本文整理汇总了Java中org.eclipse.swt.custom.CLabel.setText方法的典型用法代码示例。如果您正苦于以下问题:Java CLabel.setText方法的具体用法?Java CLabel.setText怎么用?Java CLabel.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.CLabel
的用法示例。
在下文中一共展示了CLabel.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addStats
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void addStats() {
for (String key : statsProject.keySet()) {
if (key != project.getName()) {
CLabel title = new CLabel(descriptifRight, SWT.BOLD);
title.setText(key);
title.setImage(new Image(display, getClass()
.getResourceAsStream(
"images/stats_"
+ key.replaceAll(" ", "_")
.toLowerCase() + "_16x16.png")));
title.setBackground(new Color(display, 255, 255, 255));
title.setMargins(10, 10, 0, 0);
FontData[] fd = title.getFont().getFontData();
fd[0].setStyle(SWT.BOLD);
title.setFont(new Font(title.getFont().getDevice(), fd));
CLabel subText = new CLabel(descriptifRight, SWT.NONE);
subText.setText(statsProject.get(key)
.replaceAll("<br/>", "\r\n").replaceAll(" ", " "));
subText.setBackground(new Color(display, 255, 255, 255));
subText.setMargins(30, 0, 0, 0);
}
}
}
示例2: HydroGroup
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Create the composite.
* @param parent
* @param style
*/
public HydroGroup(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout(1, false));
setData("org.eclipse.e4.ui.css.id", "HydrographGroup");
hydroGroupLabel = new CLabel(this, SWT.NONE);
hydroGroupLabel.setText("Hydro Group Label");
hydroGroupLabel.setData("org.eclipse.e4.ui.css.id", "HydroGroupLabel");
hydroGroupBorder = new Composite(this, SWT.NONE);
hydroGroupBorder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
GridLayout gl_hydroGroupBorder = new GridLayout(1, false);
gl_hydroGroupBorder.verticalSpacing = 1;
gl_hydroGroupBorder.marginWidth = 1;
gl_hydroGroupBorder.marginHeight = 1;
gl_hydroGroupBorder.horizontalSpacing = 1;
hydroGroupBorder.setLayout(gl_hydroGroupBorder);
hydroGroupBorder.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0, 0, 0));
hydroGroupBorder.setData("org.eclipse.e4.ui.css.id", "HydroGroupBorder");
hydroGroupClientArea = new Composite(hydroGroupBorder, SWT.NONE);
hydroGroupClientArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
hydroGroupClientArea.setData("org.eclipse.e4.ui.css.id", "HydroGroupClientArea");
}
示例3: createLabel
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Creates a label for a knob
* @param root
* @param knob
*/
private CLabel createLabel(final Composite root,
final Knob<Double> knob) {
// Label
String text = "100%"; //$NON-NLS-1$
final CLabel label = new CLabel(root, SWT.NONE);
label.setText(text);
label.setAlignment(SWT.LEFT);
label.setLayoutData(SWTUtil.createFillGridData());
label.setToolTipText(text);
// Listen
knob.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
updateLabel(knob, label);
}
});
// Return
return label;
}
示例4: createDialogArea
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite control = new Composite(parent, SWT.NONE);
control.setLayout(new GridLayout(2, true));
Composite imageControl = new Composite(control, SWT.BORDER);
imageControl.setLayout(new FillLayout());
imageControl.setLayoutData(new GridData(GridData.FILL_VERTICAL));
Label imageLabel = new Label(imageControl, SWT.CENTER);
imageLabel.setImage(mAboutImage);
CLabel textLabel = new CLabel(control, SWT.NONE);
// TODO: update with new year date (search this to find other occurrences to update)
textLabel.setText("Hierarchy Viewer\nCopyright 2012, The Android Open Source Project\nAll Rights Reserved.");
textLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, true));
getShell().setText("About...");
getShell().setImage(mSmallImage);
return control;
}
示例5: initGUI
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void initGUI() {
try {
RowLayout thisLayout = new RowLayout(org.eclipse.swt.SWT.HORIZONTAL);
thisLayout.pack = false;
thisLayout.justify = true;
thisLayout.fill = true;
this.setLayout(thisLayout);
jLabel1 = new CLabel(this, SWT.NONE);
jLabel1.setText("Flower:");
jLabel2 = new CLabel(this, SWT.NONE);
jLabel2.setText("(Family)");
flowerLabel = new CLabel(this, SWT.NONE);
flowerLabel.setText("$NAME$");
jLabel3 = new CLabel(this, SWT.NONE);
jLabel3.setText("Quantity:");
quantityTextField = new Text(this, SWT.NONE);
} catch (Exception e) {
e.printStackTrace();
}
}
示例6: updateUI_TourType
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* Sets the tour type image and text into a {@link CLabel}
*
* @param tourData
* @param lblTourType
* @param isTextDisplayed
*/
public static void updateUI_TourType( final TourData tourData,
final CLabel lblTourType,
final boolean isTextDisplayed) {
final TourType tourType = tourData.getTourType();
// tour type
if (tourType == null) {
lblTourType.setText(UI.EMPTY_STRING);
lblTourType.setImage(TourTypeImage.getTourTypeImage(TourDatabase.ENTITY_IS_NOT_SAVED));
} else {
lblTourType.setImage(TourTypeImage.getTourTypeImage(tourType.getTypeId()));
lblTourType.setText(isTextDisplayed ? tourType.getName() : UI.EMPTY_STRING);
}
lblTourType.pack(true);
lblTourType.redraw(); // display changed tour image
}
示例7: createControls
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
*/
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
parent = getWidgetFactory().createSection(parent, Messages.SizeSection_sizeSectionTitle, true, 4);
section = (ExpandableComposite)parent.getParent();
ASPropertyWidget hw = createWidget4Property(parent, JRDesignElement.PROPERTY_WIDTH);
CLabel lbl = hw.getLabel();
lbl.setText(Messages.SizeSection_widthLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
hw = createWidget4Property(parent, JRDesignElement.PROPERTY_HEIGHT);
lbl = hw.getLabel();
lbl.setText(Messages.SizeSection_heightLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
ASPropertyWidget w = createWidget4Property(parent, JRDesignElement.PROPERTY_STRETCH_TYPE);
GridData gd = new GridData();
gd.horizontalSpan = 3;
w.getControl().setLayoutData(gd);
}
示例8: createControls
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
*/
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
parent = getWidgetFactory().createSection(parent, Messages.LocationSection_locationLabel, true, 4);
section = (ExpandableComposite)parent.getParent();
ASPropertyWidget pw = createWidget4Property(parent, JRDesignElement.PROPERTY_X);
CLabel lbl = pw.getLabel();
lbl.setText(Messages.LocationSection_xCoordinateLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
pw = createWidget4Property(parent, JRDesignElement.PROPERTY_Y);
lbl = pw.getLabel();
lbl.setText(Messages.LocationSection_yCoordinateLabel);
lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
ASPropertyWidget w = createWidget4Property(parent, JRDesignElement.PROPERTY_POSITION_TYPE);
GridData gd = new GridData();
gd.horizontalSpan = 3;
w.getControl().setLayoutData(gd);
}
示例9: createContextButton
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
protected CLabel createContextButton (String text, Image icon)
{
CLabel lbl = new CLabel(buttonsContainer, SWT.NONE);
lbl.setLayoutData(new RowData(SWT.DEFAULT, 28));
lbl.setRightMargin(10);
lbl.setLeftMargin(8);
lbl.setText(text);
lbl.setImage(icon);
lbl.setBackground(ColorResources.COLOR_CS_BLUE);
lbl.setForeground(ColorResources.COLOR_WHITE);
lbl.setCursor(new Cursor(getDisplay(), SWT.CURSOR_HAND));
contextButtonsMap.put(lbl, text);
return lbl;
}
示例10: createComposite1
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void createComposite1() {
GridData gridData2 = new GridData();
gridData2.horizontalSpan = 2;
gridData2.grabExcessVerticalSpace = true;
gridData2.horizontalAlignment = GridData.FILL;
gridData2.verticalAlignment = GridData.FILL;
gridData2.grabExcessHorizontalSpace = true;
GridData gridData1 = new GridData();
gridData1.grabExcessHorizontalSpace = true;
GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
composite1 = new Composite(sashForm, SWT.NONE);
composite1.setLayout(gridLayout1);
Schema = new CLabel(composite1, SWT.NONE);
Schema.setText("Schema");
Schema.setLayoutData(gridData1);
buttonRefresh = new Button(composite1, SWT.NONE);
buttonRefresh.setText("Refresh Schema");
tree = new Tree(composite1, SWT.NONE);
tree.setLayoutData(gridData2);
}
示例11: createComposite2
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void createComposite2() throws ForceConnectionException, ForceRemoteException {
GridData gridData6 = new GridData();
gridData6.horizontalAlignment = GridData.FILL;
gridData6.grabExcessHorizontalSpace = true;
gridData6.heightHint = 6;
gridData6.verticalAlignment = GridData.CENTER;
GridData gridData5 = new GridData();
gridData5.horizontalAlignment = GridData.FILL;
gridData5.grabExcessHorizontalSpace = true;
gridData5.grabExcessVerticalSpace = true;
gridData5.verticalAlignment = GridData.FILL;
composite2 = new Composite(sashForm1, SWT.NONE);
composite2.setLayout(new GridLayout());
textSOQL = new Text(composite2, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
textSOQL.setText(SoqlEnum.getSchemaInitalizationQuery());
textSOQL.setLayoutData(gridData5);
cLabel1 = new CLabel(composite2, SWT.NONE);
cLabel1.setText("");
cLabel1.setLayoutData(gridData6);
queryTableViewer.setProject(project);
queryTableViewer.initialize(sashForm1);
}
示例12: createProjectComposite
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
protected void createProjectComposite(Composite parent) {
final Composite group = new Composite(parent, SWT.NONE);
group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
group.setLayout(new GridLayout(3, false));
final CLabel label = new CLabel(group, SWT.NONE);
label.setLayoutData(new GridData(SWT.BEGINNING));
label.setText("Project:");
projectField = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
projectField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
projectField.addSelectionListener(projectSelectionListener);
final List<IProject> projects = getProjects();
projectField.setData(projects);
projectField.setEnabled(!projects.isEmpty());
for (final IProject project : projects) {
projectField.add(project.getName());
}
}
示例13: setContextButtonsTextVisible
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void setContextButtonsTextVisible (boolean visible)
{
if (this.contextButtonsVisible == visible) return;
for (CLabel lbl : contextButtonsMap.keySet())
{
if (lbl.getImage() == null) continue;
if (visible)
{
lbl.setText(contextButtonsMap.get(lbl));
}
else
{
lbl.setText("");
}
}
this.contextButtonsVisible = visible;
layout();
}
示例14: initNotificationsPrefsTab
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void initNotificationsPrefsTab() {
TabItem notificationsTabbedItem = new TabItem(tabFolder, SWT.NONE);
notificationsTabbedItem.setText("Notifications");
notificationsComposite = new Composite(tabFolder, SWT.NONE);
notificationsTabbedItem.setControl(notificationsComposite);
notificationsComposite.setLayout(new GridLayout(1, false));
this.addEnableNotificationsEditor();
this.addNotificationsEditors();
this.addSelectionButtons();
CLabel explanationsLabel = new CLabel(notificationsComposite, SWT.NONE);
ImageRegistry reg = WaqtSalatPreferencePlugin.getDefault().getImageRegistry();
explanationsLabel.setImage(reg.get(WaqtSalatPreferenceConstants.IconsKeys.NOTIFICATION_1));
explanationsLabel
.setText("Notifications will alert you when it is time to pray.\nNotification will fade automatically. A small window will be shown at the corner of the screen.");
}
示例15: createOffsetStrategy
import org.eclipse.swt.custom.CLabel; //导入方法依赖的package包/类
private void createOffsetStrategy(Composite mainComp) {
FillLayout fillLayout = new FillLayout();
fillLayout.type = org.eclipse.swt.SWT.VERTICAL;
GridData gridData7 = new GridData();
gridData7.horizontalSpan = 2;
gridData7.verticalAlignment = GridData.CENTER;
gridData7.grabExcessHorizontalSpace = true;
gridData7.horizontalAlignment = GridData.FILL;
Composite comboComp = new Composite(mainComp, SWT.NONE);
comboComp.setLayoutData(gridData7);
comboComp.setLayout(fillLayout);
methodInsertionLbl = new CLabel(comboComp, SWT.NONE);
methodInsertionLbl.setText(Messages.offsetStrategyInsertionPointMethod);
methodInsertionComb = createComboViewer(comboComp);
methodInsertionComb.getCombo().select(0);
}