Example usage for org.eclipse.jface.action ToolBarManager ToolBarManager

List of usage examples for org.eclipse.jface.action ToolBarManager ToolBarManager

Introduction

In this page you can find the example usage for org.eclipse.jface.action ToolBarManager ToolBarManager.

Prototype

public ToolBarManager() 

Source Link

Document

Creates a new tool bar manager with the default SWT button style.

Usage

From source file:ch.elexis.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillCoolBar(ICoolBarManager coolBar) {
    ToolBarManager tbm = new ToolBarManager();

    tbm.add(GlobalActions.homeAction);/*from  www.j av a 2 s . co  m*/
    tbm.add(GlobalActions.resetPerspectiveAction);

    tbm.add(new Separator());
    tbm.add(GlobalActions.printEtikette);
    tbm.add(GlobalActions.printVersionedEtikette);
    tbm.add(GlobalActions.printAdresse);

    coolBar.add(tbm);
    if (Hub.localCfg.get(PreferenceConstants.SHOWTOOLBARITEMS, Boolean.toString(true))
            .equalsIgnoreCase(Boolean.toString(true))) {
        ToolBarManager tb2 = new ToolBarManager();
        // ci.getToolBarManager().add(new Separator());
        for (IAction action : openPerspectiveActions) {
            if (action != null) {
                tb2.add(action);
            }
        }
        coolBar.add(tb2);
    }

}

From source file:ch.elexis.core.application.advisors.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillCoolBar(ICoolBarManager coolBar) {
    ToolBarManager tbm = new ToolBarManager();

    tbm.add(GlobalActions.homeAction);/*from w ww .ja v  a2 s .com*/
    tbm.add(GlobalActions.resetPerspectiveAction);

    tbm.add(new Separator());
    tbm.add(GlobalActions.printEtikette);
    tbm.add(GlobalActions.printVersionedEtikette);
    tbm.add(GlobalActions.printAdresse);

    coolBar.add(tbm);
    if (CoreHub.localCfg.get(Preferences.SHOWTOOLBARITEMS, Boolean.toString(true))
            .equalsIgnoreCase(Boolean.toString(true))) {
        ToolBarManager tb2 = new ToolBarManager();

        List<IAction> l = new ArrayList<>();
        for (IAction action : openPerspectiveActions) {
            if (action != null) {
                l.add(action);
            }
        }
        Collections.sort(l, new Comparator<IAction>() {
            @Override
            public int compare(IAction o1, IAction o2) {
                if (o1.getToolTipText() != null && o2.getToolTipText() != null) {
                    return o1.getToolTipText().compareTo(o2.getToolTipText());
                }
                return o1.getToolTipText() != null ? 1 : -1;
            }
        });

        // ci.getToolBarManager().add(new Separator());
        for (IAction action : l) {
            tb2.add(action);
        }
        coolBar.add(tb2);
    }

}

From source file:ch.elexis.core.findings.ui.composites.DiagnoseListComposite.java

License:Open Source License

