Search in sources :

Example 11 with ToolEntry

use of org.eclipse.gef.palette.ToolEntry in project yamcs-studio by yamcs.

the class OPIEditorPaletteFactory method createToolsGroup.

private static void createToolsGroup(PaletteRoot palette) {
    PaletteToolbar toolbar = new PaletteToolbar("Tools");
    // Add a selection tool to the group
    ToolEntry tool = new PanningSelectionToolEntry();
    toolbar.add(tool);
    palette.setDefaultEntry(tool);
    tool = new ConnectionCreationToolEntry("Connection", "Create a connection between widgets", new CreationFactory() {

        @Override
        public Object getObjectType() {
            return null;
        }

        @Override
        public Object getNewObject() {
            return null;
        }
    }, CustomMediaFactory.getInstance().getImageDescriptorFromPlugin(OPIBuilderPlugin.PLUGIN_ID, "icons/connection_s16.gif"), CustomMediaFactory.getInstance().getImageDescriptorFromPlugin(OPIBuilderPlugin.PLUGIN_ID, "icons/connection_s24.gif"));
    toolbar.add(tool);
    palette.add(toolbar);
}
Also used : PaletteToolbar(org.eclipse.gef.palette.PaletteToolbar) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) CreationFactory(org.eclipse.gef.requests.CreationFactory) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry)

Example 12 with ToolEntry

use of org.eclipse.gef.palette.ToolEntry in project cubrid-manager by CUBRID.

the class PaletteViewerCreator method createPaletteRoot.

/**
	 * Create palette for ER canvas
	 * 
	 * @return
	 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public PaletteRoot createPaletteRoot(ERSchema erSchema) {
    paletteRoot = new PaletteRoot();
    paletteRoot.setLabel("");
    paletteRoot.setSmallIcon(null);
    paletteRoot.setLargeIcon(null);
    PaletteGroup controls = new PaletteGroup("Controls");
    paletteRoot.add(controls);
    ToolEntry tool = new SelectionToolEntry();
    controls.add(tool);
    paletteRoot.setDefaultEntry(tool);
    controls.add(new MarqueeToolEntry());
    PaletteDrawer drawer = new PaletteDrawer("New Component", null);
    List entries = new ArrayList();
    ConnectionCreationToolEntry connection = getConnectionEntry();
    CombinedTemplateCreationEntry tableEntry = getTableEntry(erSchema);
    entries.add(connection);
    entries.add(tableEntry);
    drawer.addAll(entries);
    paletteRoot.add(drawer);
    return paletteRoot;
}
Also used : PaletteRoot(org.eclipse.gef.palette.PaletteRoot) SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) PaletteDrawer(org.eclipse.gef.palette.PaletteDrawer) ArrayList(java.util.ArrayList) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) ArrayList(java.util.ArrayList) List(java.util.List) MarqueeToolEntry(org.eclipse.gef.palette.MarqueeToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PaletteGroup(org.eclipse.gef.palette.PaletteGroup) CombinedTemplateCreationEntry(org.eclipse.gef.palette.CombinedTemplateCreationEntry) MarqueeToolEntry(org.eclipse.gef.palette.MarqueeToolEntry)

Example 13 with ToolEntry

use of org.eclipse.gef.palette.ToolEntry in project tdi-studio-se by Talend.

the class BusinessPaletteFactory method createEllipse10CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createEllipse10CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.EllipseBusinessItem_1010);
    largeImage = smallImage;
    final List elementTypes = new ArrayList();
    elementTypes.add(BusinessElementTypes.EllipseBusinessItem_1010);
    ToolEntry result = new NodeToolEntry(Messages.getString("BusinessPaletteFactory.Ellipse"), Messages.getString("BusinessPaletteFactory.CreateEllipse"), smallImage, largeImage, //$NON-NLS-1$ //$NON-NLS-2$
    elementTypes);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ToolEntry(org.eclipse.gef.palette.ToolEntry)

Example 14 with ToolEntry

use of org.eclipse.gef.palette.ToolEntry in project tdi-studio-se by Talend.

the class BusinessPaletteFactory method createActor9CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createActor9CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.ActorBusinessItem_1009);
    largeImage = smallImage;
    final List elementTypes = new ArrayList();
    elementTypes.add(BusinessElementTypes.ActorBusinessItem_1009);
    ToolEntry result = new NodeToolEntry(Messages.getString("BusinessPaletteFactory.Actor"), Messages.getString("BusinessPaletteFactory.CreateActor"), smallImage, largeImage, //$NON-NLS-1$ //$NON-NLS-2$
    elementTypes);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ToolEntry(org.eclipse.gef.palette.ToolEntry)

Example 15 with ToolEntry

use of org.eclipse.gef.palette.ToolEntry in project tdi-studio-se by Talend.

the class BusinessPaletteFactory method createDirectionalRelationship14CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createDirectionalRelationship14CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.DirectionalBusinessItemRelationship_3002);
    largeImage = smallImage;
    final List relationshipTypes = new ArrayList();
    relationshipTypes.add(BusinessElementTypes.DirectionalBusinessItemRelationship_3002);
    ToolEntry result = new LinkToolEntry(//$NON-NLS-1$ //$NON-NLS-2$
    Messages.getString("BusinessPaletteFactory.DirectionalRelationShip"), //$NON-NLS-1$ //$NON-NLS-2$
    Messages.getString("BusinessPaletteFactory.CreateDirectionalRelationShip"), smallImage, largeImage, relationshipTypes);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ToolEntry(org.eclipse.gef.palette.ToolEntry)

Aggregations

ToolEntry (org.eclipse.gef.palette.ToolEntry)19 ArrayList (java.util.ArrayList)17 List (java.util.List)15 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)14 ConnectionCreationToolEntry (org.eclipse.gef.palette.ConnectionCreationToolEntry)4 SelectionToolEntry (org.eclipse.gef.palette.SelectionToolEntry)3 CombinedTemplateCreationEntry (org.eclipse.gef.palette.CombinedTemplateCreationEntry)2 PaletteDrawer (org.eclipse.gef.palette.PaletteDrawer)2 PaletteGroup (org.eclipse.gef.palette.PaletteGroup)2 DistributorNode (com.cubrid.cubridmanager.ui.replication.editor.model.DistributorNode)1 HostNode (com.cubrid.cubridmanager.ui.replication.editor.model.HostNode)1 MasterNode (com.cubrid.cubridmanager.ui.replication.editor.model.MasterNode)1 SlaveNode (com.cubrid.cubridmanager.ui.replication.editor.model.SlaveNode)1 EventObject (java.util.EventObject)1 EditPart (org.eclipse.gef.EditPart)1 RootEditPart (org.eclipse.gef.RootEditPart)1 AbstractEditPart (org.eclipse.gef.editparts.AbstractEditPart)1 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)1 MarqueeToolEntry (org.eclipse.gef.palette.MarqueeToolEntry)1 PaletteContainer (org.eclipse.gef.palette.PaletteContainer)1