use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class LogParserEditor method createMacroSection.
/**
* @param macroArea
*/
private void createMacroSection(Composite macroArea) {
GridLayout layout = new GridLayout();
layout.numColumns = 2;
macroArea.setLayout(layout);
macroList = new TableViewer(macroArea, SWT.BORDER);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.verticalSpan = 3;
final Table table = macroList.getTable();
table.setLayoutData(gd);
TableColumn tc = new TableColumn(table, SWT.LEFT);
tc.setText(Messages.get().LogParserEditor_Name);
tc.setWidth(100);
tc = new TableColumn(table, SWT.LEFT);
tc.setText(Messages.get().LogParserEditor_Value);
tc.setWidth(200);
macroList.setContentProvider(new ArrayContentProvider());
ImageHyperlink link = toolkit.createImageHyperlink(macroArea, SWT.NONE);
link.setImage(SharedIcons.IMG_ADD_OBJECT);
link.setText(Messages.get().LogParserEditor_Add);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
link.setLayoutData(gd);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addMacro();
}
});
link = toolkit.createImageHyperlink(macroArea, SWT.NONE);
link.setImage(SharedIcons.IMG_EDIT);
link.setText(Messages.get().LogParserEditor_Edit);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
link.setLayoutData(gd);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
editMacro();
}
});
link = toolkit.createImageHyperlink(macroArea, SWT.NONE);
link.setImage(SharedIcons.IMG_DELETE_OBJECT);
link.setText(Messages.get().LogParserEditor_Delete);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
link.setLayoutData(gd);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
deleteMacro();
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project tdq-studio-se by Talend.
the class BusinessRuleAnalysisDetailsPage method createAnalysisTablesSection.
void createAnalysisTablesSection(final ScrolledForm form1, Composite anasisDataComp) {
analysisTableSection = createSection(form1, anasisDataComp, DefaultMessagesImpl.getString("TableMasterDetailsPage.analyzeTable"), // $NON-NLS-1$
null);
Composite topComp1 = toolkit.createComposite(analysisTableSection);
topComp1.setLayout(new GridLayout());
// ~ MOD mzhao 2009-05-05,Bug 6587.
createConnBindWidget(topComp1);
// ~
Composite actionBarComp = toolkit.createComposite(topComp1);
GridLayout gdLayout = new GridLayout();
gdLayout.numColumns = 3;
actionBarComp.setLayout(gdLayout);
ImageHyperlink collapseAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
// $NON-NLS-1$
collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("TableMasterDetailsPage.collapseAllTables"));
WorkbenchUtils.setHyperlinkImage(collapseAllImageLink, ImageLib.getImage(ImageLib.COLLAPSE_ALL));
collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
TreeItem[] items = treeViewer.getTree().getItems();
expandTreeItems(items, false);
packOtherColumns();
}
});
ImageHyperlink expandAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
// $NON-NLS-1$
expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("TableMasterDetailsPage.expandAllTables"));
WorkbenchUtils.setHyperlinkImage(expandAllImageLink, ImageLib.getImage(ImageLib.EXPAND_ALL));
expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
TreeItem[] items = treeViewer.getTree().getItems();
expandTreeItems(items, true);
packOtherColumns();
}
});
Button clmnBtn = // $NON-NLS-1$
toolkit.createButton(// $NON-NLS-1$
actionBarComp, // $NON-NLS-1$
DefaultMessagesImpl.getString("TableMasterDetailsPage.selectTable"), SWT.NONE);
clmnBtn.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
openTableSelectionDialog();
}
});
Composite treeComp = toolkit.createComposite(topComp1, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(treeComp);
treeComp.setLayout(new GridLayout());
((GridData) treeComp.getLayoutData()).heightHint = TREE_MAX_LENGTH;
treeComp.setBackgroundMode(SWT.INHERIT_DEFAULT);
treeViewer = new AnalysisTableTreeViewer(treeComp, this);
treeViewer.setDirty(false);
treeViewer.addPropertyChangeListener(this);
analysisTableSection.setClient(topComp1);
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project tdq-studio-se by Talend.
the class ColumnAnalysisResultPage method createCollapseAllLink.
/**
* create CollapseAll Link for result section.
*
* @param composite
*/
private void createCollapseAllLink(Composite composite) {
ImageHyperlink collapseAllImageLink = toolkit.createImageHyperlink(composite, SWT.NONE);
// $NON-NLS-1$
collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("CollapseAllColumns"));
WorkbenchUtils.setHyperlinkImage(collapseAllImageLink, ImageLib.getImage(ImageLib.COLLAPSE_ALL));
collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
List<ExpandableComposite> expandableCompositeList = getExpandableCompositeList();
if (expandableCompositeList != null && !expandableCompositeList.isEmpty()) {
for (ExpandableComposite comp : expandableCompositeList) {
comp.setExpanded(false);
comp.getParent().pack();
}
}
form.reflow(true);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project tdq-studio-se by Talend.
the class DynamicAnalysisMasterPage method createExpandAllLink.
private void createExpandAllLink(Composite actionBarComp) {
ImageHyperlink expandAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
expandAllImageLink.setToolTipText(getExpandString());
WorkbenchUtils.setHyperlinkImage(expandAllImageLink, ImageLib.getImage(ImageLib.EXPAND_ALL));
expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
List<ExpandableComposite> previewChartList = getPreviewChartList();
if (previewChartList != null && !previewChartList.isEmpty()) {
for (ExpandableComposite comp : previewChartList) {
comp.setExpanded(true);
comp.getParent().pack();
}
}
if (getChartComposite() != null) {
getChartComposite().getParent().pack();
}
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project egit by eclipse.
the class ReflogView method updateRefLink.
private void updateRefLink(final String name) {
IToolBarManager toolbar = form.getToolBarManager();
toolbar.removeAll();
ControlContribution refLabelControl = new ControlContribution(// $NON-NLS-1$
"refLabel") {
@Override
protected Control createControl(Composite cParent) {
Composite composite = toolkit.createComposite(cParent);
composite.setLayout(new RowLayout());
composite.setBackground(null);
final ImageHyperlink refLink = new ImageHyperlink(composite, SWT.NONE);
Image image = UIIcons.BRANCH.createImage();
UIUtils.hookDisposal(refLink, image);
refLink.setImage(image);
refLink.setFont(JFaceResources.getBannerFont());
refLink.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
refLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent event) {
Repository repository = getRepository();
if (repository == null)
return;
RefSelectionDialog dialog = new RefSelectionDialog(refLink.getShell(), repository);
if (Window.OK == dialog.open())
showReflogFor(repository, dialog.getRefName());
}
});
refLink.setText(Repository.shortenRefName(name));
return composite;
}
};
toolbar.add(refLabelControl);
toolbar.update(true);
}
Aggregations