本文整理匯總了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;
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}