当前位置: 首页>>代码示例>>Java>>正文


Java Label.setText方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:20,代码来源:BranchEditPart.java

示例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;
		}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:24,代码来源:ITypeWidgetExtension.java

示例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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:GenericLevelPresets.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:AbstractBaseDraw2DDetailsPart.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:16,代码来源:TransitionLabelEditPart.java

示例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);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:9,代码来源:StringCharArray.java


注:本文中的org.eclipse.draw2d.Label.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。