Search in sources :

Example 1 with PropertiesColumn

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

the class NotificationDetailsDialog method configureTree.

/**
     * Configures the tree.
     * 
     * @param detailsTree The tree
     */
private void configureTree(Tree detailsTree) {
    detailsTree.setLinesVisible(true);
    detailsTree.setHeaderVisible(true);
    for (PropertiesColumn column : PropertiesColumn.values()) {
        TreeColumn treeColumn = new TreeColumn(detailsTree, SWT.NONE);
        treeColumn.setText(column.label);
        treeColumn.setWidth(column.defalutWidth);
        treeColumn.setAlignment(column.alignment);
        treeColumn.setToolTipText(column.toolTip);
    }
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(copyAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(detailsTree);
    detailsTree.setMenu(menu);
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) PropertiesColumn(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesColumn) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 2 with PropertiesColumn

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

the class InvokeDialog method configureTree.

/**
     * Configures the tree.
     * 
     * @param tree The tree
     */
private void configureTree(Tree tree) {
    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);
    for (PropertiesColumn column : PropertiesColumn.values()) {
        TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
        treeColumn.setText(column.label);
        treeColumn.setWidth(column.defalutWidth);
        treeColumn.setAlignment(column.alignment);
        treeColumn.setToolTipText(column.toolTip);
    }
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(copyAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(tree);
    tree.setMenu(menu);
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) PropertiesColumn(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesColumn) IMenuListener(org.eclipse.jface.action.IMenuListener)

Aggregations

IMenuListener (org.eclipse.jface.action.IMenuListener)2 IMenuManager (org.eclipse.jface.action.IMenuManager)2 MenuManager (org.eclipse.jface.action.MenuManager)2 Menu (org.eclipse.swt.widgets.Menu)2 TreeColumn (org.eclipse.swt.widgets.TreeColumn)2 PropertiesColumn (org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesColumn)2