Search in sources :

Example 1 with MessageHyperlinkAdapter

use of bndtools.utils.MessageHyperlinkAdapter in project bndtools by bndtools.

the class BundleContentPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    FormToolkit toolkit = managedForm.getToolkit();
    managedForm.setInput(model);
    ScrolledForm scrolledForm = managedForm.getForm();
    scrolledForm.setText("Bundle Content");
    Form form = scrolledForm.getForm();
    toolkit.decorateFormHeading(form);
    form.addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
    Composite body = form.getBody();
    // Create controls
    MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
    sashForm.setSashWidth(6);
    toolkit.adapt(sashForm, false, false);
    Composite leftPanel = toolkit.createComposite(sashForm);
    createLeftPanel(managedForm, leftPanel);
    Composite rightPanel = toolkit.createComposite(sashForm);
    createRightPanel(managedForm, rightPanel);
    sashForm.setWeights(new int[] { 1, 1 });
    sashForm.hookResizeListener();
    // Layout
    body.setLayout(new FillLayout());
}
Also used : MessageHyperlinkAdapter(bndtools.utils.MessageHyperlinkAdapter) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) MDSashForm(bndtools.editor.common.MDSashForm) IManagedForm(org.eclipse.ui.forms.IManagedForm) Form(org.eclipse.ui.forms.widgets.Form) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) MDSashForm(bndtools.editor.common.MDSashForm) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 2 with MessageHyperlinkAdapter

use of bndtools.utils.MessageHyperlinkAdapter in project bndtools by bndtools.

the class ProjectBuildPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    managedForm.setInput(model);
    FormToolkit tk = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText("Project Build");
    tk.decorateFormHeading(form.getForm());
    form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
    GridLayout layout;
    GridData gd;
    // Create Controls
    Composite body = form.getBody();
    body.setLayout(new FillLayout());
    MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
    sashForm.setSashWidth(6);
    tk.adapt(sashForm, false, false);
    sashForm.hookResizeListener();
    Composite leftPanel = tk.createComposite(sashForm);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    leftPanel.setLayoutData(gd);
    layout = new GridLayout(1, false);
    leftPanel.setLayout(layout);
    SubBundlesPart subBundlesPart = new SubBundlesPart(leftPanel, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION);
    managedForm.addPart(subBundlesPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    subBundlesPart.getSection().setLayoutData(gd);
    BuildPathPart buildPathPart = new BuildPathPart(leftPanel, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION);
    managedForm.addPart(buildPathPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 50;
    gd.heightHint = 50;
    buildPathPart.getSection().setLayoutData(gd);
    Composite rightPanel = tk.createComposite(sashForm);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    rightPanel.setLayoutData(gd);
    BuildOperationsPart buildOpsPart = new BuildOperationsPart(rightPanel, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION);
    managedForm.addPart(buildOpsPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    buildOpsPart.getSection().setLayoutData(gd);
    layout = new GridLayout(1, false);
    rightPanel.setLayout(layout);
    reportProblemsInHeader();
}
Also used : SubBundlesPart(bndtools.editor.project.SubBundlesPart) GridLayout(org.eclipse.swt.layout.GridLayout) MessageHyperlinkAdapter(bndtools.utils.MessageHyperlinkAdapter) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) MDSashForm(bndtools.editor.common.MDSashForm) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) BuildOperationsPart(bndtools.editor.project.BuildOperationsPart) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) BuildPathPart(bndtools.editor.project.BuildPathPart)

Example 3 with MessageHyperlinkAdapter

use of bndtools.utils.MessageHyperlinkAdapter in project bndtools by bndtools.

the class TestSuitesPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    managedForm.setInput(model);
    FormToolkit toolkit = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText("Tests");
    form.setImage(junitImg);
    toolkit.decorateFormHeading(form.getForm());
    form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
    Composite body = form.getBody();
    MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
    sashForm.setSashWidth(6);
    toolkit.adapt(sashForm, false, false);
    Composite leftPanel = toolkit.createComposite(sashForm);
    Composite rightPanel = toolkit.createComposite(sashForm);
    TestSuitesPart suitesPart = new TestSuitesPart(leftPanel, toolkit, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
    managedForm.addPart(suitesPart);
    SaneDetailsPart detailsPart = new SaneDetailsPart();
    managedForm.addPart(detailsPart);
    // TODO: add details pages here
    detailsPart.createContents(toolkit, rightPanel);
    sashForm.hookResizeListener();
    // LAYOUT
    body.setLayout(new FillLayout());
    GridLayout layout;
    GridData gd;
    layout = new GridLayout();
    leftPanel.setLayout(layout);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    suitesPart.getSection().setLayoutData(gd);
    layout = new GridLayout();
    rightPanel.setLayout(layout);
}
Also used : SaneDetailsPart(bndtools.editor.common.SaneDetailsPart) GridLayout(org.eclipse.swt.layout.GridLayout) MessageHyperlinkAdapter(bndtools.utils.MessageHyperlinkAdapter) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) MDSashForm(bndtools.editor.common.MDSashForm) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) TestSuitesPart(bndtools.editor.contents.TestSuitesPart)

