本文整理汇总了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);
}