Java 类org.eclipse.swt.layout.FormLayout 实例源码

项目:eZooKeeper    文件:InfoBar.java   
/**
 * 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);
}
项目:bdf2    文件:PropertySectionTransitionLabel.java   
@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);
}
项目:peten    文件:TagListCombinedWidget.java   
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);
}
项目:team-explorer-everywhere    文件:SelectMergeTargetMappingWizardPage.java   
@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);
}
项目:team-explorer-everywhere    文件:SelectMergeSourceTargetWizardPage.java   
/**
 * 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);
}
项目:team-explorer-everywhere    文件:SizeConstrainedComposite.java   
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);
}
项目:team-explorer-everywhere    文件:SWTUtil.java   
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;
}
项目:TuxGuitar-1.3.1-fork    文件:TGSettingsEditor.java   
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));
    }
}
项目:pentaho-cpython-plugin    文件:CPythonScriptExecutorDialog.java   
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
}
项目:pentaho-cpython-plugin    文件:CPythonScriptExecutorDialog.java   
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();
}
项目:AndroidRobot    文件:LogAnalysis.java   
/**
 * 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();
        }
    }

}
项目:SPELL    文件:SplitPanel.java   
/***************************************************************************
 * 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);
}
项目:CooperateModelingEnvironment    文件:DiffView.java   
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());

    }
项目:jo-widgets    文件:LayoutWrapper.java   
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);
    }
}
项目:SPLevo    文件:ResultHandlingConfigurationPage.java   
/**
 * 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);
}
项目:pdi-platform-utils-plugin    文件:Tab.java   
public Tab( CTabFolder tabFolder, String label, PropsUI props ) {
  super( tabFolder, SWT.NONE );

  FormLayout formLayout = new FormLayout();
  formLayout.marginLeft = BAServerCommonDialog.MEDIUM_MARGIN;
  formLayout.marginRight = BAServerCommonDialog.MEDIUM_MARGIN;
  formLayout.marginTop = BAServerCommonDialog.LARGE_MARGIN;
  formLayout.marginBottom = BAServerCommonDialog.LARGE_MARGIN;
  setLayout( formLayout );

  props.setLook( this );

  CTabItem tabItem = new CTabItem( tabFolder, SWT.NONE );
  tabItem.setText( label );
  tabItem.setControl( this );
}
项目:Flashtool    文件:About.java   
/**
 * Create contents of the dialog.
 */
private void createContents() {
    shlAbout = new Shell(getParent(), getStyle());
    shlAbout.setSize(426, 252);
    shlAbout.setText("About");
    shlAbout.setLayout(new FormLayout());

    Button btnNewButton = new Button(shlAbout, SWT.NONE);
    btnNewButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            shlAbout.dispose();
        }
    });
    FormData fd_btnNewButton = new FormData();
    fd_btnNewButton.bottom = new FormAttachment(100, -10);
    fd_btnNewButton.right = new FormAttachment(100, -10);
    btnNewButton.setLayoutData(fd_btnNewButton);
    btnNewButton.setText("Close");
}
项目:Environment    文件:CloudProviderListComposite.java   
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public CloudProviderListComposite(Composite parent, int style) {
    super(parent, style);
    setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
    setLayout(new FormLayout());

    tableViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
    table = tableViewer.getTable();
    FormData fd_table = new FormData();
    fd_table.bottom = new FormAttachment(100, -10);
    fd_table.top = new FormAttachment(0, 10);
    fd_table.right = new FormAttachment(100, -10);
    fd_table.left = new FormAttachment(0, 10);
    table.setLayoutData(fd_table);

    // Should not be called -- the call is auto-generated
    if (overview != null) m_bindingContext = initDataBindings();
}
项目:andes    文件:MBeanView.java   
public void createPartControl(Composite parent)
{
    // Create the Form
    _toolkit = new FormToolkit(parent.getDisplay());
    _form = _toolkit.createForm(parent);
    _form.getBody().setLayout(new FormLayout());
    _form.setText(APPLICATION_NAME);

    // Add selection listener for selection events in the Navigation view
    getSite().getPage().addSelectionListener(NavigationView.ID, _selectionListener); 

    createNotificationsTabFolder();

    ViewUtility.setMBeanView(this);

    _backAction = new BackAction();
    getViewSite().getActionBars().getToolBarManager().add(_backAction);
    _backAction.setEnabled(false);
    _backHistory = new LinkedList<Object>();
}
项目:birt    文件:ThumbnailBuilder.java   
private void createPreviewArea( Composite composite )
{
    Composite previewArea = new Composite( composite, SWT.BORDER );
    GridData gd = new GridData( GridData.BEGINNING );
    gd.widthHint = 184;
    gd.heightHint = 229;
    previewArea.setLayoutData( gd );
    previewArea.setLayout( new FormLayout( ) );

    previewCanvas = new ImageCanvas( previewArea );

    FormData formData = new FormData( 180, 229 );
    formData.left = new FormAttachment( previewArea );
    formData.top = new FormAttachment( previewArea );

    previewCanvas.setLayoutData( formData );
}
项目:eZooKeeper    文件:DataModelFormPage.java   
protected Layout createClientLayout() {
    FormLayout clientLayout = new FormLayout();
    clientLayout.marginWidth = 8;
    clientLayout.marginHeight = 8;
    clientLayout.spacing = 8;
    return clientLayout;
}
项目:eZooKeeper    文件:DataModelFormPage.java   
protected Composite createSectionClient(Section section, FormToolkit toolkit) {

        Composite sectionClient = toolkit.createComposite(section);
        FormLayout sectionClientLayout = new FormLayout();
        sectionClientLayout.marginWidth = 8;
        sectionClientLayout.marginHeight = 2;
        sectionClientLayout.spacing = 8;
        sectionClient.setLayout(sectionClientLayout);

        section.setClient(sectionClient);
        return sectionClient;
    }
