本文整理匯總了Java中org.eclipse.draw2d.Label.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setText方法的具體用法?Java Label.setText怎麽用?Java Label.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.Label
的用法示例。
在下文中一共展示了Label.setText方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createFigure
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
@Override
protected IFigure createFigure() {
final LineLayout layout = new LineLayout();
layout.setHorizontal(true);
layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
layout.setMinorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
layout.setMinorSpacing(SPACING);
layout.setMargin(MARGIN);
FreeformLayer res = new FreeformLayer();
final Label toolTip = new Label();
toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
toolTip.setForegroundColor(ColorConstants.tooltipForeground);
toolTip.setText(getModel().getTimelineWindow().getProvider().getTextAt(getModel().getBranch()));
res.setToolTip(toolTip);
res.setLayoutManager(layout);
return res;
}
示例2: createFigure
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
@Override
public IFigure createFigure(IObjectModel e) {
Label label = new Label();
label.setForegroundColor(PandionJConstants.Colors.OBJECT_HEADER_FONT);
FontManager.setFont(label, PandionJConstants.OBJECT_HEADER_FONT_SIZE);
IType type = e.getType();
if(type != null) {
IMethod method = type.getMethod("toString", new String[0]);
if(!method.exists()) {
label.setText(":" + type.getElementName());
return label;
}
}
invokeToString(e, label);
label.setToolTip(new Label("returned by toString()"));
e.getRuntimeModel().registerDisplayObserver((event) -> {
if(event.type == IRuntimeModel.Event.Type.STEP ||event.type == IRuntimeModel.Event.Type.EVALUATION) {
invokeToString(e, label);
// label.setText(e.getStringValue());
}
});
return label;
}
示例3: setLabel
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
private void setLabel ( final Label preset, final String string )
{
final Number num = getPreset ( string );
if ( num != null )
{
preset.setText ( String.format ( Messages.LevelPresets_NumFormat, num.toString () ) );
}
else
{
preset.setText ( Messages.LevelPresets_EmtyNum );
}
}
示例4: createNaPanel
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
private IFigure createNaPanel ()
{
final Figure naPanel = new Figure ();
final BorderLayout layout = new BorderLayout ();
naPanel.setLayoutManager ( layout );
final Label label = new Label ();
label.setText ( Messages.AbstractBaseDraw2DDetailsPart_Label_NotAvail_Text );
naPanel.add ( label, BorderLayout.CENTER );
return naPanel;
}
示例5: refreshVisuals
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
@Override
protected void refreshVisuals() {
TransitionLabel transitionLabel = (TransitionLabel)getModel();
Label figure = (Label) getFigure();
figure.setText(transitionLabel.getText());
Point offset=transitionLabel.getOffset();
AbstractConnectionEditPart parent = (AbstractConnectionEditPart) getParent();
PolylineConnection connection = (PolylineConnection) parent.getFigure();
if(offset==null){
offset=this.calculateInitialOffset(connection);
transitionLabel.setOffset(offset);
}
TransitionLabelLocator constraint = new TransitionLabelLocator(transitionLabel.getText(),offset,connection);
parent.setLayoutConstraint(this, getFigure(), constraint);
}
示例6: updateLabel
import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
private void updateLabel(IArrayModel<?> e, Label label) {
String text = "\"";
char[] chars = (char[]) e.getValues();
for(char c : chars)
text += c;
text += "\"";
label.setText(text);
}