Search in sources :

Example 71 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project tdi-studio-se by Talend.

the class ProjectSettingsWizardPage method createButtons.

private void createButtons(Composite parent) {
    Composite btnComposite = new Composite(parent, SWT.NONE);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    btnComposite.setLayoutData(data);
    RowLayout layout = new RowLayout();
    layout.marginTop = 8;
    layout.spacing = 15;
    btnComposite.setLayout(layout);
    // Project settings
    projectSetBtn = new Button(btnComposite, SWT.PUSH);
    //$NON-NLS-1$
    projectSetBtn.setText(org.talend.repository.i18n.Messages.getString("ProjectSettingsWizardPage.PaletteSettings"));
    // Version management
    versionBtn = new Button(btnComposite, SWT.PUSH);
    //$NON-NLS-1$
    versionBtn.setText(org.talend.repository.i18n.Messages.getString("ProjectSettingsWizardPage.VersionManagement"));
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData)

Example 72 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project tdi-studio-se by Talend.

the class ExportTreeViewer method createSelectionButton.

/**
     * DOC hcw Comment method "createSelectionButton".
     *
     * @param itemComposite
     */
private void createSelectionButton(Composite itemComposite) {
    Composite buttonComposite = new Composite(itemComposite, SWT.NONE);
    GridLayoutFactory.swtDefaults().margins(0, 25).applyTo(buttonComposite);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(buttonComposite);
    buttonComposite.setLayout(new RowLayout(SWT.VERTICAL));
    Button hide = new Button(buttonComposite, SWT.PUSH);
    hide.setVisible(false);
    Button selectAll = new Button(buttonComposite, SWT.PUSH);
    // selectAll.setText(DataTransferMessages.DataTransfer_selectAll);
    //$NON-NLS-1$
    selectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_selectAll"));
    selectAll.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getExportItemsTreeViewer().setAllChecked(true);
            checkSelection();
        }
    });
    Button deselectAll = new Button(buttonComposite, SWT.PUSH);
    // deselectAll.setText(DataTransferMessages.DataTransfer_deselectAll);
    //$NON-NLS-1$
    deselectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_deselectAll"));
    deselectAll.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getExportItemsTreeViewer().setAllChecked(false);
            checkSelection();
        }
    });
    // setButtonLayoutData(deselectAll);
    Button expandBtn = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    expandBtn.setText("Expand All");
    expandBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getExportItemsTreeViewer().expandAll();
        }
    });
    // setButtonLayoutData(expandBtn);
    Button collapseBtn = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    collapseBtn.setText("Collapse All");
    collapseBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getExportItemsTreeViewer().collapseAll();
        }
    });
// setButtonLayoutData(collapseBtn);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 73 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project tdi-studio-se by Talend.

the class TabFolderEditors method createComponents.

/**
     * DOC amaumont Comment method "createComponents".
     */
private void createComponents() {
    setSimple(false);
    // TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
    // item.setControl(metaDatasDescriptorView3);
    CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.schemaEditor"));
    SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
    inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
    item.setControl(inOutMetaEditorContainer);
    CommandStack commandStack = mapperManager.getCommandStack();
    inputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    inputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
    inputMetaEditor.initGraphicComponents();
    inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    addListenersToInputButtons();
    outputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
    outputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
    outputMetaEditor.initGraphicComponents();
    outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
    addListenersToOutputButtons();
    item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.expressionEditor"));
    StyledText styledText = createStyledText(item);
    this.styledTextHandler = new StyledTextHandler(styledText, mapperManager);
    tabFolderEditors.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            lastSelectedTab = tabFolderEditors.getSelectionIndex();
        }
    });
    tabFolderEditors.setSelection(0);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) CommandStack(org.eclipse.gef.commands.CommandStack) StyledText(org.eclipse.swt.custom.StyledText) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) DisposeListener(org.eclipse.swt.events.DisposeListener) IExtendedButtonListener(org.talend.commons.ui.swt.extended.table.IExtendedButtonListener) Listener(org.eclipse.swt.widgets.Listener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) RowLayout(org.eclipse.swt.layout.RowLayout) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Event(org.eclipse.swt.widgets.Event) ExtendedButtonEvent(org.talend.commons.ui.swt.extended.table.ExtendedButtonEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) CTabItem(org.eclipse.swt.custom.CTabItem) MetadataTableEditorView(org.talend.core.ui.metadata.editor.MetadataTableEditorView)

Example 74 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)

Example 75 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project eclipse.platform.swt by eclipse.

the class DNDExample method createFeedbackTypes.

