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


Java FormText.setLayoutData方法代码示例

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


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

示例3: 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

示例4: addChain

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void addChain(TemporalChain chain, EPlanElement origin) {
	Label label = toolkit.createLabel(constraintsComposite, "");
	label.setImage(CHAIN_IMAGE);
	label.setLayoutData(new TableWrapData(TableWrapData.CENTER, TableWrapData.MIDDLE));
	FormText text = buildChainText(chain, origin, constraintsComposite);
	TableWrapData data = new TableWrapData(TableWrapData.FILL);
	text.setLayoutData(data);
	toolkit.createLabel(constraintsComposite, "");
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:ConstraintsPage.java

示例5: addConstraint

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void addConstraint(PeriodicTemporalConstraint bound, boolean selected) {
	Button button = buildDeleteButton(bound, constraintsComposite);
	button.setLayoutData(new TableWrapData(TableWrapData.CENTER, TableWrapData.MIDDLE));
	FormText text = buildConstraintText(bound, constraintsComposite, selected);
	TableWrapData data = new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE);
	text.setLayoutData(data);
	toolkit.createLabel(constraintsComposite, "");
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:ConstraintsPage.java

示例6: 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

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