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);
}
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());
}
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);
}
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);
}
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;
}
Aggregations