當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。