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


Java Program類代碼示例

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


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

示例1: loadImage

import org.eclipse.swt.program.Program; //導入依賴的package包/類
public Image loadImage(File file) {
if (OSExplorer.getInstance().isRoot(file)) {
    return loadImage("drive.png");
} else if (file.isDirectory()) {
    return loadImage("folder.png");
} else {
    String extension = OSExplorer.getInstance().getExtension(file);
    if (extension.equals("")) {
	return loadImage("file.png");
    } else {
	Program program = Program.findProgram(extension);
	if (program == null) {
	    return loadImage("file.png");
	} else {
	    return loadImage(program);
	}
    }
}
   }
 
開發者ID:Cavallinux,項目名稱:jisocreator,代碼行數:20,代碼來源:ImageUtils.java

示例2: createViewerToolTipContentArea

import org.eclipse.swt.program.Program; //導入依賴的package包/類
@Override
protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    composite.setBackground(rowColorBack);
    Plugin plugin = (Plugin) cell.getElement();

    Hyperlink button = new Hyperlink(composite, SWT.FLAT);
    button.setText("\uf05A");
    button.setFont(fontAwesome);
    button.setBackground(composite.getBackground());
    button.setForeground(rowColorTitle);
    button.setUnderlined(false);
    button.addListener (SWT.MouseDown, e -> Program.launch(GLUON_PLUGIN_URL + plugin.getUrl()));
    button.setToolTipText("Click to access the service's JavaDoc");

    Label text = new Label(composite, SWT.LEFT);
    final String description = plugin.getDescription();
    text.setText(description.contains(".") ? description.substring(0, description.indexOf(".")) : description);
    text.setBackground(composite.getBackground());
    text.setForeground(rowColorTitle);
    composite.pack();
    return composite;
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:25,代碼來源:PluginsSWT.java

示例3: LinkComposite

import org.eclipse.swt.program.Program; //導入依賴的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

示例4: launchURL

import org.eclipse.swt.program.Program; //導入依賴的package包/類
private static void launchURL(String s) {
	Program program = Program.findProgram(".html");
	if (program != null && program.getName().contains("Chrome")) {
		try {
			Field field = Program.class.getDeclaredField("command");
			field.setAccessible(true);
			String command = (String) field.get(program);
			command = command.replaceAll("%[1lL]", s);
			command = command.replace(" --", "");
			PluginInitializer.getDefaultInterface().getUtilities().createProcess(command + " -incognito");
		} catch (Exception e1) {
			e1.printStackTrace();
			Utils.launch(s);
		}
	} else {
		Utils.launch(s);
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:19,代碼來源:SearchSubsUtils.java

示例5: isProgramInstalled

import org.eclipse.swt.program.Program; //導入依賴的package包/類
@Override
public boolean
isProgramInstalled(
	String extension,
	String name )
{
	if ( !extension.startsWith( "." )){

		extension = "." + extension;
	}

	Program program = Program.findProgram( extension );

	return( program == null ? false:(program.getName().toLowerCase(Locale.US)
		.contains(name.toLowerCase(Locale.US))));
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:17,代碼來源:UIFunctionsImpl.java

示例6: createCompleteMessageDialog

import org.eclipse.swt.program.Program; //導入依賴的package包/類
/**
 * 
 *   void
 */
protected void createCompleteMessageDialog() {
    boolean result = MessageDialog.openConfirm(getShell(), 
        UMLMessage.MESSAGE_COMPLETE_DOCUMENT_CREATION,//"문서산출물 생성완료", 
        fileLocation + 
        UMLMessage.MESSAGE_DOCUMENT_HAS_BEEN_CREATED);//" 문서가 생성되었습니다. 생성된 문서를 보시겠습니까?");
    
    if( result ) {
        File file = new File(fileLocation);
        if( file.exists() ) {
            Program program = Program.findProgram(file.getName().substring(file.getName().lastIndexOf(UICoreConstant.PROJECT_CONSTANTS__DOT)));
            if (null != program) {
                String string = file.getAbsolutePath().toString();
                program.execute(string);
            }
        }
    }
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:22,代碼來源:CommonReportAction.java

示例7: createControls

import org.eclipse.swt.program.Program; //導入依賴的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

示例8: initialToolBar

import org.eclipse.swt.program.Program; //導入依賴的package包/類
private void initialToolBar() {
	IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
	toolBarManager.add(new Action("Save", ImageUtil.getImageDescriptor(Images.save)) {
		@Override
		public void run() {
			saveContents();
		}
	});

	toolBarManager.add(new Action("help", ImageUtil.getImageDescriptor(Images.help)) {
		@Override
		public void run() {
			Program.launch(HelpConstants.HELP_ALERT_SCRIPT);
		}
	});
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:17,代碼來源:AlertScriptingView.java

示例9: displayHelp

import org.eclipse.swt.program.Program; //導入依賴的package包/類
private void displayHelp() {
	String curLang = CommonFunction.getSystemLanguage();
	StringBuffer sbHelp = new StringBuffer("help");
	if (Util.isWindows()) {
		sbHelp.append(File.separator).append("csv2tbxdoc").append(File.separator);
		if (curLang.equalsIgnoreCase("zh")) {
			sbHelp.append("tbxmaker_zh-cn.chm");
		} else {
			sbHelp.append("tbxmaker.chm");
		}
		Program.launch(PluginUtil.getConfigurationFilePath(sbHelp.toString()));
	} else {
		sbHelp.append(File.separator).append("csv2tbxdoc").append(File.separator);
		if (curLang.equalsIgnoreCase("zh")) {
			sbHelp.append("zh-cn");
		} else {
			sbHelp.append("en");
		}
		sbHelp.append(File.separator).append("toc.xml");
		PluginHelpDialog dialog = new PluginHelpDialog(getShell(), PluginUtil.getConfigurationFilePath(sbHelp.toString()),
				Messages.getString("dialog.TBXMakerDialog.helpDialogTitle"));
		dialog.open();
	}

}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:26,代碼來源:TBXMakerDialog.java

示例10: createMessageArea

import org.eclipse.swt.program.Program; //導入依賴的package包/類
@Override
protected Control createMessageArea(Composite composite) {
    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);
    }

    if (message != null) {
        Link link = new Link(composite, getMessageLabelStyle());
        link.setText(message);
        GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false)
                .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT).applyTo(link);

        link.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                Program.launch(linkUrl);
            }
        });
    }
    return composite;
}
 
