本文整理汇总了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 );
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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 );
}
}
示例8: updateLinkedLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
public static void updateLinkedLabel(Label label, String hyperlink) {
label.setData(hyperlink);
label.setToolTipText(hyperlink);
}