public DiagnoseListComposite(Composite parent, int style) {
    super(parent, style);
    setLayout(new GridLayout(1, false));

    toolbarManager = new ToolBarManager();
    toolbarManager.add(new AddConditionAction());
    toolbarManager.add(new RemoveConditionAction());
    ToolBar toolbar = toolbarManager.createControl(this);
    toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
    toolbar.setBackground(parent.getBackground());

    natTableWrapper = NatTableFactory.createSingleColumnTable(this,
            new GlazedListsDataProvider<ICondition>(dataList, new IColumnAccessor<ICondition>() {
                @Override/*  w ww.  j av a  2s .co  m*/
                public int getColumnCount() {
                    return 1;
                }

                @Override
                public Object getDataValue(ICondition condition, int columnIndex) {
                    switch (columnIndex) {
                    case 0:
                        return getFormattedDescriptionText(condition);
                    }
                    return "";
                }

                private Object getFormattedDescriptionText(ICondition condition) {
                    StringBuilder text = new StringBuilder();

                    StringBuilder contentText = new StringBuilder();
                    // first display text
                    Optional<String> conditionText = condition.getText();
                    conditionText.ifPresent(t -> {
                        if (contentText.length() > 0) {
                            contentText.append("\n");
                        }
                        contentText.append(t);
                    });
                    // then display the coding
                    List<ICoding> codings = condition.getCoding();
                    if (codings != null && !codings.isEmpty()) {
                        for (ICoding iCoding : codings) {
                            if (contentText.length() > 0) {
                                contentText.append(", ");
                            }
                            contentText.append("[")
                                    .append(CodingServiceComponent.getService().getShortLabel(iCoding))
                                    .append("] ");
                        }
                    }
                    // add additional information before content
                    text.append("<strong>");
                    ConditionStatus status = condition.getStatus();
                    text.append(status.getLocalized());
                    Optional<String> start = condition.getStart();
                    start.ifPresent(string -> text.append(" (").append(string).append(" - "));
                    Optional<String> end = condition.getEnd();
                    end.ifPresent(string -> text.append(string));
                    start.ifPresent(string -> text.append(")"));

                    List<String> notes = condition.getNotes();
                    if (!notes.isEmpty()) {
                        text.append(" (" + notes.size() + ")");
                    }
                    if (contentText.toString().contains("\n")) {
                        text.append("</strong>\n").append(contentText.toString());
                    } else {
                        text.append("</strong> ").append(contentText.toString());
                    }

                    return text.toString();
                }

                @Override
                public void setDataValue(ICondition condition, int arg1, Object arg2) {
                    // setting data values is not enabled here.
                }

            }), null);
    natTableWrapper.getNatTable().setLayoutData(new GridData(GridData.FILL_BOTH));
    natTableWrapper.addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(NatTableWrapper source, ISelection selection) {
            if (selection instanceof StructuredSelection && !selection.isEmpty()) {
                ICondition condition = (ICondition) ((StructuredSelection) selection).getFirstElement();
                AcquireLockBlockingUi.aquireAndRun((IPersistentObject) condition, new ILockHandler() {
                    @Override
                    public void lockFailed() {
                        // do nothing
                    }

                    @Override
                    public void lockAcquired() {
                        ConditionEditDialog dialog = new ConditionEditDialog(condition, getShell());
                        if (dialog.open() == Dialog.OK) {
                            dialog.getCondition().ifPresent(c -> {
                                source.getNatTable().refresh();
                            });
                        }
                    }
                });
            }
        }
    });

    final MenuManager mgr = new MenuManager();
    mgr.setRemoveAllWhenShown(true);
    mgr.addMenuListener(new ConditionsMenuListener());
    natTableWrapper.getNatTable().setMenu(mgr.createContextMenu(natTableWrapper.getNatTable()));
}

From source file:com.amazonaws.eclipse.ec2.ui.keypair.KeyPairComposite.java

License:Apache License

/**
 * Constructs a key pair composite that uses the account id given. 
 *///from   w  w  w  .jav a  2s.com
