本文整理汇总了Java中org.eclipse.ui.forms.widgets.ImageHyperlink类的典型用法代码示例。如果您正苦于以下问题:Java ImageHyperlink类的具体用法?Java ImageHyperlink怎么用?Java ImageHyperlink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageHyperlink类属于org.eclipse.ui.forms.widgets包,在下文中一共展示了ImageHyperlink类的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: 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;
}
示例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));
}
示例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);
}
}
示例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);
}
});
}
示例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);
}
示例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);
}
}
示例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();
}
});
}
示例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();
}
});
}
示例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;
}
示例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;
}
示例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;
}