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


Java FormText.setText方法代码示例

本文整理汇总了Java中org.eclipse.ui.forms.widgets.FormText.setText方法的典型用法代码示例。如果您正苦于以下问题:Java FormText.setText方法的具体用法?Java FormText.setText怎么用?Java FormText.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.forms.widgets.FormText的用法示例。


在下文中一共展示了FormText.setText方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createToolTipContentArea

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
@Override
protected Composite createToolTipContentArea(Event event, Composite parent){
	FormToolkit toolkit = new FormToolkit(parent.getDisplay());
	FormColors colors = toolkit.getColors();
	
	Form form = toolkit.createForm(parent);
	GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	form.getBody().setLayout(layout);
	
	FormText text = toolkit.createFormText(form.getBody(), true);
	GridData td = new GridData();
	td.heightHint = 200;
	td.widthHint = 300;
	text.setLayoutData(td);
	
	try {
		text.setText("<form>"+m_htmlString+"</form>", true, true);
	} catch (IllegalArgumentException e) {
		text.setText("<form><p>Fehlerhafter ToolTip Eingabestring</p><br /></form>", true, true);
	}
	
	return parent;
}
 
开发者ID:MEDEVIT,项目名称:ecard,代码行数:25,代码来源:HTMLToolTip.java

示例2: buildConstraintText

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private FormText buildConstraintText(BinaryTemporalConstraint constraint, EPlanElement origin, Composite parent) {
	FormText text = constraintPrinter.createConstraintText(toolkit, parent);
	// display the english
	String string = "<form><p>";
	string += constraintPrinter.getText(constraint, origin);
	String rationale = constraint.getRationale();
	if ((rationale != null) && (rationale.trim().length() != 0)) {
		string += "</p><p>" + constraintPrinter.getRationaleText(constraint);
	}
	string += "</p></form>";
	text.setText(string, true, false);
	trace.debug("  : " + string);
	// activate the links for hover/clicking
	text.addHyperlinkListener(new TemporalNodeHyperlinkListener(selectionProvider, model.getEPlan(), identifiableRegistry));
	return text;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:ConstraintsPage.java

示例3: createFormText

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
   * Creates a form text.
   *
   * @param parent the parent to put the form text on
   * @param text the form text to be displayed
   * @return the created form text
   *
   * @see FormToolkit#createFormText(org.eclipse.swt.widgets.Composite, boolean)
   */
  private FormText createFormText(Composite parent, String text) {
      FormToolkit toolkit= new FormToolkit(getShell().getDisplay());
      try {
      	FormText formText= toolkit.createFormText(parent, true);
      	formText.setFont(parent.getFont());
	try {
	    formText.setText(text, true, false);
	} catch (IllegalArgumentException e) {
	    formText.setText(e.getMessage(), false, false);
	    JavaPlugin.log(e);
	}
	formText.marginHeight= 2;
	formText.marginWidth= 0;
	formText.setBackground(null);
	formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
	return formText;
} finally {
       toolkit.dispose();
}
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:HintTextGroup.java

示例4: AbstractEASyEditorPage

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
 * Sole constructor for this class.
 * @param plp The {@link ProductLineProject} edited in this editor page.
 * @param title The title for this editor page.
 * @param parent The parent, holding this editor page.
 */
public AbstractEASyEditorPage(ProductLineProject plp, String title, Composite parent) {
    super(parent, SWT.BORDER);
    this.plp = plp;
    setLayout(new FillLayout());
    pageListeners = new ArrayList<IEASyPageListener>();
    toolkit = new FormToolkit(getDisplay()); // display is assumed to be valid!
    contentPane = toolkit.createScrolledForm(this);
    GridLayout layout = new GridLayout();
    contentPane.getBody().setLayout(layout);
    
    //Set Title contentPane.setText(text) will cause that scrollbars won't work correctly.
    FormText titleText = toolkit.createFormText(contentPane.getBody(), false);
    String htmlTitle = "<form><p><span color=\"header\" font=\"header\">" + title + ": " + plp.getProjectName()
        + "</span></p></form>";
    titleText.setWhitespaceNormalized(true);
    titleText.setFont("header", JFaceResources.getHeaderFont());
    titleText.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE));
    titleText.setText(htmlTitle, true, false);
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:26,代码来源:AbstractEASyEditorPage.java

示例5: createPluginsSection

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void createPluginsSection(Composite parent) {
	Section sctnPlugins = createSection(parent, "Plug-ins");
	sctnPlugins.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
	TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
	sctnPlugins.setLayoutData(data);

	FormText text = formToolkit.createFormText(sctnPlugins, true);
	ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/cordovaplug_wiz.png");
	text.setImage("plugin", idesc.createImage());

	text.setText(PLUGINS_SECTION_CONTENT, true, false);

	sctnPlugins.setClient(text);
	text.addHyperlinkListener(this);

}
 
开发者ID:eclipse,项目名称:thym,代码行数:17,代码来源:EssentialsPage.java

示例6: getBodyComposite

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
@Override
protected Composite getBodyComposite() {
	TimelineViewer viewer = scaleTimelineMarkerEditPart.getViewer();
	final EPlan plan = (EPlan) viewer.getTimeline().getModel();
	ISelectionProvider selectionProvider = viewer.getSite().getSelectionProvider();

	FormText formText = new FormText(mainComposite, SWT.NONE);
	formText.setBackground(shell.getBackground());
	formText.addHyperlinkListener(new TemporalNodeHyperlinkListener(selectionProvider, plan, identifiableRegistry) {
		@Override
		public void linkActivated(HyperlinkEvent e) {
			super.linkActivated(e);
			Object object = e.getSource();
			if(object instanceof Composite) {
				Composite composite = (Composite)object;
				composite.getShell().dispose();
			}
		}
	});
	TableWrapData layoutData = new TableWrapData(TableWrapData.FILL);
	layoutData.maxWidth = TOOLTIP_WIDTH;
	formText.setLayoutData(layoutData);

	Violation violation = this.getViolationTracker().getViolation();
	String violationText = violation.getFormText(formText, identifiableRegistry);
	formText.setText("<form><P>" + violationText + "</P></form>", true, false);
	return formText;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:29,代码来源:SolitaryScaleTimelineMarkerTooltip.java

示例7: buildChainText

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private FormText buildChainText(TemporalChain chain, EPlanElement origin, Composite parent) {
	FormText text = constraintPrinter.createConstraintText(toolkit, parent);
	// display the english
	String string = "<form><p>";
	string += constraintPrinter.getText(chain, origin);
	string += "</p></form>";
	text.setText(string, true, false);
	trace.debug("  : " + string);
	text.addHyperlinkListener(new TemporalNodeHyperlinkListener(selectionProvider, model.getEPlan(), identifiableRegistry));
	return text;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:ConstraintsPage.java

示例8: createExportSection

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void createExportSection(Composite parent) {
	Section sctnExport = createSection(parent, "Export");
	sctnExport.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
	TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
	sctnExport.setLayoutData(data);
	FormText text = formToolkit.createFormText(sctnExport, true);
	ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/export_wiz.png");
	text.setImage("export", idesc.createImage());
	text.setText(EXPORT_SECTION_CONTENT, true, false);

	sctnExport.setClient(text);
	text.addHyperlinkListener(this);
}
 
开发者ID:eclipse,项目名称:thym,代码行数:14,代码来源:EssentialsPage.java

示例9: createMessageArea

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
@Override
protected Control createMessageArea(Composite composite) {
    // create composite
    // create image
    Image image = getImage();
    if (image != null) {
        imageLabel = new Label(composite, SWT.NULL);
        image.setBackground(imageLabel.getBackground());
        imageLabel.setImage(image);
        //            addAccessibleListeners(imageLabel, image);
        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
    }
    
    composite.setLayoutData(new GridData());
    
    FormText formText = new FormText(composite, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_BOTH);
    formText.setLayoutData(gd);

    StringBuilder buf = new StringBuilder();
    buf.append("<form>"); //$NON-NLS-1$
    buf.append(message);
    buf.append("</form>"); //$NON-NLS-1$

    formText.setText(buf.toString(), true, false);
    formText.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            HyperLinkMessageDialog.this.linkActivated(e);
        }
    });

    return composite;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:35,代码来源:HyperLinkMessageDialog.java

示例10: createTextPluginMissingForm

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void createTextPluginMissingForm(Composite parent){
	String expl =
		Messages.TextTemplateVeiw_NoTxtPluginDescription
			+ Messages.TextTemplateVeiw_NoTxtPluginReason1
			+ Messages.TextTemplateVeiw_NoTxtPluginReason2
			+ Messages.TextTemplateVeiw_NoTxtPluginReason3;
	
	Form form = UiDesk.getToolkit().createForm(parent);
	form.setText(Messages.TextTemplateVeiw_NoTxtPluginTitel);
	form.setLayoutData(SWTHelper.fillGrid(parent, 1));
	form.getBody().setLayout(new GridLayout(1, false));
	FormText ft = UiDesk.getToolkit().createFormText(form.getBody(), false);
	ft.setText(expl, true, false);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:15,代码来源:TextTemplateView.java

示例11: createContainer

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
public Composite createContainer(final Composite parent, final ITextPlugin.ICallback h){
	parent.setLayout(new FillLayout());
	// Composite ret=new Composite(parent,SWT.BORDER);
	Form form = UiDesk.getToolkit().createForm(parent);
	form.setText(Messages.TextContainer_NoPluginCaption);
	form.getBody().setLayout(new FillLayout());
	FormText ft = UiDesk.getToolkit().createFormText(form.getBody(), false);
	ft.setText(expl, true, false);
	return form.getBody();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:11,代码来源:TextContainer.java

示例12: createDialogArea

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(final Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	FormToolkit toolkit = new FormToolkit(container.getDisplay());
	ScrolledForm form = toolkit.createScrolledForm(container);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(form);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(form.getBody());
	form.getBody().setLayout(new GridLayout());
	Bundle bundle = FrameworkUtil.getBundle(this.getClass());
	BundleContext bundleContext = bundle.getBundleContext();
	
    FormText notice = toolkit.createFormText(form.getBody(), true);
	GridDataFactory.fillDefaults().hint(600, SWT.DEFAULT).applyTo(notice);
	StringBuffer buf = new StringBuffer();
	buf.append("<form>");
	buf.append("<p>"+TermSuiteUI.DESCRIPTION+"</p>");
	buf.append("<p>"+TermSuiteUI.COPYRIGHT+"</p>");
	buf.append("</form>");
	notice.setText(buf.toString(), true, false);

	GridDataFactory.fillDefaults().grab(true, false).applyTo(toolkit.createSeparator(form.getBody(), SWT.HORIZONTAL));

    notice = toolkit.createFormText(form.getBody(), true);
	GridDataFactory.fillDefaults().hint(600, SWT.DEFAULT).applyTo(notice);
	buf = new StringBuffer();
	buf.append("<form>");
	buf.append("<p>Current version: "+Platform.getProduct().getDefiningBundle()+"</p>");
	buf.append("<p>Last modified: "+dateFormat.format(new Date(bundle.getLastModified()))+"</p>");
	buf.append("<p>Plugins:</p>");
	for(Bundle b:bundleContext.getBundles()) {
		if(b.getSymbolicName().startsWith("fr.univnantes.termsuite"))
			buf.append("<li>"+b.getSymbolicName()+":"+ b.getVersion()+"</li>");
	}
	buf.append("</form>");

	notice.setText(buf.toString(), true, false);

	GridDataFactory.fillDefaults().grab(true, false).applyTo(toolkit.createSeparator(form.getBody(), SWT.HORIZONTAL));

    notice = toolkit.createFormText(form.getBody(), true);
	GridDataFactory.fillDefaults().hint(600, SWT.DEFAULT).applyTo(notice);
	buf = new StringBuffer();
	buf.append("<form>");
	buf.append("<p>Web site: <a href=\"web\">"+TermSuiteUI.WEB_SITE_URL+"</a></p>");
	buf.append("<p>Source code: <a href=\"github\">"+TermSuiteUI.GITHUB_URL+"</a></p>");
	buf.append("<p>Documentation: <a href=\"doc\">"+TermSuiteUI.WEB_SITE_DOC_URL+"</a></p>");
	buf.append("</form>");
	FormTextUtil.bindToExternalLink(notice, "web", TermSuiteUI.WEB_SITE_URL);
	FormTextUtil.bindToExternalLink(notice, "github", TermSuiteUI.GITHUB_URL);
	FormTextUtil.bindToExternalLink(notice, "doc", TermSuiteUI.WEB_SITE_DOC_URL);
	notice.setText(buf.toString(), true, false);

	
	return container;
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:57,代码来源:AboutDialog.java

示例13: createToolTipContentArea

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
protected Composite createToolTipContentArea(Event event, Composite parent) {

		FormToolkit toolkit = new FormToolkit(parent.getDisplay());
		FormColors colors = toolkit.getColors();
		Color top = colors.getColor(IFormColors.H_GRADIENT_END);
		Color bot = colors.getColor(IFormColors.H_GRADIENT_START);

		// create the base form
		Form form = toolkit.createForm(parent);
		form.setText(title);
		form.setTextBackground(new Color[] { top, bot }, new int[] { 100 }, true);
		FormLayout layout = new FormLayout();
		layout.marginTop = 10;
		layout.marginBottom = 10;
		layout.marginLeft = 10;
		layout.marginRight = 10;
		form.getBody().setLayout(layout);

		// Scrolled text
		ScrolledFormText scrolledFormText = new ScrolledFormText(form.getBody(), true);
		FormText text = toolkit.createFormText(scrolledFormText, true);

		scrolledFormText.setAlwaysShowScrollBars(false);

		StringBuilder builder = new StringBuilder();
		for (final String currentText : texts) {
			builder.append("<p>").append(currentText).append("</p>");
		}

		text.setText(String.format("<form>%s</form>", builder.toString()), true, false);

		FormData data = new FormData();
		data.left = new FormAttachment(0, 0);
		data.right = new FormAttachment(100);
		scrolledFormText.setLayoutData(data);

		scrolledFormText.setFormText(text);
		scrolledFormText.setBackground(ColorConstants.white);

		return parent;
	}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:42,代码来源:FormToolTip.java

示例14: createControls

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
 * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
 *      org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
 */
public void createControls(Composite parent,
		TabbedPropertySheetPage tabbedPropertySheetPage) {
	super.createControls(parent, tabbedPropertySheetPage);
	parent.setLayout(new GridLayout(2, false));

	FormText mapPickSuggestion=new FormText(parent, SWT.NONE);
	mapPickSuggestion.setText("<form><p><b>You can pickup the map center, zooom and type by</b><a href=\"\">clicking here</a></p></form>", true, false);
	mapPickSuggestion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false,2,1));
	mapPickSuggestion.setWhitespaceNormalized(true);
	mapPickSuggestion.addHyperlinkListener(new HyperlinkAdapter() {
		@Override
		public void linkActivated(HyperlinkEvent e) {
			BasicInfoMapDialog pickmapDialog = new BasicInfoMapDialog(UIUtils.getShell()) {
				@Override
				protected void configureShell(Shell newShell) {
					super.configureShell(newShell);
					UIUtils.resizeAndCenterShell(newShell, 800, 600);
				}
			};
			if(pickmapDialog.open()==Dialog.OK){
				LatLng center=pickmapDialog.getMapCenter();
				int zoom = pickmapDialog.getZoomLevel();
				getElement().setPropertyValue(StandardMapComponent.PROPERTY_LATITUDE_EXPRESSION, new JRDesignExpression(center.getLat()+"f"));
				getElement().setPropertyValue(StandardMapComponent.PROPERTY_LONGITUDE_EXPRESSION, new JRDesignExpression(center.getLng()+"f"));
				getElement().setPropertyValue(StandardMapComponent.PROPERTY_ZOOM_EXPRESSION, new JRDesignExpression(String.valueOf(zoom)));
				getElement().setPropertyValue(StandardMapComponent.PROPERTY_MAP_TYPE, pickmapDialog.getMapType().ordinal());
			}
		}
	});
	createWidget4Property(parent, StandardMapComponent.PROPERTY_MAP_TYPE);
	createWidget4Property(parent,
			StandardMapComponent.PROPERTY_LATITUDE_EXPRESSION);
	createWidget4Property(parent,
			StandardMapComponent.PROPERTY_LONGITUDE_EXPRESSION);
	createWidget4Property(parent,
			StandardMapComponent.PROPERTY_ZOOM_EXPRESSION);

	createWidget4Property(parent,
			StandardMapComponent.PROPERTY_LANGUAGE_EXPRESSION);
	createWidget4Property(parent, StandardMapComponent.PROPERTY_MAP_SCALE);
	IPropertyDescriptor pd = getPropertyDesriptor(StandardMapComponent.PROPERTY_EVALUATION_TIME);
	IPropertyDescriptor gpd = getPropertyDesriptor(StandardMapComponent.PROPERTY_EVALUATION_GROUP);
	getWidgetFactory().createCLabel(parent, pd.getDisplayName());
	widgets.put(pd.getId(), new SPEvaluationTime(parent, this, pd, gpd));
	createWidget4Property(parent, StandardMapComponent.PROPERTY_IMAGE_TYPE);
	createWidget4Property(parent, StandardMapComponent.PROPERTY_ON_ERROR_TYPE);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:52,代码来源:MapSection.java


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