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


Java Link類代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Link的典型用法代碼示例。如果您正苦於以下問題:Java Link類的具體用法?Java Link怎麽用?Java Link使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Link類屬於org.eclipse.swt.widgets包,在下文中一共展示了Link類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: LinkComposite

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
public LinkComposite ( final Composite parent, final int style, final String format )
{
    super ( parent, style );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.textLabel = new Link ( this, SWT.NONE );
    this.textLabel.setText ( format );

    this.textLabel.addSelectionListener ( new SelectionAdapter () {

        @Override
        public void widgetSelected ( final SelectionEvent event )
        {
            logger.info ( "LinkComponent selected: {}", event.text ); //$NON-NLS-1$
            Program.launch ( event.text );
        }
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:LinkComposite.java

示例2: createDialogArea

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	
	Link link = new Link(container, SWT.NONE);
	link.setText("Your project has been successfully deployed.\n\nYou can try it with this URL:\n<a href=\""+ projectURL + "\">" + projectURL + "</a>");
	link.addListener (SWT.Selection, new Listener () {
		
		public void handleEvent(Event event) {
			org.eclipse.swt.program.Program.launch(event.text);
		}
		
	});
			
	link.setSize(330, 150);

	return container;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:23,代碼來源:ProjectDeploySuccessfulDialog.java

示例3: 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);
}
 
開發者ID:cnldw,項目名稱:APITools,代碼行數:23,代碼來源:ShortcutKeyExplain.java

示例4: 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));
	    }
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:19,代碼來源:ComponentTooltip.java

示例5: 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");
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:27,代碼來源:ComponentTooltip.java

示例6: 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));
			}
		}
	});
	
	
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:29,代碼來源:EGradlePreferencePage.java

示例7: 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;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:20,代碼來源:FlexDeployPreferencesDialog.java

示例8: 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);
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:27,代碼來源:ProjectSelector.java

示例9: 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

示例10: doLinkActivated

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
final void doLinkActivated(Link link) {
	Map data = new HashMap();
	data.put(DATA_NO_LINK, Boolean.TRUE);

	if (isProjectPreferencePage()) {
		openWorkspacePreferences(data);
	} else {
		/*
		 * HashSet projectsWithSpecifics= new HashSet(); try {
		 * IJavaScriptProject[] projects=
		 * JavaScriptCore.create(ResourcesPlugin.getWorkspace().getRoot()).
		 * getJavaScriptProjects(); for (int i= 0; i < projects.length; i++)
		 * { IJavaScriptProject curr= projects[i]; if
		 * (hasProjectSpecificOptions(curr.getProject())) {
		 * projectsWithSpecifics.add(curr); } } } catch
		 * (JavaScriptModelException e) { // ignore } ProjectSelectionDialog
		 * dialog= new ProjectSelectionDialog(getShell(),
		 * projectsWithSpecifics); if (dialog.open() == Window.OK) {
		 * IJavaScriptProject res= (IJavaScriptProject)
		 * dialog.getFirstResult(); openProjectProperties(res.getProject(),
		 * data); }
		 */
	}
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:25,代碼來源:PropertyAndPreferencePage.java

示例11: createControls

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
protected void createControls() {
	group = new Group(this, SWT.NONE);
	group.setLayout(new GridLayout(3, false));
	imageLabel = new Label(group, SWT.NONE);
	GridDataFactory.fillDefaults().grab(false, false).align(SWT.BEGINNING, SWT.CENTER).applyTo(imageLabel);
	textLabel = new Link(group, SWT.WRAP);
	textLabel.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (DOWNLOAD_LINK.equals(e.text)) {
				Program.launch(DOWNLOAD_LINK);
			} else {
				PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), PREF_PAGE_ID,
						new String[] { DISPLAY_ID }, null);
				dialog.setSelectedNode("DISPLAY_ID");
				dialog.open();
			}
		}
	});
	GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(textLabel);
	button = new Button(group, SWT.FLAT);
	button.setText("Download");
	GridDataFactory.fillDefaults().grab(false, false).align(SWT.END, SWT.CENTER).applyTo(button);
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:25,代碼來源:MessageArea.java

示例12: createControl

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
@Override
public void createControl(final Composite parent, FormToolkit toolkit) {
  link = new Link(parent, SWT.BORDER);
  link.setText("<a>" + getValue() + "</a>");
  link.addListener(SWT.Selection, new Listener() {
    @Override
    public void handleEvent(Event event) {
      try {
        RepositoryCommit commit = getCommit();
        if (commit != null) {
          CommitEditor.openQuiet(commit);
        } else {
          MessageDialog alert = new MessageDialog(parent.getShell(), "Oops", null,
              "Commit " + getValue() + " not found", MessageDialog.ERROR, new String[] {"OK"}, 0);
          alert.open();
        }
      } catch (IOException e) {
        AppraiseUiPlugin.logError("Error reading commit " + getValue(), e);
      }
    }
  });
  setControl(link);
}
 
開發者ID:google,項目名稱:git-appraise-eclipse,代碼行數:24,代碼來源:CommitAttributeEditor.java

示例13: 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;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:21,代碼來源:HyperlinkMessageDialog.java

示例14: createUI_Field_Text

import org.eclipse.swt.widgets.Link; //導入依賴的package包/類
private int createUI_Field_Text(final Composite parent) {

		{
			/*
			 * Link: Fulltext search hint
			 */
			final Link link = new Link(parent, SWT.NONE);
			link.setText(Messages.Slideout_TourFilter_Link_TextSearchHint);
			link.setToolTipText(Messages.Slideout_TourFilter_Link_TextSearchHint_Tooltip);
			link.addSelectionListener(new SelectionAdapter() {
				@Override
				public void widgetSelected(final SelectionEvent e) {
					Util.showView(SearchView.ID, true);
				}
			});
		}

		return 1;
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:20,代碼來源:SlideoutTourFilter.java

示例15: 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);
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:26,代碼來源:DialogEasyImportConfig.java


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