use of org.eclipse.gef.palette.PaletteDrawer in project tdi-studio-se by Talend.
the class TalendPaletteViewer method removeFavoritesComponent.
public void removeFavoritesComponent(CombinedTemplateCreationEntry component) {
if (favoritesEditPart != null) {
TalendEditorPaletteFactory.deleteFavoriteFromPreference(component.getLabel());
List children = favoritesEditPart.getChildren();
if (children != null) {
for (Object obj : children) {
TalendEntryEditPart entryEditPart = (TalendEntryEditPart) obj;
CombinedTemplateCreationEntry entryModule = (CombinedTemplateCreationEntry) entryEditPart.getModel();
if (entryModule.getLabel().equals(component.getLabel())) {
PaletteDrawer paletteDrawer = favoritesEditPart.getDrawer();
if (paletteDrawer != null) {
paletteDrawer.remove(entryModule);
}
// favoritesEditPart.removeChild(entryEditPart);
break;
}
}
}
}
}
use of org.eclipse.gef.palette.PaletteDrawer in project tdi-studio-se by Talend.
the class TalendPaletteViewer method removeRecentlyUsedComponent.
public void removeRecentlyUsedComponent(CombinedTemplateCreationEntry component) {
if (recentlyUsedEditPart != null) {
List children = recentlyUsedEditPart.getChildren();
if (children != null) {
for (Object obj : children) {
TalendEntryEditPart entryEditPart = (TalendEntryEditPart) obj;
CombinedTemplateCreationEntry entryModule = (CombinedTemplateCreationEntry) entryEditPart.getModel();
if (entryModule.getLabel().equals(component.getLabel())) {
PaletteDrawer paletteDrawer = recentlyUsedEditPart.getDrawer();
if (paletteDrawer != null) {
paletteDrawer.remove(entryModule);
}
// favoritesEditPart.removeChild(entryEditPart);
break;
}
}
}
}
}
use of org.eclipse.gef.palette.PaletteDrawer in project tdi-studio-se by Talend.
the class BusinessPaletteFactory method createbusiness1Group.
/**
* @generated
*/
private PaletteContainer createbusiness1Group() {
//$NON-NLS-1$
PaletteContainer paletteContainer = new PaletteDrawer("business");
paletteContainer.add(createDecision1CreationTool());
paletteContainer.add(createAction2CreationTool());
paletteContainer.add(createTerminal3CreationTool());
paletteContainer.add(createData4CreationTool());
paletteContainer.add(createDocument5CreationTool());
paletteContainer.add(createInput6CreationTool());
paletteContainer.add(createList7CreationTool());
paletteContainer.add(createDatabase8CreationTool());
paletteContainer.add(createActor9CreationTool());
paletteContainer.add(createEllipse10CreationTool());
paletteContainer.add(createGear11CreationTool());
paletteContainer.add(new PaletteSeparator());
paletteContainer.add(createRelationship13CreationTool());
paletteContainer.add(createDirectionalRelationship14CreationTool());
paletteContainer.add(createBidirectionalRelationship15CreationTool());
return paletteContainer;
}
use of org.eclipse.gef.palette.PaletteDrawer in project dbeaver by serge-rider.
the class ERDGraphicalViewer method setContents.
@Override
public void setContents(EditPart editpart) {
loadContents = true;
try {
super.setContents(editpart);
// Reset palette contents
if (editpart instanceof DiagramPart) {
List<DBSEntity> tables = new ArrayList<>();
for (Object child : editpart.getChildren()) {
if (child instanceof EntityPart) {
tables.add(((EntityPart) child).getTable().getObject());
}
}
Collections.sort(tables, DBUtils.<DBSEntity>nameComparator());
Map<PaletteDrawer, List<ToolEntryTable>> toolMap = new LinkedHashMap<>();
for (DBSEntity table : tables) {
DBPDataSourceContainer container = table.getDataSource().getContainer();
PaletteDrawer drawer = getContainerPaletteDrawer(container);
if (drawer != null) {
List<ToolEntryTable> tools = toolMap.get(drawer);
if (tools == null) {
tools = new ArrayList<>(tables.size());
toolMap.put(drawer, tools);
}
tools.add(new ToolEntryTable(table));
}
}
for (Map.Entry<PaletteDrawer, List<ToolEntryTable>> entry : toolMap.entrySet()) {
entry.getKey().setChildren(entry.getValue());
}
//editor.getPaletteContents().setChildren(tools);
}
} finally {
loadContents = false;
}
}
use of org.eclipse.gef.palette.PaletteDrawer in project dbeaver by serge-rider.
the class ERDGraphicalViewer method acquireContainer.
private void acquireContainer(DBPDataSourceContainer container) {
container.acquire(editor);
container.getRegistry().addDataSourceListener(this);
PaletteRoot paletteRoot = editor.getPaletteRoot();
PaletteDrawer dsDrawer = new PaletteDrawer(container.getName(), DBeaverIcons.getImageDescriptor(container.getDriver().getIcon()));
dsDrawer.setDescription(container.getDescription());
dsDrawer.setId(container.getId());
paletteRoot.add(dsDrawer);
}
Aggregations