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


Java Label.setLayoutData方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Label.setLayoutData方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setLayoutData方法的具體用法?Java Label.setLayoutData怎麽用?Java Label.setLayoutData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Label的用法示例。


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

示例1: CustomElementSelectionForm

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * Create the composite.
 */
public CustomElementSelectionForm(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(2, false));

	treeViewer = new TreeViewer(this, SWT.BORDER);
	Tree tree = getTreeViewer().getTree();

	// Set a minimum height to prevent weird dialog dimensions
	tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());

	elementLabel = new Label(this, SWT.NONE);
	elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
	elementLabel.setText("New Label");

	elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
	elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:CustomElementSelectionForm.java

示例2: createComposite

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * This method initializes composite
 * 
 */
private void createComposite() {
	GridData gridData7 = new org.eclipse.swt.layout.GridData();
	gridData7.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData7.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
	GridData gridData4 = new org.eclipse.swt.layout.GridData();
	gridData4.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData4.grabExcessHorizontalSpace = false;
	gridData4.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
	GridLayout gridLayout4 = new GridLayout();
	gridLayout4.numColumns = 2;
	compositeOutputFooter = new Composite(compositeOutput, SWT.NONE);
	compositeOutputFooter.setBackground(new Color(Display.getCurrent(), 162, 194, 250));
	compositeOutputFooter.setLayout(gridLayout4);
	compositeOutputFooter.setLayoutData(gridData4);
	label1 = new Label(compositeOutputFooter, SWT.NONE);
	label1.setBackground(new Color(Display.getCurrent(), 162, 194, 250));
	label1.setText("Last detected screen class:");
	label1.setToolTipText("Displays the current screen class name");

	labelLastDetectedScreenClass = new Label(compositeOutputFooter, SWT.NONE);
	labelLastDetectedScreenClass.setBackground(new Color(Display.getCurrent(), 162, 194, 250));
	labelLastDetectedScreenClass.setText("(unknown)");
	labelLastDetectedScreenClass.setLayoutData(gridData7);
	labelLastDetectedScreenClass.setToolTipText("Displays the current screen class name");
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:30,代碼來源:ConnectorEditorPart.java

示例3: createToolBarManagerWithTitle

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
protected void createToolBarManagerWithTitle(Composite parent, ToolBarConfiguration toolBarConfiguration, String toolBarId) {
	
	Composite compo = new Composite(composite, SWT.NONE);
	GridLayout layout = new GridLayout(3, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;
	compo.setLayout(layout);
	compo.setLayoutData(new  GridData(GridData.FILL_HORIZONTAL));
	
	Label imageLabel = new Label(compo, SWT.NONE);
	imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
	imageLabel.setImage(AvroSchemaEditorActivator.getNoneImage());
	toolBarImageLabels.put(toolBarId, imageLabel);
	
	Label titleLabel = new Label(compo, SWT.NONE);
	titleLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	toolBarTextLabels.put(toolBarId, titleLabel);
	
	createToolBarManager(compo, toolBarConfiguration, toolBarId);
}
 
開發者ID:Talend,項目名稱:avro-schema-editor,代碼行數:22,代碼來源:SchemaViewer.java

示例4: createEmptyPanel

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * Creates just an empty panel with a message indicating there are no reports to display
 */
private void createEmptyPanel() {
	Composite emptyPanel = new Composite(scrollChild, SWT.BORDER);
	GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
	gData.heightHint = 100;
	emptyPanel.setLayoutData(gData);
	emptyPanel.setLayout(new GridLayout());
	Label nothingToDisplay = new Label(emptyPanel, SWT.NONE);
	nothingToDisplay.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	nothingToDisplay.setText(MessageText.getString("Progress.reporting.no.reports.to.display"));

	/*
	 * Mark this as being opened and is showing the empty panel
	 */
	isShowingEmpty = true;

}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:20,代碼來源:ProgressReporterWindow.java

示例5: addErrorLabel

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * 	
 * @param container
 */
private void addErrorLabel(Composite container) {
		
	lblPropertyError = new Label(container, SWT.NONE);
	lblPropertyError.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true,0,0));
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
	lblPropertyError.setText(Messages.HIVE_FIELD_DIALOG_ERROR);
	lblPropertyError.setVisible(false);
	lblPropertyError.setData("Error", lblPropertyError);
	keyValueTableViewer.setData("Error", lblPropertyError);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:15,代碼來源:HivePartitionKeyValueDialog.java

示例6: createTitleComposite

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private void createTitleComposite(Composite mainComposite) {
	Composite titleComposite = new Composite(mainComposite, SWT.NONE);
	titleComposite.setLayout(new GridLayout(1, false));
	titleComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	Label title = new Label(titleComposite, SWT.NONE);
	title.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	title.setText(Messages.JDK_PATH_DIALOG_MESSAGE);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:10,代碼來源:JdkPathDialog.java

示例7: InterfacesComponent

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * Creates a new interfaces component inside the parent composite using the given model.
 *
 * @param interfacesContainingModel
 *            A interface containing model
 * @param container
 *            The component container
 */
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
		WizardComponentContainer container) {
	super(container);
	this.model = interfacesContainingModel;

	Composite parent = getParentComposite();

	Label interfacesLabel = new Label(parent, SWT.NONE);

	GridData interfacesLabelGridData = fillLabelDefaults();
	interfacesLabelGridData.verticalAlignment = SWT.TOP;
	interfacesLabel.setLayoutData(interfacesLabelGridData);

	interfacesLabel.setText("Interfaces:");

	interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
	interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
	interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());

	interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());

	interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
	interfacesAddButton.setText("Add...");
	interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

	interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
	interfacesRemoveButton.setText("Remove");
	interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

	setupBindings();
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:42,代碼來源:InterfacesComponentProvider.java