项目:eZooKeeper    文件:BaseZnodeModelDataEditor.java   
protected Layout createLayout() {
    FormLayout formLayout = new FormLayout();
    formLayout.marginHeight = 8;
    formLayout.marginWidth = 8;
    formLayout.spacing = 8;       
    return formLayout;
}
项目:eZooKeeper    文件:BaseZnodeModelFormPage.java   
@Override
protected void contributeToToolBar(IToolBarManager toolBarManager) {
    super.contributeToToolBar(toolBarManager);

    ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) {

        @Override
        protected Control createControl(Composite parent) {

            FormToolkit toolkit = getManagedForm().getToolkit();
            Composite toolBarComposite = toolkit.createComposite(parent);
            FormLayout toolBarCompositeLayout = new FormLayout();
            toolBarCompositeLayout.marginTop = 0;
            toolBarCompositeLayout.marginBottom = 0;
            toolBarCompositeLayout.marginLeft = 4;
            toolBarCompositeLayout.marginRight = 4;
            toolBarCompositeLayout.spacing = 4;
            toolBarComposite.setLayout(toolBarCompositeLayout);

            _ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT);

            FormData toolBarLabelFormData = new FormData();
            toolBarLabelFormData.top = new FormAttachment(0, 0);
            toolBarLabelFormData.left = new FormAttachment(0, 0);
            toolBarLabelFormData.right = new FormAttachment(100, 0);

            // HACK: I really struggled to get this label to show up.
            toolBarLabelFormData.width = 100;

            _ToolBarLabel.setLayoutData(toolBarLabelFormData);

            return toolBarComposite;
        }
    };

    toolBarManager.add(toolBarCompositeContribution);

}
项目:eZooKeeper    文件:ZnodeModelDataFormPage.java   
@Override
protected Layout createClientLayout() {
    FormLayout clientLayout = (FormLayout) super.createClientLayout();
    clientLayout.spacing = 10;
    clientLayout.marginBottom = 10;
    return clientLayout;
}
项目:gw4e.project    文件:EdgeJavaScriptSection.java   
protected void fillComposite (Composite composite) {
    composite.setLayout(new FormLayout());

    viewer = createViewer(composite);
    Control control = viewer.getControl();
    control.setEnabled(false);

    FormData fd_javaScript = new FormData();
    fd_javaScript.left = new FormAttachment(0, 10);
    fd_javaScript.right = new FormAttachment(100, -5);
    fd_javaScript.top = new FormAttachment(0, 10);
        setHeight (fd_javaScript, control, 10);
    control.setLayoutData(fd_javaScript);
}
项目:gw4e.project    文件:VertexInitSection.java   
protected void fillComposite (Composite composite) {
    composite.setLayout(new FormLayout());

    viewer = ViewerHelper.createEditor(composite);  

    viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT);
    FocusListener listener = new FocusListener() {
        @Override
        public void focusGained(FocusEvent e) {
        }

        @Override
        public void focusLost(FocusEvent event) {
            if (!notification) return;
            GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class);
            if (viewer.getDocument() == null) return;
            String content  = viewer.getDocument().get();
            properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content);
        }
    };
    viewer.getControl().addFocusListener(listener);

    Control control = viewer.getControl();
    control.setEnabled(false);

    FormData fd_javaScript = new FormData();
    fd_javaScript.left = new FormAttachment(0, 10);
    fd_javaScript.right = new FormAttachment(100, -5);
    fd_javaScript.top = new FormAttachment(0, 10);
        setHeight (fd_javaScript, control, 10);
    control.setLayoutData(fd_javaScript);
}
项目:com.onpositive.prefeditor    文件:ViewerPage.java   
protected void createViewer() {
    FormLayout formLayout = new FormLayout();
    setLayout(formLayout);
    Composite con = new Composite(this, SWT.NONE);
    FormData topData = new FormData();
    topData.left = new FormAttachment(0,0);
    topData.right = new FormAttachment(100,0);
    topData.top = new FormAttachment(0,0);
    con.setLayoutData(topData);

    con.setLayout(new GridLayout(3,false));
    createTopArea(con);

    viewer = new TreeViewer(this, SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
       contentProvider = new PrefsContentProvider();
    viewer.setContentProvider(contentProvider);
       viewer.getTree().setHeaderVisible(true);
       viewer.getTree().setLinesVisible(true);
       FormData viewerData = new FormData();
       viewerData.top = new FormAttachment(con, 5);
       viewerData.bottom = new FormAttachment(100,0);
       viewerData.left = new FormAttachment(0,0);
       viewerData.right = new FormAttachment(100,0);
       viewer.getTree().setLayoutData(viewerData);
       viewerFilter = new PreferenceFilter();
    viewer.addFilter(viewerFilter);
    filterJob = new SetFilterJob(viewer, viewerFilter);
}
项目:Tarski    文件:ModelWriterPreferencePage.java   
/**
 * Create contents of the preference page.
 *
 * @param parent
 */
@Override
public Control createContents(Composite parent) {
  Composite container = new Composite(parent, SWT.NULL);
  container.setLayout(new FormLayout());

  return container;
}
项目:BiglyBT    文件:SideBar.java   
private void addSideBarView(UISWTViewImpl view, Composite cPluginsArea) {
    Composite parent = new Composite(cPluginsArea, SWT.NONE);
    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = SWT.FILL;
    parent.setLayoutData(gridData);
    parent.setLayout(new FormLayout());
    //parent.setBackground(ColorCache.getRandomColor());
    //cPluginsArea.setBackground(ColorCache.getRandomColor());

    view.initialize(parent);
    parent.setVisible(true);

    Control[] children = parent.getChildren();
    for (int i = 0; i < children.length; i++) {
        Control control = children[i];
        Object ld = control.getLayoutData();
        boolean useGridLayout = ld != null && (ld instanceof GridData);
        if (useGridLayout) {
            GridLayout gridLayout = new GridLayout();
            gridLayout.horizontalSpacing = 0;
            gridLayout.marginHeight = 0;
            gridLayout.marginWidth = 0;
            gridLayout.verticalSpacing = 0;
            parent.setLayout(gridLayout);
            break;
        } else if (ld == null) {
            control.setLayoutData(Utils.getFilledFormData());
        }
    }

    pluginViews.add(view);
}
项目:BiglyBT    文件:SWTSkinObjectBrowser.java   
/**
 * @param skin
 * @param properties
 * @param sID
 * @param sConfigID
 * @param parent
 */
public SWTSkinObjectBrowser(SWTSkin skin, SWTSkinProperties properties,
        String sID, String sConfigID, SWTSkinObject parent) {
    super(skin, properties, sID, sConfigID, "browser", parent);

    cParent = parent == null ? skin.getShell()
            : (Composite) parent.getControl();

    cArea = cParent;
    cArea = new Canvas(cParent, SWT.NO_BACKGROUND);
    cArea.setLayout(new FormLayout());

    setControl(cArea);

    if (cParent.isVisible()) {
        init();
    } else {
        addListener(new SWTSkinObjectListener() {
            @Override
            public Object eventOccured(SWTSkinObject skinObject, int eventType,
                                       Object params) {
                if (eventType == EVENT_SHOW) {
                    removeListener(this);
                    init();
                }
                return null;
            }
        });
    }
}
项目:BiglyBT    文件:DeviceManagerUI.java   
public void
initialize(
    Composite parent_composite )
{
    composite = new Composite( parent_composite, SWT.NULL );

    FormLayout layout = new FormLayout();

    layout.marginTop    = 4;
    layout.marginLeft   = 4;
    layout.marginRight  = 4;
    layout.marginBottom = 4;

    composite.setLayout( layout );

    FormData data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.top = new FormAttachment(composite,0);
    data.bottom = new FormAttachment(100,0);


    Label label = new Label( composite, SWT.NULL );

    label.setText( "Nothing to show for " + getTitle());

    label.setLayoutData( data );
}
项目:bdf2    文件:ModelFilePage.java   
public void createControl(Composite parent) {
    composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new FormLayout());

    Label label = setCreationMethod();
    createNewModelFile(parent, label);
    selectExistingModelFile(label);
}
项目:sdmx-kettle    文件:SdmxStepDialog.java   
private void addSettingTab() {
  // ////////////////////////
  // START OF SETTING TAB ///
  // ////////////////////////

  wSettingTab = new CTabItem( wTabFolder, SWT.NONE );
  wSettingTab.setText( BaseMessages.getString( PKG, "SdmxDialog.SettingTab.TabTitle" ) );

  wSettingsSComp = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
  wSettingsSComp.setLayout( new FillLayout() );

  wSettingComp = new Composite( wSettingsSComp, SWT.NONE );
  props.setLook(wSettingComp);

  FormLayout settingLayout = new FormLayout();
  settingLayout.marginWidth = 3;
  settingLayout.marginHeight = 3;

  wSettingComp.setLayout( settingLayout );

  addProviderLabel();
  addProviderCombo();

  addFlowLabel();
  addFlowTextInput();
  addFlowBrowsingButton();

  addDimensionTableView();
  addDimensionButton();

  addCodeListTableView();
  addCodeButton();

  addViewTimeSeriesButton();

  wSettingComp.pack();
  Rectangle bounds = wSettingComp.getBounds();

  wSettingsSComp.setContent( wSettingComp );
  wSettingsSComp.setExpandHorizontal( true );
  wSettingsSComp.setExpandVertical( true );
  wSettingsSComp.setMinWidth( bounds.width );
  wSettingsSComp.setMinHeight( bounds.height );

  fdSettingComp = new FormData();
  fdSettingComp.left = new FormAttachment( 0, 0 );
  fdSettingComp.top = new FormAttachment( 0, 0 );
  fdSettingComp.right = new FormAttachment( 100, 0 );
  fdSettingComp.bottom = new FormAttachment( 100, 0 );
  wSettingComp.setLayoutData( fdSettingComp );

  wSettingTab.setControl( wSettingsSComp );
}
项目:sdmx-kettle    文件:PreviewTimeSeriesDialog.java   
public void open() {

    shell = new Shell( parentShell, style );
    props.setLook( shell );
    shell.setImage( GUIResource.getInstance().getImageSpoon() );

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;

    if ( title == null ) {
      title = BaseMessages.getString( PKG, "Sdmx.PreviewTimeSeriesDialog.Title" ) + " " + timeSeries.size();
    }
    if ( message == null ) {
      message = BaseMessages.getString( PKG, "Sdmx.PreviewTimeSeriesDialog.Header" );
    }

    shell.setLayout( formLayout );
    shell.setText( title );

    addTableView();

    shell.open();
    while (!shell.isDisposed()) {
      if (!shell.getDisplay().readAndDispatch())
        shell.getDisplay().sleep();
    }
  }