Example 4 with MessageHyperlinkAdapter

use of bndtools.utils.MessageHyperlinkAdapter in project bndtools by bndtools.

the class ProjectRunPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    managedForm.setInput(model);
    FormToolkit tk = managedForm.getToolkit();
    final ScrolledForm form = managedForm.getForm();
    form.setText("Resolve/Run");
    Central.onWorkspaceAsync(workspace -> updateFormImage(form));
    tk.decorateFormHeading(form.getForm());
    form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
    // Toolbar Actions
    RunAction runAction = new RunAction(this, "run");
    runAction.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/run.gif"));
    runAction.setText("Run OSGi");
    ActionContributionItem runContrib = new ActionContributionItem(runAction);
    runContrib.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    form.getToolBarManager().add(runContrib);
    RunAction debugAction = new RunAction(this, "debug");
    debugAction.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/debug.gif"));
    debugAction.setText("Debug OSGi");
    ActionContributionItem debugContrib = new ActionContributionItem(debugAction);
    debugContrib.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    form.getToolBarManager().add(debugContrib);
    ExportAction exportAction = new ExportAction(getEditorSite().getShell(), getEditor(), model);
    exportAction.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/run_export.png"));
    exportAction.setText("Export");
    ActionContributionItem exportContrib = new ActionContributionItem(exportAction);
    exportContrib.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    if (exportAction.shouldEnable())
        form.getToolBarManager().add(exportContrib);
    form.getToolBarManager().update(true);
    GridLayout gl;
    GridData gd;
    // Create Controls
    final Composite body = form.getBody();
    MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
    sashForm.setSashWidth(6);
    tk.adapt(sashForm);
    final Composite left = tk.createComposite(sashForm);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    left.setLayoutData(gd);
    gl = new GridLayout(1, true);
    left.setLayout(gl);
    final Composite right = tk.createComposite(sashForm);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    right.setLayoutData(gd);
    gl = new GridLayout(1, true);
    right.setLayout(gl);
    // First column
    RepositorySelectionPart reposPart = new RepositorySelectionPart(getEditor(), left, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
    managedForm.addPart(reposPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 50;
    gd.heightHint = 50;
    reposPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
    AvailableBundlesPart availableBundlesPart = new AvailableBundlesPart(left, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
    managedForm.addPart(availableBundlesPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 50;
    gd.heightHint = 50;
    availableBundlesPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
    RunFrameworkPart runFwkPart = new RunFrameworkPart(left, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
    managedForm.addPart(runFwkPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    runFwkPart.getSection().setLayoutData(gd);
    RunPropertiesPart runPropertiesPart = new RunPropertiesPart(left, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
    managedForm.addPart(runPropertiesPart);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    runPropertiesPart.getSection().setLayoutData(gd);
    // SECOND COLUMN
    if (supportsResolve) {
        RunRequirementsPart requirementsPart = new RunRequirementsPart(right, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | Section.DESCRIPTION);
        managedForm.addPart(requirementsPart);
        requirementsPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
        requirementsPart.getSection().addExpansionListener(new ResizeExpansionAdapter(requirementsPart.getSection()));
        RunBlacklistPart blacklistPart = new RunBlacklistPart(right, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT | Section.DESCRIPTION);
        managedForm.addPart(blacklistPart);
        blacklistPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
        blacklistPart.getSection().addExpansionListener(new ResizeExpansionAdapter(blacklistPart.getSection()));
        RunBundlesPart runBundlesPart = new RunBundlesPart(right, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
        managedForm.addPart(runBundlesPart);
        runBundlesPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
        runBundlesPart.getSection().addExpansionListener(new ResizeExpansionAdapter(runBundlesPart.getSection()));
    } else {
        RunBundlesPart runBundlesPart = new RunBundlesPart(right, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
        managedForm.addPart(runBundlesPart);
        runBundlesPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
        runBundlesPart.getSection().addExpansionListener(new ResizeExpansionAdapter(runBundlesPart.getSection()));
    }
    // Listeners
    model.addPropertyChangeListener(BndEditModel.PROP_WORKSPACE, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    updateFormImage(form);
                }
            });
        }
    });
    sashForm.setWeights(new int[] { 1, 1 });
    sashForm.hookResizeListener();
    body.setLayout(new FillLayout());
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) MessageHyperlinkAdapter(bndtools.utils.MessageHyperlinkAdapter) RunBundlesPart(bndtools.editor.project.RunBundlesPart) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) MDSashForm(bndtools.editor.common.MDSashForm) RunPropertiesPart(bndtools.editor.project.RunPropertiesPart) PropertyChangeListener(java.beans.PropertyChangeListener) AvailableBundlesPart(bndtools.editor.project.AvailableBundlesPart) RunBlacklistPart(bndtools.editor.project.RunBlacklistPart) FillLayout(org.eclipse.swt.layout.FillLayout) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) GridLayout(org.eclipse.swt.layout.GridLayout) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) GridData(org.eclipse.swt.layout.GridData) RepositorySelectionPart(bndtools.editor.project.RepositorySelectionPart) RunFrameworkPart(bndtools.editor.project.RunFrameworkPart) RunRequirementsPart(bndtools.editor.project.RunRequirementsPart)

