当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionCreationToolEntry.setToolClass方法代码示例

本文整理汇总了Java中org.eclipse.gef.palette.ConnectionCreationToolEntry.setToolClass方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionCreationToolEntry.setToolClass方法的具体用法?Java ConnectionCreationToolEntry.setToolClass怎么用?Java ConnectionCreationToolEntry.setToolClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gef.palette.ConnectionCreationToolEntry的用法示例。


在下文中一共展示了ConnectionCreationToolEntry.setToolClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ERDiagramPaletteRoot

import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入方法依赖的package包/类
public ERDiagramPaletteRoot(ERDiagram diagram) {
    this.diagram = diagram;
    final PaletteGroup group = new PaletteGroup("");

    final PanningSelectionToolEntry selectionToolEntry = setupSelectionTool(group);
    // what is this? by jflute
    // group.add(new MarqueeToolEntry());

    setupTableViewTool(group);

    // #deleted relationship creating new column is implemented as option of "1:n relationship"
    //final ConnectionCreationToolEntry toolEntry1 =
    //        new ConnectionCreationToolEntry("1:n new column", DisplayMessages.getMessage("label.create.relation.one.to.many"),
    //                new SimpleFactory(Relationship.class), Activator.getImageDescriptor(ImageKey.RELATION_1_N),
    //                Activator.getImageDescriptor(ImageKey.RELATION_1_N));
    //toolEntry1.setToolClass(RelationCreationTool.class);
    //group.add(toolEntry1);

    final ConnectionCreationToolEntry toolEntry2 =
            new ConnectionCreationToolEntry("1:n Relationship", "Make relationship of tables", new SimpleFactory(
                    RelationByExistingColumns.class), Activator.getImageDescriptor(ImageKey.RELATION_1_N),
                    Activator.getImageDescriptor(ImageKey.RELATION_1_N));
    toolEntry2.setToolClass(RelationByExistingColumnsCreationTool.class);
    group.add(toolEntry2);

    // #deleted unneeded by jflute
    //final ConnectionCreationToolEntry toolEntry3 =
    //        new ConnectionCreationToolEntry(DisplayMessages.getMessage("label.relation.many.to.many"),
    //                DisplayMessages.getMessage("label.create.relation.many.to.many"), new SimpleFactory(RelatedTable.class),
    //                Activator.getImageDescriptor(ImageKey.RELATION_N_N), Activator.getImageDescriptor(ImageKey.RELATION_N_N));
    //toolEntry3.setToolClass(RelatedTableCreationTool.class);
    //group.add(toolEntry3);

    final ConnectionCreationToolEntry seflRelationshipToolEntry =
            new ConnectionCreationToolEntry("Self Relationship", "Make relationship in same table", new SimpleFactory(
                    SelfRelation.class), Activator.getImageDescriptor(ImageKey.RELATION_SELF),
                    Activator.getImageDescriptor(ImageKey.RELATION_SELF));
    seflRelationshipToolEntry.setToolClass(SelfRelationCreationTool.class);
    group.add(seflRelationshipToolEntry);
    setupSeparator(group);

    setupNoteTool(group);
    setupSeparator(group);

    setupWalkerGroupTool(group);
    setupSeparator(group);

    setupImageTool(group);
    add(group);

    setDefaultEntry(selectionToolEntry);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:53,代码来源:ERDiagramPaletteRoot.java

示例2: ERDiagramPaletteRoot

import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入方法依赖的package包/类
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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:53,代码来源:ERDiagramPaletteRoot.java


注:本文中的org.eclipse.gef.palette.ConnectionCreationToolEntry.setToolClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。