use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project archi by archimatetool.
the class ArchimateDiagramEditorPalette method createArchimateRelationsGroup.
/**
* Relations Types
*/
private void createArchimateRelationsGroup() {
PaletteGroup group = new PaletteGroup(Messages.ArchimateDiagramEditorPalette_13);
add(1, group);
fEntries.add(group);
// Magic Connector
ConnectionCreationToolEntry magicConnectionEntry = new ConnectionCreationToolEntry(Messages.ArchimateDiagramEditorPalette_14, Messages.ArchimateDiagramEditorPalette_15, new MagicConnectionModelFactory(), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MAGIC_CONNECTION), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MAGIC_CONNECTION));
magicConnectionEntry.setToolClass(MagicConnectionCreationTool.class);
magicConnectionEntry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
group.add(magicConnectionEntry);
// Relations
for (EClass eClass : ArchimateModelUtils.getRelationsClasses()) {
ToolEntry entry = createConnectionCreationToolEntry(eClass, null);
group.add(entry);
}
// Junctions
for (EClass eClass : ArchimateModelUtils.getConnectorClasses()) {
ToolEntry entry = createElementCreationToolEntry(eClass, null);
group.add(entry);
}
}
use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project archi by archimatetool.
the class ArchimateDiagramEditorPalette method createConnectionCreationToolEntry.
private ToolEntry createConnectionCreationToolEntry(EClass eClass, String description) {
ToolEntry entry = new ConnectionCreationToolEntry(ArchiLabelProvider.INSTANCE.getDefaultName(eClass), description, new ArchimateDiagramModelFactory(eClass), ArchiLabelProvider.INSTANCE.getImageDescriptor(eClass), ArchiLabelProvider.INSTANCE.getImageDescriptor(eClass));
// Ensure Tool gets deselected
entry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
return entry;
}
use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project archi by archimatetool.
the class SketchEditorPalette method createConnectionsGroup.
private PaletteContainer createConnectionsGroup() {
PaletteContainer group = new PaletteGroup(Messages.SketchEditorPalette_7);
add(group);
ConnectionCreationToolEntry entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.LINE_SOLID, Messages.SketchEditorPalette_8, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_PLAIN));
group.add(entry);
entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET, Messages.SketchEditorPalette_9, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_ARROW));
group.add(entry);
entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DASHED, Messages.SketchEditorPalette_10, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DASHED_ARROW));
group.add(entry);
entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DOTTED, Messages.SketchEditorPalette_11, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DOTTED_ARROW));
group.add(entry);
return group;
}
use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project archi by archimatetool.
the class SketchEditorPalette method createConnectionCreationToolEntry.
private ConnectionCreationToolEntry createConnectionCreationToolEntry(EClass eClass, int type, String name, String description, ImageDescriptor icon) {
ConnectionCreationToolEntry entry = new ConnectionCreationToolEntry(name, description, new SketchModelFactory(eClass, type), icon, icon);
// Ensure Tool gets deselected
entry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
return entry;
}
use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project cubrid-manager by CUBRID.
the class PaletteFactory method createControlGroup.
/**
* create control group
*
* @param root PaletteRoot
* @return componentGroup
*/
private static PaletteContainer createControlGroup(PaletteRoot root) {
PaletteGroup componentGroup = new PaletteGroup(Messages.lblComponentGrp);
List<ToolEntry> toolEntries = new ArrayList<ToolEntry>();
ToolEntry toolEntry = new SelectionToolEntry();
toolEntry.setLabel(Messages.lblSelectTool);
toolEntry.setDescription(Messages.descSelectTool);
toolEntries.add(toolEntry);
root.setDefaultEntry(toolEntry);
toolEntry = new ConnectionCreationToolEntry(Messages.lblConnectionTool, Messages.descConnectionTool, null, CubridManagerUIPlugin.getImageDescriptor("icons/replication/arrow.gif"), CubridManagerUIPlugin.getImageDescriptor("icons/replication/arrow.gif"));
toolEntries.add(toolEntry);
componentGroup.addAll(toolEntries);
return componentGroup;
}
Aggregations