use of org.eclipse.gef.palette.PaletteContainer in project dbeaver by serge-rider.
the class ERDGraphicalViewer method handleTableActivate.
public void handleTableActivate(DBSEntity table) {
if (table.getDataSource() != null) {
DBPDataSourceContainer container = table.getDataSource().getContainer();
if (container != null) {
synchronized (usedDataSources) {
DataSourceInfo dataSourceInfo = usedDataSources.get(container);
if (dataSourceInfo == null) {
dataSourceInfo = new DataSourceInfo();
usedDataSources.put(container, dataSourceInfo);
acquireContainer(container);
}
dataSourceInfo.tableCount++;
}
}
}
if (!loadContents) {
final PaletteContainer drawer = getContainerPaletteDrawer(table.getDataSource().getContainer());
if (drawer != null) {
// Add entry (with right order)
List children = drawer.getChildren();
int index = 0;
for (int i = 0, childrenSize = children.size(); i < childrenSize; i++) {
Object child = children.get(i);
if (child instanceof ToolEntryTable) {
if (((ToolEntryTable) child).table.getName().compareTo(table.getName()) > 0) {
index = i;
break;
}
}
}
drawer.add(index, new ToolEntryTable(table));
}
}
}
use of org.eclipse.gef.palette.PaletteContainer in project tdi-studio-se by Talend.
the class TalendPaletteDrawer method setFiltered.
/**
* Sets the filtered.
*
* @param filtered the filtered to set
*/
@Override
public void setFiltered(boolean filtered) {
this.filtered = filtered;
PaletteContainer parentContainer = getParent();
if (parentContainer instanceof IPaletteFilter) {
((IPaletteFilter) parentContainer).setFiltered(filtered);
}
}
use of org.eclipse.gef.palette.PaletteContainer in project tdi-studio-se by Talend.
the class AbstractTalendEditor method expandPaletteDrawer.
/**
* DOC hcw Comment method "expandPaletteDrawer".
*
* @param paletteViewer
* @param paletteEntry
*/
private void expandPaletteDrawer(PaletteViewer paletteViewer, ToolEntry paletteEntry) {
List<TalendDrawerEditPart> parts = new ArrayList<TalendDrawerEditPart>();
PaletteContainer parent = paletteEntry.getParent();
while (parent != null) {
if (parent instanceof TalendPaletteDrawer) {
Object editpart = paletteViewer.getEditPartRegistry().get(parent);
if (editpart instanceof TalendDrawerEditPart) {
parts.add((TalendDrawerEditPart) editpart);
}
}
parent = parent.getParent();
}
for (int i = parts.size() - 1; i >= 0; i--) {
parts.get(i).setExpanded(true);
}
}
Aggregations