Search in sources :

Example 6 with TalendPropertyTabDescriptor

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;
        }
    });
}
Also used : ArrayList(java.util.ArrayList) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) List(java.util.List) ArrayList(java.util.ArrayList) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) TraceDebugProcessComposite(org.talend.designer.runprocess.ui.TraceDebugProcessComposite) ProcessComposite(org.talend.designer.runprocess.ui.ProcessComposite)

Example 7 with TalendPropertyTabDescriptor

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;
        }
    });
}
Also used : ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EComponentCategory(org.talend.core.model.process.EComponentCategory)

Example 8 with TalendPropertyTabDescriptor

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;
        }
    });
}
Also used : ArrayList(java.util.ArrayList) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) List(java.util.List) ArrayList(java.util.ArrayList) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor)

Example 9 with TalendPropertyTabDescriptor

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;
        }
    });
}
Also used : ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EComponentCategory(org.talend.core.model.process.EComponentCategory)

Aggregations

TalendPropertyTabDescriptor (org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)8 ArrayList (java.util.ArrayList)5 List (java.util.List)5 Element (org.talend.core.model.process.Element)4 Iterator (java.util.Iterator)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 Control (org.eclipse.swt.widgets.Control)3 EComponentCategory (org.talend.core.model.process.EComponentCategory)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 IEditorPart (org.eclipse.ui.IEditorPart)2 IProcess (org.talend.core.model.process.IProcess)2 EmptyRepositoryObject (org.talend.core.model.repository.EmptyRepositoryObject)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 IDynamicProperty (org.talend.core.ui.properties.tab.IDynamicProperty)2 ProcessComposite (org.talend.designer.runprocess.ui.ProcessComposite)2 TraceDebugProcessComposite (org.talend.designer.runprocess.ui.TraceDebugProcessComposite)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1