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


Java FormText.addHyperlinkListener方法代码示例

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


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

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

示例2: createLabel

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
  * Create a label with a hyperlink and a picture.
  *
  * @param parent the parent widget of the label
  * @param text the text of the label
  * @param action the action to be executed if the hyperlink is activated
  */
 private void createLabel(Composite parent, String text, final BuildpathModifierAction action) {
     FormText formText= createFormText(parent, text);
     Image image= fImageMap.get(action.getId());
     if (image == null) {
         image= action.getImageDescriptor().createImage();
         fImageMap.put(action.getId(), image);
     }
     formText.setImage("defaultImage", image); //$NON-NLS-1$
     formText.addHyperlinkListener(new HyperlinkAdapter() {

         @Override
public void linkActivated(HyperlinkEvent e) {
             action.run();
         }

     });
 }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:HintTextGroup.java

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

示例4: configureFormText

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void configureFormText(final Form form, FormText text) {
    text.addHyperlinkListener(new HyperlinkAdapter() {
        @SuppressWarnings("unchecked")
        public void linkActivated(HyperlinkEvent e) {
            String is = (String) e.getHref();
            try {
                ((FormText) e.widget).getShell().dispose();
                int index = Integer.parseInt(is);
                IMessage[] messages = form.getChildrenMessages();
                IMessage message = messages[index];
                Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) message.getData();
                if (conflicts != null) {
                    viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
                }
            } catch (NumberFormatException ex) {
            }
        }
    });
    text.setImage("error", getImage(IMessageProvider.ERROR));
    text.setImage("warning", getImage(IMessageProvider.WARNING));
    text.setImage("info", getImage(IMessageProvider.INFORMATION));
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:23,代码来源:ResolveVisualizerForm.java

示例5: bindToExternalLink

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
public static void bindToExternalLink(final FormText formText, final String key, final String webSiteTaggerDocUrl) {
	formText.addHyperlinkListener(new HyperlinkAdapter(){
		@Override
		public void linkActivated(HyperlinkEvent e) {
			if(e.getHref().equals(key)) {
				try {
					java.awt.Desktop.getDesktop().browse(java.net.URI.create(webSiteTaggerDocUrl));
				} catch (IOException e1) {
					MessageDialog.openInformation(formText.getShell(), "No browser found", "Could not open the url in your Web browser.");
				}
			}
		}
	});
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:15,代码来源:FormTextUtil.java

示例6: createControl

import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
 * This is a callback that will allow us
 * to create the viewer and initialize it.
 */
@Override
public void createControl(Composite parent) {
	sashForm = new SashForm(parent, SWT.VERTICAL);
	
	viewer = new PlanAdvisorTreeViewer(sashForm);
	viewer.setContentProvider(new ViolationContentProvider());
	viewer.addDoubleClickListener(new ViolationClickListener(editor, planAdvisorMember));
	if (EnsembleProperties.getBooleanPropertyValue("advisor.singleclicktoselectculprits", true)) {
		viewer.addPostSelectionChangedListener(new ViolationClickListener(editor, planAdvisorMember));
	}
	viewer.addPostSelectionChangedListener(new FixTreeSelectionChangedListener());
	viewer.setInput(plan);
	createTreeContextMenu(viewer.getTree());
	
	Composite composite = new EnsembleComposite(sashForm, SWT.NONE);
	composite.setLayout(new FillLayout());
	composite.setBackground(ColorConstants.blue);
	
	scrolledFormText = new ScrolledFormText(composite, SWT.VERTICAL, true);
	scrolledFormText.setExpandHorizontal(true);
	scrolledFormText.setExpandVertical(true);
	scrolledFormText.setAlwaysShowScrollBars(true);
	FormText formText = scrolledFormText.getFormText();
	toolkit = new FormToolkit(parent.getDisplay());
	toolkit.adapt(formText);
	formText.addHyperlinkListener(new TemporalNodeHyperlinkListener(selectionProvider, plan, identifiableRegistry));
	
	ViolationDetailsTreeListener detailsListener = new ViolationDetailsTreeListener(viewer, scrolledFormText, identifiableRegistry);
	refreshListener = new RefreshListener(viewer, plan, detailsListener);
	
	sashForm.setWeights(new int[] {80, 20});
	
	setup();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:39,代码来源:PlanAdvisorPage.java

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

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

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

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

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