本文整理匯總了Java中org.eclipse.swt.widgets.Link.setLayoutData方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.setLayoutData方法的具體用法?Java Link.setLayoutData怎麽用?Java Link.setLayoutData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Link
的用法示例。
在下文中一共展示了Link.setLayoutData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addComment
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void addComment( Composite parent , String text ){
final Link link = new Link( parent , SWT.LEFT );
link.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
link.setText(text);
link.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
final String href = event.text;
if( href != null ){
new Thread( new Runnable() {
public void run() throws TGException {
TGCommunityWeb.open(getContext(), href);
}
} ).start();
}
}
});
}
示例2: setBackupWorkspace
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void setBackupWorkspace() {
if (warning == null) {
warning = new Label(this, SWT.WRAP);
warning.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 2, 1));
warning.setText(ResourceManager.instance().getLabel("targettree.isbackup.warning"));
warning.setForeground(Colors.C_RED);
more = new Link(this, SWT.NONE);
more.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
more.setText("<A HREF=\"" + ArecaURLs.BACKUP_COPY_URL + "\">" + ResourceManager.instance().getLabel("targettree.isbackup.more") + "</A>");
more.addListener (SWT.Selection, new Listener () {
public void handleEvent(Event event) {
try {
ViewerHandlerHelper.getViewerHandler().browse(new URL(event.text));
} catch (Exception e) {
Logger.defaultLogger().error(e);
}
}
});
this.layout(true);
}
}
示例3: createContents
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
Label icon = new Label(composite, SWT.NONE);
icon.setImage(ArecaImages.ICO_BIG);
icon.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 2));
Label lbl = new Label(composite, SWT.NONE);
lbl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
lbl.setText("You have used Areca-Backup more than " + ArecaUserPreferences.getLaunchCount() + " times since its installation on your computer.\nIf you find Areca useful, please consider making a donation to support the time that has been (and still is) spent on it.");
Link lnk = DonationLink.build(composite);
lnk.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
SavePanel pnlSave = new SavePanel(RM.getLabel("common.close.label"), this);
pnlSave.setShowCancel(false);
Composite pnl = pnlSave.buildComposite(composite);
pnl.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 2, 1));
composite.pack();
return composite;
}
示例4: 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;
}
示例5: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP);
link.setText(ActionMessages.AddDelegateMethodsAction_template_link_message);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openCodeTempatePage(CodeTemplateContextType.OVERRIDECOMMENT_ID);
}
});
link.setToolTipText(ActionMessages.AddDelegateMethodsAction_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;
}
示例6: createKeysLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void createKeysLink(Composite composite, int h_span) {
Link link= new Link(composite, SWT.NONE | SWT.WRAP);
link.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_key_binding_hint);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null);
}
});
PixelConverter pixelConverter= new PixelConverter(composite);
int width= pixelConverter.convertWidthInCharsToPixels(40);
// limit the size of the Link as it would take all it can get
GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1);
gd.widthHint= width;
link.setLayoutData(gd);
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:19,代碼來源:CodeAssistAdvancedConfigurationBlock.java
示例7: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
@Override
protected Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP);
link.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_template_link_message);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openCodeTempatePage(CodeTemplateContextType.CONSTRUCTORCOMMENT_ID);
}
});
link.setToolTipText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_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,代碼來源:GenerateConstructorUsingFieldsSelectionDialog.java
示例8: createLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
public static Link createLink(Composite container, String label, int columns, int horizontalAlignment,
Integer verticalIndent, Integer horizontalIndent) {
Link linkButton = new Link(container, SWT.CHECK);
linkButton.setText(label);
if (columns != -1) {
GridData gridData = new GridData();
gridData.horizontalSpan = columns;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = horizontalAlignment; // SWT.FILL;
if (verticalIndent != null) {
gridData.verticalIndent = verticalIndent;
}
if (horizontalIndent != null) {
gridData.horizontalIndent = horizontalIndent;
}
linkButton.setLayoutData(gridData);
}
return linkButton;
}
示例9: createLinkControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private Control createLinkControl(Composite composite) {
Link link= new Link(composite, SWT.WRAP | SWT.RIGHT);
link.setText(DialogsMessages.SortMembersMessageDialog_description);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
openMembersSortOrderPage();
}
});
link.setToolTipText(DialogsMessages.SortMembersMessageDialog_link_tooltip);
GridData gridData= new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData.widthHint= convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);//convertWidthInCharsToPixels(60);
link.setLayoutData(gridData);
link.setFont(composite.getFont());
return link;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:18,代碼來源:SortMembersMessageDialog.java
示例10: 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
示例11: 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;
}
示例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;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:20,代碼來源:NewJavaProjectWizardPageOne.java
示例13: createHeader
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void createHeader(Composite contents) {
final Shell shell= contents.getShell();
String text= PreferencesMessages.JavaEditorPreferencePage_link;
Link link= new Link(contents, SWT.NONE);
link.setText(text);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$
PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, null);
else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, "selectFont:org.eclipse.jdt.ui.editors.textfont"); //$NON-NLS-1$
}
});
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gridData.widthHint= 150; // only expand further if anyone else requires it
link.setLayoutData(gridData);
addFiller(contents);
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:22,代碼來源:JavaEditorAppearanceConfigurationBlock.java
示例14: addLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void addLink(Composite composite, String text) {
GridData gd;
final Link link= new Link(composite, SWT.NONE);
link.setText(text);
gd= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gd.widthHint= 300; // don't get wider initially
gd.horizontalSpan= 2;
gd.horizontalIndent= LayoutUtil.getIndent();
link.setLayoutData(gd);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, null);
}
});
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:17,代碼來源:JavaEditorAppearanceConfigurationBlock.java
示例15: createLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
public static Link createLink(Composite parent, String text, Font font, int hspan, int fill) {
Link l = new Link(parent, SWT.UNDERLINE_LINK);
l.setFont(font);
l.setText(text);
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
l.setLayoutData(gd);
return l;
}