當前位置: 首頁>>代碼示例>>Java>>正文


Java FormAttachment類代碼示例

本文整理匯總了Java中org.eclipse.swt.layout.FormAttachment的典型用法代碼示例。如果您正苦於以下問題:Java FormAttachment類的具體用法?Java FormAttachment怎麽用?Java FormAttachment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FormAttachment類屬於org.eclipse.swt.layout包,在下文中一共展示了FormAttachment類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: InfoBar

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:30,代碼來源:InfoBar.java

示例2: createContent

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);
        }
    });

}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:25,代碼來源:ZnodeModelTextDataEditor.java

示例3: createModelFormContent

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);

}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:20,代碼來源:MBeanModelJmxDocFormPage.java

示例4: createDetailSection

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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;
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:21,代碼來源:MBeanFeatureModeMainFormPage.java

示例5: getGroupSO

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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;
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:21,代碼來源:ToolBarView.java

示例6: createDialogArea

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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;
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:20,代碼來源:LoadExtensionDialog.java

示例7: createControls

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:20,代碼來源:PropertySectionTransitionLabel.java

示例8: setLayoutsForNoProgress

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);

	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:23,代碼來源:ProgressInfoItem.java

示例9: TagListCombinedWidget

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);
}
 
開發者ID:sjclemen,項目名稱:peten,代碼行數:26,代碼來源:TagListCombinedWidget.java

示例10: addCodeButton

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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() );
    }
  });
}
 
開發者ID:andtorg,項目名稱:sdmx-kettle,代碼行數:27,代碼來源:SdmxStepDialog.java

示例11: addTableView

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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();
}
 
開發者ID:andtorg,項目名稱:sdmx-kettle,代碼行數:24,代碼來源:PreviewTimeSeriesDialog.java

示例12: createControl

import org.eclipse.swt.layout.FormAttachment; //導入依賴的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);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:21,代碼來源:SelectMergeTargetMappingWizardPage.java

示例13: createBaselessWarningMessage

import org.eclipse.swt.layout.FormAttachment; //導入依賴的package包/類
private void createBaselessWarningMessage(final Composite container, final Control imageNeighbour) {
    final Image baselessWarningImage = imageHelper.getImage("images/common/warning.gif"); //$NON-NLS-1$
    baselessWarningImageLabel = new Label(container, SWT.NONE);
    baselessWarningImageLabel.setImage(baselessWarningImage);
    baselessWarningImageLabel.setToolTipText(
        Messages.getString("SelectMergeSourceTargetWizardPage.BaselessWarningText")); //$NON-NLS-1$
    final FormData baselessWarningImageLabelData = new FormData();
    final int warningImageTopOffset = FormHelper.VerticalOffset(baselessWarningImageLabel, imageNeighbour);
    baselessWarningImageLabelData.top = new FormAttachment(imageNeighbour, warningImageTopOffset, SWT.TOP);
    baselessWarningImageLabelData.left = new FormAttachment(imageNeighbour, 2, SWT.RIGHT);
    baselessWarningImageLabel.setLayoutData(baselessWarningImageLabelData);

    baselessWarningLabel = new Label(container, SWT.NONE);
    final FormData baselessWarningLabelData = new FormData();
    baselessWarningLabelData.top = new FormAttachment(targetCombo, 5, SWT.BOTTOM);
    baselessWarningLabelData.left = new FormAttachment(0, 0);
    baselessWarningLabel.setLayoutData(baselessWarningLabelData);
    baselessWarningLabel.setText(Messages.getString("SelectMergeSourceTargetWizardPage.BaselessWarningText")); //$NON-NLS-1$

    setBaselessWarningVisibility(false);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:22,代碼來源:SelectMergeSourceTargetWizardPage.java

示例14: addDateChooser

import org.eclipse.swt.layout.FormAttachment; //導入依賴的package包/類
private void addDateChooser(final Composite compositeFields) {
	final Button open = new Button(compositeFields, SWT.PUSH);
	final FormData fd_dtPasswordExpire = new FormData();
	fd_dtPasswordExpire.left = new FormAttachment(txtPasswordExpire, 10, SWT.RIGHT);
	fd_dtPasswordExpire.top = new FormAttachment(txtPasswordExpire, 0, SWT.TOP);
	fd_dtPasswordExpire.bottom = new FormAttachment(txtPasswordExpire, 0, SWT.BOTTOM);
	open.setLayoutData(fd_dtPasswordExpire);
	open.setText(Messages.getString("EditDialog.Calendar")); //$NON-NLS-1$
	open.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(final SelectionEvent e) {
			final DateDialog dialog = new DateDialog(shell);
			dialog.setDate(entryToEdit.getExpires());
			final Date result = dialog.open();
			if (result != null && !result.equals(entryToEdit.getExpires())) {
				txtPasswordExpire.setText(format(result));
				setDirty(true);
			}
		}
	});
}
 
開發者ID:nresare,項目名稱:javapasswordsafe,代碼行數:22,代碼來源:EditDialog.java

示例15: resetLayoutData

import org.eclipse.swt.layout.FormAttachment; //導入依賴的package包/類
public void resetLayoutData() {
	if (text != null) {
		FormData fd_styledText = new FormData();
		if (composite.getVisible())
			fd_styledText.bottom = new FormAttachment(composite, 1);
		else
			fd_styledText.bottom = new FormAttachment(100);
		fd_styledText.right = new FormAttachment(100);
		fd_styledText.top = new FormAttachment(0);
		if (tree.getVisible())
			fd_styledText.left = new FormAttachment(tree, 1);
		else
			fd_styledText.left = new FormAttachment(0);
		text.setLayoutData(fd_styledText);
		layout();
	}
}
 
開發者ID:piiiiq,項目名稱:Black,代碼行數:18,代碼來源:black.java


注:本文中的org.eclipse.swt.layout.FormAttachment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。