Java Reference
In-Depth Information
public void createPartControl(Composite parent)
{
FunctionsUserInterface ui =
new FunctionsUserInterface(parent);
Counter counter = new Counter();
try
{
process(ui, counter);
}
catch(WorkbenchException e)
{
System.err.println(e.getMessage());
}
}
public void setFocus()
{
}
private void process(FunctionsUserInterface ui, Counter counter)
throws WorkbenchException
{
IExtensionRegistry registry =
Platform.getExtensionRegistry();
IExtensionPoint extensionPoint =
registry.getExtensionPoint(EXTENSION_POINT);
if(extensionPoint == null)
{
throw new WorkbenchException("unable to resolve " +
"extension-point: " + EXTENSION_POINT);
}
IConfigurationElement[] members =
extensionPoint.getConfigurationElements();
for(IConfigurationElement member : members)
{
String functionName =
member.getAttribute(FUNCTION_NAME_ATTRIBUTE);
if(functionName == null)
{
functionName = "[namenlose Funktion]";
}
//Markierung Nr. 1
Object callback = null;
try
{
callback =
member.createExecutableExtension(CLASS_ATTRIBUTE);
if(!(callback instanceof Function))
{
System.err.println("callback function does " +
"not implement Function");
continue;
}
}
catch(CoreException e)
 
Search WWH ::




Custom Search