本文整理匯總了Java中org.eclipse.swt.custom.CLabel.setToolTipText方法的典型用法代碼示例。如果您正苦於以下問題:Java CLabel.setToolTipText方法的具體用法?Java CLabel.setToolTipText怎麽用?Java CLabel.setToolTipText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CLabel
的用法示例。
在下文中一共展示了CLabel.setToolTipText方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: createEditRow
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
@Override
protected void createEditRow(Composite theContainer) {
Object[] layoutData = this.getLookAndBehaviour().getLayoutDataOfControls();
CLabel labelId = new CLabel( theContainer, SWT.LEFT);
labelId.setText( this.getParameter().getId());
labelId.setLayoutData( layoutData[0]);
String toolTipString = this.getParameter().getName() + ":\n" + this.getParameter().getDescription();
labelId.setToolTipText( toolTipString);
createInputWidget( theContainer, layoutData[0]);
Button reset = new Button (theContainer, SWT.PUSH);
reset.setText ("Reset");
reset.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent theEvent) {
String defaultValueString = ParameterValueUtil.getDefaultValue( getParameter());
setInputValue( defaultValueString);
super.widgetSelected( theEvent);
}
});
theContainer.pack();
}
示例3: createEditRow
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
@Override
protected void createEditRow(Composite theContainer) {
Object[] layoutData = this.getLookAndBehaviour().getLayoutDataOfControls();
CLabel label = new CLabel( theContainer, SWT.LEFT);
label.setText( this.getParameter().getId());
label.setLayoutData( layoutData[0]);
String toolTipString = this.getParameter().getName() + ":\n" + this.getParameter().getDescription();
label.setToolTipText( toolTipString);
createTextInputWidget( theContainer, layoutData[0]);
Button reset = new Button (theContainer, SWT.PUSH);
reset.setText ("Reset");
reset.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent theEvent) {
String defaultValueString = ParameterValueUtil.getDefaultValue( getParameter());
setInputValue( defaultValueString);
super.widgetSelected( theEvent);
}
});
theContainer.pack();
}
示例4: createLabel
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
private CLabel createLabel(Composite composite, boolean showLabel, IPropertyDescriptor pd) {
CLabel label = null;
if (showLabel) {
label = getWidgetFactory().createCLabel(composite, pd.getDisplayName(), SWT.NONE);
label.setToolTipText(pd.getDescription());
}
return label;
}
示例5: createEditRow
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
@Override
protected void createEditRow(Composite theContainer) {
Object[] layoutData = this.getLookAndBehaviour().getLayoutDataOfControls();
CLabel label = new CLabel( theContainer, SWT.LEFT);
label.setText( this.getParameter().getId());
label.setLayoutData( layoutData[0]);
String toolTipString = this.getParameter().getName() + ":\n" + this.getParameter().getDescription();
label.setToolTipText( toolTipString);
if ( useOnlyTextField ||
integerType.getMinValue() == null ||
integerType.getMaxValue() == null ||
integerType.getMinValue().compareTo( new BigInteger( String.valueOf( Integer.MIN_VALUE))) < 0 ||
integerType.getMaxValue().compareTo( new BigInteger( String.valueOf( Integer.MAX_VALUE))) > 0) {
createTextInputWidget( theContainer, layoutData[0]);
} else {
createSpinnerInputWidget( theContainer, layoutData[0]);
}
Button reset = new Button (theContainer, SWT.PUSH);
reset.setText ("Reset");
reset.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent theEvent) {
String defaultValueString = ParameterValueUtil.getDefaultValue( getParameter());
setInputValue( defaultValueString);
super.widgetSelected( theEvent);
}
});
theContainer.pack();
}
示例6: createParameternameLabel
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
private void createParameternameLabel( Composite theComposite, Object theLayoutData) {
// create label for parameter name
CLabel label = new CLabel( theComposite, SWT.LEFT);
label.setText( this.getParameter().getId());
label.setLayoutData( theLayoutData);
// set a tooltip to the label
String toolTipString = this.getParameter().getName() + ":\n"
+ this.getParameter().getDescription();
label.setToolTipText( toolTipString);
}
示例7: createEditRow
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
@Override
protected void createEditRow(Composite theContainer) {
Object[] layoutData = this.getLookAndBehaviour().getLayoutDataOfControls();
CLabel labelId = new CLabel( theContainer, SWT.LEFT);
labelId.setText( this.getParameter().getId());
labelId.setLayoutData( layoutData[0]);
String toolTipString = this.getParameter().getName() + ":\n" + this.getParameter().getDescription();
labelId.setToolTipText( toolTipString);
Button reset = new Button (theContainer, SWT.PUSH);
reset.setText ("Reset");
reset.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent theEvent) {
String defaultValueString = ParameterValueUtil.getDefaultValue( getParameter());
setInputValue( defaultValueString);
super.widgetSelected( theEvent);
}
});
CLabel labelInterpretation = new CLabel( theContainer, SWT.LEFT);
labelInterpretation.setText( "Interpreted value:");
labelInterpretation.setLayoutData( layoutData[0]);
labelInterpretedValue = new CLabel( theContainer, SWT.LEFT);
labelInterpretation.setLayoutData( layoutData[0]);
createInputWidget( theContainer, layoutData[0]);
getInputControl().getControl().moveAbove( reset);
theContainer.pack();
}
示例8: ComponentRiskMonitor
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
/**
* Creates a new instance
* @param parent
* @param controller
* @param text
* @param shortText
*/
public ComponentRiskMonitor(final Composite parent,
final String text,
final String shortText) {
Display.getCurrent().getActiveShell();
// Images
imageLow = Resources.getImage("bullet_green.png"); //$NON-NLS-1$
imageHigh = Resources.getImage("bullet_red.png"); //$NON-NLS-1$
// Layout
GridLayout layout = SWTUtil.createGridLayout(1);
layout.marginHeight = 0;
layout.marginTop = 0;
layout.marginBottom = 0;
layout.verticalSpacing = 0;
// Root
this.root = new Composite(parent, SWT.NONE);
this.root.setLayout(layout);
this.root.setToolTipText(text);
// Caption
this.caption = new CLabel(root, SWT.CENTER);
this.caption.setText(shortText);
this.caption.setLayoutData(SWTUtil.createFillHorizontallyGridData());
this.caption.setToolTipText(text);
this.caption.setImage(imageHigh);
try {
SWTUtil.changeFont(caption, SWT.BOLD);
} catch (DeviceResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Content
Composite content = new Composite(root, SWT.NONE);
content.setLayoutData(SWTUtil.createFillGridData());
content.setToolTipText(text);
// Create meter
Canvas canvas = new Canvas(content, SWT.DOUBLE_BUFFERED);
canvas.setToolTipText(text);
this.meter = new ComponentMeterFigure();
this.meter.setNeedleColor(XYGraphMediaFactory.getInstance().getColor(0, 0, 0));
this.meter.setValueLabelVisibility(true);
this.meter.setRange(new Range(0, 100));
this.meter.setLoLevel(0);
this.meter.setLoColor(XYGraphMediaFactory.getInstance().getColor(0, 150, 0));
this.meter.setLoloLevel(25);
this.meter.setLoloColor(XYGraphMediaFactory.getInstance().getColor(255, 255, 0));
this.meter.setHiLevel(50);
this.meter.setHiColor(XYGraphMediaFactory.getInstance().getColor(255, 200, 25));
this.meter.setHihiLevel(100);
this.meter.setHihiColor(XYGraphMediaFactory.getInstance().getColor(255, 0, 0));
this.meter.setMajorTickMarkStepHint(50);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(this.meter);
// Create label
label = new CLabel(content, SWT.CENTER);
label.setLayoutData(SWTUtil.createFillHorizontallyGridData());
label.setToolTipText(text);
// Create responsive layout
new ComponentResponsiveLayout(content, 100, 50, canvas, label);
}
示例9: updateLabel
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
/**
* Updates the value on the label
* @param knob
* @param label
*/
private void updateLabel(Knob<Double> knob, CLabel label) {
String text = SWTUtil.getPrettyString(knob.getValue())+"%"; //$NON-NLS-1$
label.setText(text);
label.setToolTipText(text);
}
示例10: createUI23HrZoneHeader
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
private void createUI23HrZoneHeader(final Composite parent) {
/*
* label: color
*/
Label label = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.FILL, SWT.BOTTOM)
.applyTo(label);
label.setText(Messages.Dialog_HRZone_Label_Header_Color);
/*
* label: zone name
*/
label = new Label(parent, SWT.NONE);
GridDataFactory
.fillDefaults()
.grab(true, false)
.hint(250, SWT.DEFAULT)
.align(SWT.FILL, SWT.BOTTOM)
.applyTo(label);
label.setText(Messages.Dialog_HRZone_Label_Header_Zone);
/*
* label: zone shortcut
*/
label = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BOTTOM).applyTo(label);
label.setText(Messages.Dialog_HRZone_Label_Header_ZoneShortcut);
/*
* header label: pulse
*/
label = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BOTTOM).span(3, 1).applyTo(label);
label.setText(Messages.Dialog_HRZone_Label_Header_Pulse);
/*
* label: %
*/
label = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults().applyTo(label);
label.setText(UI.EMPTY_STRING);
/*
* label: trash
*/
final CLabel iconImport = new CLabel(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).indent(10, 0).applyTo(iconImport);
iconImport.setImage(_imageTrash);
iconImport.setToolTipText(Messages.Dialog_HRZone_Label_Trash_Tooltip);
}
示例11: ContextComponent
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
/**
* Default constructor.
*
* @param parent
* parent
* @param conflict
* conflict
*/
public ContextComponent(DecisionBox parent, VisualConflict conflict) {
super(parent, SWT.NONE);
ConflictContext context = conflict.getConflictContext();
GridLayout layout = new GridLayout(3, false);
layout.verticalSpacing = 1;
layout.horizontalSpacing = 20;
this.setLayout(layout);
this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
setBackground(parent.getBackground());
FontRegistry fontRegistry = UIDecisionUtil.getFontRegistry();
Label meTitle = new Label(this, SWT.NONE);
meTitle.setText(context.getModelElementTitleLabel());
meTitle.setFont(fontRegistry.get("titleLabel"));
meTitle.setBackground(getBackground());
Label attTitle = new Label(this, SWT.NONE);
attTitle.setText(context.getAttributeTitleLabel());
attTitle.setFont(fontRegistry.get("titleLabel"));
attTitle.setBackground(getBackground());
Label oppTitle = new Label(this, SWT.NONE);
oppTitle.setText(context.getOpponentTitleLabel());
oppTitle.setFont(fontRegistry.get("titleLabel"));
oppTitle.setBackground(getBackground());
adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
AdapterFactoryLabelProvider provider = new AdapterFactoryLabelProvider(adapterFactory);
CLabel meLabel = new CLabel(this, SWT.NONE);
meLabel.setImage(provider.getImage(context.getModelElement()));
meLabel.setText(UIDecisionUtil.cutString(provider.getText(context.getModelElement()), 40, true));
meLabel.setToolTipText(DecisionUtil.getClassAndName(context.getModelElement()));
meLabel.setFont(fontRegistry.get("content"));
meLabel.setBackground(getBackground());
Label attLabel = new Label(this, SWT.NONE);
attLabel.setText(context.getAttribute());
attLabel.setFont(fontRegistry.get("content"));
attLabel.setBackground(getBackground());
Label oppLable = new Label(this, SWT.NONE);
oppLable.setText(context.getOpponent());
oppLable.setFont(fontRegistry.get("content"));
oppLable.setBackground(getBackground());
}
示例12: ComponentRiskMonitor
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
/**
* Creates a new instance
* @param parent
* @param controller
* @param text
* @param shortText
*/
public ComponentRiskMonitor(final Composite parent,
final Controller controller,
final String text,
final String shortText) {
// Images
imageLow = controller.getResources().getManagedImage("bullet_green.png"); //$NON-NLS-1$
imageHigh = controller.getResources().getManagedImage("bullet_red.png"); //$NON-NLS-1$
// Layout
GridLayout layout = SWTUtil.createGridLayout(1);
layout.marginHeight = 0;
layout.marginTop = 0;
layout.marginBottom = 0;
layout.verticalSpacing = 0;
// Root
this.root = new Composite(parent, SWT.NONE);
this.root.setLayout(layout);
this.root.setToolTipText(text);
// Caption
this.caption = new CLabel(root, SWT.CENTER);
this.caption.setText(shortText);
this.caption.setLayoutData(SWTUtil.createFillHorizontallyGridData());
this.caption.setToolTipText(text);
this.caption.setImage(imageHigh);
SWTUtil.changeFont(caption, SWT.BOLD);
// Content
Composite content = new Composite(root, SWT.NONE);
content.setLayoutData(SWTUtil.createFillGridData());
content.setToolTipText(text);
// Create meter
Canvas canvas = new Canvas(content, SWT.DOUBLE_BUFFERED);
canvas.setToolTipText(text);
this.meter = new ComponentMeterFigure();
this.meter.setNeedleColor(XYGraphMediaFactory.getInstance().getColor(0, 0, 0));
this.meter.setValueLabelVisibility(true);
this.meter.setRange(new Range(0, 100));
this.meter.setLoLevel(0);
this.meter.setLoColor(XYGraphMediaFactory.getInstance().getColor(0, 150, 0));
this.meter.setLoloLevel(25);
this.meter.setLoloColor(XYGraphMediaFactory.getInstance().getColor(255, 255, 0));
this.meter.setHiLevel(50);
this.meter.setHiColor(XYGraphMediaFactory.getInstance().getColor(255, 200, 25));
this.meter.setHihiLevel(100);
this.meter.setHihiColor(XYGraphMediaFactory.getInstance().getColor(255, 0, 0));
this.meter.setMajorTickMarkStepHint(50);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(this.meter);
// Create label
label = new CLabel(content, SWT.CENTER);
label.setLayoutData(SWTUtil.createFillHorizontallyGridData());
label.setToolTipText(text);
// Create responsive layout
new ComponentResponsiveLayout(content, 100, 50, canvas, label);
}