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;
}
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;
}
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);
}
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);
}
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;
}
Aggregations