use of org.eclipse.swt.layout.GridLayout 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.GridLayout 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.GridLayout 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;
}
use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.
the class ExportFilterComposite method createContent.
/** 创建控件 */
private void createContent() {
setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
GridLayout gridLayout = new GridLayout(5, false);
gridLayout.horizontalSpacing = 2;
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
setLayout(gridLayout);
conditionComboViewer = new ComboViewer(this, SWT.NONE | SWT.READ_ONLY);
Combo conditionCombo = conditionComboViewer.getCombo();
GridData gdConditionCombo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gdConditionCombo.widthHint = 200;
conditionCombo.setLayoutData(gdConditionCombo);
conditionComboViewer.setContentProvider(new ArrayContentProvider());
conditionComboViewer.setInput(filterNames);
conditionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
if (sel.isEmpty()) {
return;
}
baseDataBean.setOptionName((String) sel.getFirstElement());
handlerFilterChangedEvent();
opratorComboViewer.setInput(baseDataBean.getCurrentFilterExpressions());
// 默认选中第一个
opratorComboViewer.getCombo().select(0);
baseDataBean.setCurrentExpression(opratorComboViewer.getCombo().getText());
}
});
opratorComboViewer = new ComboViewer(this, SWT.NONE | SWT.READ_ONLY);
Combo opratorCombo = opratorComboViewer.getCombo();
GridData gd_opratorCombo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gd_opratorCombo.widthHint = 100;
opratorCombo.setLayoutData(gd_opratorCombo);
opratorComboViewer.setContentProvider(new ArrayContentProvider());
opratorComboViewer.setInput(this.baseDataBean.getCurrentFilterExpressions());
opratorComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
if (sel.isEmpty()) {
return;
}
baseDataBean.setCurrentExpression((String) sel.getFirstElement());
}
});
dynaComposite = new Composite(this, SWT.NONE);
dynaComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
GridLayout gldynaComposite = new GridLayout(1, false);
gldynaComposite.marginWidth = 0;
gldynaComposite.marginHeight = 0;
dynaComposite.setLayout(gldynaComposite);
valueText = new Text(dynaComposite, SWT.BORDER);
valueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
addButton = new Button(this, SWT.NONE);
GridData gdAddButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdAddButton.widthHint = 25;
addButton.setLayoutData(gdAddButton);
addButton.setText("+");
addButton.addListener(SWT.Selection, this);
deleteButton = new Button(this, SWT.NONE);
GridData gdDeletebutton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdDeletebutton.widthHint = 25;
deleteButton.setLayoutData(gdDeletebutton);
deleteButton.setText("-");
deleteButton.addListener(SWT.Selection, this);
}
use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.
the class BrowserViewPart method createBrowserArea.
private Composite createBrowserArea(Composite parent) {
GridLayout gridLayout = new GridLayout(1, false);
parent.setLayout(gridLayout);
GridData gd_displayArea = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
parent.setLayoutData(gd_displayArea);
tabFolder = new CTabFolder(parent, SWT.TOP | SWT.MULTI | SWT.FLAT);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
UIJob job = new UIJob(Display.getDefault(), "refresh browser") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
refreshTabContent();
return Status.OK_STATUS;
}
/** (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
@Override
public boolean shouldRun() {
return !tabFolder.isDisposed();
}
};
job.schedule();
return parent;
}
Aggregations