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


Java ImageHyperlink.setImage方法代码示例

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


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

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

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

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

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

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

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

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

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

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

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

示例15: decorateLink

import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入方法依赖的package包/类
private static void decorateLink(ImageHyperlink link, CategorizedEntity entity) {
	link.setText(Labels.getDisplayName(entity));
	link.setImage(Images.get(entity));
	Controls.onClick(link, (e) -> App.openEditor(entity));
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:6,代码来源:InfoSection.java


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