本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
});
}
示例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);
}
示例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);
}
}
示例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();
}
});
}
示例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();
}
});
}
示例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;
}
示例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);
});
}
示例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)));
}
示例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);
}
示例14: setWidgetImage
import org.eclipse.ui.forms.widgets.ImageHyperlink; //导入方法依赖的package包/类
@Override
protected void setWidgetImage(ImageHyperlink widget, Image image) {
widget.setImage(image);
}
示例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));
}