项目:team-explorer-everywhere    文件:SelectMergeVersionWizardPage.java   
/**
 * 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.marginHeight = FormHelper.MarginHeight();
    formLayout.marginWidth = FormHelper.MarginWidth();
    formLayout.spacing = FormHelper.Spacing();
    container.setLayout(formLayout);

    setControl(container);

    final Label specifyTheVersionLabel = new Label(container, SWT.WRAP);
    final FormData specifyTheVersionLabelData = new FormData();
    specifyTheVersionLabelData.top = new FormAttachment(0, 0);
    specifyTheVersionLabelData.left = new FormAttachment(0, 0);
    specifyTheVersionLabel.setLayoutData(specifyTheVersionLabelData);
    specifyTheVersionLabel.setText(Messages.getString("SelectMergeVersionWizardPage.ExplainMergeProcess")); //$NON-NLS-1$
    ControlSize.setCharWidthHint(specifyTheVersionLabel, MergeWizard.TEXT_CHARACTER_WIDTH);

    version = new VersionPickerControl(container, SWT.NONE);
    version.setRepository(((MergeWizard) getWizard()).getRepository());
    version.setText(Messages.getString("SelectMergeVersionWizardPage.VersionTypeLabelText")); //$NON-NLS-1$

    final FormData versionData = new FormData();
    versionData.top = new FormAttachment(specifyTheVersionLabel, FormHelper.ControlSpacing(), SWT.BOTTOM);
    versionData.left = new FormAttachment(0, 0);
    versionData.right = new FormAttachment(100, 0);
    version.setLayoutData(versionData);
}
项目:team-explorer-everywhere    文件:MergeEndPage.java   
/**
 * 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.marginHeight = FormHelper.MarginHeight();
    formLayout.marginWidth = FormHelper.MarginWidth();
    container.setLayout(formLayout);

    setControl(container);

    final Label label = new Label(container, SWT.WRAP);
    final FormData labelData = new FormData();
    labelData.top = new FormAttachment(0, 0);
    labelData.left = new FormAttachment(0, 0);
    label.setLayoutData(labelData);
    label.setText(Messages.getString("MergeEndPage.StatusLabelText")); //$NON-NLS-1$
    ControlSize.setCharWidthHint(label, MergeWizard.TEXT_CHARACTER_WIDTH);

    final Label label2 = new Label(container, SWT.WRAP);
    final FormData label2Data = new FormData();
    label2Data.top = new FormAttachment(label, 10, SWT.BOTTOM);
    label2Data.left = new FormAttachment(0, 0);
    label2.setLayoutData(label2Data);
    label2.setText(Messages.getString("MergeEndPage.ExplainMergeProcess")); //$NON-NLS-1$
    ControlSize.setCharWidthHint(label2, MergeWizard.TEXT_CHARACTER_WIDTH);

    final Label label3 = new Label(container, SWT.WRAP);
    final FormData label3Data = new FormData();
    label3Data.top = new FormAttachment(label2, 10, SWT.BOTTOM);
    label3Data.left = new FormAttachment(0, 0);
    label3.setLayoutData(label3Data);
    label3.setText(Messages.getString("MergeEndPage.InformConflictResolution")); //$NON-NLS-1$
}
项目:TuxGuitar-1.3.1-fork    文件:TGFretBoard.java   
public TGFretBoard(TGContext context, Composite parent) {
    super(parent, SWT.NONE);
    this.context = context;
    this.config = new TGFretBoardConfig();
    this.config.load();
    this.setLayout(new FormLayout());
    this.initToolBar();
    this.initEditor();
    this.loadIcons();
    this.loadProperties();

    TuxGuitar.getInstance().getKeyBindingManager().appendListenersTo(this.toolComposite);
    TuxGuitar.getInstance().getKeyBindingManager().appendListenersTo(this.fretBoardComposite);
}
项目:Black    文件:writingView.java   
/**
 * Create contents of the shell.
 */