public KeyPairComposite(Composite parent, String accountId) {
    super(parent, SWT.NONE);

    this.accountId = accountId;

    GridLayout layout = new GridLayout(1, false);
    layout.verticalSpacing = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.marginTop = 1;
    setLayout(layout);

    toolBarManager = new ToolBarManager();
    toolBar = toolBarManager.createControl(this);
    toolBar.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    keyPairSelectionTable = new KeyPairSelectionTable(this, this.accountId);
    keyPairSelectionTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    toolBarManager.add(keyPairSelectionTable.refreshAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(keyPairSelectionTable.createNewKeyPairAction);
    toolBarManager.add(keyPairSelectionTable.deleteKeyPairAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(keyPairSelectionTable.registerKeyPairAction);
    toolBarManager.update(true);
}

From source file:com.aptana.ide.rcp.IDEWorkbenchWindowAdvisor.java

License:Open Source License

public Control createEmptyWindowContents(Composite parent) {
    final IWorkbenchWindow window = getWindowConfigurer().getWindow();
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    Display display = composite.getDisplay();
    Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
    composite.setBackground(bgCol);//ww  w. j a va 2s.c o m
    Label label = new Label(composite, SWT.WRAP);
    label.setForeground(display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
    label.setBackground(bgCol);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
    label.setText(msg);
    ToolBarManager toolBarManager = new ToolBarManager();
    // TODO: should obtain the open perspective action from ActionFactory
    openPerspectiveAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
    toolBarManager.add(openPerspectiveAction);
    ToolBar toolBar = toolBarManager.createControl(composite);
    toolBar.setBackground(bgCol);
    return composite;
}

From source file:com.aptana.rcp.IDEWorkbenchWindowAdvisor.java

License:Open Source License

/**
 * @see org.eclipse.ui.application.WorkbenchAdvisor#createEmptyWindowContents(org.eclipse.ui.application.IWorkbenchWindowConfigurer,
 *      org.eclipse.swt.widgets.Composite)
 *//*  w  w w. j a va  2 s  . co m*/
public Control createEmptyWindowContents(Composite parent) {
    final IWorkbenchWindow window = getWindowConfigurer().getWindow();
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    Display display = composite.getDisplay();
    Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
    composite.setBackground(bgCol);
    Label label = new Label(composite, SWT.WRAP);
    label.setForeground(display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
    label.setBackground(bgCol);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
    label.setText(msg);
    ToolBarManager toolBarManager = new ToolBarManager();
    // TODO: should obtain the open perspective action from ActionFactory
    openPerspectiveAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
    toolBarManager.add(openPerspectiveAction);
    ToolBar toolBar = toolBarManager.createControl(composite);
    toolBar.setBackground(bgCol);
    return composite;
}

From source file:com.astra.ses.spell.dev.advisor.ApplicationWorkbenchWindowAdvisor.java

License:Open Source License

public Control createEmptyWindowContents(Composite parent) {
    //      final IWorkbenchWindow window = getWindowConfigurer().getWindow();
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    Display display = composite.getDisplay();
    Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
    composite.setBackground(bgCol);//ww w.  j a v a  2  s. c  om
    Label label = new Label(composite, SWT.WRAP);
    label.setForeground(display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
    label.setBackground(bgCol);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
    label.setText(msg);
    ToolBarManager toolBarManager = new ToolBarManager();
    //      // TODO: should obtain the open perspective action from ActionFactory
    //      openPerspectiveAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG
    //            .create(window);
    //      toolBarManager.add(openPerspectiveAction);
    ToolBar toolBar = toolBarManager.createControl(composite);
    toolBar.setBackground(bgCol);
    return composite;
}

From source file:com.diffplug.common.swt.jface.JFaceRxTest.java

License:Apache License

@Test
public void testToggle() {
    InteractiveTest.testCoat(//  w ww .j  a v a 2 s  .c  o m
            "When you check and uncheck the action, the state of the selected text should change.", 20,
            SWT.DEFAULT, root -> {
                Layouts.setGrid(root);

                IAction action = Actions.builder().setText("Action").setStyle(Style.CHECK).build();
                RxBox<Boolean> selection = JFaceRx.toggle(action);

                {
                    Group cmp = new Group(root, SWT.SHADOW_ETCHED_IN);
                    cmp.setText("Under test");
                    Layouts.setGridData(cmp).grabHorizontal();
                    Layouts.setFill(cmp);

                    ToolBarManager manager = new ToolBarManager();
                    manager.createControl(cmp);
                    manager.add(action);
                    manager.update(true);
                }
                {
                    Group cmp = new Group(root, SWT.NONE);
                    cmp.setText("Read");
                    Layouts.setGridData(cmp).grabHorizontal();
                    Layouts.setFill(cmp);

                    Label selectedTxt = new Label(cmp, SWT.BORDER);
                    Rx.subscribe(selection, s -> selectedTxt.setText(Boolean.toString(s)));
                }
                {
                    Group cmp = new Group(root, SWT.NONE);
                    cmp.setText("Write");
                    Layouts.setGridData(cmp).grabHorizontal();
                    Layouts.setFill(cmp);

                    Button setFalse = new Button(cmp, SWT.PUSH);
                    setFalse.setText("set false");
                    setFalse.addListener(SWT.Selection, e -> selection.set(false));

                    Button setTrue = new Button(cmp, SWT.PUSH);
                    setTrue.setText("set true");
                    setTrue.addListener(SWT.Selection, e -> selection.set(true));
                }
            });
}

From source file:com.laex.cg2d.core.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void fillCoolBar(ICoolBarManager coolBar) {

    ToolBarManager toolBarManager = new ToolBarManager();
    coolBar.add(toolBarManager);//from w  w w  .  j  av a  2 s.  c o m
    toolBarManager.add(newWizardDropDownAction);
}

From source file:com.smartmonkey.recrep.SMonkeyViewer.java

License:Apache License

/**
 * Create contents of the application window.
 * //from   w w  w  .j a  va 2 s .  c  o  m
 * @param parent
 */
@Override
protected Control createContents(Composite parent) {
    parent.setLayout(new FillLayout());
    SashForm baseSash = new SashForm(parent, SWT.HORIZONTAL | SWT.NONE);
    // draw the canvas with border, so the divider area for sash form can be
    // highlighted
    SashForm leftSash = new SashForm(baseSash, SWT.VERTICAL);
    mScreenshotCanvas = new Canvas(leftSash, SWT.BORDER | SWT.NO_REDRAW_RESIZE);
    mScreenshotCanvas.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            if (e.button == 3) // Right Click
            {
                SMonkeyModel.getModel().toggleExploreMode();
            } else if (e.button == 1) // Left Click
            {
                SMonkeyModel.getModel().touch();
            }
        }
    });

    mScreenshotCanvas.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    mScreenshotCanvas.addPaintListener(new PaintListener() {
        @Override
        public void paintControl(PaintEvent e) {
            Image image = SMonkeyModel.getModel().getScreenshot();
            if (image != null) {
                updateScreenshotTransformation();
                // shifting the image here, so that there's a border around
                // screen shot
                // this makes highlighting red rectangles on the screen shot
                // edges more visible
                Transform t = new Transform(e.gc.getDevice());
                t.translate(mDx, mDy);
                t.scale(mScale, mScale);
                e.gc.setTransform(t);
                e.gc.drawImage(image, 0, 0);
                // this resets the transformation to identity transform,
                // i.e. no change
                // we don't use transformation here because it will cause
                // the line pattern
                // and line width of highlight rect to be scaled, causing to
                // appear to be blurry
                e.gc.setTransform(null);
                if (SMonkeyModel.getModel().shouldShowNafNodes()) {
                    // highlight the "Not Accessibility Friendly" nodes
                    e.gc.setForeground(e.gc.getDevice().getSystemColor(SWT.COLOR_YELLOW));
                    e.gc.setBackground(e.gc.getDevice().getSystemColor(SWT.COLOR_YELLOW));
                    for (Rectangle r : SMonkeyModel.getModel().getNafNodes()) {
                        e.gc.setAlpha(50);
                        e.gc.fillRectangle(mDx + getScaledSize(r.x), mDy + getScaledSize(r.y),
                                getScaledSize(r.width), getScaledSize(r.height));
                        e.gc.setAlpha(255);
                        e.gc.setLineStyle(SWT.LINE_SOLID);
                        e.gc.setLineWidth(2);
                        e.gc.drawRectangle(mDx + getScaledSize(r.x), mDy + getScaledSize(r.y),
                                getScaledSize(r.width), getScaledSize(r.height));
                    }
                }
                // draw the mouseover rects
                Rectangle rect = SMonkeyModel.getModel().getCurrentDrawingRect();
                if (rect != null) {
                    e.gc.setForeground(e.gc.getDevice().getSystemColor(SWT.COLOR_RED));
                    if (SMonkeyModel.getModel().isExploreMode()) {
                        // when we highlight nodes dynamically on mouse
                        // move,
                        // use dashed borders
                        e.gc.setLineStyle(SWT.LINE_DASH);
                        e.gc.setLineWidth(1);
                    } else {
                        // when highlighting nodes on tree node selection,
                        // use solid borders
                        e.gc.setLineStyle(SWT.LINE_SOLID);
                        e.gc.setLineWidth(2);
                    }
                    e.gc.drawRectangle(mDx + getScaledSize(rect.x), mDy + getScaledSize(rect.y),
                            getScaledSize(rect.width), getScaledSize(rect.height));
                }
            }
        }
    });
    mScreenshotCanvas.addMouseMoveListener(new MouseMoveListener() {
        @Override
        public void mouseMove(MouseEvent e) {
            if (SMonkeyModel.getModel().isExploreMode()) {
                SMonkeyModel.getModel().updateSelectionForCoordinates(getInverseScaledSize(e.x - mDx),
                        getInverseScaledSize(e.y - mDy));
            }
        }
    });

    // Lower Left Base contains the physical buttons on the phone
    SashForm lowerLeftBase = new SashForm(leftSash, SWT.HORIZONTAL);

    Composite buttonComposite = new Composite(lowerLeftBase, SWT.BORDER);
    ToolBarManager physicalButtonToolbarManager = new ToolBarManager();
    physicalButtonToolbarManager.add(new Action() {
        @Override
        public ImageDescriptor getImageDescriptor() {
            return ImageHelper.loadImageDescriptorFromResource("images/back_gray.png");
        }

        public void run() {
            SMonkeyModel.getModel().pressButton(PhysicalButton.BACK);
        }
    });
    physicalButtonToolbarManager.add(new Action() {
        @Override
        public ImageDescriptor getImageDescriptor() {
            return ImageHelper.loadImageDescriptorFromResource("images/menu_gray.png");
        }

        public void run() {
            SMonkeyModel.getModel().pressButton(PhysicalButton.MENU);
        }
    });
    physicalButtonToolbarManager.add(new Action() {
        @Override
        public ImageDescriptor getImageDescriptor() {
            return ImageHelper.loadImageDescriptorFromResource("images/home_gray.png");
        }

        public void run() {
            SMonkeyModel.getModel().pressButton(PhysicalButton.HOME);
        }
    });
    physicalButtonToolbarManager.add(new Action() {
        @Override
        public ImageDescriptor getImageDescriptor() {
            return ImageHelper.loadImageDescriptorFromResource("images/noop.png");
        }

        public void run() {
            SMonkeyModel.getModel().noop();
        }
    });
    physicalButtonToolbarManager.add(mFBLoginAction);

    physicalButtonToolbarManager.createControl(buttonComposite);

    Composite textComposite = new Composite(lowerLeftBase, SWT.BORDER);
    mText = new Text(textComposite, SWT.SINGLE);
    mSendTextButton = new Button(textComposite, SWT.PUSH);
    mSendTextButton.setText("Send\nText");
    mSendTextButton.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            SMonkeyModel.getModel().sendText(mText.getText());
        }
    });
    textComposite.setLayout(new FillLayout());

    leftSash.setWeights(new int[] { 6, 1 });

    // middle sash contains the list of events, which are highlighted as
    // they happen.
    // TODO: Add a fast forward button to perform the next event, skipping
    // the wait
    SashForm middleSash = new SashForm(baseSash, SWT.VERTICAL);

    ToolBarManager replayToolbarManager = new ToolBarManager(SWT.FLAT);
    replayToolbarManager.add(mClearRecordingAction);
    replayToolbarManager.add(mOpenRecordFileAction);
    replayToolbarManager.add(mSaveRecordFileAction);
    replayToolbarManager.add(mToggleAutoRefreshAction);
    replayToolbarManager.add(mReplayAction);

    replayToolbarManager.createControl(middleSash);

    chimpEventTableViewer = new TableViewer(middleSash,
            SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);

    chimpEventTableViewer.getTable().setMenu(new Menu(chimpEventTableViewer.getTable()));

    TableViewerColumn waitColumn = new TableViewerColumn(chimpEventTableViewer, SWT.NONE);
    waitColumn.getColumn().setText("Wait time");
    waitColumn.getColumn().setWidth(100);
    waitColumn.setLabelProvider(new ColumnLabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof ChimpEvent) {
                ChimpEvent chimp = (ChimpEvent) element;
                return chimp.getWait();
            }
            return super.getText(element);
        }
    });

    TableViewerColumn typeColumn = new TableViewerColumn(chimpEventTableViewer, SWT.NONE);
    typeColumn.getColumn().setText("Type");
    typeColumn.getColumn().setWidth(100);
    typeColumn.setLabelProvider(new ColumnLabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof ChimpEvent) {
                ChimpEvent chimp = (ChimpEvent) element;
                return chimp.getType();
            }
            return super.getText(element);
        }
    });

    TableViewerColumn miscColumn = new TableViewerColumn(getChimpEventTableViewer(), SWT.NONE);
    miscColumn.getColumn().setText("Misc");
    miscColumn.getColumn().setWidth(100);
    miscColumn.setLabelProvider(new ColumnLabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof ChimpEvent) {
                ChimpEvent chimp = (ChimpEvent) element;
                return chimp.getMisc();
            }
            return super.getText(element);
        }
    });
    chimpEventTableViewer.getTable().setLinesVisible(true);
    chimpEventTableViewer.getTable().setHeaderVisible(true);
    chimpEventTableViewer.setContentProvider(ArrayContentProvider.getInstance());
    chimpEventTableViewer.setInput(SMonkeyModel.getModel().getLog());

    middleSash.setWeights(new int[] { 1, 20 });

    // right sash is split into 2 parts: upper-right and lower-right
    // both are composites with borders, so that the horizontal divider can
    // be highlighted by
    // the borders
    SashForm rightSash = new SashForm(baseSash, SWT.VERTICAL);

    // upper-right base contains the toolbar and the tree
    Composite upperRightBase = new Composite(rightSash, SWT.BORDER);
    upperRightBase.setLayout(new GridLayout(1, false));
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    toolBarManager.add(mOpenFilesAction);
    toolBarManager.add(mSaveFilesAction);
    toolBarManager.add(mExpandAllAction);
    toolBarManager.add(mScreenshotAction);
    toolBarManager.add(mToggleNafAction);

    // toolBarManager.add(mClearRecordingAction);
    // toolBarManager.add(mSaveRecordingAction);
    toolBarManager.createControl(upperRightBase);

    // Button b = new Button(upperRightBase.getShell(),SWT.CHECK);
    // b.setText("Auto");

    mTreeViewer = new TreeViewer(upperRightBase, SWT.NONE);
    mTreeViewer.setContentProvider(new BasicTreeNodeContentProvider());
    // default LabelProvider uses toString() to generate text to display
    mTreeViewer.setLabelProvider(new LabelProvider());
    mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection().isEmpty()) {
                SMonkeyModel.getModel().setSelectedNode(null);
            } else if (event.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                Object o = selection.toArray()[0];
                if (o instanceof BasicTreeNode) {
                    SMonkeyModel.getModel().setSelectedNode((BasicTreeNode) o);
                }
            }
        }
    });
    Tree tree = mTreeViewer.getTree();
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    // move focus so that it's not on tool bar (looks weird)
    tree.setFocus();

    // lower-right base contains the detail group
    Composite lowerRightBase = new Composite(rightSash, SWT.BORDER);
    lowerRightBase.setLayout(new FillLayout());
    Group grpNodeDetail = new Group(lowerRightBase, SWT.NONE);
    grpNodeDetail.setLayout(new FillLayout(SWT.HORIZONTAL));
    grpNodeDetail.setText("Node Detail");

    Composite tableContainer = new Composite(grpNodeDetail, SWT.NONE);

    TableColumnLayout columnLayout = new TableColumnLayout();
    tableContainer.setLayout(columnLayout);

    mTableViewer = new TableViewer(tableContainer, SWT.NONE | SWT.FULL_SELECTION);
    Table table = mTableViewer.getTable();
    table.setLinesVisible(true);
    // use ArrayContentProvider here, it assumes the input to the
    // TableViewer
    // is an array, where each element represents a row in the table
    mTableViewer.setContentProvider(ArrayContentProvider.getInstance());

    TableViewerColumn tableViewerColumnKey = new TableViewerColumn(mTableViewer, SWT.NONE);
    TableColumn tblclmnKey = tableViewerColumnKey.getColumn();
    tableViewerColumnKey.setLabelProvider(new ColumnLabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof AttributePair) {
                // first column, shows the attribute name
                return ((AttributePair) element).key;
            }
            return super.getText(element);
        }
    });
    columnLayout.setColumnData(tblclmnKey, new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));

    TableViewerColumn tableViewerColumnValue = new TableViewerColumn(mTableViewer, SWT.NONE);
    tableViewerColumnValue.setEditingSupport(new AttributeTableEditingSupport(mTableViewer));
    TableColumn tblclmnValue = tableViewerColumnValue.getColumn();
    columnLayout.setColumnData(tblclmnValue, new ColumnWeightData(2, ColumnWeightData.MINIMUM_WIDTH, true));
    tableViewerColumnValue.setLabelProvider(new ColumnLabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof AttributePair) {
                // second column, shows the attribute value
                return ((AttributePair) element).value;
            }
            return super.getText(element);
        }
    });
    // sets the ratio of the vertical split: left 5 vs middle 3 vs right 3
    baseSash.setWeights(new int[] { 5, 5, 3 });
    return baseSash;
}