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


Java HyperlinkEvent类代码示例

本文整理汇总了Java中org.eclipse.ui.forms.events.HyperlinkEvent的典型用法代码示例。如果您正苦于以下问题:Java HyperlinkEvent类的具体用法?Java HyperlinkEvent怎么用?Java HyperlinkEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HyperlinkEvent类属于org.eclipse.ui.forms.events包,在下文中一共展示了HyperlinkEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createStandardLinkText

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType )
{
    this.toolkit.createLabel ( parent, label + ":" );

    final Text text = this.toolkit.createText ( parent, "" );
    text.setMessage ( textMessage );
    text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) );
    text.setToolTipText ( textMessage );

    final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );

    final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE );
    link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) );

    link.addHyperlinkListener ( new HyperlinkAdapter () {

        @Override
        public void linkActivated ( final HyperlinkEvent e )
        {
            EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () );
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:25,代码来源:ConfigurationFormToolkit.java

示例2: linkActivated

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
@Override
public void linkActivated(final HyperlinkEvent event) {
	Session session = ActivityExplorerManager.INSTANCE.getSession();
	RefreshEditorsPrecommitListener repl = session.getRefreshEditorsListener();
	repl.notify(SessionListener.REPRESENTATION_CHANGE);
	repl.notify(SessionListener.SEMANTIC_CHANGE);
	EObject root = ActivityExplorerManager.INSTANCE.getRootSemanticModel();
	if (root instanceof Project) {
		Project rootProject = (Project) root;
		final EList<BehaviorScenario> bsList = rootProject.getDesign().getWorkloadBehavior().getBehavior();
		if (bsList.isEmpty()) {
			final BehaviorScenario bs = GqamFactory.eINSTANCE.createBehaviorScenario();
			final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(rootProject);
			domain.getCommandStack().execute(new RecordingCommand(domain) {
				public void doExecute() {
					bsList.add(bs);
				}
			});
		}
		linkPressed(event, bsList.get(0), session);
	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:23,代码来源:BehaviorScenarioActivity.java

示例3: linkPressed

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
@Override
protected void linkPressed(final HyperlinkEvent event, final EObject project_p, final Session session) {
	if (project_p instanceof Project) {
		TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(project_p);
		domain.getCommandStack().execute(new RecordingCommand(domain) {

			@Override
			protected void doExecute() {
				final Project prj = ((Project) project_p);
				final Mapping mapping = ToPeriodicDerivation.getOrApply(prj);
				final DesignModel toBeAnalysedModel = (DesignModel) mapping.getSubLinks().get(0).getUniqueTargetValue("copy");
				final URI uri = prj.eResource().getURI();
				IPath path = new Path(uri.toPlatformString(true));
				final String filename = path.lastSegment().replaceAll(".time4sys", "-report.asciidoc");
				path = path.removeLastSegments(1);
				path = path.append(filename);
				IWorkspaceRoot wrkspc = ResourcesPlugin.getWorkspace().getRoot();
				final IFile output = wrkspc.getFile(path);
				generateReport(toBeAnalysedModel, output, null);
			}
		});

	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:DesignSimpleReport.java

示例4: createDropHyperlink

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
public static ImageHyperlink createDropHyperlink(
    final FormToolkit toolkit,
    final Composite parent,
    final String text,
    final Menu menu) {
    final ImageHyperlink link = createDropHyperlink(toolkit, parent, text);

    link.setMenu(menu);
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            PageHelpers.showPopup(link);
        }
    });

    final Point point = link.getLocation();
    point.y += link.getSize().y;
    link.getMenu().setLocation(point);
    link.getMenu().setVisible(false);

    return link;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:23,代码来源:PageHelpers.java

示例5: createControls

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
private void createControls() {	
	Composite cloudForgeComposite = new Composite(this, SWT.NULL);
	GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	cloudForgeComposite.setLayout(layout);
	GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
	cloudForgeComposite.setLayoutData(data);
	
	ImageHyperlink cloudForgeLink = new ImageHyperlink(cloudForgeComposite, SWT.NONE);
	cloudForgeLink.setImage(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_CLOUDFORGE).createImage());
	cloudForgeLink.addHyperlinkListener(new HyperlinkAdapter() {
		@Override
		public void linkActivated(HyperlinkEvent evt) {
			try {
				PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(SIGNUP_URL));
			} catch (Exception e) {
				MessageDialog.openError(getShell(), "Sign-up for CloudForge", e.getMessage());
			}
		}			
	});
	cloudForgeLink.setToolTipText(SIGNUP_URL);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:23,代码来源:CloudForgeComposite.java

示例6: createLabel

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的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

示例7: linkActivated

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
@Override
public void linkActivated(HyperlinkEvent e) {
	String href = (String) e.getHref();
	Action action = null;
	if ("export.app".equals(href)) {
		action = new NativeArtifactExportAction(getConfigEditor());
	} else if ("plugin.folder".equals(href)) {
		action = new LaunchCordovaPluginWizardAction(getConfigEditor(),
				CordovaPluginSelectionPage.PLUGIN_SOURCE_DIRECTORY);
	} else if ("plugin.git".equals(href)) {
		action = new LaunchCordovaPluginWizardAction(getConfigEditor(),
				CordovaPluginSelectionPage.PLUGIN_SOURCE_GIT);
	} else if ("plugin.registry".equals(href)) {
		action = new LaunchCordovaPluginWizardAction(getConfigEditor(),
				CordovaPluginSelectionPage.PLUGIN_SOURCE_REGISTRY);
	}
	Assert.isNotNull(action);
	action.run();

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

示例8: configureFormText

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的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

示例9: createHyperlink

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
/**
 * Return a Label that acts as a hyperlink
 * 
 * @param parent
 *            parent control
 * @param text
 *            text to display
 * @param lis
 *            hyperlink listener that is called on Mouse click
 * @return a Label
 */
public static Label createHyperlink(final Composite parent, final String text,
	final IHyperlinkListener lis){
	final Label ret = new Label(parent, SWT.NONE);
	ret.setText(text);
	ret.setForeground(UiDesk.getColorRegistry().get(Messages.SWTHelper_blue)); //$NON-NLS-1$
	ret.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDown(final MouseEvent e){
			if (lis != null) {
				lis.linkActivated(new HyperlinkEvent(ret, ret, text, e.stateMask));
			}
		}
		
	});
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:28,代码来源:SWTHelper.java

示例10: populateInnerComposite

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
private void populateInnerComposite(){
	for (String l : fields) {
		Hyperlink hl = tk.createHyperlink(inner, l, SWT.NONE);
		hl.addHyperlinkListener(new HyperlinkAdapter() {
			
			@Override
			public void linkActivated(final HyperlinkEvent e){
				Hyperlink h = (Hyperlink) e.getSource();
				fireSortEvent(h.getText());
			}
			
		});
		hl.setBackground(inner.getBackground());
	}
	
	createSelectors(fields.length);
	for (int i = 0; i < selectors.length; i++) {
		selectors[i] = new ElexisText(tk.createText(inner, "", SWT.BORDER)); //$NON-NLS-1$
		selectors[i].addModifyListener(ml);
		selectors[i].addSelectionListener(sl);
		selectors[i].setToolTipText(Messages.DefaultControlFieldProvider_enterFilter); //$NON-NLS-1$
		selectors[i].setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
		SWTHelper.setSelectOnFocus((Text) selectors[i].getWidget());
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:26,代码来源:DefaultControlFieldProvider.java

示例11: deleteFile

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
private void deleteFile(HyperlinkEvent e) {
	if (getModel().getExternalFile() == null)
		return;
	File file = getDatabaseFile();
	boolean doIt = Question.ask(M.DeleteFile,
			M.SourceFileDeleteQuestion);
	if (!doIt)
		return;
	try {
		if (file.exists())
			file.delete();
		getModel().setExternalFile(null);
		updateFileLink();
		getEditor().setDirty(true);
	} catch (Exception ex) {
		log.error("failed to delete file", ex);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:19,代码来源:SourceInfoPage.java

示例12: RowDisplay

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
RowDisplay(final Overview parent, final Composite c) {
	super(c, SWT.NONE);
	this.parent = parent;
	setLayout(new FillLayout());
	sash = new SashForm(this, SWT.HORIZONTAL);
	left = new Composite(sash, SWT.NONE);
	left.setLayout(new GridLayout(1, false));
	SWTHelper.createHyperlink(left, Messages.RowDisplay_overview,
			new HyperlinkAdapter() {

				@Override
				public void linkActivated(final HyperlinkEvent e) {
					parent.setTopControl(parent.dispAll);
				}

			});
	right = new ScrolledComposite(sash, SWT.BORDER | SWT.V_SCROLL
			| SWT.H_SCROLL);
	right.setAlwaysShowScrollBars(true);
	actSlot = 0;
	rightContents = new DetailDisplay(right, parent);
	right.setContent(rightContents);
	sash.setWeights(new int[] { 20, 80 });
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:25,代码来源:RowDisplay.java

示例13: ColumnHeader

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
public ColumnHeader(Composite parent, AgendaWeek aw){
	super(parent, SWT.NONE);
	view = aw;
	if (UiDesk.getImage(IMG_PERSONS_NAME) == null) {
		UiDesk.getImageRegistry().put(IMG_PERSONS_NAME,
			Activator.getImageDescriptor(IMG_PERSONS_PATH));
	}
	ihRes = new ImageHyperlink(this, SWT.NONE);
	ihRes.setImage(UiDesk.getImage(IMG_PERSONS_NAME));
	ihRes.setToolTipText(Messages.ColumnHeader_selectDaysToDisplay);
	ihRes.addHyperlinkListener(new HyperlinkAdapter() {
		
		@Override
		public void linkActivated(HyperlinkEvent e){
			new SelectDaysDlg().open();
		}
		
	});
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:20,代码来源:ColumnHeader.java

示例14: ColumnHeader

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
ColumnHeader(Composite parent, AgendaParallel v){
	super(parent, SWT.NONE);
	view = v;
	
	if (UiDesk.getImage(IMG_PERSONS_NAME) == null) {
		UiDesk.getImageRegistry().put(IMG_PERSONS_NAME,
			Activator.getImageDescriptor(IMG_PERSONS_PATH));
	}
	ihRes = new ImageHyperlink(this, SWT.NONE);
	ihRes.setImage(UiDesk.getImage(IMG_PERSONS_NAME));
	ihRes.setToolTipText(Messages.ColumnHeader_selectMandatorToShow);
	ihRes.addHyperlinkListener(new HyperlinkAdapter() {
		
		@Override
		public void linkActivated(HyperlinkEvent e){
			new SelectResourceDlg().open();
		}
		
	});
	
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:22,代码来源:ColumnHeader.java

示例15: createImageHyperlinkToolBarContribution

import org.eclipse.ui.forms.events.HyperlinkEvent; //导入依赖的package包/类
protected BaseControlContribution createImageHyperlinkToolBarContribution(String id,
        final DataModel<?, ?, ?> model, final DataModelElementType modelElementType) {

    BaseControlContribution controlContribution = new BaseControlContribution(id) {

        @Override
        protected Control createControlInternal(Composite parent) {
            ImageHyperlink imageHyperlink = new ImageHyperlink(parent, SWT.TOP | SWT.WRAP);
            HyperlinkGroup group = new HyperlinkGroup(imageHyperlink.getDisplay());
            group.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
            group.add(imageHyperlink);

            imageHyperlink.addHyperlinkListener(new HyperlinkAdapter() {

                @Override
                public void linkActivated(HyperlinkEvent e) {
                    BaseOpenAction openAction = modelElementType.getOpenAction();
                    if (openAction != null) {

                        try {
                            openAction.runWithObject(model);
                        }
                        catch (Exception e1) {
                            openAction.reportError(e1);
                        }
                    }
                }
            });

            ElementTypeDataModelImageHyperlinkView view = new ElementTypeDataModelImageHyperlinkView(model,
                    imageHyperlink, modelElementType);
            view.updateView();

            return imageHyperlink;
        }
    };

    return controlContribution;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:40,代码来源:DataModelFormEditor.java


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