當前位置: 首頁>>代碼示例>>Java>>正文


Java Link.setLayoutData方法代碼示例

本文整理匯總了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();
			}
		}
	});
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:18,代碼來源:TGCommunityStartupScreen.java

示例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);
	}
}
 
開發者ID:chfoo,項目名稱:areca-backup-release-mirror,代碼行數:25,代碼來源:TargetTreeComposite.java

示例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;
  }
 
開發者ID:chfoo,項目名稱:areca-backup-release-mirror,代碼行數:24,代碼來源:DonationWindow.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:18,代碼來源:AddGetterSetterAction.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:18,代碼來源:AddDelegateMethodsAction.java

示例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;
}
 
開發者ID:wso2,項目名稱:developer-studio,代碼行數:20,代碼來源:WSO2UIToolkit.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:18,代碼來源:OverrideMethodDialog.java

示例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;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:10,代碼來源:SWTFactory.java


注:本文中的org.eclipse.swt.widgets.Link.setLayoutData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。