private void createFeedbackTypes(Group parent) {
    parent.setLayout(new RowLayout(SWT.VERTICAL));
    Button b = new Button(parent, SWT.CHECK);
    b.setText("FEEDBACK_SELECT");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        Button eb = (Button) e.widget;
        if (eb.getSelection()) {
            dropFeedback |= DND.FEEDBACK_SELECT;
        } else {
            dropFeedback &= ~DND.FEEDBACK_SELECT;
        }
    }));
    b = new Button(parent, SWT.CHECK);
    b.setText("FEEDBACK_SCROLL");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        Button eb = (Button) e.widget;
        if (eb.getSelection()) {
            dropFeedback |= DND.FEEDBACK_SCROLL;
        } else {
            dropFeedback &= ~DND.FEEDBACK_SCROLL;
        }
    }));
    b = new Button(parent, SWT.CHECK);
    b.setText("FEEDBACK_INSERT_BEFORE");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        Button eb = (Button) e.widget;
        if (eb.getSelection()) {
            dropFeedback |= DND.FEEDBACK_INSERT_BEFORE;
        } else {
            dropFeedback &= ~DND.FEEDBACK_INSERT_BEFORE;
        }
    }));
    b = new Button(parent, SWT.CHECK);
    b.setText("FEEDBACK_INSERT_AFTER");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        Button eb = (Button) e.widget;
        if (eb.getSelection()) {
            dropFeedback |= DND.FEEDBACK_INSERT_AFTER;
        } else {
            dropFeedback &= ~DND.FEEDBACK_INSERT_AFTER;
        }
    }));
    b = new Button(parent, SWT.CHECK);
    b.setText("FEEDBACK_EXPAND");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        Button eb = (Button) e.widget;
        if (eb.getSelection()) {
            dropFeedback |= DND.FEEDBACK_EXPAND;
        } else {
            dropFeedback &= ~DND.FEEDBACK_EXPAND;
        }
    }));
}
Also used : StyledText(org.eclipse.swt.custom.StyledText) URL(java.net.URL) DND(org.eclipse.swt.dnd.DND) TableColumn(org.eclipse.swt.widgets.TableColumn) FontMetrics(org.eclipse.swt.graphics.FontMetrics) Point(org.eclipse.swt.graphics.Point) SWTError(org.eclipse.swt.SWTError) DropTargetEvent(org.eclipse.swt.dnd.DropTargetEvent) URLTransfer(org.eclipse.swt.dnd.URLTransfer) Composite(org.eclipse.swt.widgets.Composite) TreeColumn(org.eclipse.swt.widgets.TreeColumn) DropTarget(org.eclipse.swt.dnd.DropTarget) Text(org.eclipse.swt.widgets.Text) Button(org.eclipse.swt.widgets.Button) Display(org.eclipse.swt.widgets.Display) Transfer(org.eclipse.swt.dnd.Transfer) MenuItem(org.eclipse.swt.widgets.MenuItem) Tree(org.eclipse.swt.widgets.Tree) SWT(org.eclipse.swt.SWT) HTMLTransfer(org.eclipse.swt.dnd.HTMLTransfer) List(org.eclipse.swt.widgets.List) DragSourceEvent(org.eclipse.swt.dnd.DragSourceEvent) Label(org.eclipse.swt.widgets.Label) RTFTransfer(org.eclipse.swt.dnd.RTFTransfer) DragSourceListener(org.eclipse.swt.dnd.DragSourceListener) Image(org.eclipse.swt.graphics.Image) Rectangle(org.eclipse.swt.graphics.Rectangle) Table(org.eclipse.swt.widgets.Table) SelectionListener.widgetSelectedAdapter(org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter) TextTransfer(org.eclipse.swt.dnd.TextTransfer) Canvas(org.eclipse.swt.widgets.Canvas) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) FileTransfer(org.eclipse.swt.dnd.FileTransfer) DragSource(org.eclipse.swt.dnd.DragSource) TableItem(org.eclipse.swt.widgets.TableItem) Combo(org.eclipse.swt.widgets.Combo) Shell(org.eclipse.swt.widgets.Shell) MalformedURLException(java.net.MalformedURLException) DropTargetListener(org.eclipse.swt.dnd.DropTargetListener) FormLayout(org.eclipse.swt.layout.FormLayout) FileDialog(org.eclipse.swt.widgets.FileDialog) FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment) Group(org.eclipse.swt.widgets.Group) TreeItem(org.eclipse.swt.widgets.TreeItem) File(java.io.File) RowLayout(org.eclipse.swt.layout.RowLayout) Menu(org.eclipse.swt.widgets.Menu) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Control(org.eclipse.swt.widgets.Control) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout)

Aggregations

RowLayout (org.eclipse.swt.layout.RowLayout)86 Composite (org.eclipse.swt.widgets.Composite)73 GridData (org.eclipse.swt.layout.GridData)55 Button (org.eclipse.swt.widgets.Button)54 GridLayout (org.eclipse.swt.layout.GridLayout)52 Label (org.eclipse.swt.widgets.Label)44 SelectionEvent (org.eclipse.swt.events.SelectionEvent)41 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)34 Group (org.eclipse.swt.widgets.Group)27 Text (org.eclipse.swt.widgets.Text)23 Combo (org.eclipse.swt.widgets.Combo)19 Shell (org.eclipse.swt.widgets.Shell)17 Display (org.eclipse.swt.widgets.Display)16 Point (org.eclipse.swt.graphics.Point)12 ArrayList (java.util.ArrayList)10 StyledText (org.eclipse.swt.custom.StyledText)10 Table (org.eclipse.swt.widgets.Table)10 List (java.util.List)9 SelectionListener (org.eclipse.swt.events.SelectionListener)9 FillLayout (org.eclipse.swt.layout.FillLayout)9