use of org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor in project tdi-studio-se by Talend.
the class ProcessView method selectTab.
public void selectTab(final EComponentCategory category) {
if (tabFactory.getSelection().getCategory().equals(category)) {
return;
}
List<TalendPropertyTabDescriptor> allTabs = tabFactory.getInput();
final List<TalendPropertyTabDescriptor> selection = new ArrayList<TalendPropertyTabDescriptor>();
for (TalendPropertyTabDescriptor talendPropertyTabDescriptor : allTabs) {
if (talendPropertyTabDescriptor.getCategory().equals(category)) {
dc = new ProcessComposite(tabFactory.getTabComposite(), SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS);
// createBasicComposite(tabFactory.getTabComposite(), element, null);
refresh();
selection.add(talendPropertyTabDescriptor);
}
}
tabFactory.setSelection(new StructuredSelection() {
@Override
public List toList() {
return selection;
}
});
}
use of org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor in project tdi-studio-se by Talend.
the class ComponentSettingsView method setElement.
@Override
public void setElement(Element elem) {
if (currentSelectedTab != null && currentSelectedTab.getData().equals(elem) && !cleaned) {
updatePropertiesViewerTitle();
return;
}
EComponentCategory[] categories = getCategories(elem);
final List<TalendPropertyTabDescriptor> descriptors = new ArrayList<TalendPropertyTabDescriptor>();
for (EComponentCategory category : categories) {
TalendPropertyTabDescriptor d = new TalendPropertyTabDescriptor(category);
d.setData(elem);
descriptors.add(d);
// if (category.hadSubCategories()) {
// for (EComponentCategory subCategory : category.getSubCategories()) {
// TalendPropertyTabDescriptor subc = new TalendPropertyTabDescriptor(subCategory);
// subc.setElement(elem);
// d.addSubItem(subc);
// }
// }
}
tabFactory.setInput(descriptors);
setPropertiesViewerTitle(elem);
cleaned = false;
tabFactory.setSelection(new IStructuredSelection() {
@Override
public Object getFirstElement() {
return null;
}
@Override
public Iterator iterator() {
return null;
}
@Override
public int size() {
return 0;
}
@Override
public Object[] toArray() {
return null;
}
@Override
public List toList() {
List<TalendPropertyTabDescriptor> d = new ArrayList<TalendPropertyTabDescriptor>();
if (descriptors.size() > 0) {
if (currentSelectedTab != null) {
for (TalendPropertyTabDescriptor ds : descriptors) {
if (ds.getCategory() == currentSelectedTab.getCategory()) {
d.add(ds);
return d;
}
}
}
d.add(descriptors.get(0));
}
return d;
}
@Override
public boolean isEmpty() {
return false;
}
});
}
use of org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor in project tdi-studio-se by Talend.
the class ComponentSettingsView method selectTab.
public void selectTab(final EComponentCategory category) {
if (tabFactory.getSelection().getCategory().equals(category)) {
return;
}
List<TalendPropertyTabDescriptor> allTabs = tabFactory.getInput();
final List<TalendPropertyTabDescriptor> selection = new ArrayList<TalendPropertyTabDescriptor>();
for (TalendPropertyTabDescriptor talendPropertyTabDescriptor : allTabs) {
if (talendPropertyTabDescriptor.getCategory().equals(category)) {
selection.add(talendPropertyTabDescriptor);
}
}
tabFactory.setSelection(new StructuredSelection() {
@Override
public List toList() {
return selection;
}
});
}
use of org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor in project tdi-studio-se by Talend.
the class ProcessView method setElement.
public void setElement() {
EComponentCategory[] categories = getCategories();
final List<TalendPropertyTabDescriptor> descriptors = new ArrayList<TalendPropertyTabDescriptor>();
for (EComponentCategory category : categories) {
TalendPropertyTabDescriptor d = new TalendPropertyTabDescriptor(category);
// d.setData(data);
descriptors.add(d);
}
tabFactory.setInput(descriptors);
tabFactory.setSelection(new IStructuredSelection() {
@Override
public Object getFirstElement() {
return null;
}
@Override
public Iterator iterator() {
return null;
}
@Override
public int size() {
return 0;
}
@Override
public Object[] toArray() {
return null;
}
@Override
public List toList() {
List<TalendPropertyTabDescriptor> d = new ArrayList<TalendPropertyTabDescriptor>();
if (descriptors.size() > 0) {
if (currentSelectedTab != null) {
for (TalendPropertyTabDescriptor ds : descriptors) {
if (ds.getCategory() == currentSelectedTab.getCategory()) {
d.add(ds);
return d;
}
}
}
d.add(descriptors.get(0));
}
return d;
}
@Override
public boolean isEmpty() {
return false;
}
});
}
Aggregations