Example usage for org.eclipse.jface.resource JFaceResources getFontRegistry

List of usage examples for org.eclipse.jface.resource JFaceResources getFontRegistry

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources getFontRegistry.

Prototype

public static FontRegistry getFontRegistry() 

Source Link

Document

Returns the font registry for JFace itself.

Usage

From source file:edu.tum.in.bruegge.epd.emfstore.dialog.util.scm.SCMLabelProvider.java

License:Open Source License

/**
 * {@inheritDoc}//from w w  w  . j ava  2s.co  m
 */
@Override
public Font getFont(Object element) {
    if (!(element instanceof TreeNode)) {
        return null;
    }
    Object value = ((TreeNode) element).getValue();

    Font italic = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);
    Font bold = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);

    // if (getText(findTopParent((TreeNode)
    // element)).equals(LOCAL_REVISION)) {
    // return italic;
    // }
    String text = getText(element);
    if (text == null) {
        text = "";
    }
    if (value instanceof HistoryInfo) {
        if (text.equals(LOCAL_REVISION)) {
            return italic;
        }
        HistoryInfo historyInfo = (HistoryInfo) value;
        if (historyInfo.getPrimerySpec().getIdentifier() == WorkspaceManager.getProjectSpace(project)
                .getBaseVersion().getIdentifier()) {
            return bold;
        }
    } else if (value instanceof ModelElementId) {
        if (text.equals(ELEMENT_NOT_FOUND)) {
            return italic;
        }
    }
    if (((TreeNode) element).getParent() != null
            && ((TreeNode) element).getParent().getValue() instanceof AbstractOperation) {
        AbstractOperation op = (AbstractOperation) ((TreeNode) element).getParent().getValue();
        if ((value instanceof ModelElementId && value.equals(op.getModelElementId()))) {
            return bold;
        }

        if (value instanceof EObject) {
            EObject modelElement = (EObject) value;
            Project project = ModelUtil.getProject(modelElement);
            if (project != null && project.getModelElementId(modelElement).equals(op.getModelElementId())) {
                return bold;
            }
        }
    }
    return null;
}

From source file:edu.uchicago.cs.hao.texdojo.bibeditor.editors.EditorUI.java

License:Open Source License

private void createEditPanel(Composite parent) {
    Composite editPanel = new Composite(parent, SWT.NONE);
    editPanel.setLayout(new FillLayout());
    editText = new StyledText(editPanel, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    editText.setFont(JFaceResources.getTextFont());
    editText.addModifyListener(textModifyListener);
    JFaceResources.getFontRegistry().addListener(new IPropertyChangeListener() {
        @Override/*from   w w  w. jav  a2  s  . c  o  m*/
        public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
            if (JFaceResources.getFontRegistry().equals(event.getSource())
                    && JFaceResources.TEXT_FONT.equals(event.getProperty())) {
                editText.setFont(JFaceResources.getTextFont());
            }
            return;
        }
    });
}

From source file:egovframework.hdev.imp.ide.pages.SelectProjectPage.java

License:Apache License

/**
 *  ? ?//from  www .jav a  2  s.co  m
 * @param SelectProjectPage
 * @param control void
 */
private void createNoteControl(Composite control) {
    Composite noteControl = new Composite(control, SWT.None);
    noteControl.setLayout(new GridLayout(2, false));
    noteControl.setLayoutData(new GridData());

    noteName = new Label(noteControl, SWT.BOLD | SWT.TOP);
    noteName.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    noteName.setText(DeviceAPIMessages.SELECT_PROJECT_PAGE_NOTE);

    noteContent = new Label(noteControl, SWT.BOLD | SWT.TOP);
    noteContent.setText(DeviceAPIMessages.SELECT_PROJECT_PAGE_NOTE_CONTENTS);
}

From source file:eu.esdihumboldt.hale.ui.style.dialog.RuleStylePage.java

License:Open Source License

/**
 * @see IDialogPage#createControl(Composite)
 *///from www.jav  a  2  s .c  om
