use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class SimpleModelExample method createControls.
/**
* Create the controls that compose the console test.
*
*/
protected void createControls() {
GridLayout gl = new GridLayout();
gl.numColumns = 1;
_shell.setLayout(gl);
GridData gd = new GridData(GridData.FILL_BOTH);
_jt = new JaretTable(_shell, SWT.V_SCROLL | SWT.H_SCROLL);
_jt.setLayoutData(gd);
if (_tableModel == null) {
SimpleJaretTableModel model = new SimpleJaretTableModel();
for (int x = 0; x <= NUMCOLS; x++) {
model.setHeaderLabel(x, "" + x);
for (int y = 0; y <= NUMROWS; y++) {
model.setValueAt(x, y, x + "/" + y);
}
}
_tableModel = model;
}
_jt.setTableModel(_tableModel);
// set rowheight mode to variable .. optimal would be quite expensive on each col resize
_jt.getTableViewState().setRowHeightMode(ITableViewState.RowHeightMode.VARIABLE);
for (int i = 0; i < NUMCOLS; i++) {
IColumn col = _tableModel.getColumn(i);
_jt.getTableViewState().setColumnWidth(col, 40);
}
JaretTableActionFactory af = new JaretTableActionFactory();
MenuManager mm = new MenuManager();
mm.add(af.createStdAction(_jt, JaretTableActionFactory.ACTION_CONFIGURECOLUMNS));
_jt.setHeaderContextMenu(mm.createContextMenu(_jt));
MenuManager rm = new MenuManager();
rm.add(af.createStdAction(_jt, JaretTableActionFactory.ACTION_OPTROWHEIGHT));
rm.add(af.createStdAction(_jt, JaretTableActionFactory.ACTION_OPTALLROWHEIGHTS));
_jt.setRowContextMenu(rm.createContextMenu(_jt));
TableControlPanel ctrlPanel = new TableControlPanel(_shell, SWT.NULL, _jt);
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class SelectionStatusDialog method createButtonBar.
/*
* @see Dialog#createButtonBar(Composite)
*/
protected Control createButtonBar(Composite parent) {
Font font = parent.getFont();
Composite composite = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
if (!fStatusLineAboveButtons) {
layout.numColumns = 2;
}
layout.marginHeight = 0;
layout.marginLeft = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setFont(font);
if (!fStatusLineAboveButtons && isHelpAvailable()) {
createHelpControl(composite);
}
fStatusLine = new MessageLine(composite);
fStatusLine.setAlignment(SWT.LEFT);
GridData statusData = new GridData(GridData.FILL_HORIZONTAL);
fStatusLine.setErrorStatus(null);
fStatusLine.setFont(font);
if (fStatusLineAboveButtons && isHelpAvailable()) {
statusData.horizontalSpan = 2;
createHelpControl(composite);
}
fStatusLine.setLayoutData(statusData);
/*
* Create the rest of the button bar, but tell it not to
* create a help button (we've already created it).
*/
boolean helpAvailable = isHelpAvailable();
setHelpAvailable(false);
super.createButtonBar(composite);
setHelpAvailable(helpAvailable);
return composite;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class HsImageLabel method doComputeSize.
protected Point doComputeSize(int width) {
Point bodySize = getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
if (descriptionLabel != null) {
GridData gd = (GridData) descriptionLabel.getLayoutData();
gd.widthHint = bodySize.x + width;
descriptionLabel.setText(description);
}
return bodySize;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class HsImageLabel method createControl.
public Composite createControl(Composite parent) {
parent.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
dispose();
}
});
Composite content = new Composite(parent, SWT.NONE);
GridLayout contentLayout = new GridLayout(2, false);
contentLayout.marginWidth = 0;
contentLayout.marginHeight = 0;
content.setLayout(contentLayout);
content.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.control = content;
imageLabel = createImageLabel(content);
if (imageLabel != null) {
imageLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
}
Composite composite = new Composite(content, SWT.NONE);
GridLayout comLayout = new GridLayout();
comLayout.marginWidth = 0;
comLayout.marginHeight = 0;
composite.setLayout(comLayout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
descriptionLabel = createDescriptionLabel(composite);
if (descriptionLabel != null) {
descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
body = new Composite(composite, SWT.NONE);
GridLayout gd = new GridLayout();
gd.marginRight = 0;
gd.marginHeight = 0;
body.setLayout(gd);
if (body != null) {
body.setLayoutData(new GridData(GridData.FILL_BOTH));
}
return body;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class TSWizardDialog method createDialogArea.
/*
* (non-Javadoc) Method declared on Dialog.
*/
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
// Build the Page container
pageContainer = createPageContainer(composite);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = pageWidth;
gd.heightHint = pageHeight;
pageContainer.setLayoutData(gd);
pageContainer.setFont(parent.getFont());
// Insert a progress monitor
progressMonitorPart = createProgressMonitorPart(composite, new GridLayout());
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
progressMonitorPart.setLayoutData(gridData);
progressMonitorPart.setVisible(false);
// Build the separator line
Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
applyDialogFont(progressMonitorPart);
return composite;
}
Aggregations