示例8: createStatsView

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private GridComposite createStatsView(GridComposite parent) {
    GridComposite c = null;
    if (true) {
        c = new GridComposite(parent, SWT.BORDER_DOT);

        c.initLayout(2, false, GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
        c.noMargins();


        c.getGridData().horizontalIndent = 0;
        c.getGridData().verticalIndent = 0;
        // c.debugLayout(SWT.COLOR_BLUE);

    } else {
        c = parent;
    }

    for (BookElement s : elems) {


        String labelName = getName(s);
        Label l = c.newLabel();
        l.setText(Translate.getInstance().labelName(labelName) + ": ");
        l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
        l.setFont(FontShop.tableFontBold());
        l.setBackground(bgColor);

        Label d = c.newLabel();
        d.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        d.setFont(FontShop.tableFont());
        d.setBackground(bgColor);
        d.setData(s);
        stats[s.ordinal()] = d;
    }
    return c;
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:37,代碼來源:BookInfoPanel.java

示例9: initialize

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * This method initializes this
 * 
 */
private void initialize() {
       GridData gridData2 = new org.eclipse.swt.layout.GridData();
       gridData2.horizontalSpan = 3;
       label1 = new Label(this, SWT.NONE);
       label1.setText("Please choose what kind of screen class you would like to create\nbased one detected one");
       label1.setLayoutData(gridData2);
       GridData gridData1 = new org.eclipse.swt.layout.GridData();
       gridData1.grabExcessHorizontalSpace = true;
       gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
       GridData gridData = new org.eclipse.swt.layout.GridData();
       gridData.grabExcessHorizontalSpace = false;
       gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
       gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData.grabExcessVerticalSpace = false;
       createGroup();
       label = new Label(this, SWT.NONE);
       label.setText("Give a screen class name");
       label.setLayoutData(gridData);
       screenClassName = new Text(this, SWT.BORDER);
       screenClassName.setLayoutData(gridData1);
       screenClassName.addModifyListener(modifyListener);
       GridLayout gridLayout = new GridLayout();
       gridLayout.numColumns = 1;
       this.setLayout(gridLayout);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:31,代碼來源:LearnScreenClassWizardComposite2.java

示例10: createLabel

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * Label creation helper method
 * @param parent
 * @param text
 * @return
 */
protected Label createLabel(Composite parent, String text) {
	Label label = new Label(parent, SWT.LEFT);
	label.setText(text);
	GridData data = new GridData();
	data.horizontalAlignment = GridData.FILL;
	label.setLayoutData(data);
	return label;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:15,代碼來源:GraphModelPropertyPage.java

示例11: createContent

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@Override
public void createContent ( final Composite parent )
{
    parent.setLayout ( new GridLayout ( 1, false ) );

    final Label label = new Label ( parent, SWT.NONE );
    label.setText ( System.getProperty ( Properties.MAIN_PAGE_TEXT, "Administration Console" ) );
    label.setData ( RWT.CUSTOM_VARIANT, "mainLabel" );

    final GridData gd = new GridData ( SWT.CENTER, SWT.BEGINNING, true, true );
    gd.verticalIndent = 20;
    label.setLayoutData ( gd );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:14,代碼來源:MainPage.java

示例12: createXPath

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private void createXPath(Composite parent) {
       GridData gridData = new GridData();
       gridData.horizontalSpan = numColumns;
       gridData.horizontalAlignment = GridData.FILL;
	
	Label label = new Label(parent, SWT.NULL);
	label.setLayoutData(gridData);
	label.setText("&XPath : " + xpath);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:10,代碼來源:XMLTableWizardPage.java

示例13: attachAddRowButton

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
private void attachAddRowButton(Composite composite) {
	Label btnAdd = new Label(composite, SWT.NONE);
	GridData gd_btnAdd = getGridControlButtonLayout();
	btnAdd.setLayoutData(gd_btnAdd);
	btnAdd.setText("");
	btnAdd.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
	
	attachAddRowButtonListener(btnAdd);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:10,代碼來源:ParameterGridDialog.java

示例14: createControl

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public void createControl(Composite parent) {		
	container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout(1, true));
	
	Label label = new Label(container, SWT.WRAP);
	label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
	label.setText("A new Convertigo workspace will be created in:\n\n" +
			"\t'" + Engine.PROJECTS_PATH + "'\n\n" +
			"This action will be completed when this wizard finishes.");
	
	setControl(container);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:13,代碼來源:WorkspaceCreationPage.java

示例15: createControl

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
	super.createControl(parent);
	Composite control = (Composite) getControl();

	Composite extensionGroup = new Composite(control, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	extensionGroup.setLayout(layout);
	extensionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Label refOccieLabel = new Label(extensionGroup, SWT.NONE);
	refOccieLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
	refOccieLabel.setText(Messages.NewConnectorWizard_RefExtensionLabel);
	refOccieLabel.setFont(parent.getFont());

	Composite composite = new Composite(extensionGroup, SWT.NULL);
	GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
	composite.setLayoutData(layoutData);
	TableColumnLayout tableLayout = new TableColumnLayout();
	composite.setLayout(tableLayout);

	Table table = new Table(composite,
			SWT.CHECK | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
	refExtensionViewer = new CheckboxTableViewer(table);

	refExtensionViewer.setContentProvider(ArrayContentProvider.getInstance());

	refExtensionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});

	Collection<String> registeredExtensions = new ArrayList<String>(
			OcciRegistry.getInstance().getRegisteredExtensions());
	// removed the OCCI core extension as it is added by default.
	registeredExtensions.remove(OcciCoreConstants.OCCI_CORE_SCHEME);
	refExtensionViewer.setInput(registeredExtensions);
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:42,代碼來源:NewConnectorWizard.java


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