@Override
public void createControl(Composite parent) {
    changed = false;

    Composite page = new Composite(parent, SWT.NONE);
    page.setLayout(new GridLayout(2, false));

    // DISABLED - this method seems to change the rule order - Rule[]
    // ruleArray = SLD.rules(getParent().getStyle());
    // use list instead:
    List<Rule> ruleList;
    try {
        ruleList = getParent().getStyle().featureTypeStyles().get(0).rules();
    } catch (Exception e) {
        ruleList = new ArrayList<Rule>();
    }

    // init index
    if (ruleList.size() > 0) {
        currentIndex = 0;
    } else {
        currentIndex = -1;
    }

    currentEditor = null;

    // populate rule map
    rules = new ArrayList<RuleItem>(ruleList.size() + 5);
    for (int i = 0; i < ruleList.size(); i++) {
        Rule rule = ruleList.get(i);
        if (rule != null) {
            rules.add(new RuleItem(rule));
        }
    }

    // rule list
    Composite ruleArea = new Composite(page, SWT.NONE);
    ruleArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
    GridLayout leftLayout = new GridLayout(5, true);
    leftLayout.horizontalSpacing = 1;
    leftLayout.verticalSpacing = 1;
    ruleArea.setLayout(leftLayout);

    // label
    Label rulesLabel = new Label(ruleArea, SWT.NONE);
    rulesLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 5, 1));
    rulesLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    rulesLabel.setText(Messages.RuleStylePage_RuleLabelText);

    // viewer
    listViewer = new ListViewer(ruleArea);
    listViewer.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 5, 1));
    listViewer.setContentProvider(new IStructuredContentProvider() {

        @Override
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
            // ignore
        }

        @Override
        public void dispose() {
            // ignore
        }

        @SuppressWarnings("unchecked")
        @Override
        public Object[] getElements(Object inputElement) {
            try {
                List<RuleItem> rules = (List<RuleItem>) inputElement;
                return rules.toArray();
            } catch (Exception e) {
                return null;
            }
        }
    });
    listViewer.setInput(rules);

    if (currentIndex >= 0 && currentIndex < rules.size()) {
        listViewer.setSelection(new StructuredSelection(rules.get(currentIndex)));
    }

    listViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            RuleItem item = (RuleItem) ((IStructuredSelection) event.getSelection()).getFirstElement();

            int newIndex = rules.indexOf(item);

            if (currentIndex != newIndex) {
                try {
                    updateCurrentRule();
                } catch (Exception e) {
                    log.userError("Invalid editor state, could not update rule.", e);
                    return;
                }
                currentIndex = newIndex;
                updateEditor();
            }
        }
    });

    // buttons
    addButton = new Button(ruleArea, SWT.PUSH);
    addButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    addButton.setImage(addImage);
    addButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            addRule();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });
    addButton.setToolTipText(Messages.RuleStylePage_AddRuleButtonToolTippText);

    removeButton = new Button(ruleArea, SWT.PUSH);
    removeButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    removeButton.setImage(removeImage);
    removeButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            removeCurrentRule();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });
    removeButton.setToolTipText(Messages.RuleStylePage_RemoveRuleButtonToolTippText);

    upButton = new Button(ruleArea, SWT.PUSH);
    upButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    upButton.setImage(upImage);
    upButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            moveCurrentRuleUp();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });
    upButton.setToolTipText(Messages.RuleStylePage_UpRuleButtonToolTippText);

    downButton = new Button(ruleArea, SWT.PUSH);
    downButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    downButton.setImage(downImage);
    downButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            moveCurrentRuleDown();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });
    downButton.setToolTipText(Messages.RuleStylePage_DownRuleButtonToolTippText);

    renameButton = new Button(ruleArea, SWT.PUSH);
    renameButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    renameButton.setImage(renameImage);
    renameButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            renameCurrentRule();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });
    renameButton.setToolTipText(Messages.RuleStylePage_RenameRuleButtonToolTippText);

    // editor area
    editorArea = new Composite(page, SWT.NONE);
    editorArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    editorArea.setLayout(new FillLayout());

    setControl(page);

    updateEditor();
}

From source file:eu.esdihumboldt.hale.ui.style.editors.ColorEditor.java

License:Open Source License

/**
 * Determine with and height//ww w  .  j a va2s  . c  o m
 * 
 * @param control the parent control
 */