開發者ID:Talend,項目名稱:tesb-studio-se,代碼行數:27,代碼來源:MessageDialogWithLink.java

示例11: menuEventsForecast

import org.eclipse.swt.program.Program; //導入依賴的package包/類
protected void menuEventsForecast() {
	{
		MenuItem eventForecast = new MenuItem(eventsSubMenu, SWT.CASCADE);
		eventForecast.setText("Run a forecast based on technical analysis");
		eventForecast.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent evt) {
				ActionDialog actionDialog = new ActionDialog(getShell(), "Info",
						"Running a neural network forecast on technical analysis is not available in this version.\n"+
						"This feature is part of the advanced version including "+MainGui.APP_NAME+" Forecast engine.\n", 
						null,
						"Click here for more information and a workable demo",
						new ActionDialogAction() {

							@Override
							public void action() {
								Program.launch("http://"+siteUrl);
	
						}
				});
				actionDialog.open();
			}
		});
	}
}
 
開發者ID:premiummarkets,項目名稱:pm,代碼行數:26,代碼來源:MainGui.java

示例12: buildPluginInfoCell

import org.eclipse.swt.program.Program; //導入依賴的package包/類
/**
 * build plugin info cell.
 */
protected void buildPluginInfoCell() {
    this.ascLink = new Link(this.dialog, SWT.NONE);
    this.ascLink.setText(BaseMessages.getString(PKG, "SapInputDialog.About.Plugin.Info"));
    GridData grdData = new GridData();
    grdData.horizontalIndent = DEFAULT_INDENT;
    grdData.verticalIndent = DEFAULT_INDENT;
    this.ascLink.setLayoutData(grdData);

    
    this.ascLink.addListener(SWT.Selection, new Listener() {
        public void handleEvent(final Event event) {
            Program.launch(event.text);
        }
    });
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:19,代碼來源:SapInputAboutDialog.java

示例13: buildPluginInfoCell

import org.eclipse.swt.program.Program; //導入依賴的package包/類
/**
 * build plugin info cell.
 */
protected void buildPluginInfoCell() {
    this.ascLink = new Link(this.dialog, SWT.NONE);
    this.ascLink.setText(BaseMessages.getString(PKG, "TeraFastDialog.About.Plugin.Info"));
    GridData grdData = new GridData();
    grdData.horizontalIndent = DEFAULT_INDENT;
    grdData.verticalIndent = DEFAULT_INDENT;
    this.ascLink.setLayoutData(grdData);

    
    this.ascLink.addListener(SWT.Selection, new Listener() {
        public void handleEvent(final Event event) {
            Program.launch(event.text);
        }
    });
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:19,代碼來源:TeraFastAboutDialog.java

示例14: buildPluginInfoCell

import org.eclipse.swt.program.Program; //導入依賴的package包/類
/**
 * build plugin info cell.
 */
protected void buildPluginInfoCell() {
    this.ascLink = new Link(this.dialog, SWT.NONE);
    this.ascLink.setText(BaseMessages.getString(PKG, "OlapInputDialog.About.Plugin.Info"));
    GridData grdData = new GridData();
    grdData.horizontalIndent = DEFAULT_INDENT;
    grdData.verticalIndent = DEFAULT_INDENT;
    this.ascLink.setLayoutData(grdData);

    
    this.ascLink.addListener(SWT.Selection, new Listener() {
        public void handleEvent(final Event event) {
            Program.launch(event.text);
        }
    });
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:19,代碼來源:OlapInputAboutDialog.java

示例15: createDetailsMessage

import org.eclipse.swt.program.Program; //導入依賴的package包/類
protected void createDetailsMessage(Composite topControl, IDetailsMessage detailsMessage) {
	if(!detailsMessage.getDetailsMessage2().isPresent()) {
		return;
	}
	String additionalMessage = "\n" + detailsMessage.getDetailsMessage2().get();
	
	helpControl = SWTFactoryUtil.createLink(topControl, SWT.WRAP, additionalMessage, 
		gdfFillDefaults().grab(true, true).span(2, 1).create()
	);
	
	helpControl.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			String uri = e.text;
			if(uri.startsWith("http")) {
				Program.launch(uri);
			} else if(uri.startsWith("pref:")) {
				String prefId = StringUtil.removeStart("pref:", uri);
				WorkbenchUtils.openPreferencePage(helpControl.getShell(), prefId);
			} else {
				UIOperationsStatusHandler.handleInternalError("Unknown link URI:\n" + uri, null);
			}
		}
	});
}
 
開發者ID:GoClipse,項目名稱:goclipse,代碼行數:26,代碼來源:StatusMessageDialogExt.java


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