Examples of PaletteDrawer


Examples of org.eclipse.gef.palette.PaletteDrawer

  /**
   * Creates "OntoUML Classes" palette tool group
   * @generated
   */
  private PaletteContainer createOntoUMLClasses1Group() {
    PaletteDrawer paletteContainer = new PaletteDrawer(
        OntoUML.diagram.part.Messages.OntoUMLClasses1Group_title);
    paletteContainer.add(createCategory1CreationTool());
    paletteContainer.add(createCollective2CreationTool());
    paletteContainer.add(createGeneralizationSet3CreationTool());
    paletteContainer.add(createKind4CreationTool());
    paletteContainer.add(createMixin5CreationTool());
    paletteContainer.add(createMode6CreationTool());
    paletteContainer.add(createPhase7CreationTool());
    paletteContainer.add(createQuantity8CreationTool());
    paletteContainer.add(createRelator9CreationTool());
    paletteContainer.add(createRole10CreationTool());
    paletteContainer.add(createRoleMixin11CreationTool());
    paletteContainer.add(createSimpleDatatype12CreationTool());
    paletteContainer.add(createStructuredDatatype13CreationTool());
    paletteContainer.add(createSubKind14CreationTool());
    return paletteContainer;
  }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

  /**
   * Creates "OntoUML Relationships" palette tool group
   * @generated
   */
  private PaletteContainer createOntoUMLRelationships2Group() {
    PaletteDrawer paletteContainer = new PaletteDrawer(
        OntoUML.diagram.part.Messages.OntoUMLRelationships2Group_title);
    paletteContainer.add(createCharacterization1CreationTool());
    paletteContainer.add(createComponentOf2CreationTool());
    paletteContainer.add(createDatatypeRelationship3CreationTool());
    paletteContainer.add(createDerivation4CreationTool());
    paletteContainer.add(createFormal5CreationTool());
    paletteContainer.add(createGeneralization6CreationTool());
    paletteContainer.add(createMaterial7CreationTool());
    paletteContainer.add(createMediation8CreationTool());
    paletteContainer.add(createMemberOf9CreationTool());
    paletteContainer.add(createSubCollectionOf10CreationTool());
    paletteContainer.add(createSubQuantityOf11CreationTool());
    return paletteContainer;
  }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

  /**
   * Creates "OntoUML Rules" palette tool group
   * @generated
   */
  private PaletteContainer createOntoUMLRules3Group() {
    PaletteDrawer paletteContainer = new PaletteDrawer(
        OntoUML.diagram.part.Messages.OntoUMLRules3Group_title);
    paletteContainer
        .setDescription(OntoUML.diagram.part.Messages.OntoUMLRules3Group_desc);
    paletteContainer.add(createCondition1CreationTool());
    paletteContainer.add(createDerivationRule2CreationTool());
    paletteContainer.add(createConclusion3CreationTool());
    return paletteContainer;
  }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

            try {
                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                    List<CombinedTemplateCreationEntry> entries = new ArrayList<CombinedTemplateCreationEntry>();
                    try {
                        for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                            final String label;
                            String description = workDefinition.getName();
                            String icon = null;
                            if (workDefinition instanceof WorkDefinitionExtension) {
                                WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                label = extension.getDisplayName();
                                description = extension.getExplanationText();
                                icon = extension.getIcon();
                            } else {
                                label = workDefinition.getName();
                            }

                            URL iconUrl = null;
                            if (icon != null) {
                                iconUrl = newLoader.getResource(icon);
                            }
                            if (iconUrl == null) {
                                iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                            }
                            CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                label,
                                description,
                                WorkItemWrapper.class,
                                new SimpleFactory(WorkItemWrapper.class) {
                                    public Object getNewObject() {
                                        WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                        workItemWrapper.setName(label);
                                        workItemWrapper.setWorkDefinition(workDefinition);
                                        return workItemWrapper;
                                    }
                                },
                                ImageDescriptor.createFromURL(iconUrl),
                                ImageDescriptor.createFromURL(iconUrl)
                            );
                            entries.add(combined);
                        }
                    } catch (Throwable t) {
                        DroolsEclipsePlugin.log(t);
                        MessageDialog.openError(
                            getSite().getShell(), "Parsing work item definitions", t.getMessage());
                    }
                    drawer.setChildren(entries);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
                DroolsEclipsePlugin.log(e);
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    if (getPaletteRoot().getChildren().size() > 2) {
                      PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                      List<CombinedTemplateCreationEntry> entries = new ArrayList<CombinedTemplateCreationEntry>();
                      try {
                          for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                              final String label;
                              String description = workDefinition.getName();
                              String icon = null;
                              if (workDefinition instanceof WorkDefinitionExtension) {
                                  WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                  label = extension.getDisplayName();
                                  description = extension.getExplanationText();
                                  icon = extension.getIcon();
                              } else {
                                  label = workDefinition.getName();
                              }
 
                              URL iconUrl = null;
                              if (icon != null) {
                                  iconUrl = newLoader.getResource(icon);
                              }
                              if (iconUrl == null) {
                                  iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                              }
                              CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                  label,
                                  description,
                                  WorkItemWrapper.class,
                                  new SimpleFactory(WorkItemWrapper.class) {
                                      public Object getNewObject() {
                                          WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                          workItemWrapper.setName(label);
                                          workItemWrapper.setWorkDefinition(workDefinition);
                                          return workItemWrapper;
                                      }
                                  },
                                  ImageDescriptor.createFromURL(iconUrl),
                                  ImageDescriptor.createFromURL(iconUrl)
                              );
                              entries.add(combined);
                          }
                      } catch (Throwable t) {
                          DroolsEclipsePlugin.log(t);
                          MessageDialog.openError(
                              getSite().getShell(), "Parsing work item definitions", t.getMessage());
                      }
                      drawer.setChildren(entries);
                    }
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

            try {
                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                    List entries = new ArrayList();
                    try {
                        for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                            final String label;
                            String description = workDefinition.getName();
                            String icon = null;
                            if (workDefinition instanceof WorkDefinitionExtension) {
                                WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                label = extension.getDisplayName();
                                description = extension.getExplanationText();
                                icon = extension.getIcon();
                            } else {
                                label = workDefinition.getName();
                            }

                            URL iconUrl = null;
                            if (icon != null) {
                                iconUrl = newLoader.getResource(icon);
                            }
                            if (iconUrl == null) {
                                iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                            }
                            CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                label,
                                description,
                                WorkItemWrapper.class,
                                new SimpleFactory(WorkItemWrapper.class) {
                                    public Object getNewObject() {
                                        WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                        workItemWrapper.setName(label);
                                        workItemWrapper.setWorkDefinition(workDefinition);
                                        return workItemWrapper;
                                    }
                                },
                                ImageDescriptor.createFromURL(iconUrl),
                                ImageDescriptor.createFromURL(iconUrl)
                            );
                            entries.add(combined);
                        }
                    } catch (Throwable t) {
                        DroolsEclipsePlugin.log(t);
                        MessageDialog.openError(
                            getSite().getShell(), "Parsing work item definitions", t.getMessage());
                    }
                    drawer.setChildren(entries);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
                DroolsEclipsePlugin.log(e);
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    if (getPaletteRoot().getChildren().size() > 2) {
                      PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                      List entries = new ArrayList();
                      try {
                          for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                              final String label;
                              String description = workDefinition.getName();
                              String icon = null;
                              if (workDefinition instanceof WorkDefinitionExtension) {
                                  WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                  label = extension.getDisplayName();
                                  description = extension.getExplanationText();
                                  icon = extension.getIcon();
                              } else {
                                  label = workDefinition.getName();
                              }
 
                              URL iconUrl = null;
                              if (icon != null) {
                                  iconUrl = newLoader.getResource(icon);
                              }
                              if (iconUrl == null) {
                                  iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                              }
                              CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                  label,
                                  description,
                                  WorkItemWrapper.class,
                                  new SimpleFactory(WorkItemWrapper.class) {
                                      public Object getNewObject() {
                                          WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                          workItemWrapper.setName(label);
                                          workItemWrapper.setWorkDefinition(workDefinition);
                                          return workItemWrapper;
                                      }
                                  },
                                  ImageDescriptor.createFromURL(iconUrl),
                                  ImageDescriptor.createFromURL(iconUrl)
                              );
                              entries.add(combined);
                          }
                      } catch (Throwable t) {
                          DroolsEclipsePlugin.log(t);
                          MessageDialog.openError(
                              getSite().getShell(), "Parsing work item definitions", t.getMessage());
                      }
                      drawer.setChildren(entries);
                    }
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

        return controlGroup;
     }

     private static PaletteContainer createComponentsDrawer() {

        PaletteDrawer drawer = new PaletteDrawer(Messages.PageEditorPaletteFactory_components_title, null);

        List<ToolEntry> entries = new ArrayList<ToolEntry>();
       
        List<BoxFactory> boxFactories = PrintingPlugin.getDefault().getVisibleBoxes();
       
        for (BoxFactory factory : boxFactories) {
          ToolEntry tool = new CombinedTemplateCreationEntry(
              factory.getName(),
              factory.getDescription(),
              null,
              new BoxCreationFactory(factory),
              factory.getSmallImage(),
              factory.getLargeImage()
          );
          entries.add(tool);
        }

        drawer.addAll(entries);
        return drawer;
     }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

            if( category.getId().equals("org.locationtech.udig.tool.category.zoom") ||
                    category.getId().equals("org.locationtech.udig.tool.category.pan")){
                container = navigation;
            }
            else {
                PaletteDrawer drawer = new PaletteDrawer(name);
                drawer.setId( category.getId() );
                if( category == toolManager.getActiveCategory()){
                    drawer.setInitialState(PaletteDrawer.INITIAL_STATE_OPEN);
                }
                else {
                    drawer.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED);
                }
                drawer.setDrawerType(ToolEntry.PALETTE_TYPE_TOOL);
                drawer.setUserModificationPermission(PaletteContainer.PERMISSION_NO_MODIFICATION);
                drawer.setShowDefaultIcon(false);
                if( shortcut != null ){
                    drawer.setDescription( "("+shortcut+")" );
                }
                container = drawer;
            }
            category.container( container ); // hook up so container can cycle tools on keypress
            for( ModalItem modalItem : category ) {
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteDrawer

            try {
                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                ClassLoader newLoader = ProjectClassLoader.getProjectClassLoader(javaProject);
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    PaletteDrawer drawer = (PaletteDrawer) getPaletteRoot().getChildren().get(2);
                    List entries = new ArrayList();
                    try {
                        for (final WorkDefinition workDefinition: WorkItemDefinitions.getWorkDefinitions(file).values()) {
                            final String label;
                            String description = workDefinition.getName();
                            String icon = null;
                            if (workDefinition instanceof WorkDefinitionExtension) {
                                WorkDefinitionExtension extension = (WorkDefinitionExtension) workDefinition;
                                label = extension.getDisplayName();
                                description = extension.getExplanationText();
                                icon = extension.getIcon();
                            } else {
                                label = workDefinition.getName();
                            }

                            URL iconUrl = null;
                            if (icon != null) {
                                iconUrl = newLoader.getResource(icon);
                            }
                            if (iconUrl == null) {
                                iconUrl = DroolsEclipsePlugin.getDefault().getBundle().getEntry("icons/action.gif");
                            }
                            CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
                                label,
                                description,
                                WorkItemWrapper.class,
                                new SimpleFactory(WorkItemWrapper.class) {
                                    public Object getNewObject() {
                                        WorkItemWrapper workItemWrapper = (WorkItemWrapper) super.getNewObject();
                                        workItemWrapper.setName(label);
                                        workItemWrapper.setWorkDefinition(workDefinition);
                                        return workItemWrapper;
                                    }
                                },
                                ImageDescriptor.createFromURL(iconUrl),
                                ImageDescriptor.createFromURL(iconUrl)
                            );
                            entries.add(combined);
                        }
                    } catch (Throwable t) {
                        DroolsEclipsePlugin.log(t);
                        MessageDialog.openError(
                            getSite().getShell(), "Parsing work item definitions", t.getMessage());
                    }
                    drawer.setChildren(entries);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (Exception e) {
                DroolsEclipsePlugin.log(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.