protected void init(Control control) {
    if (!initialized) {
        initialized = true;

        GC gc = new GC(control);
        try {
            Font font = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
            gc.setFont(font);
            height = gc.getFontMetrics().getHeight();
            width = height * 2;
        } finally {
            gc.dispose();
        }
    }
}

From source file:eu.esdihumboldt.hale.ui.style.editors.MarkEditor.java

License:Open Source License

/**
 * Creates a {@link Mark} editor/*from w  w w.j a va 2  s  .  co m*/
 * 
 * @param parent the parent composite
 * @param mark the initial mark
 */
public MarkEditor(Composite parent, Mark mark) {
    if (mark == null) {
        mark = styleBuilder.createMark(StyleBuilder.MARK_SQUARE);
    }

    page = new Composite(parent, SWT.NONE);

    RowLayout layout = new RowLayout(SWT.VERTICAL);
    page.setLayout(layout);

    // mark
    Composite markComp = new Composite(page, SWT.NONE);
    markComp.setLayout(new GridLayout(2, false));

    Label markLabel = new Label(markComp, SWT.NONE);
    markLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    markLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    markLabel.setText(Messages.MarkEditor_MarkLabel);

    Combo markCombo = new Combo(markComp, SWT.READ_ONLY);
    markCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    markView = new ComboViewer(markCombo);
    markView.add(MARKS);
    markView.setSelection(new StructuredSelection(mark.getWellKnownName().toString()));
    markView.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            changed = true;
        }
    });

    // stroke
    Label strokeLabel = new Label(page, SWT.NONE);
    strokeLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    strokeLabel.setText(Messages.MarkEditor_StrokeLabel);
    strokeEditor = new StrokeEditor(page, mark.getStroke());

    // fill
    Label fillLabel = new Label(page, SWT.NONE);
    fillLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    fillLabel.setText(Messages.MarkEditor_FillLabel);
    fillEditor = new FillEditor(page, mark.getFill());
}

From source file:eu.esdihumboldt.hale.ui.style.editors.PointGraphicEditor.java

License:Open Source License

/**
 * Creates a {@link Graphic} editor/*from  w w w  .java  2  s  .  c  o m*/
 * 
 * @param parent the parent composite
 */
public PointGraphicEditor(Composite parent) {
    page = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    page.setLayout(layout);

    Label graphLabel = new Label(page, SWT.NONE);
    graphLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    graphLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    graphLabel.setText(Messages.PointGraphicEditor_UrlTextField);

    path = new TextViewer(page, SWT.SINGLE | SWT.BORDER);
    path.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    path.setDocument(new Document());

    dialogButton = new Button(page, SWT.PUSH);
    dialogButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    dialogButton.setText(Messages.PointGraphicEditor_FileDialogButton);
    dialogButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            openFileDialog();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // ignore
        }
    });

    Label supportLabel = new Label(page, SWT.NONE);
    supportLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    supportLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    supportLabel.setText("\n" + Messages.PointGraphicEditor_SupportedTypes);

    supportText = new Text(page, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
    supportText.setLayoutData(new GridData(SWT.BOTTOM, SWT.CENTER, false, false, 2, 1));
    supportText.setText(new HashSet<String>(Arrays.asList(ImageIO.getReaderMIMETypes())).toString());
}

From source file:eu.esdihumboldt.hale.ui.style.editors.PolygonSymbolizerEditor.java

License:Open Source License

/**
 * Creates a {@link PolygonSymbolizer} editor
 * /*  w  ww .jav a  2s.c  om*/
 * @param parent the parent composite
 * @param poly the initial {@link PolygonSymbolizer}
 */
public PolygonSymbolizerEditor(Composite parent, PolygonSymbolizer poly) {
    super();

    page = new Composite(parent, SWT.NONE);

    RowLayout layout = new RowLayout(SWT.VERTICAL);
    page.setLayout(layout);

    // stroke
    Label strokeLabel = new Label(page, SWT.NONE);
    strokeLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    strokeLabel.setText(Messages.PolygonSymbolizerEditor_StrokeLabel);
    strokeEditor = new StrokeEditor(page, poly.getStroke());

    // fill
    Label fillLabel = new Label(page, SWT.NONE);
    fillLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    fillLabel.setText(Messages.PolygonSymbolizerEditor_FillLabel);
    fillEditor = new FillEditor(page, poly.getFill());
}

