Search in sources :

Example 56 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project sling by apache.

the class ImportWizardPage method createControl.

@Override
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
    composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    Composite container = new Composite(composite, SWT.NONE);
    container.setLayout(new GridLayout(2, false));
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    gridData.minimumWidth = 450;
    container.setLayoutData(gridData);
    new Label(container, SWT.NONE).setText("Repository: ");
    repositoryCombo = new SlingLaunchpadCombo(container, project);
    repositoryCombo.getWidget().addSelectionListener(new SelectionListener() {

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

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            determinePageCompletion();
            updateWidgetEnablements();
        }
    });
    repositoryCombo.refreshRepositoryList(new NullProgressMonitor());
    Composite containerGroup = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    containerGroup.setLayout(layout);
    containerGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    containerGroup.setFont(composite.getFont());
    // container label
    Label resourcesLabel = new Label(containerGroup, SWT.NONE);
    resourcesLabel.setText("Import into:");
    resourcesLabel.setFont(composite.getFont());
    containerNameField = new Text(containerGroup, SWT.SINGLE | SWT.BORDER);
    containerNameField.addListener(SWT.Modify, this);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    containerNameField.setLayoutData(data);
    containerNameField.setFont(composite.getFont());
    containerBrowseButton = new Button(containerGroup, SWT.PUSH);
    containerBrowseButton.setText("Select location...");
    containerBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    containerBrowseButton.addListener(SWT.Selection, this);
    containerBrowseButton.setFont(composite.getFont());
    setButtonLayoutData(containerBrowseButton);
    if (importRoot != null) {
        containerNameField.setText(importRoot.getFullPath().toPortableString());
    } else {
        setErrorMessage("Select an import location");
    }
    adjustComposite = new Composite(composite, SWT.NONE);
    adjustComposite.setLayout(new RowLayout());
    adjustJcrRootText = new Label(adjustComposite, SWT.NONE);
    adjustJcrRootText.setFont(containerGroup.getFont());
    adjustJcrRootText();
    Link openPropertiesLink = new Link(adjustComposite, SWT.NONE);
    openPropertiesLink.setText("(<a>change</a>)");
    openPropertiesLink.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            SlingProjectPropertyPage.openPropertyDialog(getShell(), project);
            updateWidgetEnablements();
        }
    });
    createOptionsGroup(composite);
    setControl(composite);
    updateWidgetEnablements();
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Link(org.eclipse.swt.widgets.Link) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

RowLayout (org.eclipse.swt.layout.RowLayout)56 Composite (org.eclipse.swt.widgets.Composite)51 Button (org.eclipse.swt.widgets.Button)39 GridData (org.eclipse.swt.layout.GridData)37 SelectionEvent (org.eclipse.swt.events.SelectionEvent)35 GridLayout (org.eclipse.swt.layout.GridLayout)32 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)30 Label (org.eclipse.swt.widgets.Label)26 Group (org.eclipse.swt.widgets.Group)19 Text (org.eclipse.swt.widgets.Text)11 Combo (org.eclipse.swt.widgets.Combo)9 SelectionListener (org.eclipse.swt.events.SelectionListener)8 ArrayList (java.util.ArrayList)6 RowData (org.eclipse.swt.layout.RowData)6 Event (org.eclipse.swt.widgets.Event)6 Listener (org.eclipse.swt.widgets.Listener)6 List (java.util.List)5 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)5 StyledText (org.eclipse.swt.custom.StyledText)5 Table (org.eclipse.swt.widgets.Table)5