Search in sources :

Example 91 with SashForm

use of org.eclipse.swt.custom.SashForm in project Palladio-Editors-Sirius by PalladioSimulator.

the class NewPalladioTemplateWizardPage method createControl.

/**
 * @see IDialogPage#createControl(Composite)
 */
@Override
public void createControl(final Composite parent) {
    final Composite container = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.verticalSpacing = 10;
    container.setLayout(layout);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    final Label label = new Label(container, SWT.NONE);
    label.setText(getTitle());
    GridData gd = new GridData();
    label.setLayoutData(gd);
    final SashForm sashForm = new SashForm(container, SWT.HORIZONTAL);
    gd = new GridData(GridData.FILL_BOTH);
    // limit the width of the sash form to avoid the wizard
    // opening very wide. This is just preferred size -
    // it can be made bigger by the wizard
    // See bug #83356
    gd.widthHint = 300;
    sashForm.setLayoutData(gd);
    this.wizardSelectionViewer = new TableViewer(sashForm, SWT.BORDER);
    this.wizardSelectionViewer.setContentProvider(ArrayContentProvider.getInstance());
    this.wizardSelectionViewer.setLabelProvider(new TemplateLabelProvider());
    createDescriptionIn(sashForm);
    this.wizardSelectionViewer.setInput(this.initiatorATs);
    this.wizardSelectionViewer.addSelectionChangedListener(this);
    setControl(container);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 92 with SashForm

use of org.eclipse.swt.custom.SashForm in project eclipse.platform.text by eclipse.

the class AbstractTemplatesPage method createControl.

@Override
public void createControl(Composite ancestor) {
    setupActions();
    fControl = new SashForm(ancestor, SWT.VERTICAL);
    createTemplateTree(fControl);
    createPatternForm(fControl);
    hookContextMenu();
    initializeDND();
    updateButtons();
    int sashSize = fPreferenceStore.getInt(SASH_SIZE_PREF_ID);
    fControl.setWeights(new int[] { sashSize, 100 - sashSize });
    fTemplateChangeListener = new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            getShell().getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    refresh();
                }
            });
        }
    };
    getTemplatePreferenceStore().addPropertyChangeListener(fTemplateChangeListener);
    updateContextTypes(getEditorContextTypeIds());
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) SashForm(org.eclipse.swt.custom.SashForm) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) Point(org.eclipse.swt.graphics.Point)

Example 93 with SashForm

use of org.eclipse.swt.custom.SashForm in project yamcs-studio by yamcs.

the class CommandHistoryEntryDetailsDialog method createSashForm.

private void createSashForm(Composite parent) {
    sashForm = new SashForm(parent, SWT.VERTICAL);
    GridLayout layout = new GridLayout();
    layout.marginHeight = layout.marginWidth = 0;
    sashForm.setLayout(layout);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
    sashForm.setSashWidth(10);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData)

Example 94 with SashForm

use of org.eclipse.swt.custom.SashForm in project yamcs-studio by yamcs.

the class CommandQueueView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    // Build the tables
    FillLayout fl = new FillLayout();
    fl.marginHeight = 0;
    fl.marginWidth = 0;
    parent.setLayout(fl);
    SashForm sash = new SashForm(parent, SWT.VERTICAL);
    Composite tableWrapper = new Composite(sash, SWT.NONE);
    tableWrapper.setLayoutData(new GridData(GridData.FILL_BOTH));
    TableColumnLayout tcl = new TableColumnLayout();
    tableWrapper.setLayout(tcl);
    commandQueuesTableViewer = new CommandQueuesTableViewer(this, tableWrapper, tcl);
    commandQueuesContentProvider = new CommandQueuesTableContentProvider(commandQueuesTableViewer);
    commandQueuesTableViewer.setContentProvider(commandQueuesContentProvider);
    commandQueuesTableViewer.setInput(commandQueuesContentProvider);
    commandQueuesTableViewer.addSelectionChangedListener(evt -> {
        currentQueuesModel.reloadCommandsTable((IStructuredSelection) evt.getSelection());
    });
    if (getViewSite() != null)
        getViewSite().setSelectionProvider(commandQueuesTableViewer);
    Composite tableWrapper2 = new Composite(sash, SWT.NONE);
    tableWrapper2.setLayoutData(new GridData(GridData.FILL_BOTH));
    TableColumnLayout tcl2 = new TableColumnLayout();
    tableWrapper2.setLayout(tcl2);
    commandQueuedTableViewer = new CommandQueuedTableViewer(this, tableWrapper2, tcl2);
    commandQueuedContentProvider = new CommandQueuedTableContentProvider(commandQueuedTableViewer);
    commandQueuedTableViewer.setContentProvider(commandQueuedContentProvider);
    commandQueuedTableViewer.setInput(commandQueuedContentProvider);
    // Set initial state
    refreshState();
    CommandingCatalogue.getInstance().addCommandQueueListener(this);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) TableColumnLayout(org.eclipse.jface.layout.TableColumnLayout) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 95 with SashForm