From source file:eu.esdihumboldt.hale.ui.style.editors.RuleEditor.java

License:Open Source License

/**
 * Creates a {@link Rule} editor//from   w  w  w  . j a  va2 s .  co m
 * 
 * @param parent the parent composite
 * @param typeDefinition the type Definition
 * @param filter the initial {@link Filter}
 * @param symbolizerType the {@link Symbolizer} type
 * @param symbolizer the initial {@link Symbolizer}
 * @param symbolizerFactory a {@link Symbolizer} editor factory
 */
public RuleEditor(Composite parent, TypeDefinition typeDefinition, Filter filter, Class<T> symbolizerType,
        T symbolizer, EditorFactory<T> symbolizerFactory) {
    super();

    page = new Composite(parent, SWT.NONE);
    page.setLayout(new GridLayout(1, false));

    // filter
    Label filterLabel = new Label(page, SWT.NONE);
    filterLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
    filterLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    filterLabel.setText(Messages.RuleEditor_FilterLabel);

    filterEditor = new FilterEditor(page, typeDefinition, filter);
    filterEditor.getControl().setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));

    // symbolizer
    Label symbolLabel = new Label(page, SWT.NONE);
    symbolLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
    symbolLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
    symbolLabel.setText(symbolizerType.getSimpleName());

    symbolizerEditor = symbolizerFactory.createEditor(page, symbolizer);
    symbolizerEditor.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}

From source file:eu.scasefp7.eclipse.servicecomposition.views.ServiceCompositionView.java

