Search in sources :

Example 1 with PropertiesFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree in project tdi-studio-se by Talend.

the class AttributesTab method createViewer.

/**
     * Creates the viewer.
     * 
     * @param propertySheet The property sheet
     */
private void createViewer(PropertySheet propertySheet) {
    filteredTree = new PropertiesFilteredTree(this, propertySheet.getViewSite().getActionBars()) {

        private ShowInTimelineAction showInTimelineAction;

        @Override
        protected List<Action> createActions(IActionBars actionBars) {
            List<Action> actions = new ArrayList<Action>();
            CopyAction copyAction = CopyAction.createCopyAction(actionBars);
            actions.add(copyAction);
            showInTimelineAction = new MyShowInTimelineAction(section);
            actions.add(showInTimelineAction);
            return actions;
        }

        @Override
        public void menuAboutToshow() {
        // do nothing
        }
    };
    viewer = filteredTree.getViewer();
    filteredTree.setEditingSupport(new MyEditingSupport(viewer));
    contentProvider = new AttributeContentProvider();
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new AttributeLabelProvider(viewer));
    viewer.setInput(new Object());
}
Also used : CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) Action(org.eclipse.jface.action.Action) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) ArrayList(java.util.ArrayList) List(java.util.List) IActionBars(org.eclipse.ui.IActionBars)

Example 2 with PropertiesFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree in project tdi-studio-se by Talend.

the class OverviewSection method createControls.

/*
     * @see AbstractJvmPropertySection#createControls(Composite)
     */
@Override
protected void createControls(final Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    viewer = new PropertiesFilteredTree(composite, getActionBars()) {

        private ShowInTimelineAction showInTimelineAction;

        @Override
        protected List<Action> createActions(IActionBars actionBars) {
            List<Action> actions = new ArrayList<Action>();
            CopyAction copyAction = CopyAction.createCopyAction(actionBars);
            actions.add(copyAction);
            showInTimelineAction = new MyShowInTimelineAction(OverviewSection.this);
            actions.add(showInTimelineAction);
            return actions;
        }

        @Override
        public void menuAboutToshow() {
        // do nothing
        }
    }.getViewer();
    viewer.setContentProvider(new OverviewContentProvider(overviewProperties));
    viewer.setLabelProvider(new OverviewLabelProvider());
    ((Tree) viewer.getControl()).addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent e) {
            storeTreeExpansionState();
        }
    });
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.OVERVIEW_PAGE);
}
Also used : FocusAdapter(org.eclipse.swt.events.FocusAdapter) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) Action(org.eclipse.jface.action.Action) RefreshAction(org.talend.designer.runtime.visualization.internal.actions.RefreshAction) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) Composite(org.eclipse.swt.widgets.Composite) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) ArrayList(java.util.ArrayList) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) FocusEvent(org.eclipse.swt.events.FocusEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) Tree(org.eclipse.swt.widgets.Tree) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

ArrayList (java.util.ArrayList)2 Action (org.eclipse.jface.action.Action)2 IActionBars (org.eclipse.ui.IActionBars)2 CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)2 ShowInTimelineAction (org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction)2 PropertiesFilteredTree (org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree)2 List (java.util.List)1 FocusAdapter (org.eclipse.swt.events.FocusAdapter)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Tree (org.eclipse.swt.widgets.Tree)1 RefreshAction (org.talend.designer.runtime.visualization.internal.actions.RefreshAction)1