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


Java FormLayout類代碼示例

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


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

示例1: InfoBar

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

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

示例3: TagListCombinedWidget

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

示例4: createControl

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

示例5: createControl

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
/**
 * Create contents of the wizard
 *
 * @param parent
 */
@Override
public void createControl(final Composite parent) {
    final Composite container = new Composite(parent, SWT.NULL);

    final FormLayout formLayout = new FormLayout();
    formLayout.spacing = FormHelper.Spacing();
    formLayout.marginHeight = FormHelper.MarginHeight();
    formLayout.marginWidth = FormHelper.MarginWidth();
    container.setLayout(formLayout);
    setControl(container);

    createMergeSourceControls(container);
    createMergeSelectionControls(container);
    createMergeTargeControls(container);

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

示例6: getLayoutMargin

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
private Point getLayoutMargin() {
    final Layout layout = getLayout();

    if (layout == null) {
        return new Point(0, 0);
    } else if (layout instanceof GridLayout) {
        final GridLayout gridLayout = (GridLayout) layout;
        return new Point(gridLayout.marginWidth, gridLayout.marginHeight);
    } else if (layout instanceof FillLayout) {
        final FillLayout fillLayout = (FillLayout) layout;
        return new Point(fillLayout.marginWidth, fillLayout.marginHeight);
    } else if (layout instanceof FormLayout) {
        final FormLayout formLayout = (FormLayout) layout;
        return new Point(formLayout.marginWidth, formLayout.marginHeight);
    }

    return new Point(0, 0);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:19,代碼來源:SizeConstrainedComposite.java

示例7: formLayout

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
public static FormLayout formLayout(
    final Composite composite,
    final int marginWidth,
    final int marginHeight,
    final int spacing) {
    Check.notNull(composite, "composite"); //$NON-NLS-1$

    final FormLayout layout = new FormLayout();
    layout.marginWidth = marginHeight;
    layout.marginHeight = marginHeight;
    layout.spacing = spacing;

    composite.setLayout(layout);

    return layout;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:17,代碼來源:SWTUtil.java

示例8: createComposites

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
private void createComposites(Composite parent) {
	ToolBar toolBar = new ToolBar(parent, SWT.VERTICAL | SWT.FLAT | SWT.WRAP);
	toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true , true));
	
	Composite option = new Composite(parent,SWT.NONE);
	option.setLayout(new FormLayout());
	
	initOptions(toolBar,option);
	
	Point optionSize = computeOptionsSize(0 , toolBar.computeSize(SWT.DEFAULT,SWT.DEFAULT).y );
	option.setLayoutData(new GridData(optionSize.x,optionSize.y));
	
	if( this.options.size() > 0 ){
		select((Option)this.options.get(0));
	}
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:17,代碼來源:TGSettingsEditor.java

示例9: addRowHandlingGroup

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
private void addRowHandlingGroup() {
  wgRowHandling = new Group( wcConfig, SWT.SHADOW_NONE );
  props.setLook( wgRowHandling );
  wgRowHandling.setText( BaseMessages.getString( PKG, "CPythonScriptExecutorDialog.ConfigTab.RowHandlingGroup" ) );
  FormLayout wglRowHandling = new FormLayout();
  wglRowHandling.marginWidth = 10;
  wglRowHandling.marginHeight = 10;
  wgRowHandling.setLayout( wglRowHandling );
  fd = new FormData();
  fd.left = new FormAttachment( 0, 0 );
  fd.right = new FormAttachment( 100, 0 );
  fd.top = new FormAttachment( 0, 0 );
  wgRowHandling.setLayoutData( fd );

  addRowsToProcessControllers(); // Number of Rows to Process
  addReservoirSamplingControllers(); // Reservoir Sampling
  addRandomSeedControllers(); // Random Seed
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:19,代碼來源:CPythonScriptExecutorDialog.java

示例10: addOptionsGroup

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
private void addOptionsGroup() {
  // add second group
  wgOptions = new Group( wcConfig, SWT.SHADOW_NONE );
  props.setLook( wgOptions );
  wgOptions.setText( BaseMessages.getString( PKG, "CPythonScriptExecutorDialog.ConfigTab.OptionsGroup" ) );
  FormLayout optionsGroupLayout = new FormLayout();
  optionsGroupLayout.marginWidth = 10;
  optionsGroupLayout.marginHeight = 10;
  wgOptions.setLayout( optionsGroupLayout );
  FormData fd = new FormData();
  fd.left = new FormAttachment( 0, 0 );
  fd.right = new FormAttachment( 100, 0 );
  fd.top = new FormAttachment( wgRowHandling, MARGIN );
  wgOptions.setLayoutData( fd );

  addIncludeInputInOutputControllers();
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:18,代碼來源:CPythonScriptExecutorDialog.java

示例11: open

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
/**
 * Open the window.
 */
public void open() {
    display = Display.getDefault();
    shell = new Shell();
    shell.setLayout(new FormLayout());
    shell.open();
    shell.setSize(800, 600);
    shell.setText("日誌分析係統");
    shell.setImage(new Image(display, ClassLoader.getSystemResourceAsStream("icons/log.png")));

    createToolBar();
    createSashForm();
    createStatusBar();
    loadLogs();

    shell.layout();
    while (shell != null & !shell.isDisposed()) {
        if (display != null && !display.readAndDispatch()) {
            display.sleep();
        }
    }

}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:26,代碼來源:LogAnalysis.java

示例12: SplitPanel

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
/***************************************************************************
 * Constructor
 * 
 * @param parent
 *            Container composite
 * @param horizontalSplit
 *            True if the split bar is to be horizontal
 * @param limit
 *            Size limit for sections
 * @param initial
 *            Initial percentage of the split bar position
 **************************************************************************/
public SplitPanel(Composite parent, int limit, IPresentationPanel ppanel )
{
	super(parent, SWT.NONE);

	m_presentationPanel = ppanel;
	m_sizeLimit = limit;
	m_initialSize = true;
	m_listeners = new HashSet<ISashListener>();

	FormLayout layout = new FormLayout();
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	setLayout(layout);
	createSections();
	defineSectionsLayout();

	m_presentationSection.setSize(m_presentationSection.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	m_controlSection.setSize(m_controlSection.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	
	addControlListener(this);
}
 
開發者ID:Spacecraft-Code,項目名稱:SPELL,代碼行數:34,代碼來源:SplitPanel.java

示例13: setUpTabs

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
private void setUpTabs(Composite parent) {

        tabFolder = new TabFolder(parent, SWT.BOTTOM);

        commitHistoryTab = new TabItem(tabFolder, SWT.NULL);
        commitHistoryTab.setText("Commit History");
        commitHistoryComposite = new Composite(tabFolder, SWT.NULL);
        commitHistoryTab.setControl(commitHistoryComposite);
        commitHistoryComposite.setLayout(new FormLayout());

        diffViewTab = new TabItem(tabFolder, SWT.NULL);
        diffViewTab.setText("Diff View");
        diffViewComposite = new Composite(tabFolder, SWT.NULL);
        diffViewTab.setControl(diffViewComposite);
        diffViewComposite.setLayout(new FormLayout());

    }
 
開發者ID:Cooperate-Project,項目名稱:CooperateModelingEnvironment,代碼行數:18,代碼來源:DiffView.java

示例14: LayoutWrapper

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
public LayoutWrapper(final Layout layout) {
    super();
    Assert.paramNotNull(layout, "layout");
    this.layout = new FormLayout();
    this.layoutListeners = new HashSet<ILayoutListener>();
    try {
        this.computeSizeMethod = layout.getClass().getDeclaredMethod(
                "computeSize",
                Composite.class,
                int.class,
                int.class,
                boolean.class);
        this.computeSizeMethod.setAccessible(true);

        this.layoutMethod = layout.getClass().getDeclaredMethod("layout", Composite.class, boolean.class);
        this.layoutMethod.setAccessible(true);

    }
    catch (final Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:23,代碼來源:LayoutWrapper.java

示例15: createControl

import org.eclipse.swt.layout.FormLayout; //導入依賴的package包/類
/**
 * Create contents of the wizard.
 *
 * @param parent
 *            The parent ui element to place this one into.
 */
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    container.setLayout(new FormLayout());
    setControl(container);

    Group resultPresentationGrp = createResultPresentationGroup(container);

    ruleConfigurationGroup = new Group(container, SWT.NONE);
    ruleConfigurationGroup.setText("Refinement Detection");
    ruleConfigurationGroup.setLayout(new FormLayout());
    FormData ruleConfigGroupFD = createFormDataMargin(resultPresentationGrp);
    ruleConfigurationGroup.setLayoutData(ruleConfigGroupFD);

    generateRuleComponents(ruleConfigurationGroup);

    ruleConfigGroupFD.height = ruleConfigurationGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;

    boolean isRefinementBrowser = (this.resultPresentation == ResultPresentation.REFINEMENT_BROWSER);
    enableRulesDetection(isRefinementBrowser);
}
 
開發者ID:kopl,項目名稱:SPLevo,代碼行數:27,代碼來源:ResultHandlingConfigurationPage.java


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