Examples of PaletteEntry


Examples of org.eclipse.gef.palette.PaletteEntry

        return drawer;
    }
   
    public PaletteEntry createConnectionEntry() {
        final ElementConnectionFactory normalConnectionFactory = new ConnectionWrapperFactory();
        PaletteEntry tool = new ConnectionCreationToolEntry(
            "Connection Creation",
            "Creating connections",
            new CreationFactory() {
                public Object getNewObject() {
                    return normalConnectionFactory.createElementConnection();
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteEntry

        return drawer;
    }
   
    public PaletteEntry createConnectionEntry() {
        final ElementConnectionFactory normalConnectionFactory = new ConnectionWrapperFactory();
        PaletteEntry tool = new ConnectionCreationToolEntry(
            "Sequence Flow",
            "Creating connections",
            new CreationFactory() {
                public Object getNewObject() {
                    return normalConnectionFactory.createElementConnection();
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteEntry

    // remove old entries
    setDefaultEntry(null);
    List<PaletteEntry> allEntries = new ArrayList<PaletteEntry>(getChildren()); // MUST make a copy
    for (Iterator<PaletteEntry> iter = allEntries.iterator(); iter.hasNext();)
    {
      PaletteEntry entry = iter.next();
      remove(entry);
    }
   
    // create new entries
    DiagramEditorPageDef diagramPageDef = (DiagramEditorPageDef)diagramPart.definition();
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteEntry

    List<PaletteEntry> allEntries = new ArrayList<PaletteEntry>(getChildren()); // MUST
                                          // make
                                          // a
                                          // copy
    for (Iterator<PaletteEntry> iter = allEntries.iterator(); iter.hasNext();) {
      PaletteEntry entry = iter.next();
      remove(entry);
    }

    // create new entries
    add(createModelIndependentTools());

    IToolBehaviorProvider currentToolBehaviorProvider = cfgProvider.getDiagramTypeProvider().getCurrentToolBehaviorProvider();

    IPaletteCompartmentEntry[] paletteCompartments = currentToolBehaviorProvider.getPalette();

    for (IPaletteCompartmentEntry compartmentEntry : paletteCompartments) {
      PaletteDrawer drawer = new PaletteDrawer(compartmentEntry.getLabel(), getImageDescriptor(compartmentEntry));
      if (!compartmentEntry.isInitiallyOpen()) {
        drawer.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED);
      }
      add(drawer);

      List<IToolEntry> toolEntries = compartmentEntry.getToolEntries();

      for (IToolEntry toolEntry : toolEntries) {

        if (toolEntry instanceof ICreationToolEntry) {
          ICreationToolEntry creationToolEntry = (ICreationToolEntry) toolEntry;

          PaletteEntry createTool = createTool(creationToolEntry);
          if (createTool != null) {
            drawer.add(createTool);
          }

        } else if (toolEntry instanceof IStackToolEntry) {
          IStackToolEntry stackToolEntry = (IStackToolEntry) toolEntry;
          PaletteStack stack = new PaletteStack(stackToolEntry.getLabel(), stackToolEntry.getDescription(), GraphitiUi
              .getImageService().getImageDescriptorForId(cfgProvider.getDiagramTypeProvider().getProviderId(), stackToolEntry.getIconId()));
          drawer.add(stack);
          List<ICreationToolEntry> creationToolEntries = stackToolEntry.getCreationToolEntries();
          for (ICreationToolEntry creationToolEntry : creationToolEntries) {
            PaletteEntry createTool = createTool(creationToolEntry);
            if (createTool != null) {
              stack.add(createTool);
            }
          }
        } else if (toolEntry instanceof IPaletteSeparatorEntry) {
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteEntry

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        final EditDomain editDomain = getEditDomain();
        final List<PaletteEntry> entries = new PaletteFinder(editDomain).findEntries(new ToolEntryLabelMatcher(labelMatcher));
        if (entries.size() > 0) {
          final PaletteEntry paletteEntry = entries.get(index);
          if (paletteEntry instanceof ToolEntry) {
            editDomain.getPaletteViewer().setActiveTool((ToolEntry) paletteEntry);
          } else {
            exception[0] = new WidgetNotFoundException(String.format("%s is not a tool entry, it's a %s", labelMatcher
                .toString(), paletteEntry.getClass().getName()));
          }
        } else {
          exception[0] = new WidgetNotFoundException(labelMatcher.toString());
        }
      }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteEntry

        return drawer;
    }
   
    public PaletteEntry createConnectionEntry() {
        final ElementConnectionFactory normalConnectionFactory = new ConnectionWrapperFactory();
        PaletteEntry tool = new ConnectionCreationToolEntry(
            "Sequence Flow",
            "Creating connections",
            new CreationFactory() {
                public Object getNewObject() {
                    return normalConnectionFactory.createElementConnection();
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.