本文整理匯總了Java中org.eclipse.swt.widgets.Link.addSelectionListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.addSelectionListener方法的具體用法?Java Link.addSelectionListener怎麽用?Java Link.addSelectionListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Link
的用法示例。
在下文中一共展示了Link.addSelectionListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createContents
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void createContents(String str) {
aboutToolsShell = new Shell(getParent(), getStyle());
aboutToolsShell.setImage(SWTResourceManager.getImage(ShortcutKeyExplain.class, Resource.IMAGE_ICON));
aboutToolsShell.setSize(400, 391);
aboutToolsShell.setText(getText());
PubUtils.setCenterinParent(getParent(), aboutToolsShell);
Link link = new Link(aboutToolsShell, SWT.NONE);
link.setBounds(143, 336, 108, 17);
link.setText("<a>www.itlaborer.com</a>");
link.addSelectionListener(new LinkSelection());
StyledText readMeTextLabel = new StyledText(aboutToolsShell,
SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
readMeTextLabel.setBounds(3, 33, 389, 297);
readMeTextLabel.setText(str);
Label label_2 = new Label(aboutToolsShell, SWT.NONE);
label_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微軟雅黑", 9, SWT.BOLD));
label_2.setText("快捷鍵說明:");
label_2.setBounds(3, 12, 136, 17);
}
示例2: addSelectionListenerToLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void addSelectionListenerToLink(final PropertyToolTipInformation propertyInfo, final Link link) {
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if(OPERATION.equalsIgnoreCase(propertyInfo.getPropertyName()))
transformMapping.setAddPassThroughFields(true);
else if(JOIN_MAPPING.equalsIgnoreCase(propertyInfo.getPropertyName()))
{
joinMappingGrid.setAddPassThroughFields(true);
}
else if(LOOKUP_MAPPING.equalsIgnoreCase(propertyInfo.getPropertyName()))
{
lookupMappingGrid.setAddPassThroughFields(true);
}
link.setLinkForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0,0,255));
}
});
}
示例3: addListenerToOpenOpeartionClassFile
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
/**
* Add listener to open operation class file
*
* @param filePath
* @param link
*/
private void addListenerToOpenOpeartionClassFile(final String filePath,
Link link) {
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.debug("ComponentTooltip.widgetSelected(): Link clicked");
super.widgetSelected(e);
boolean flag = FilterOperationClassUtility.INSTANCE.openFileEditor(null,filePath);
if (!flag) {
logger.debug("ComponentTooltip.widgetSelected(): Link clicked - error - File " + filePath + " Not Found");
WidgetUtility.errorMessage("File Not Found");
} else {
logger.debug("ComponentTooltip.widgetSelected(): Link clicked - hiding tooltip");
setVisible(false);
}
}
});
logger.debug("ComponentTooltip.addListenerToOpenOpeartionClassFile(): added opeartion class link listener");
}
示例4: createFieldEditors
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
/**
* Creates the field editors. Field editors are abstractions of the common
* GUI blocks needed to manipulate various types of preferences. Each field
* editor knows how to save and restore itself.
*/
public void createFieldEditors() {
Composite composite = getFieldEditorParent();
String message = "You can visit the project site at <a href=\"https://github.com/de-jcup/egradle/wiki\">GitHub</a>.";
Link link = new Link(composite, SWT.NONE);
link.setText(message);
link.setSize(400, 100);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
try {
// Open default external browser
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(e.text));
} catch (Exception ex) {
MainActivator.getDefault().getLog().log(new Status(IStatus.ERROR, MainActivator.PLUGIN_ID, "Was not able to open url in external browser", ex));
}
}
});
}
示例5: createDialogArea
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(final Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
Composite container = new Composite(dialogArea, SWT.NONE);
Link flexPricing = new Link(container, SWT.WRAP);
flexPricing.setText(Messages.getString("deploy.preferences.dialog.flex.pricing")); //$NON-NLS-1$
flexPricing.addSelectionListener(
new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
FontUtil.convertFontToItalic(flexPricing);
GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
Point margins = LayoutConstants.getMargins();
GridLayoutFactory.fillDefaults()
.extendedMargins(margins.x, margins.x, 0 /* no upper margin */, margins.y)
.generateLayout(container);
return dialogArea;
}
示例6: ProjectSelector
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
public ProjectSelector(Composite parent) {
super(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().numColumns(2).spacing(0, 0).applyTo(this);
Composite tableComposite = new Composite(this, SWT.NONE);
TableColumnLayout tableColumnLayout = new TableColumnLayout();
tableComposite.setLayout(tableColumnLayout);
GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
createColumns(tableColumnLayout);
viewer.getTable().setHeaderVisible(true);
viewer.getTable().setLinesVisible(false);
input = WritableList.withElementType(GcpProject.class);
projectProperties = PojoProperties.values(new String[] {"name", "id"}); //$NON-NLS-1$ //$NON-NLS-2$
ViewerSupport.bind(viewer, input, projectProperties);
viewer.setComparator(new ViewerComparator());
Composite linkComposite = new Composite(this, SWT.NONE);
statusLink = new Link(linkComposite, SWT.WRAP);
statusLink.addSelectionListener(
new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
statusLink.setText("");
GridDataFactory.fillDefaults().span(2, 1).applyTo(linkComposite);
GridLayoutFactory.fillDefaults().generateLayout(linkComposite);
}
示例7: createMessageArea
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createMessageArea(Composite composite)
{
String message = this.message;
this.message = null;
Composite messageArea = (Composite) super.createMessageArea(composite);
messageLink = new Link(messageArea, getMessageLabelStyle() | SWT.NO_FOCUS);
messageLink.setText("<a></a>" + message); //$NON-NLS-1$
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false)
.hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT)
.applyTo(messageLink);
messageLink.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
openLink(e);
}
});
return messageArea;
}
示例8: createUI_270_IC_3_99_Actions
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void createUI_270_IC_3_99_Actions(final Composite parent) {
// V-spacer
new Label(parent, SWT.NONE);
{
_linkIC_ILActions = new Link(parent, SWT.NONE);
_linkIC_ILActions.setText(Messages.Dialog_ImportConfig_Link_OtherActions);
_linkIC_ILActions.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
onSelect_IC_LauncherActions();
}
});
GridDataFactory
.fillDefaults()//
.grab(true, false)
.span(2, 1)
.align(SWT.FILL, SWT.CENTER)
.applyTo(_linkIC_ILActions);
}
// V-spacer
new Label(parent, SWT.NONE);
}
示例9: createControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private Control createControl(Composite parent) {
Account account = getAccount();
if (account == null) {
Label label = new Label(parent, SWT.NONE);
label.setText(id);
logger.info("Lable text=" + id);
return label;
}
Link link = new Link(parent, SWT.NONE);
link.setText("<A>" + id + "</A>");
logger.info("Link text=<A>" + id + "</A>");
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
listener.click(AccountLink.this);
}
});
return link;
}
示例10: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP);
link.setText(ActionMessages.AddUnimplementedConstructorsAction_template_link_message);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openCodeTempatePage(CodeTemplateContextType.CONSTRUCTORCOMMENT_ID);
}
});
link.setToolTipText(ActionMessages.AddUnimplementedConstructorsAction_template_link_tooltip);
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
link.setLayoutData(gridData);
return link;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:18,代碼來源:AddUnimplementedConstructorsAction.java
示例11: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP);
link.setText(ActionMessages.AddGetterSetterAction_template_link_description);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openCodeTempatePage(CodeTemplateContextType.GETTERCOMMENT_ID);
}
});
link.setToolTipText(ActionMessages.AddGetterSetterAction_template_link_tooltip);
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
link.setLayoutData(gridData);
return link;
}
示例12: createContent
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
public Control createContent(Composite composite) {
fGroup= new Group(composite, SWT.NONE);
fGroup.setFont(composite.getFont());
fGroup.setLayout(initGridLayout(new GridLayout(3, false), true));
fGroup.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_title);
fStdRadio.doFillIntoGrid(fGroup, 3);
LayoutUtil.setHorizontalGrabbing(fStdRadio.getSelectionButton(null));
fSrcBinRadio.doFillIntoGrid(fGroup, 2);
fPreferenceLink= new Link(fGroup, SWT.NONE);
fPreferenceLink.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_link_description);
fPreferenceLink.setLayoutData(new GridData(GridData.END, GridData.END, false, false));
fPreferenceLink.addSelectionListener(this);
updateEnableState();
return fGroup;
}
示例13: createControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
public Control createControl(Composite composite) {
fGroup= new Group(composite, SWT.NONE);
fGroup.setFont(composite.getFont());
fGroup.setLayout(initGridLayout(new GridLayout(2, false), true));
fGroup.setText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_title);
fUseEEJRE.doFillIntoGrid(fGroup, 1);
Combo eeComboControl= fEECombo.getComboControl(fGroup);
eeComboControl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
fUseProjectJRE.doFillIntoGrid(fGroup, 1);
Combo comboControl= fJRECombo.getComboControl(fGroup);
comboControl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
fUseDefaultJRE.doFillIntoGrid(fGroup, 1);
fPreferenceLink= new Link(fGroup, SWT.NONE);
fPreferenceLink.setFont(fGroup.getFont());
fPreferenceLink.setText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_link_description);
fPreferenceLink.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
fPreferenceLink.addSelectionListener(this);
updateEnableState();
return fGroup;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:26,代碼來源:NewJavaProjectWizardPageOne.java
示例14: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP);
link.setText(JavaUIMessages.OverrideMethodDialog_link_message);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openCodeTempatePage(CodeTemplateContextType.OVERRIDECOMMENT_ID);
}
});
link.setToolTipText(JavaUIMessages.OverrideMethodDialog_link_tooltip);
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
link.setLayoutData(gridData);
return link;
}
示例15: createContents
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent) {
final Composite composite= new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(new GridLayout());
Link link= new Link(composite, SWT.WRAP);
GridData data= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
data.widthHint= 300;
link.setLayoutData(data);
link.setText(PreferencesMessages.JavaEditorPropertyPage_SaveActionLink_Text);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)getContainer();
container.openPage(SaveParticipantPreferencePage.PROPERTY_PAGE_ID, null);
}
});
noDefaultAndApplyButton();
Dialog.applyDialogFont(composite);
return composite;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:23,代碼來源:JavaEditorPropertyPage.java