Search in sources :

Example 91 with FillLayout

use of org.eclipse.swt.layout.FillLayout 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, Section.TITLE_BAR | Section.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) 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 92 with FillLayout

use of org.eclipse.swt.layout.FillLayout 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, Section.TITLE_BAR | Section.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, Section.TITLE_BAR | Section.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, Section.TITLE_BAR | Section.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) 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 93 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project azure-tools-for-java by Microsoft.

the class SignInDialog method createDialogArea.

/**
     * Create contents of the dialog.
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("Azure Sign In");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new FillLayout(SWT.HORIZONTAL));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    Group group = new Group(composite, SWT.NONE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    group.setText("Authentication Method");
    group.setLayout(new GridLayout(1, false));
    rbtnInteractive = new Button(group, SWT.RADIO);
    rbtnInteractive.setSelection(true);
    rbtnInteractive.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            enableAutomatedAuthControls(false);
        }
    });
    rbtnInteractive.setText("Interactive");
    Composite compositeInteractive = new Composite(group, SWT.NONE);
    GridData gd_compositeInteractive = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_compositeInteractive.heightHint = 38;
    gd_compositeInteractive.widthHint = 66;
    compositeInteractive.setLayoutData(gd_compositeInteractive);
    compositeInteractive.setLayout(new GridLayout(1, false));
    lblInteractiveInfo = new Label(compositeInteractive, SWT.WRAP);
    GridData gd_lblInteractiveInfo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gd_lblInteractiveInfo.horizontalIndent = 11;
    lblInteractiveInfo.setLayoutData(gd_lblInteractiveInfo);
    lblInteractiveInfo.setText("You will manually sign in using your Azure credentials as needed.");
    rbtnAutomated = new Button(group, SWT.RADIO);
    rbtnAutomated.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            enableAutomatedAuthControls(true);
        }
    });
    rbtnAutomated.setText("Automated");
    Composite compositeAutomated = new Composite(group, SWT.NONE);
    compositeAutomated.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    compositeAutomated.setLayout(new GridLayout(2, false));
    lblAutomatedInfo = new Label(compositeAutomated, SWT.WRAP | SWT.HORIZONTAL);
    lblAutomatedInfo.setEnabled(false);
    GridData gd_lblAutomatedInfo = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    gd_lblAutomatedInfo.widthHint = 483;
    gd_lblAutomatedInfo.horizontalIndent = 11;
    gd_lblAutomatedInfo.heightHint = 49;
    lblAutomatedInfo.setLayoutData(gd_lblAutomatedInfo);
    lblAutomatedInfo.setText("An authentication file with credentials for an Azure Active Directory service principal will be used for automated sign ins.");
    lblAuthenticationFile = new Label(compositeAutomated, SWT.NONE);
    lblAuthenticationFile.setEnabled(false);
    GridData gd_lblAuthenticationFile = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblAuthenticationFile.horizontalIndent = 10;
    lblAuthenticationFile.setLayoutData(gd_lblAuthenticationFile);
    lblAuthenticationFile.setText("Authentication file:");
    new Label(compositeAutomated, SWT.NONE);
    textAuthenticationFilePath = new Text(compositeAutomated, SWT.BORDER | SWT.READ_ONLY);
    textAuthenticationFilePath.setEnabled(false);
    GridData gd_textAuthenticationFilePath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_textAuthenticationFilePath.horizontalIndent = 10;
    textAuthenticationFilePath.setLayoutData(gd_textAuthenticationFilePath);
    btnBrowse = new Button(compositeAutomated, SWT.NONE);
    btnBrowse.setEnabled(false);
    btnBrowse.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doSelectCredFilepath();
        }
    });
    btnBrowse.setText("Browse...");
    new Label(compositeAutomated, SWT.NONE);
    btnCreateAuthenticationFile = new Button(compositeAutomated, SWT.NONE);
    btnCreateAuthenticationFile.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doCreateServicePrincipal();
        }
    });
    btnCreateAuthenticationFile.setEnabled(false);
    btnCreateAuthenticationFile.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    btnCreateAuthenticationFile.setText("New...");
    link = new Link(compositeAutomated, SWT.NONE);
    link.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("https://go.microsoft.com/fwlink/?linkid=847862"));
            } catch (PartInitException | MalformedURLException ex) {
                LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "widgetSelected@SelectionAdapter@link@SignInDialog", ex));
            }
        }
    });
    GridData gd_link = new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1);
    gd_link.widthHint = 312;
    link.setLayoutData(gd_link);
    link.setText("Follow these manual <a>steps</a> if Azure Toolkit fails to create an authentication file programmatically.");
    fileDialog = new FileDialog(btnBrowse.getShell(), SWT.OPEN);
    fileDialog.setText("Select Authentication File");
    fileDialog.setFilterPath(System.getProperty("user.home"));
    fileDialog.setFilterExtensions(new String[] { "*.azureauth", "*.*" });
    return area;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout) URL(java.net.URL) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileDialog(org.eclipse.swt.widgets.FileDialog) Link(org.eclipse.swt.widgets.Link)

Example 94 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project azure-tools-for-java by Microsoft.

the class WindowsAzureActivityLogView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    parent.setLayout(new FillLayout());
    viewer = new TableViewer(createTable(parent));
    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "com.microsoft.azuretools.core.ui.views.WindowsAzureActivityLogView");
    registerDeploymentListener();
}
Also used : FillLayout(org.eclipse.swt.layout.FillLayout) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 95 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project azure-tools-for-java by Microsoft.

the class ErrorWindow method createDialogArea.

/**;
     * Create contents of the dialog.
     * @param parent
     */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("Error Window");
    setMessage("Error details");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new FillLayout(SWT.HORIZONTAL));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    text = new Text(container, SWT.BORDER | SWT.WRAP | SWT.MULTI);
    return area;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)298 Composite (org.eclipse.swt.widgets.Composite)180 GridData (org.eclipse.swt.layout.GridData)130 Shell (org.eclipse.swt.widgets.Shell)104 GridLayout (org.eclipse.swt.layout.GridLayout)97 Label (org.eclipse.swt.widgets.Label)69 SelectionEvent (org.eclipse.swt.events.SelectionEvent)67 Display (org.eclipse.swt.widgets.Display)63 Button (org.eclipse.swt.widgets.Button)60 Point (org.eclipse.swt.graphics.Point)55 Table (org.eclipse.swt.widgets.Table)48 Group (org.eclipse.swt.widgets.Group)40 SelectionListener (org.eclipse.swt.events.SelectionListener)38 TableColumn (org.eclipse.swt.widgets.TableColumn)38 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)37 Text (org.eclipse.swt.widgets.Text)36 Test (org.junit.Test)36 TableItem (org.eclipse.swt.widgets.TableItem)35 SashForm (org.eclipse.swt.custom.SashForm)31 Rectangle (org.eclipse.swt.graphics.Rectangle)29