Example 5 with MessageHyperlinkAdapter

use of bndtools.utils.MessageHyperlinkAdapter in project bndtools by bndtools.

the class WorkspacePage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    managedForm.setInput(model);
    FormToolkit tk = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText("Workspace Config");
    tk.decorateFormHeading(form.getForm());
    form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
    // Create controls
    Composite body = form.getBody();
    WorkspaceMainPart linksPart = new WorkspaceMainPart(mainBuildFile, body, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION);
    managedForm.addPart(linksPart);
    PluginPathPart pluginPathPart = new PluginPathPart(body, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION | ExpandableComposite.TWISTIE);
    managedForm.addPart(pluginPathPart);
    pluginsPart = new PluginsPart(body, tk, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | Section.DESCRIPTION | ExpandableComposite.TWISTIE);
    managedForm.addPart(pluginsPart);
    // Layout
    GridLayout layout = new GridLayout(1, false);
    body.setLayout(layout);
    linksPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
    pluginPathPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
    pluginPathPart.getSection().addExpansionListener(new ResizeExpansionAdapter(pluginPathPart.getSection()));
    pluginsPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
    pluginsPart.getSection().addExpansionListener(new ResizeExpansionAdapter(pluginsPart.getSection()));
}
Also used : PluginsPart(bndtools.editor.workspace.PluginsPart) GridLayout(org.eclipse.swt.layout.GridLayout) MessageHyperlinkAdapter(bndtools.utils.MessageHyperlinkAdapter) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) PluginPathPart(bndtools.editor.workspace.PluginPathPart) WorkspaceMainPart(bndtools.editor.workspace.WorkspaceMainPart)

Aggregations

MessageHyperlinkAdapter (bndtools.utils.MessageHyperlinkAdapter)6 Composite (org.eclipse.swt.widgets.Composite)6 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)6 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)6 ScrolledForm (org.eclipse.ui.forms.widgets.ScrolledForm)6 MDSashForm (bndtools.editor.common.MDSashForm)5 FillLayout (org.eclipse.swt.layout.FillLayout)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 GridData (org.eclipse.swt.layout.GridData)4 IManagedForm (org.eclipse.ui.forms.IManagedForm)2 Form (org.eclipse.ui.forms.widgets.Form)2 SaneDetailsPart (bndtools.editor.common.SaneDetailsPart)1 DescriptionBundlePart (bndtools.editor.contents.DescriptionBundlePart)1 DescriptionDeveloperPart (bndtools.editor.contents.DescriptionDeveloperPart)1 DescriptionRightsPart (bndtools.editor.contents.DescriptionRightsPart)1 DescriptionVendorPart (bndtools.editor.contents.DescriptionVendorPart)1 TestSuitesPart (bndtools.editor.contents.TestSuitesPart)1 AvailableBundlesPart (bndtools.editor.project.AvailableBundlesPart)1 BuildOperationsPart (bndtools.editor.project.BuildOperationsPart)1 BuildPathPart (bndtools.editor.project.BuildPathPart)1