org.eclipse.gef.palette.CreationToolEntry Java Examples

The following examples show how to use org.eclipse.gef.palette.CreationToolEntry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ERDiagramPaletteRoot.java    From erflute with Apache License 2.0 5 votes vote down vote up
private void setupTableViewTool(final PaletteGroup group) {
    group.add(new CreationToolEntry("Table", "Make new table object", new SimpleFactory(ERTable.class),
            Activator.getImageDescriptor(ImageKey.TABLE_NEW), Activator.getImageDescriptor(ImageKey.TABLE_NEW)));

    if (diagram.getDiagramContents().getSettings().isUseViewObject()) { // #for_erflute view is option
        group.add(new CreationToolEntry("View", "Make new view object", new SimpleFactory(ERView.class),
                Activator.getImageDescriptor(ImageKey.VIEW), Activator.getImageDescriptor(ImageKey.VIEW)));
    }
}
 
Example #2
Source File: ERDiagramPaletteRoot.java    From erflute with Apache License 2.0 5 votes vote down vote up
private void setupNoteTool(final PaletteGroup group) {
    final CreationToolEntry noteToolEntry =
            new CreationToolEntry("Note", "Make new note for tables", new SimpleFactory(WalkerNote.class),
                    Activator.getImageDescriptor(ImageKey.NOTE), Activator.getImageDescriptor(ImageKey.NOTE));
    group.add(noteToolEntry);
    final ConnectionCreationToolEntry relationNoteTool =
            new ConnectionCreationToolEntry("Note Connection", "Connect note to tables", new SimpleFactory(CommentConnection.class),
                    Activator.getImageDescriptor(ImageKey.COMMENT_CONNECTION),
                    Activator.getImageDescriptor(ImageKey.COMMENT_CONNECTION));
    group.add(relationNoteTool);
}
 
Example #3
Source File: ERDiagramPaletteRoot.java    From erflute with Apache License 2.0 4 votes vote down vote up
private void setupWalkerGroupTool(final PaletteGroup group) {
    group.add(new CreationToolEntry("Table Group", "Make new group for tables by border", new SimpleFactory(WalkerGroup.class),
            Activator.getImageDescriptor(ImageKey.CATEGORY), Activator.getImageDescriptor(ImageKey.CATEGORY)));
}
 
Example #4
Source File: ERDiagramPaletteRoot.java    From ermasterr with Apache License 2.0 2 votes vote down vote up
public ERDiagramPaletteRoot() {
    final PaletteGroup group = new PaletteGroup("");

    // when tooltip equals to label, tooltip is not displayed.
    final PanningSelectionToolEntry selectionTool = new PanningSelectionToolEntry(ResourceString.getResourceString("label.select"));
    selectionTool.setToolClass(MovablePanningSelectionTool.class);
    selectionTool.setLargeIcon(ERDiagramActivator.getImageDescriptor(ImageKey.ARROW));
    selectionTool.setSmallIcon(ERDiagramActivator.getImageDescriptor(ImageKey.ARROW));

    group.add(selectionTool);
    // group.add(new MarqueeToolEntry());

    group.add(new CreationToolEntry(ResourceString.getResourceString("label.table"), ResourceString.getResourceString("label.create.table"), new SimpleFactory(ERTable.class), ERDiagramActivator.getImageDescriptor(ImageKey.TABLE_NEW), ERDiagramActivator.getImageDescriptor(ImageKey.TABLE_NEW)));

    group.add(new CreationToolEntry(ResourceString.getResourceString("label.view"), ResourceString.getResourceString("label.create.view"), new SimpleFactory(View.class), ERDiagramActivator.getImageDescriptor(ImageKey.VIEW), ERDiagramActivator.getImageDescriptor(ImageKey.VIEW)));

    final ConnectionCreationToolEntry oneToManyTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.one.to.many"), ResourceString.getResourceString("label.create.relation.one.to.many"), new SimpleFactory(Relation.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N));
    oneToManyTool.setToolClass(RelationCreationTool.class);
    group.add(oneToManyTool);

    final ConnectionCreationToolEntry relationByExistingTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.by.existing.columns"), ResourceString.getResourceString("label.create.relation.by.existing.columns"), new SimpleFactory(RelationByExistingColumns.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N));
    relationByExistingTool.setToolClass(RelationByExistingColumnsCreationTool.class);
    group.add(relationByExistingTool);

    final ConnectionCreationToolEntry manyToManyTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.many.to.many"), ResourceString.getResourceString("label.create.relation.many.to.many"), new SimpleFactory(RelatedTable.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_N_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_N_N));
    manyToManyTool.setToolClass(RelatedTableCreationTool.class);
    group.add(manyToManyTool);

    final ConnectionCreationToolEntry selfRelationTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.self"), ResourceString.getResourceString("label.create.relation.self"), new SimpleFactory(SelfRelation.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_SELF), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_SELF));
    selfRelationTool.setToolClass(SelfRelationCreationTool.class);
    group.add(selfRelationTool);

    group.add(new PaletteSeparator());

    final CreationToolEntry noteTool = new CreationToolEntry(ResourceString.getResourceString("label.note"), ResourceString.getResourceString("label.create.note"), new SimpleFactory(Note.class), ERDiagramActivator.getImageDescriptor(ImageKey.NOTE), ERDiagramActivator.getImageDescriptor(ImageKey.NOTE));
    group.add(noteTool);

    final ConnectionCreationToolEntry commentConnectionTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.note"), ResourceString.getResourceString("label.create.relation.note"), new SimpleFactory(CommentConnection.class), ERDiagramActivator.getImageDescriptor(ImageKey.COMMENT_CONNECTION), ERDiagramActivator.getImageDescriptor(ImageKey.COMMENT_CONNECTION));
    group.add(commentConnectionTool);

    group.add(new PaletteSeparator());

    group.add(new CreationToolEntry(ResourceString.getResourceString("label.category"), ResourceString.getResourceString("label.create.category"), new SimpleFactory(Category.class), ERDiagramActivator.getImageDescriptor(ImageKey.CATEGORY), ERDiagramActivator.getImageDescriptor(ImageKey.CATEGORY)));

    group.add(new PaletteSeparator());

    group.add(new InsertImageTool());

    this.add(group);

    setDefaultEntry(selectionTool);
}