当前位置: 首页>>代码示例>>Java>>正文


Java Composite.getLayout方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Composite.getLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Composite.getLayout方法的具体用法?Java Composite.getLayout怎么用?Java Composite.getLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Composite的用法示例。


在下文中一共展示了Composite.getLayout方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDialogArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected final Control createDialogArea(Composite parent) {

    int fullHorizontalSpan = ((GridLayout) parent.getLayout()).numColumns;

    Label topSeparator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
    topSeparator.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, fullHorizontalSpan, 1));

    _GridComposite = createGridComposite(parent);
    _GridComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, fullHorizontalSpan, 1));
    _GridComposite.init();

    Label bottomSeparator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
    bottomSeparator.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, fullHorizontalSpan, 1));

    return _GridComposite;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:18,代码来源:GridDialog.java

示例2: createDialogArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 2;

  Label usernameLabel = new Label( comp, SWT.RIGHT );
  usernameLabel.setText( "Username: " );
  usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  Label passwordLabel = new Label( comp, SWT.RIGHT );
  passwordLabel.setText( "Password: " );
  passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD );
  passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  return comp;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:20,代码来源:UsernamePasswordDialog.java

示例3: getZnodeData

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 * TODO: Comment.
 * 
 * @return
 */
private byte[] getZnodeData() throws Exception {
    Composite dataStackComposite = (Composite) getControl(CONTROL_NAME_DATA_STACK_COMPOSITE);
    ZnodeDataGridComposite znodeDataGridComposite = (ZnodeDataGridComposite) ((StackLayout) dataStackComposite
            .getLayout()).topControl;
    return znodeDataGridComposite.getZnodeData();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:12,代码来源:ZnodeNewWizardComposite1.java

示例4: widgetSelected

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
    Control composite = getControl(_DataCompositeName);
    Composite dataStackComposite = (Composite) getControl(CONTROL_NAME_DATA_STACK_COMPOSITE);
    ((StackLayout) dataStackComposite.getLayout()).topControl = composite;
    dataStackComposite.layout();
    modified(composite);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:9,代码来源:ZnodeNewWizardComposite1.java

示例5: createExtensions

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
private void createExtensions ( final List<ExtensionDescriptor> extensions, final Composite composite, final String location, final boolean horizontal ) throws CoreException
{
    int count = 0;
    for ( final ExtensionDescriptor extension : extensions )
    {
        if ( !location.equals ( extension.getLocation () ) )
        {
            continue;
        }

        final ViewerExtension viewerExtension = extension.createExtension ();
        if ( viewerExtension != null )
        {
            final Control result = viewerExtension.create ( composite, this, horizontal );
            if ( result != null )
            {
                count++;
                final String align = extension.getAlign ();
                if ( "END".equalsIgnoreCase ( align ) )
                {
                    result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.END, SWT.FILL, !horizontal, horizontal ) );
                }
                else if ( "FILL".equalsIgnoreCase ( align ) )
                {
                    result.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
                }
                else
                {
                    result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.BEGINNING, SWT.FILL, !horizontal, horizontal ) );
                }
            }
        }
    }
    if ( composite.getLayout () instanceof GridLayout )
    {
        ( (GridLayout)composite.getLayout () ).numColumns = count;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:39,代码来源:SingleVisualInterfaceViewPart.java

示例6: removeMargins

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 *
 * @param area
 */
public static void removeMargins(Composite area) {
	final GridLayout layout = (GridLayout)area.getLayout();
	if (layout==null) return;
	layout.horizontalSpacing=0;
	layout.verticalSpacing  =0;
	layout.marginBottom     =0;
	layout.marginTop        =0;
	layout.marginLeft       =0;
	layout.marginRight      =0;
	layout.marginHeight     =0;
	layout.marginWidth      =0;

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:18,代码来源:MarginUtils.java

示例7: createDialogArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	
	getShell().setText("Credentials Required");
	
	Composite container = (Composite) super.createDialogArea(parent);
	container.getLayout();

	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayout(new GridLayout(4, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	
	Label lblUserName = new Label(composite, SWT.NONE);
	lblUserName.setText("User Name");
	new Label(composite, SWT.NONE);
	
	username = new Text(composite, SWT.BORDER);
	username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	new Label(composite, SWT.NONE);
	
	Label lblPassword = new Label(composite, SWT.NONE);
	lblPassword.setText("Password");
	new Label(composite, SWT.NONE);
	
	password = new Text(composite, SWT.PASSWORD|SWT.BORDER);
	password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	createErrorComposite(container);

	return container;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:42,代码来源:HiveInputExtractMetaStoreDialog.java

示例8: createButtonsForButtonBar

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
	// The button manager will handle the correct sizing of the buttons.
	// We do not want columns equal width because we are going to add some
	// padding in the final column (close button).
	GridLayout layout = (GridLayout) parent.getLayout();
	layout.makeColumnsEqualWidth = false;
	buttonManager = new ButtonManager(parent);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:HydrographInstallationDialog.java

示例9: createDialogArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 3;

  Label nameLabel = new Label( comp, SWT.RIGHT );
  nameLabel.setText( "Name: " );
  nameLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  nameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  nameText.setText( Const.NVL( repo.getName(), "" ) );
  nameText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );

  Label descLabel = new Label( comp, SWT.RIGHT );
  descLabel.setText( "Description: " );
  descLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  descText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  descText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  descText.setText( Const.NVL( repo.getDescription(), "" ) );

  Label directoryLabel = new Label( comp, SWT.RIGHT );
  directoryLabel.setText( "Directory: " );
  directoryLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  directoryText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  directoryText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false ) );
  directoryText.setText( Const.NVL( repo.getDirectory(), "" ) );

  Button directoryButton = new Button( comp, SWT.PUSH );
  directoryButton.setText( "Browse" );
  directoryButton.addSelectionListener( new SelectionAdapter() {
    @Override
    public void widgetSelected( SelectionEvent e ) {
      DirectoryDialog dialog = new DirectoryDialog( getShell(), SWT.OPEN );
      if ( dialog.open() != null ) {
        directoryText.setText( dialog.getFilterPath() );
      }
    }
  } );

  Label typeLabel = new Label( comp, SWT.RIGHT );
  typeLabel.setText( "Type: " );
  typeLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  typeCombo = new Combo( comp, SWT.READ_ONLY );
  typeCombo.setItems( IVCS.GIT, IVCS.SVN );
  if ( repo.getType() != null ) {
    if ( repo.getType().equals( IVCS.GIT ) ) {
      typeCombo.select( 0 );
    } else {
      typeCombo.select( 1 );
    }
  }
  typeCombo.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  return comp;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:56,代码来源:EditRepositoryDialog.java


注:本文中的org.eclipse.swt.widgets.Composite.getLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。