• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ImageHyperlink类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createDropHyperlink

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
public static ImageHyperlink createDropHyperlink(
    final FormToolkit toolkit,
    final Composite parent,
    final String text) {
    final ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.WRAP | SWT.CENTER | SWT.RIGHT);

    link.setBackground(parent.getBackground());
    link.setForeground(parent.getForeground());

    final Image arrow = ImageUtils.createDisclosureTriangle(link);

    link.setText(text);
    link.setImage(arrow);
    link.setUnderlined(false);

    link.addDisposeListener(new DisposeListener() {
        @Override
        public void widgetDisposed(final DisposeEvent e) {
            if (arrow != null) {
                arrow.dispose();
            }
        }
    });

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


示例2: createControls

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


示例3: createHelpWidget

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
protected void createHelpWidget(final Composite parent, final Control control, String helpId) {
	final ImageHyperlink helpWidget = toolkit.createImageHyperlink(parent, SWT.CENTER);
	Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_LCL_LINKTO_HELP);
	helpWidget.setImage(defaultImage);
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(helpWidget);
	helpWidget.setToolTipText(JFaceResources.getString(IDialogLabelKeys.HELP_LABEL_KEY));
	helpWidget.addMouseListener(new MouseAdapter() {
		public void mouseDown(MouseEvent e) {
			control.setFocus();
			PlatformUI.getWorkbench().getHelpSystem().displayDynamicHelp();
		}
	});
	GridDataFactory.fillDefaults().applyTo(helpWidget);
	helpWidget.setEnabled(true);
	setHelpContext(control, helpId);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:AbstractEditorPropertySection.java


示例4: openWizard

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
/**
 * @param matcherImageHyperLink
 * @param bot
 * @return
 */
public static boolean openWizard(Matcher matcherImageHyperLink,
		SWTWorkbenchBot bot) {
	@SuppressWarnings("unchecked")
	ImageHyperlink link = (ImageHyperlink) bot
			.widget(matcherImageHyperLink);
	link.getClass();

	SWTBotImageHyperlink swtbotImageHyperLink = new SWTBotImageHyperlink(
			link);
	swtbotImageHyperLink.click();

	if (swtbotImageHyperLink.isEnabled()) {
		return true;

	}
	return false;
}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:23,代码来源:DashBoardCreation.java


示例5: testESBConfigProjectCreation

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Test
public void testESBConfigProjectCreation() throws Exception {

	assertTrue(Properties.ERROR_OPEN_DASHBOARD,
			DashBoardCreation.openDashBoard(bot));

	@SuppressWarnings({ "rawtypes", "unchecked" })
	Matcher matcherImageHyperLink = allOf(
			widgetOfType(ImageHyperlink.class),
			withText(EndPointCreation.IMAGE_HYPER_LINK));

	assertTrue(Properties.ERROR_OPEN_CREATION_WIZARD,
			DashBoardCreation.openWizard(matcherImageHyperLink, bot));

	SWTBotShell shell = bot
			.shell(EndPointCreation.SHELL_CREATE_NEW_ENDPOINT);
	shell.activate();

	EndPointCreation.handleCreationWizard(bot);

	assertTrue(EndPointCreation.checkCreatedProject(bot));

}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:24,代码来源:EndPointTestCase.java


