@Override
  public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
    if (toolBehaviorProviders == null) {
      DefaultBPMN2Editor editor = (DefaultBPMN2Editor) getDiagramEditor();
      TargetRuntime rt = editor.getTargetRuntime();
      IConfigurationElement[] config =
          Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.UI_EXTENSION_ID);
      Bpmn2ToolBehaviorProvider provider = null;
      try {
        for (IConfigurationElement e : config) {
          if (e.getName().equals("toolProvider")) { // $NON-NLS-1$
            String id = e.getAttribute("id"); // $NON-NLS-1$
            String runtimeId = e.getAttribute("runtimeId"); // $NON-NLS-1$
            if (rt != null && rt.getId().equals(runtimeId)) {
              String className = e.getAttribute("class"); // $NON-NLS-1$
              ClassLoader cl = rt.getRuntimeExtension().getClass().getClassLoader();
              Constructor ctor = null;
              Class providerClass = Class.forName(className, true, cl);
              ctor = providerClass.getConstructor(IDiagramTypeProvider.class);
              provider = (Bpmn2ToolBehaviorProvider) ctor.newInstance(this);
              break;
            }
          }
        }
      } catch (Exception ex) {
        Activator.logError(ex);
      }

      if (provider == null) provider = new Bpmn2ToolBehaviorProvider(this);
      toolBehaviorProviders = new IToolBehaviorProvider[] {provider};
    }
    return toolBehaviorProviders;
  }
Пример #2
0
 /**
  * Ugly hack to force layout of the entire widget tree of the property sheet page.
  *
  * @param parent
  */
 public static void recursivelayout(Composite parent) {
   Control[] kids = parent.getChildren();
   for (Control k : kids) {
     if (k.isDisposed()) Activator.logError(new SWTException("Widget is disposed."));
     if (k instanceof Composite) {
       recursivelayout((Composite) k);
       ((Composite) k).layout(true);
     }
   }
   parent.layout(true);
 }
Пример #3
0
 @Override
 public Image getLargeImage(Object object) {
   return Activator.getDefault().getImage(IConstants.ICON_OUTPUT_32);
 }
Пример #4
0
 public Image getLargeImage(Object object) {
   return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_32);
 }
Пример #5
0
 public Image getSmallImage(Object object) {
   return Activator.getDefault().getImage(IConstants.ICON_PORTTYPE_16);
 }
 /* ILabeledElement overrides */
 @Override
 public Image getSmallImage(Object object) {
   return Activator.getDefault().getImage(IConstants.ICON_XSD_ATTRIBUTE_DECLARATION_16);
 }