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


Java Label.setData方法代碼示例

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


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

示例1: 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

示例2: createContents

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public Control createContents(Composite parent) {

		noDefaultAndApplyButton();
		Composite panel = createComposite(parent, 2);

		// PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),PROPERTY_PAGE_CONTEXT);

		IResource resource = (IResource) getElement();

		if (resource.getType() == IResource.FILE) {
			Label label = createLabel(panel, MessageUtil.getString("File_name")); //$NON-NLS-1$
			label = createLabel(panel, resource.getName());
			label.setData(GW4E_LABEL_ID,GW4E_LABEL_ID);
			fillExcessHorizontalSpace(label);

			//
			createLabel(panel, MessageUtil.getString("Path")); //$NON-NLS-1$
			label = createLabel(panel, resource.getFullPath().setDevice(null).toString());
			fillExcessHorizontalSpace(label);

			createLabel(panel, MessageUtil.getString("modified")); //$NON-NLS-1$
			IFile file = (IFile) resource;
			label = createLabel(panel, formatDate(new Date(file.getLocalTimeStamp())));
			fillExcessHorizontalSpace(label);

			createrequirementSection(panel, file);
			createMethodSection(panel, file);
		}
		return new Canvas(panel, 0);
	}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:31,代碼來源:GraphModelPropertyPage.java

示例3: 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

示例4: addErrorLabel

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

示例5: 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

示例6: StatusPanel

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
StatusPanel(Composite c) {
    super(c, SWT.NONE);
    initLayout(2, false, GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);

    BookNotifier.getInstance().addListener(this);
    ConnectionNotifier.getInstance().addListener(this);

    Status elems[] = Status.values();
    stats = new Label[elems.length];


    for (int x = 0; x < elems.length; x++) {
        if (!elems[x].display())
            continue;
        String labelName = elems[x].displayName();
        Label l = newLabel();
        l.setText(Translate.getInstance().labelName(labelName) + ": ");
        l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
        l.setFont(FontShop.tableFontBold());
        l.setBackground(bgColor);

        Label d = newLabel();
        GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
        // gd.widthHint=120;
        d.setLayoutData(gd);

        d.setFont(FontShop.tableFont());
        d.setBackground(bgColor);
        d.setData(elems[x]);
        stats[x] = d;
    }

    _update();
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:35,代碼來源:StatusPanel.java

示例7: LabelizedTexts

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public LabelizedTexts(Composite parent, 
		int style,
		Property[]  properties,
		String id) {
	super(parent, style);
	
	
	this.properties = properties;
	
	setLayout(new GridLayout(10, false));
	
	texts = new Text [properties.length];
	for (int i = 0; i < texts.length; i++) {
		Label lblNewLabel = new Label(this, SWT.NONE);
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalSpan = 4;
		lblNewLabel.setLayoutData(gridData);
		lblNewLabel.setText(properties [i].getLabel() );
		lblNewLabel.setData(PROJECT_PROPERTY_PAGE_WIDGET_ID, LABEL + "." + id + "." + i );
		
		final int index = i;  
		ModifyListener listener = new ModifyListener() {
		    public void modifyText(ModifyEvent e) {
		    	properties[index].check(new String [] {texts [index].getText() });
		    }
		};
		
		if (properties [i].isMultitext()) {
			texts [i] = new Text(this, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
			texts [i] .setText(properties [i].getValue());
			texts [i] .setEnabled(properties [i].isEditable());
			texts [i] .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 6, 1));
			texts [i].addModifyListener(listener);
		} else {
			texts [i] = new Text(this, SWT.BORDER);
			texts [i] .setText(properties [i].getValue());
			texts [i] .setEnabled(properties [i].isEditable());
			texts [i] .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 6, 1));
			texts [i].addModifyListener(listener);
		}
		texts [i].setData(PROJECT_PROPERTY_PAGE_WIDGET_ID, TEXT + "." + id + "." + i );
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:50,代碼來源:LabelizedTexts.java

示例8: updateLinkedLabel

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
public static void updateLinkedLabel(Label label, String hyperlink) {
	label.setData(hyperlink);
	label.setToolTipText(hyperlink);
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:5,代碼來源:LinkLabel.java


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