public void updateRightComposite(edu.uci.ics.jung.graph.Graph jungGraph) {

    final Display display = Display.getCurrent();
    final Graph graph = viewer.getGraphControl();
    if (sc != null) {
        sc.dispose();/*from   w w w.  j  a va2 s  .co m*/
    }
    // Create the ScrolledComposite to scroll horizontally and vertically
    sc = new ScrolledComposite(sashForm, SWT.H_SCROLL | SWT.V_SCROLL);

    sc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    rightComposite.dispose();

    rightComposite = new Composite(sc, SWT.FILL);

    sc.setContent(rightComposite);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    sc.setMinSize(300, 600);

    // runWorkflowAction.setEnabled(false);

    Listener inputListener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            TreeItem treeItem = (TreeItem) event.item;
            final TreeColumn[] treeColumns = treeItem.getParent().getColumns();
            // final Display display = Display.getCurrent();
            display.asyncExec(new Runnable() {

                @Override
                public void run() {
                    for (TreeColumn treeColumn : treeColumns) {
                        treeColumn.pack();
                    }
                }
            });

        }
    };
    // create inputs composite

    rightComposite.setLayout(new GridLayout());

    Composite inputsLabelComposite = new Composite(rightComposite, SWT.FILL);
    inputsLabelComposite.setLayout(new GridLayout(1, false));
    Label label1 = new Label(inputsLabelComposite, SWT.NONE);
    label1.setText("Workflow Inputs:");
    label1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    label1.setFont(JFaceResources.getFontRegistry().getBold(""));
    inputsComposite = new Tree(rightComposite, SWT.BORDER | SWT.FILL | SWT.MULTI);
    inputsComposite.setLayout(new GridLayout(2, false));
    inputsTreeViewer = new TreeViewer(inputsComposite);
    TreeViewerEditor.create(inputsTreeViewer, new ColumnViewerEditorActivationStrategy(inputsTreeViewer) {
        protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
            return event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION;
        }
    }, ColumnViewerEditor.TABBING_HORIZONTAL);

    columna = new TreeViewerColumn(inputsTreeViewer, SWT.NONE);
    columna.getColumn().setWidth(200);
    columna.getColumn().setText("Columna");
    columna.getColumn().setResizable(true);

    columnb = new TreeViewerColumn(inputsTreeViewer, SWT.NONE);
    columnb.getColumn().setText("Columnb");
    columnb.getColumn().setWidth(300);
    columnb.getColumn().setResizable(true);

    Vector<Node> InputNodes = new Vector<Node>();

    // get matched io
    Object[] vertices1 = (Object[]) jungGraph.getVertices().toArray();
    ArrayList<OwlService> matchedNodes = new ArrayList<OwlService>();
    for (int i = 0; i < vertices1.length; i++) {
        final OwlService node = (OwlService) vertices1[i];

        if (node.getisMatchedIO()) {

            matchedNodes.add(node);
        }
    }

    // get all inputs

    Object[] vertices = (Object[]) jungGraph.getVertices().toArray();
    for (int i = 0; i < vertices.length; i++) {
        final OwlService node = (OwlService) vertices[i];
        if (node.getType().contains("Action")) {
            Node n = new Node(node.getName().toString(), null, node, null);
            Collection<OwlService> predecessors = (Collection<OwlService>) jungGraph.getPredecessors(node);
            for (OwlService predecessor : predecessors) {
                if (predecessor.getType().contains("Property")) {
                    showInputs(predecessor, n, InputNodes, jungGraph, matchedNodes);

                }
            }
            InputNodes.add(n);
        }
    }

    inputsComposite.setSize(300, 200);
    inputsTreeViewer.setContentProvider(new MyTreeContentProvider());

    columna.setLabelProvider(new MyLabelProvider());
    columnb.setLabelProvider(createColumnLabelProvider());

    final TextCellEditor cellEditor = new MyTextCellEditor(inputsTreeViewer.getTree());
    columnb.setEditingSupport(new EditingSupport(inputsTreeViewer) {

        @Override
        protected void setValue(Object element, Object value) {
            if (((Node) element).getOwlService().getArgument() != null
                    && ((Node) element).getOwlService().getArgument().getSubtypes().isEmpty())
                ((Node) element).setValue(value.toString());

            getViewer().update(element, null);
        }

        @Override
        protected Object getValue(Object element) {
            return ((Node) element).getValue();
        }

        @Override
        protected TextCellEditor getCellEditor(Object element) {
            return cellEditor;
        }

        @Override
        protected boolean canEdit(Object element) {
            if (((Node) element).getOwlService().getArgument() != null
                    && ((Node) element).getOwlService().getArgument().getSubtypes().isEmpty()
                    && !((Node) element).getOwlService().getisMatchedIO())
                return true;
            else
                return false;
        }
    });

    inputsTreeViewer.setInput(InputNodes);
    inputsTreeViewer.expandToLevel(2);

    final Action a = new Action("Add new element") {
        public void run() {

            try {
                int length = ((Node) ((TreeSelection) inputSelection).getFirstElement()).getSubCategories()
                        .size();
                addTreeNode(((Node) ((TreeSelection) inputSelection).getFirstElement()).getOwlService(),
                        ((Node) ((TreeSelection) inputSelection).getFirstElement()), length);
                // Updating the display in the view
                // inputsTreeViewer.setInput(InputNodes);
                inputsTreeViewer.refresh();
            } catch (Exception e) {
                Activator.log("Error while running the workflow", e);
                e.printStackTrace();
            }

        }
    };

    final Action b = new Action("Remove element") {
        public void run() {

            try {
                Node n = ((Node) ((TreeSelection) inputSelection).getFirstElement()).getParent();
                n.getSubCategories().remove(((Node) ((TreeSelection) inputSelection).getFirstElement()));

                // Updating the display in the view
                // inputsTreeViewer.setInput(InputNodes);
                inputsTreeViewer.refresh();
            } catch (Exception e) {
                Activator.log("Error while running the workflow", e);
                e.printStackTrace();
            }

        }
    };
    final MenuManager mgr = new MenuManager();
    mgr.setRemoveAllWhenShown(true);

    mgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            inputSelection = inputsTreeViewer.getSelection();

            Node n = ((Node) ((TreeSelection) inputSelection).getFirstElement());
            if (!inputSelection.isEmpty()) {
                if (n.getOwlService().getArgument() != null && n.getOwlService().getArgument().isArray()
                        && n.getName().toString().replaceAll("[^\\d.]", "").isEmpty()) {
                    boolean notMatched = true;
                    // check if the array of primitive or array of objects
                    // is matched
                    if (n.getSubCategories().get(0).getValue().equals("matched")
                            || (!n.getOwlService().getArgument().getSubtypes().isEmpty()
                                    && (n.getOwlService().getArgument().getSubtypes().get(0)).getOwlService()
                                            .getisMatchedIO())) {
                        notMatched = false;
                    }
                    if (notMatched) {
                        a.setText("Add new element for "
                                + ((Node) ((TreeSelection) inputSelection).getFirstElement()).getName()
                                        .toString());
                        a.setToolTipText("Right click to add new element");
                        a.setEnabled(true);

                        mgr.add(a);
                    }

                }
                if (n.getOwlService().getArgument() != null && n.getOwlService().getArgument().isArray()
                        && !n.getName().toString().replaceAll("[^\\d.]", "").isEmpty()) {

                    int nodeNum = Integer.parseInt(n.getName().toString().replaceAll("[^\\d.]", ""));
                    Node parent = ((Node) ((TreeSelection) inputSelection).getFirstElement()).getParent();

                    if (nodeNum == parent.getSubCategories().size() - 1 && nodeNum != 0) {

                        b.setText(
                                "Remove element " + ((Node) ((TreeSelection) inputSelection).getFirstElement())
                                        .getName().toString());
                        b.setToolTipText("Right click to remove element");
                        b.setEnabled(true);

                        mgr.add(b);
                    }
                }
            }
        }

    });
    inputsTreeViewer.getControl().setMenu(mgr.createContextMenu(inputsTreeViewer.getControl()));

    inputsComposite.addListener(SWT.Collapse, inputListener);
    inputsComposite.addListener(SWT.Expand, inputListener);

    inputsTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                if (selection.getFirstElement() != null) {
                    for (int i = 0; i < graph.getNodes().size(); i++) {
                        GraphNode graphNode = (GraphNode) graph.getNodes().get(i);
                        if (((OwlService) ((MyNode) graphNode.getData()).getObject())
                                .equals(((Node) selection.getFirstElement()).getOwlService())) {
                            graphNode.highlight();
                        } else
                            graphNode.unhighlight();

                    }
                }

            }
        }
    });

    // create authentication Params composite

    rightComposite.setLayout(new GridLayout());
    Composite authenticationLabelComposite = new Composite(rightComposite, SWT.FILL);

    authenticationLabelComposite.setLayout(new GridLayout());
    Label label4 = new Label(authenticationLabelComposite, SWT.FILL);
    label4.setText("Workflow Authentication Parameters:");
    label4.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    label4.setFont(JFaceResources.getFontRegistry().getBold(""));
    authParamsComposite = new Composite(rightComposite, SWT.FILL);
    authParamsComposite.setLayout(new GridLayout(2, false));

    // get all authParams
    ArrayList<String> baseURIs = new ArrayList<String>();
    for (int i = 0; i < vertices.length; i++) {
        final OwlService node = (OwlService) vertices[i];

        if (node.getType().contains("Action") && node.getOperation().getDomain() != null) {
            if (node.getOperation().getDomain().getSecurityScheme() != null) {
                if (node.getOperation().getDomain().getSecurityScheme().equalsIgnoreCase("Basic Authentication")
                        && !baseURIs.contains(node.getOperation().getDomain().getURI())) {
                    showBasicAuthenticationParams();
                    baseURIs.add(node.getOperation().getDomain().getURI());
                }
            }
        }
    }

    // create authentication Params composite

    rightComposite.setLayout(new GridLayout());
    Composite requestHeaderLabelComposite = new Composite(rightComposite, SWT.FILL);

    requestHeaderLabelComposite.setLayout(new GridLayout());
    Label label5 = new Label(requestHeaderLabelComposite, SWT.FILL);
    label5.setText("Workflow Request Headers:");
    label5.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    label5.setFont(JFaceResources.getFontRegistry().getBold(""));
    requestHeadersComposite = new Composite(rightComposite, SWT.FILL);
    requestHeadersComposite.setLayout(new GridLayout(2, false));

    // get all request headers

    for (int i = 0; i < vertices.length; i++) {
        final OwlService node = (OwlService) vertices[i];

        if (node.getType().contains("Action") && node.getOperation().getRequestHeaders() != null) {
            for (RequestHeader header : node.getOperation().getRequestHeaders()) {
                showRequestHeaders(node.getName().toString(), header.getName());
            }

        }
    }

    Listener outputListener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            TreeItem treeItem = (TreeItem) event.item;
            final TreeColumn[] treeColumns = treeItem.getParent().getColumns();

            display.asyncExec(new Runnable() {

                @Override
                public void run() {
                    for (TreeColumn treeColumn : treeColumns)
                        treeColumn.pack();
                }
            });
        }
    };

    // create outputs composite

    Composite outputsLabelComposite = new Composite(rightComposite, SWT.FILL);
    outputsLabelComposite.setLayout(new GridLayout(1, false));
    Label label2 = new Label(outputsLabelComposite, SWT.NONE);
    label2.setText("Workflow Outputs:");
    label2.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    label2.setFont(JFaceResources.getFontRegistry().getBold(""));
    outputsComposite = new Tree(rightComposite, SWT.BORDER | SWT.FILL | SWT.MULTI);
    outputsComposite.setLayout(new GridLayout(2, false));
    treeViewer = new TreeViewer(outputsComposite);
    column1 = new TreeViewerColumn(treeViewer, SWT.NONE);
    column1.getColumn().setWidth(300);
    column1.getColumn().setText("Column1");
    column1.getColumn().setResizable(true);
    // column1.getColumn().pack();
    column2 = new TreeViewerColumn(treeViewer, SWT.NONE);
    column2.getColumn().setText("Column2");
    column2.getColumn().setWidth(300);
    column2.getColumn().setResizable(true);
    // column2.getColumn().pack();
    // get all outputs
    Vector<Node> nodes = new Vector<Node>();
    for (int i = 0; i < vertices.length; i++) {
        final OwlService node = (OwlService) vertices[i];

        if (node.getType().contains("Action")) {
            Collection<OwlService> successors = (Collection<OwlService>) jungGraph.getSuccessors(node);
            for (OwlService successor : successors) {
                if (successor.getType().contains("Property")) {
                    showOutputs(successor, null, nodes, jungGraph);

                }
            }
        }
    }

    treeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
    outputsComposite.setSize(300, 200);
    treeViewer.setContentProvider(new MyTreeContentProvider());

    // sort alphabetically based on operation name
    treeViewer.setComparator(new ViewerComparator() {
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
            Node t1 = (Node) e1;
            Node t2 = (Node) e2;
            int order = ((t1.getOwlService().getArgument().getBelongsToOperation().getName().toString())
                    .compareTo(t2.getOwlService().getArgument().getBelongsToOperation().getName().toString()));
            return order;
        };
    });

    column1.setLabelProvider(new MyLabelProvider());
    column2.setLabelProvider(createColumnLabelProvider());
    treeViewer.setInput(nodes);
    // // outputsComposite.setSize(300, nodes.size() * 10);
    // treeViewer.expandAll();
    //

    outputsComposite.addListener(SWT.Collapse, outputListener);
    outputsComposite.addListener(SWT.Expand, outputListener);

    treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                if (selection.getFirstElement() != null) {
                    for (int i = 0; i < graph.getNodes().size(); i++) {
                        GraphNode graphNode = (GraphNode) graph.getNodes().get(i);
                        if (((OwlService) ((MyNode) graphNode.getData()).getObject())
                                .equals(((Node) selection.getFirstElement()).getOwlService())) {
                            graphNode.highlight();
                        } else
                            graphNode.unhighlight();

                    }
                }

            }
        }
    });

    graph.update();
    graph.redraw();

    inputsLabelComposite.redraw();
    outputsLabelComposite.redraw();
    treeViewer.refresh();
    inputsTreeViewer.refresh();
    outputsComposite.redraw();
    inputsComposite.redraw();
    rightComposite.layout();
    rightComposite.update();
    rightComposite.redraw();
    sc.update();
    sc.redraw();

    sashForm.update();
    sashForm.redraw();
    sashForm.layout(true);
    this.showBusy(false);
}