當前位置: 首頁>>代碼示例>>Java>>正文


Java Label.setToolTip方法代碼示例

本文整理匯總了Java中org.eclipse.draw2d.Label.setToolTip方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setToolTip方法的具體用法?Java Label.setToolTip怎麽用?Java Label.setToolTip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.draw2d.Label的用法示例。


在下文中一共展示了Label.setToolTip方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ReferenceFigure

import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
public ReferenceFigure(IReferenceModel model) {
	super(model, false);
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 3;
	layout.verticalSpacing = 0;
	setLayoutManager(layout);
	label = new Label(model.getName());
	label.setForegroundColor(ColorConstants.black);
	FontManager.setFont(label, PandionJConstants.VAR_FONT_SIZE);
	
	String tooltip = Utils.getTooltip(model); 

	Collection<String> tags = model.getTags();
	if(!tags.isEmpty())
		tooltip += "\ntags: " + String.join(", ", tags);
		
	label.setToolTip(new Label(tooltip));

	add(label);
	refLabel = new ReferenceLabel(model);
	add(refLabel);
	layout.setConstraint(refLabel, new GridData(PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH));
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:26,代碼來源:ReferenceFigure.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: ValueExtensionFigure

import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
public ValueExtensionFigure(IValueModel model, IFigure figure) {
	super(model, false);
	
	layout = new GridLayout(1, false);
	layout.verticalSpacing = 0;
	layout.horizontalSpacing = 0;
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	
	setLayoutManager(layout);

	Figure comp = new Figure();
	GridLayout compLayout = new GridLayout(2,false);
	compLayout.marginHeight = 0;
	compLayout.marginWidth = 0;
	compLayout.horizontalSpacing = 3;
	compLayout.verticalSpacing = 0;
	
	comp.setLayoutManager(compLayout);
	
	String tooltip = Utils.getTooltip(model); 
	
	Label nameLabel = new Label(model.getName());
	nameLabel.setForegroundColor(ColorConstants.black);
	FontManager.setFont(nameLabel, PandionJConstants.VAR_FONT_SIZE);
	
	nameLabel.setToolTip(new Label(tooltip));
	comp.add(nameLabel);
	comp.add(figure);
	add(comp);
	
	layout.setConstraint(comp, new GridData(SWT.RIGHT, SWT.DEFAULT, true, false));
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:34,代碼來源:ValueExtensionFigure.java

示例4: NullFigure

import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
public NullFigure(IEntityModel model) {
	super(model);
	Label label = new Label("  ");
	label.setOpaque(false);
	label.setSize(-1,-1);
	label.setToolTip(new Label("null"));
	add(label);
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:9,代碼來源:NullFigure.java


注:本文中的org.eclipse.draw2d.Label.setToolTip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。