use of org.talend.core.ui.component.preference.provider.IPaletteItem in project tdi-studio-se by Talend.
the class PaletteSettingPage method retrieveAllEntry.
private void retrieveAllEntry(Set<IPaletteItem> list, IPaletteItem entry) {
if (!(entry instanceof ComponentPaletteItem)) {
IPaletteItem container = entry;
for (Object element : container.getChildren()) {
IPaletteItem en = (IPaletteItem) element;
retrieveAllEntry(list, en);
}
} else {
list.add(entry);
}
}
use of org.talend.core.ui.component.preference.provider.IPaletteItem in project tdi-studio-se by Talend.
the class PaletteItemHelper method getFamilyItem.
/**
* DOC nrousseau Comment method "getFamilyItem".
*
* @param family
* @param rootPaletteItem
* @return
*/
private static IPaletteItem getFamilyItem(String family, IPaletteItem rootPaletteItem) {
String curFolder = family.split(FAMILY_FOLDER_SEPARATOR)[0];
IPaletteItem curFolderItem = null;
for (IPaletteItem paletteItem : rootPaletteItem.getChildren()) {
if (paletteItem instanceof FolderPaletteItem && paletteItem.getLabel().equals(curFolder)) {
curFolderItem = paletteItem;
break;
}
}
if (curFolderItem == null) {
curFolderItem = new FolderPaletteItem(curFolder, rootPaletteItem.getPaletteType());
rootPaletteItem.getChildren().add(curFolderItem);
curFolderItem.setParent(rootPaletteItem);
}
int index = family.indexOf(FAMILY_FOLDER_SEPARATOR);
if (index < 0) {
return curFolderItem;
}
return getFamilyItem(family.substring(index + 1, family.length()), curFolderItem);
}
Aggregations