createlabel在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

​點讚 2

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,

示例2: createContents

​點讚 2

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,

示例3: addErrorLabel

​點讚 2

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,

示例4: addErrorLabel

​點讚 2

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,

示例5: createStatsView

​點讚 2

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,

示例6: StatusPanel

​點讚 2

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,

示例7: LabelizedTexts

​點讚 2

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,

示例8: updateLinkedLabel

​點讚 2

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,

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值