Search in sources :

Example 1 with PaletteGroup

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

the class TalendEditorPaletteFactory method clearGroup.

public static void clearGroup() {
    paGroup.getChildren().clear();
    List list = palette.getChildren();
    if (list.size() > 0) {
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i) instanceof PaletteGroup) {
                PaletteGroup entry = (PaletteGroup) list.get(i);
                if (entry instanceof TalendPaletteGroup) {
                    continue;
                }
                palette.remove(entry);
            }
        }
    }
}
Also used : List(java.util.List) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) TalendPaletteGroup(org.talend.core.ui.component.TalendPaletteGroup) PaletteGroup(org.eclipse.gef.palette.PaletteGroup) TalendPaletteGroup(org.talend.core.ui.component.TalendPaletteGroup)

Example 2 with PaletteGroup

use of org.eclipse.gef.palette.PaletteGroup 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;
}
Also used : SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) ArrayList(java.util.ArrayList) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PaletteGroup(org.eclipse.gef.palette.PaletteGroup)

Example 3 with PaletteGroup

use of org.eclipse.gef.palette.PaletteGroup 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)

Aggregations

ArrayList (java.util.ArrayList)3 PaletteGroup (org.eclipse.gef.palette.PaletteGroup)3 List (java.util.List)2 ConnectionCreationToolEntry (org.eclipse.gef.palette.ConnectionCreationToolEntry)2 SelectionToolEntry (org.eclipse.gef.palette.SelectionToolEntry)2 ToolEntry (org.eclipse.gef.palette.ToolEntry)2 LinkedList (java.util.LinkedList)1 CombinedTemplateCreationEntry (org.eclipse.gef.palette.CombinedTemplateCreationEntry)1 MarqueeToolEntry (org.eclipse.gef.palette.MarqueeToolEntry)1 PaletteDrawer (org.eclipse.gef.palette.PaletteDrawer)1 PaletteRoot (org.eclipse.gef.palette.PaletteRoot)1 TalendPaletteGroup (org.talend.core.ui.component.TalendPaletteGroup)1