本文整理匯總了Java中org.eclipse.swt.layout.FormData類的典型用法代碼示例。如果您正苦於以下問題:Java FormData類的具體用法?Java FormData怎麽用?Java FormData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FormData類屬於org.eclipse.swt.layout包,在下文中一共展示了FormData類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: InfoBar
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
/**
* Constructor.
*
* @param parent The parent {@link Composite}.
* @param style The InfoBar {@link Composite#getStyle() style}.
*/
public InfoBar(Composite parent, int style) {
super(parent, style);
setVisible(false);
FormLayout layout = new FormLayout();
layout.marginTop = 5;
layout.marginBottom = 5;
layout.marginLeft = 5;
layout.marginRight = 5;
layout.spacing = 5;
setLayout(layout);
Color backgroundColor = parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
setBackground(backgroundColor);
_Label = new Label(this, SWT.LEAD | SWT.WRAP);
_Label.setBackground(backgroundColor);
FormData labelFormData = new FormData();
labelFormData.top = new FormAttachment(0, 0);
labelFormData.left = new FormAttachment(0, 0);
_Label.setLayoutData(labelFormData);
}
示例2: createContent
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
protected void createContent() {
FormToolkit toolkit = getToolkit();
_Text = toolkit.createText(this, "", SWT.BORDER | SWT.SINGLE);
_Text.setFont(JFaceResources.getTextFont());
FormData formData = new FormData();
formData.top = new FormAttachment(0, 0);
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
_Text.setLayoutData(formData);
_Text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setDirtyInternal(true);
}
});
}
示例3: createModelFormContent
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {
FormToolkit toolkit = managedForm.getToolkit();
_ScrolledFormText = new ScrolledFormText(client, false);
_ScrolledFormText.setExpandHorizontal(true);
toolkit.adapt(_ScrolledFormText, false, false);
_JmxDocFormText = toolkit.createFormText(_ScrolledFormText, true);
_ScrolledFormText.setFormText(_JmxDocFormText);
JmxDocFormText.initFormText(_JmxDocFormText);
FormData scrolledFormTextFormData = new FormData();
scrolledFormTextFormData.top = new FormAttachment(0, 0);
scrolledFormTextFormData.left = new FormAttachment(0, 0);
scrolledFormTextFormData.right = new FormAttachment(100, 0);
scrolledFormTextFormData.bottom = new FormAttachment(100, 0);
_ScrolledFormText.setLayoutData(scrolledFormTextFormData);
}
示例4: createDetailSection
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
protected Section createDetailSection(ScrolledForm form, Composite client, FormToolkit toolkit) {
Section section = createSection(form, client, toolkit, DETAIL_SECTION_TITLE, JmxActivator
.getManagedImage(JmxActivator.IMAGE_KEY_OBJECT_JMX_DOC));
Composite sectionClient = createSectionClient(section, toolkit);
_JmxDocFormText = toolkit.createFormText(sectionClient, false);
JmxDocFormText.initFormText(_JmxDocFormText);
FormData jmxdocFormTextFormData = new FormData();
jmxdocFormTextFormData.top = new FormAttachment(0, 0);
jmxdocFormTextFormData.left = new FormAttachment(0, 0);
_JmxDocFormText.setLayoutData(jmxdocFormTextFormData);
GridData detailSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
section.setLayoutData(detailSectionGridData);
return section;
}
示例5: updateButtonVisibility
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
private void updateButtonVisibility(final Tag[] tags) {
Utils.execSWTThread(new AERunnable() {
@Override
public void runSupport() {
if (btnAnyTags == null || btnAnyTags.isDisposed()) {
return;
}
boolean show = tags != null && tags.length > 1;
btnAnyTags.setVisible(show);
FormData fd = Utils.getFilledFormData();
fd.height = show ? SWT.DEFAULT : 0;
btnAnyTags.setLayoutData(fd);
Composite cTop = btnAnyTags.getParent();
cTop.getParent().layout(true, true);
}
});
}
示例6: getGroupSO
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
private SWTSkinObjectContainer getGroupSO(String groupID) {
String soID = "toolbar-group-" + groupID;
SWTSkinObjectContainer soGroup = (SWTSkinObjectContainer) skin.getSkinObjectByID(
soID, soMain);
if (soGroup == null) {
soGroup = (SWTSkinObjectContainer) skin.createSkinObject(soID,
"toolbar.group", soMain);
FormData fd = (FormData) soGroup.getControl().getLayoutData();
if (soLastGroup != null) {
fd.left = new FormAttachment(soLastGroup.getControl(), 0, SWT.RIGHT);
} else {
fd.left = new FormAttachment(0, 2);
}
}
soLastGroup = soGroup;
return soGroup;
}
示例7: dispose
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
public void dispose() {
if (control == null || control.isDisposed()) {
return;
}
if (!TEST_SWT_PAINTING) {
control.removeListener(SWT.Resize, this);
control.removeListener(SWT.Paint, this);
control.getShell().removeListener(SWT.Show, this);
}
control.removeListener(SWT.Dispose, this);
control.setBackgroundImage(null);
FormData formData = (FormData) control.getLayoutData();
formData.width = SWT.DEFAULT;
formData.height = SWT.DEFAULT;
control.setData("BGPainter", null);
}
示例8: betterComputeSize
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
protected Point betterComputeSize(Composite c, Point size, int wHint,
int hHint) {
if (c.getChildren().length == 0 && (size.x == 64 || size.y == 64)) {
Object ld = c.getLayoutData();
if (ld instanceof FormData) {
FormData fd = (FormData) ld;
if (fd.width != 0 && fd.height != 0) {
Rectangle trim = c.computeTrim (0, 0, fd.width, fd.height);
return new Point(trim.width, trim.height);
}
}
return new Point(1, 1);
}
if (size.x == 0 || size.y == 0) {
return size;
}
if (minWidth > 0 && size.x < minWidth) {
size.x = minWidth;
}
if (minHeight > 0 && size.y < minHeight) {
size.y = minHeight;
}
return size;
}
示例9: createDialogArea
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Composite buttonComposite = (Composite) composite.getChildren()[0];
Button browseRegisteredExtensionsButton = new Button(buttonComposite,
SWT.PUSH);
browseRegisteredExtensionsButton
.setText(Messages.LoadExtensionDialog_ExtensionRegistry);
prepareBrowseRegisteredPackagesButton(browseRegisteredExtensionsButton);
{
FormData data = new FormData();
Control[] children = buttonComposite.getChildren();
data.right = new FormAttachment(children[0], -CONTROL_OFFSET);
browseRegisteredExtensionsButton.setLayoutData(data);
}
return composite;
}
示例10: createControls
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
public void createControls(Composite parent,
TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite composite=this.getWidgetFactory().createFlatFormComposite(parent);
composite.setLayout(new FormLayout());
Label la=this.getWidgetFactory().createLabel(composite,"名稱:");
FormData laData=new FormData();
laData.top=new FormAttachment(0,12);
laData.left=new FormAttachment(0,10);
la.setLayoutData(laData);
this.labelText=this.getWidgetFactory().createText(composite, "");
FormData textData=new FormData();
textData.left=new FormAttachment(la,1);
textData.top=new FormAttachment(0,12);
textData.right=new FormAttachment(100,-10);
this.labelText.setLayoutData(textData);
}
示例11: setLayoutsForNoProgress
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
/**
* Set the layout of the widgets for the no progress case.
*
*/
private void setLayoutsForNoProgress() {
FormData buttonData = new FormData();
buttonData.top = new FormAttachment(progressLabel, 0, SWT.TOP);
buttonData.right = new FormAttachment(100,
IDialogConstants.HORIZONTAL_SPACING * -1);
actionBar.setLayoutData(buttonData);
if (taskEntries.size() > 0) {
FormData linkData = new FormData();
linkData.top = new FormAttachment(progressLabel,
IDialogConstants.VERTICAL_SPACING);
linkData.left = new FormAttachment(progressLabel, 0, SWT.LEFT);
linkData.right = new FormAttachment(actionBar, 0, SWT.LEFT);
taskEntries.get(0).setLayoutData(linkData);
}
}
示例12: TagListCombinedWidget
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
public TagListCombinedWidget(Composite parent, int style, Composite callLayoutOnMe) {
super(parent, style);
FormLayout layout = new FormLayout();
setLayout(layout);
FormData selfFormData = new FormData();
selfFormData.top = new FormAttachment(0, 0);
selfFormData.left = new FormAttachment(0, 0);
selfFormData.right = new FormAttachment(100, 0);
setLayoutData(selfFormData);
tagList = new TagListCombo(this, SWT.NONE);
FormData tagListFormData = new FormData();
tagListFormData.top = new FormAttachment(0, 0);
tagListFormData.left = new FormAttachment(0, 0);
tagListFormData.right = new FormAttachment(100, 0);
tagList.getControl().setLayoutData(tagListFormData);
tagListSelected = new TagListSelected(this, SWT.NONE, callLayoutOnMe);
FormData tagListSelectedFormData = new FormData();
tagListSelectedFormData.top = new FormAttachment(tagList.getControl(), 0);
tagListSelectedFormData.left = new FormAttachment(0, 0);
tagListSelectedFormData.right = new FormAttachment(100, 0);
tagListSelected.getWidget().setLayoutData(tagListSelectedFormData);
}
示例13: addCodeButton
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
private void addCodeButton() {
wbCodes = new Button(wSettingComp, SWT.PUSH);
wbCodes.setText( BaseMessages.getString( PKG, "SdmxDialog.AddCodes.Button"));
props.setLook(wbCodes);
fdCodes = new FormData();
fdCodes.left = new FormAttachment( wCodeList, margin );
fdCodes.top = new FormAttachment( wbDimensions, margin );
wbCodes.setLayoutData( fdCodes );
wbCodes.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event e) {
StringBuilder builder = new StringBuilder();
int ind[] = wCodeList.getSelectionIndices();
for (int anInd : ind) {
if (builder.length() > 0) {
builder.append("+");
}
builder.append(wCodeList.getItem(anInd)[0]);
}
updateDimensionTable( sdmxDialogData.getActiveDimensionId(), builder.toString() );
}
});
}
示例14: addTableView
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
private void addTableView() {
int margin = Const.MARGIN;
ColumnInfo[] colinf = new ColumnInfo[rowMeta.size()];
for ( int i = 0; i < rowMeta.size(); i++ ) {
ValueMetaInterface v = rowMeta.getValueMeta( i );
colinf[i] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() );
colinf[i].setToolTip( v.toStringMeta() );
colinf[i].setValueMeta( v );
}
wSeriesTable =
new TableView( variables, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, props );
wSeriesTable.setShowingBlueNullValues( true ); //// TODO: 25/05/16 wat?
fdSeriesTable = new FormData();
fdSeriesTable.left = new FormAttachment( 0, 0 );
fdSeriesTable.top = new FormAttachment( 0, margin );
fdSeriesTable.right = new FormAttachment( 100, 0 );
fdSeriesTable.bottom = new FormAttachment( 100, -50 );
wSeriesTable.setLayoutData( fdSeriesTable );
fillTableView();
}
示例15: createControl
import org.eclipse.swt.layout.FormData; //導入依賴的package包/類
@Override
public void createControl(final Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
final FormLayout formLayout = new FormLayout();
formLayout.marginHeight = FormHelper.MarginHeight();
formLayout.marginWidth = FormHelper.MarginWidth();
formLayout.spacing = FormHelper.Spacing();
container.setLayout(formLayout);
setControl(container);
final Label errorLabel = new Label(container, SWT.WRAP);
final FormData errorLabelData = new FormData();
errorLabelData.top = new FormAttachment(0, 0);
errorLabelData.left = new FormAttachment(0, 0);
errorLabel.setLayoutData(errorLabelData);
errorLabel.setText(Messages.getString("SelectMergeTargetMappingWizardPage.ErrorLabelText")); //$NON-NLS-1$
ControlSize.setCharWidthHint(errorLabel, MergeWizard.TEXT_CHARACTER_WIDTH);
}