Search in sources :

Example 11 with PaletteRoot

use of org.eclipse.gef.palette.PaletteRoot 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 12 with PaletteRoot

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

the class PaletteSettingsDialog method getViewerInput.

private PaletteRoot getViewerInput() {
    IComponentsFactory components = ComponentsFactoryProvider.getInstance();
    PaletteRoot paletteRoot = CoreUIPlugin.getDefault().getDesignerCoreUIService().getAllNodeStructure(components);
    return paletteRoot;
}
Also used : PaletteRoot(org.eclipse.gef.palette.PaletteRoot) IComponentsFactory(org.talend.core.model.components.IComponentsFactory)

Example 13 with PaletteRoot

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

the class PaletteSettingsDialog method addTreeViewer.

/**
     * qwei Comment method "addViewer".
     * 
     * @param parent
     */
private void addTreeViewer(ThreeCompositesSashForm parent) {
    hiddenViewer = new TreeViewer(parent.getLeftComposite());
    hiddenViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
    hiddenViewer.setContentProvider(new TalendPaletteTreeProvider());
    hiddenViewer.setLabelProvider(new TalendPaletteLabelProvider());
    hiddenViewer.addFilter(getFilterForComponent(false));
    hiddenViewer.expandToLevel(2);
    hiddenViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            rightButton.setEnabled(!event.getSelection().isEmpty());
        }
    });
    createButtons(parent.getMidComposite());
    displayViewer = new TreeViewer(parent.getRightComposite());
    displayViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
    displayViewer.setContentProvider(new TalendPaletteTreeProvider());
    displayViewer.setLabelProvider(new TalendPaletteLabelProvider());
    displayViewer.addFilter(getFilterForComponent(true));
    displayViewer.expandToLevel(2);
    displayViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            leftButton.setEnabled(!event.getSelection().isEmpty());
        }
    });
    PaletteRoot input = getViewerInput();
    hiddenViewer.setInput(input);
    displayViewer.setInput(input);
}
Also used : PaletteRoot(org.eclipse.gef.palette.PaletteRoot) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) TalendPaletteLabelProvider(org.talend.core.ui.component.preference.provider.TalendPaletteLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) TalendPaletteTreeProvider(org.talend.core.ui.component.preference.provider.TalendPaletteTreeProvider)

Example 14 with PaletteRoot

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

the class TalendEditorPaletteFactory method createPalette.

public static PaletteRoot createPalette(final IComponentsFactory compFac, boolean isFavorite) {
    PaletteRoot pr = new PaletteRoot();
    pr.add(createToolsGroup());
    return createPalette(compFac, pr, isFavorite);
}
Also used : PaletteRoot(org.eclipse.gef.palette.PaletteRoot)

Example 15 with PaletteRoot

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

the class TalendEditorPaletteFactory method createEmptyPalette.

/**
     * DOC guanglong.du Comment method "createEmptyPalette".
     * 
     * @return
     */
public static PaletteRoot createEmptyPalette() {
    palette = new PaletteRoot();
    palette.add(createToolsGroup());
    return palette;
}
Also used : PaletteRoot(org.eclipse.gef.palette.PaletteRoot)

Aggregations

PaletteRoot (org.eclipse.gef.palette.PaletteRoot)18 PaletteDrawer (org.eclipse.gef.palette.PaletteDrawer)6 ArrayList (java.util.ArrayList)3 SelectionToolEntry (org.eclipse.gef.palette.SelectionToolEntry)3 List (java.util.List)2 TreeMap (java.util.TreeMap)2 CombinedTemplateCreationEntry (org.eclipse.gef.palette.CombinedTemplateCreationEntry)2 PaletteEntry (org.eclipse.gef.palette.PaletteEntry)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 RootEditPart (org.eclipse.gef.RootEditPart)1 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)1 ConnectionCreationToolEntry (org.eclipse.gef.palette.ConnectionCreationToolEntry)1 CreationToolEntry (org.eclipse.gef.palette.CreationToolEntry)1 MarqueeToolEntry (org.eclipse.gef.palette.MarqueeToolEntry)1 PaletteContainer (org.eclipse.gef.palette.PaletteContainer)1 PaletteGroup (org.eclipse.gef.palette.PaletteGroup)1 ToolEntry (org.eclipse.gef.palette.ToolEntry)1 PaletteViewer (org.eclipse.gef.ui.palette.PaletteViewer)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1