use of org.eclipse.swt.custom.SashForm in project yamcs-studio by yamcs.

the class ConnectionsDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    parent.getShell().setText("Yamcs Server Connections");
    Composite contentArea = new Composite(parent, SWT.NONE);
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.verticalSpacing = 0;
    contentArea.setLayout(gl);
    ResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources(), contentArea);
    ToolBar editBar = new ToolBar(contentArea, SWT.NO_FOCUS);
    addServerButton = new ToolItem(editBar, SWT.NONE);
    addServerButton.setImage(resourceManager.createImage(RCPUtils.getImageDescriptor(ConnectionsDialog.class, "icons/obj16/server_add.png")));
    addServerButton.setToolTipText("Add Connection");
    addServerButton.addListener(SWT.Selection, evt -> {
        addServer();
        updateState();
    });
    removeServerButton = new ToolItem(editBar, SWT.NONE);
    removeServerButton.setImage(resourceManager.createImage(RCPUtils.getImageDescriptor(ConnectionsDialog.class, "icons/obj16/server_remove.png")));
    removeServerButton.setToolTipText("Delete Connection");
    removeServerButton.addListener(SWT.Selection, evt -> {
        removeSelectedServer();
        updateState();
    });
    editBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    SashForm sash = new SashForm(contentArea, SWT.HORIZONTAL);
    sash.setLayoutData(new GridData(GridData.FILL_BOTH));
    sash.setLayout(new FillLayout());
    createServerPanel(sash, resourceManager);
    // Create right side, but wrap it in another composite to force
    // dimensions even when invisible
    Composite detailPanelWrapper = new Composite(sash, SWT.NONE);
    gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    detailPanelWrapper.setLayout(gl);
    createDetailPanel(detailPanelWrapper, resourceManager);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = 250;
    detailPanel.setLayoutData(gd);
    sash.setWeights(new int[] { 55, 45 });
    ConnectionPreferences.getConfigurations().forEach(conf -> {
        connViewer.add(conf);
    });
    YamcsConfiguration lastConf = ConnectionPreferences.getLastUsedConfiguration();
    if (lastConf != null)
        selectServer(lastConf);
    else
        selectFirstServer();
    updateState();
    return contentArea;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LocalResourceManager(org.eclipse.jface.resource.LocalResourceManager) ToolBar(org.eclipse.swt.widgets.ToolBar) GridData(org.eclipse.swt.layout.GridData) ResourceManager(org.eclipse.jface.resource.ResourceManager) LocalResourceManager(org.eclipse.jface.resource.LocalResourceManager) FillLayout(org.eclipse.swt.layout.FillLayout) ToolItem(org.eclipse.swt.widgets.ToolItem)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)96 GridData (org.eclipse.swt.layout.GridData)65 GridLayout (org.eclipse.swt.layout.GridLayout)57 Composite (org.eclipse.swt.widgets.Composite)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 FillLayout (org.eclipse.swt.layout.FillLayout)30 Label (org.eclipse.swt.widgets.Label)26 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 CTabItem (org.eclipse.swt.custom.CTabItem)14 Button (org.eclipse.swt.widgets.Button)13 StyledText (org.eclipse.swt.custom.StyledText)12 ToolBar (org.eclipse.swt.widgets.ToolBar)12 ArrayList (java.util.ArrayList)11 Point (org.eclipse.swt.graphics.Point)11 Table (org.eclipse.swt.widgets.Table)11 ToolItem (org.eclipse.swt.widgets.ToolItem)11 TableViewer (org.eclipse.jface.viewers.TableViewer)10 Event (org.eclipse.swt.widgets.Event)10 Listener (org.eclipse.swt.widgets.Listener)9 Tree (org.eclipse.swt.widgets.Tree)9