示例6: createItems

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void createItems(FormToolkit tk, Composite body) {
	int i = 0;
	LinkClick click = new LinkClick();
	for (BaseDescriptor d : results) {
		if (i > 1000)
			break;
		i++;
		Composite comp = tk.createComposite(body);
		UI.gridData(comp, true, false);
		UI.gridLayout(comp, 1).verticalSpacing = 3;
		ImageHyperlink link = tk.createImageHyperlink(comp, SWT.TOP);
		link.setText(Labels.getDisplayName(d));
		link.setImage(Images.get(d));
		link.setForeground(Colors.linkBlue());
		link.setData(d);
		link.addHyperlinkListener(click);
		renderCategory(tk, d, comp);
		renderDescription(tk, d, comp);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:21,代码来源:SearchResultView.java


示例7: createFolderLink

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void createFolderLink(Composite composite) {
	UI.formLabel(composite, tk, "Location");
	ImageHyperlink link = tk.createImageHyperlink(composite, SWT.TOP);
	File folder = ShapeFileUtils.getFolder(method());
	link.setText(Strings.cut(folder.getAbsolutePath(), 75));
	link.setImage(Icon.FOLDER.get());
	link.setForeground(Colors.linkBlue());
	link.setToolTipText(folder.getAbsolutePath());
	Controls.onClick(link, e -> {
		try {
			if (folder.exists() && folder.isDirectory())
				Desktop.getDesktop().open(folder);
		} catch (Exception ex) {
			log.error("failed to open shape-file folder", ex);
		}
	});
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:18,代码来源:ShapeFilePage.java


示例8: createCategoryViewer

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void createCategoryViewer(Composite client) {
	Composite container = toolkit.createComposite(client);
	UI.gridLayout(container, App.isCommentingEnabled() ? 3 : 2, 10, 0);
	UI.gridData(container, true, false);
	new Label(container, SWT.NONE).setText(M.ImpactCategory);
	categoryViewer = new ImpactCategoryViewer(container);
	CategoryChange categoryChange = new CategoryChange();
	categoryViewer.addSelectionChangedListener(categoryChange);
	categoryViewer.setInput(getDescriptorList());
	editor.getEventBus().register(categoryChange);
	commentControl = new ImageHyperlink(container, SWT.NONE);
	UI.gridData(commentControl, false, false).verticalAlignment = SWT.TOP;
	Controls.onClick(commentControl, (e) -> {
		ImpactCategoryDescriptor category = categoryViewer.getSelected();
		if (category == null)
			return;
		String path = CommentPaths.get(category) + ".impactFactors";
		if (!editor.hasComment(path))
			return;
		new CommentDialog(path, editor.getComments()).open();
	});
	if (!App.isCommentingEnabled())
		return;
	commentControl.setImage(Icon.SHOW_COMMENTS.get());
	commentControl.setToolTipText(M.ShowComments);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:27,代码来源:ImpactFactorPage.java


示例9: element

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void element(String text, Object model, int colorIndex) {
	if (model instanceof CategorizedDescriptor || model instanceof CategorizedEntity) {
		ImageHyperlink link = new ImageHyperlink(composite, SWT.TOP);
		link.setText(text);
		link.setImage(getImage(colorIndex));
		Controls.onClick(link, (e) -> {
			if (model instanceof CategorizedDescriptor) {
				App.openEditor((CategorizedDescriptor) model);
			} else if (model instanceof CategorizedEntity) {
				App.openEditor((CategorizedEntity) model);
			}
		});
		createdLinks.push(link);
	} else {
		CLabel label = new CLabel(composite, SWT.TOP);
		label.setImage(getImage(colorIndex));
		label.setText(text);
		createdLinks.push(label);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:21,代码来源:ChartLegend.java


示例10: ColumnHeader

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


示例11: ColumnHeader

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


示例12: createImageHyperlinkToolBarContribution

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


示例13: getPageContent

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Override
public Composite getPageContent(
    final FormToolkit toolkit,
    final Composite parent,
    final int style,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 3, false, 0, 5);

    // Create the new work item hyper-link
    final String linkText = Messages.getString("TeamExplorerWorkItemPage.NewWorkItemLinkText"); //$NON-NLS-1$
    final Menu menu = createNewWorkItemMenu(composite.getShell(), context);
    final ImageHyperlink link = PageHelpers.createDropHyperlink(toolkit, composite, linkText, menu);

    GridDataBuilder.newInstance().applyTo(link);

    final Label separator = toolkit.createLabel(composite, "|", SWT.VERTICAL); //$NON-NLS-1$
    GridDataBuilder.newInstance().vFill().applyTo(separator);

    // Create the new query hyper-link.
    final String title = Messages.getString("TeamExplorerWorkItemsQueriesSection.NewQueryLinkText"); //$NON-NLS-1$
    final Hyperlink newQueryHyperlink = toolkit.createHyperlink(composite, title, SWT.WRAP);
    newQueryHyperlink.setUnderlined(false);
    newQueryHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            WorkItemHelpers.openNewQuery(context);
        }
    });

    GridDataBuilder.newInstance().applyTo(newQueryHyperlink);

    CodeMarkerDispatch.dispatch(WORKITEMS_PAGE_LOADED);
    return composite;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:39,代码来源:TeamExplorerWorkItemPage.java


示例14: createCompositeHeader

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Override
public void createCompositeHeader(
    final FormToolkit toolkit,
    final Composite composite,
    final TeamExplorerContext context) {
    final Composite headerComposite = toolkit.createComposite(composite);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(headerComposite, 3, false, 0, 0);
    GridDataBuilder.newInstance().applyTo(headerComposite);

    final String title = Messages.getString("TeamExplorerPendingChangesIncludedSection.ExcludeAllLinkText"); //$NON-NLS-1$
    final Hyperlink includeAllHyperlink = toolkit.createHyperlink(headerComposite, title, SWT.WRAP);
    includeAllHyperlink.setUnderlined(false);
    AutomationIDHelper.setWidgetID(includeAllHyperlink, EXCLUDE_ALL_HYPERLINK_ID);
    includeAllHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            getModel().excludeAllPendingChanges();
            clearFilterTextbox();
            TeamExplorerHelpers.updateContainingSectionTitle(treeComposite, getTitle());
        }
    });
    GridDataBuilder.newInstance().applyTo(includeAllHyperlink);

    final Label separator = toolkit.createLabel(headerComposite, "|", SWT.VERTICAL); //$NON-NLS-1$
    GridDataBuilder.newInstance().vFill().applyTo(separator);

    final String linkText = Messages.getString("TeamExplorerPendingChangesIncludedSection.FilterLinkText"); //$NON-NLS-1$
    final Menu menu = createFilterMenu(composite.getShell());
    final ImageHyperlink link = PageHelpers.createDropHyperlink(toolkit, headerComposite, linkText, menu);
    GridDataBuilder.newInstance().applyTo(link);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:35,代码来源:TeamExplorerPendingChangesIncludedSection.java


示例15: createControl

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Override
public Composite createControl(final Composite parent){
	// Form form=tk.createForm(parent);
	// form.setLayoutData(SWTHelper.getFillGridData(1,true,1,false));
	// Composite ret=form.getBody();
	Composite ret = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout(2, false);
	layout.marginWidth = 0;
	ret.setLayout(layout);
	ret.setBackground(parent.getBackground());
	
	ImageHyperlink hClr = tk.createImageHyperlink(ret, SWT.NONE); //$NON-NLS-1$
	hClr.setImage(Images.IMG_CLEAR.getImage());
	hClr.addHyperlinkListener(new HyperlinkAdapter() {
		
		@Override
		public void linkActivated(final HyperlinkEvent e){
			clearValues();
		}
		
	});
	hClr.setBackground(parent.getBackground());
	
	inner = new Composite(ret, SWT.NONE);
	GridLayout lRet = new GridLayout(fields.length, true);
	inner.setLayout(lRet);
	inner.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	
	populateInnerComposite();
	
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:33,代码来源:DefaultControlFieldProvider.java


示例16: linkActivated

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Override
public void linkActivated(HyperlinkEvent e) {
	ImageHyperlink link = (ImageHyperlink) e.widget;
	Object data = link.getData();
	if (data instanceof CategoryDescriptor) {
		CategoryDescriptor d = (CategoryDescriptor) data;
		Category c = Cache.getEntityCache().get(Category.class, d.getId());
		Navigator.select(c);
	} else if (data instanceof CategorizedDescriptor) {
		App.openEditor((CategorizedDescriptor) data);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:13,代码来源:SearchResultView.java


示例17: renderFlowLink

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void renderFlowLink(Image image, Composite composite,
		ProcessDescriptor d) {
	ImageHyperlink link = new ImageHyperlink(composite, SWT.TOP);
	link.setText(Labels.getDisplayName(d));
	link.setToolTipText(Labels.getDisplayInfoText(d));
	link.setImage(image);
	link.setForeground(Colors.linkBlue());
	Controls.onClick(link, e -> {
		ProcessDao dao = new ProcessDao(database);
		Process p = dao.getForId(d.getId());
		App.openEditor(p);
	});
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:14,代码来源:FlowUseSection.java


示例18: renderUsageLink

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void renderUsageLink(Image image, Composite composite, int rest) {
	if (rest < 1)
		return;
	ImageHyperlink link = new ImageHyperlink(composite, SWT.TOP);
	link.setText(rest + " more"); // TODO: @translate
	link.setImage(image);
	link.setForeground(Colors.linkBlue());
	Controls.onClick(link,
			e -> UsageView.open(Descriptors.toDescriptor(flow)));
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:11,代码来源:FlowUseSection.java


示例19: initControl

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
private void initControl(Composite parent, FormToolkit toolkit) {
	if (!App.isCommentingEnabled() || comments == null || !comments.hasPath(path)) {
		UI.filler(parent, toolkit);
		return;
	}
	ImageHyperlink control = new ImageHyperlink(parent, SWT.NONE);
	UI.gridData(control, false, false).verticalAlignment = SWT.TOP;
	Controls.onClick(control, (e) -> {
		new CommentDialog(path, comments).open();
	});
	control.setImage(Icon.SHOW_COMMENTS.get());
	control.setToolTipText(M.Comment);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:14,代码来源:CommentControl.java


示例20: setWidgetImage

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入依赖的package包/类
@Override
protected void setWidgetImage(ImageHyperlink widget, Image image) {
    widget.setImage(image);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:5,代码来源:ElementTypeDataModelImageHyperlinkView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ModelBuilder类代码示例发布时间:2022-05-22
下一篇:
Java DefaultRenameStrategy类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap