本文整理汇总了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);
}
示例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);
}