use of org.eclipse.swt.widgets.Link in project cogtool by cogtool.
the class EltGroupPropertiesPane method createWidgets.
protected void createWidgets() {
eltGroupNameLabel = new DisplayLabel(this, SWT.NONE);
eltGroupNameLabel.setText(groupNameLabel);
eltGroupName = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.SetRemoteLabelText, view) {
@Override
protected boolean doChangeAction() {
FrameElementGroup eltGroup = (FrameElementGroup) getData();
FrameEditorUI.EltGroupRenameParameters evt = new FrameEditorUI.EltGroupRenameParameters(eltGroup, getText());
boolean changed = view.performAction(FrameEditorLID.RenameEltGroup, evt, true);
if (!changed) {
setText(eltGroup.getName());
}
return changed;
}
};
remoteLabel = new DisplayLabel(this, SWT.NONE);
remoteLabel.setText(L10N.get("FE.RemoteLabelCaption", "Remote Label") + ":");
remoteLabelFind = new Link(this, SWT.NONE);
remoteLabelFind.setText(L10N.get("FE.RemoteLabelFind", "<a>Find</a>"));
remoteLabelFind.setFont(FontUtils.getAdjustedFont(remoteLabelFind.getFont(), 8, SWT.BOLD));
remoteLabelText = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.SetRemoteLabelText, view);
auxTextLabel = new DisplayLabel(this, SWT.NONE);
auxTextLabel.setText(L10N.get("FE.AuxTextLabelCaption", "Auxiliary Text") + ":");
auxText = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.ChangeAuxTextProperty, view);
groupEltsTreeLabel = new DisplayLabel(this, SWT.NONE);
groupEltsTreeLabel.setText(GROUP_ELTS);
groupEltsTree = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
groupEltsTree.setLinesVisible(true);
groupEltsUpdater = new TreeItemUpdater.FrameEltItemUpdater(groupEltsTree);
}
use of org.eclipse.swt.widgets.Link in project cogtool by cogtool.
the class AboutView method addLink.
// buildDialog
protected void addLink(String label, final String url) {
Link link = new Link(dialog, SWT.NONE);
GridData linkLayout = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
linkLayout.horizontalSpan = 4;
link.setLayoutData(linkLayout);
link.setText(label + ": <a href=\"" + url + "\">" + url + "</a>");
link.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event evt) {
Program.launch(url);
}
});
}
use of org.eclipse.swt.widgets.Link in project tesb-studio-se by Talend.
the class InitFinishMessageDialog method createMessageArea.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createMessageArea(Composite composite) {
// create image
Image image = getImage();
if (image != null) {
imageLabel = new Label(composite, SWT.NULL);
image.setBackground(imageLabel.getBackground());
imageLabel.setImage(image);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
}
Link link = new Link(composite, SWT.WRAP);
link.setText("Local runtime serview has been started, totally installed bundles: <a href=\"#\">" + bundlesName.length + "</a>.");
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ElementListSelectionDialog report = new ElementListSelectionDialog(getShell(), new LabelProvider());
report.setTitle("Installed bundles:");
report.setMessage("Search bundle (? = any character, * = any string):");
report.setElements(bundlesName);
report.open();
}
});
return composite;
}
use of org.eclipse.swt.widgets.Link in project azure-tools-for-java by Microsoft.
the class SDKJarsFilter method createLinks.
private void createLinks(Composite container) {
// Privacy Link
lnkAIPrivacy = new Link(container, SWT.RIGHT);
GridData gridData = new GridData();
gridData.horizontalSpan = 4;
gridData.horizontalIndent = 10;
gridData.verticalIndent = 5;
lnkAIPrivacy.setText(Messages.lnkAIPrivacy);
lnkAIPrivacy.setLayoutData(gridData);
lnkAIPrivacy.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(event.text));
} catch (Exception ex) {
/*
* only logging the error in log file
* not showing anything to end user
*/
Activator.getDefault().log(Messages.lnkAIPrivacy, ex);
}
}
});
}
use of org.eclipse.swt.widgets.Link in project translationstudio8 by heartsome.
the class MachineTranslationPreferencePage method createBingTranslateArea.
private Composite createBingTranslateArea(Composite tparent) {
Group apiKeySettingGroup = new Group(tparent, SWT.NONE);
apiKeySettingGroup.setText(Messages.getString("preference.BingPreferencePage.apiKeySettingGroup"));
apiKeySettingGroup.setLayout(new GridLayout(1, false));
apiKeySettingGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
HsImageLabel lbKeySetting = new HsImageLabel(Messages.getString("preference.BingPreferencePage.lbKeySetting"), Activator.getImageDescriptor("images/trans_bing_key_32.png"));
Composite com = lbKeySetting.createControl(apiKeySettingGroup);
com.setLayout(new GridLayout(3, false));
Label lblId = new Label(com, SWT.NONE);
lblId.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblId.setText(Messages.getString("preference.BingPreferencePage.lblId"));
idText = new Text(com, SWT.BORDER);
idText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
new Label(com, SWT.NONE);
Label lblApiKey = new Label(com, SWT.NONE);
lblApiKey.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblApiKey.setText(Messages.getString("preference.BingPreferencePage.lblApiKey"));
bingKeyText = new Text(com, SWT.BORDER);
bingKeyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
bingStateLable = new Label(com, SWT.NONE);
bingStateLable.setImage(errorImage);
new Label(com, SWT.NONE);
Button validateKey = new Button(com, SWT.NONE);
validateKey.setText(Messages.getString("preference.BingPreferencePage.validateKey"));
validateKey.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String id = idText.getText();
String bingKey = bingKeyText.getText();
if (id == null || id.equals("")) {
MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg1"));
return;
}
if (bingKey == null || bingKey.equals("")) {
MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg2"));
return;
}
bingValidator();
setComponentsState();
if (!bingState) {
MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg3"));
return;
}
}
});
new Label(com, SWT.NONE);
new Label(com, SWT.NONE);
Link link = new Link(com, SWT.NONE);
link.setText("<a>" + Messages.getString("preference.BingPreferencePage.link") + "</a>");
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Program.launch("http://msdn.microsoft.com/en-us/library/hh454950.aspx");
}
});
link.setToolTipText("http://msdn.microsoft.com/en-us/library/hh454950.aspx");
new Label(com, SWT.NONE);
lbKeySetting.computeSize();
return tparent;
}
Aggregations