protected void createContents() {
    String name = b.ba.getShowNameByRealName(b.getCurrentEditFile().getName());
    if(b.fileIsSave == 0)
        setText(name+"* - д����ͼ");
    else setText(name+" - д����ͼ");
    setLayout(new FormLayout());
}
项目:ether    文件:Splash.java   
public Splash(Display display, Rectangle displayRect, boolean showProgress)  {
    image = new Image(display, getClass().getResourceAsStream("/splash.png"));
    shell = new Shell(SWT.ON_TOP);
    progressUI    = new ProgressBar(shell, SWT.NONE);
    progressUI.setMaximum(100);

    Label label = new Label(shell, SWT.NONE);
    label.setImage(image);

    FormLayout layout = new FormLayout();
    shell.setLayout(layout);

    FormData labelData = new FormData();
    labelData.right = new FormAttachment(100, 0);
    labelData.bottom = new FormAttachment(100, 0);
    label.setLayoutData(labelData);

    FormData progressData = new FormData();
    progressData.left = new FormAttachment(0, -5);
    progressData.right = new FormAttachment(100, 0);
    progressData.bottom = new FormAttachment(100, 0);
    progressUI.setLayoutData(progressData);
    progressUI.setVisible(showProgress);
    shell.pack();

    Rectangle splashRect = shell.getBounds();

    progressUI.setBounds(2, splashRect.height-14, splashRect.width-6, 10);

    int x = displayRect.x + (displayRect.width - splashRect.width) / 2;
    int y = displayRect.y + (displayRect.height - splashRect.height) / 2;
    shell.setLocation(x, y);

    shell.open();       
    setProgress(0);
}