本文整理汇总了Java中org.eclipse.osgi.service.environment.Constants类的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Constants类属于org.eclipse.osgi.service.environment包,在下文中一共展示了Constants类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parseArgs
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Parses the arguments string into a list of arguments. This takes care of
* removing quoted arguments (for example, if an argument has a space.)
* <p>
* Any double-quotes that need to be preserved should be escaped (for example,
* "arg\\\"1 arg2", where a list consisting of "arg\"1" and "arg2" will be
* returned.) Any double-quotes that are not escaped will be treated as
* grouping e.g. white-space separated words into a single arg. Note that
* {@link #createArgsString(List)} will properly escape when assembling a
* single arg string from a list of args (the opposite of this method.)
*/
public static List<String> parseArgs(String args) {
List<String> argsList = new ArrayList<String>();
String[] argsArray = DebugPlugin.parseArguments(args);
if (Platform.getOS().equals(Constants.OS_WIN32)) {
/*
* On Windows, DebugPlugin.parseArguments escapes embedded quotes, but for
* other platforms, it does not. Undo this Windows-specific behavior since
* we will re-escape the quotes when creating a single args string from a
* list of args.
*/
for (int i = 0; i < argsArray.length; i++) {
argsArray[i] = argsArray[i].replaceAll("\\\\\\\"", "\"");
}
}
argsList.addAll(Arrays.asList(argsArray));
return argsList;
}
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:31,代码来源:LaunchConfigurationProcessorUtilities.java
示例2: useExternalBrowser
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
private boolean useExternalBrowser(String url) {
// On non Windows platforms, use external when modal window is displayed
if (!Constants.OS_WIN32.equalsIgnoreCase(Platform.getOS())) {
Display display = Display.getCurrent();
if (display != null) {
if (insideModalParent(display))
return true;
}
}
// Use external when no help frames are to be displayed, otherwise no
// navigation buttons.
if (url != null) {
if (url.indexOf("?noframes=true") > 0 //$NON-NLS-1$
|| url.indexOf("&noframes=true") > 0) { //$NON-NLS-1$
return true;
}
}
return false;
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:21,代码来源:AbstractSelfHelpUI.java
示例3: updateCollapsedStatus
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
public void updateCollapsedStatus( TreeViewer treeViewer, Object data )
{
if(!Constants.OS_MACOSX.equalsIgnoreCase( Platform.getOS( ) )){//collapse all sub nodes if not in MacOS
treeViewer.collapseToLevel( data, TreeViewer.ALL_LEVELS );
}
updateStatus( treeViewer );
}
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:TreeViewerBackup.java
示例4: test
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Must run on UI thread
*
* @return
*/
private static boolean test( )
{
if ( !Constants.OS_WIN32.equalsIgnoreCase( Platform.getOS( ) )
&& !Constants.OS_LINUX.equalsIgnoreCase( Platform.getOS( ) ) )
{
return false;
}
if ( !embeddedBrowserTested )
{
embeddedBrowserTested = true;
Shell sh = new Shell( );
try
{
new Browser( sh, SWT.NONE );
embeddedBrowserAvailable = true;
}
catch ( SWTError se )
{
if ( se.code == SWT.ERROR_NO_HANDLES )
{
// Browser not implemented
embeddedBrowserAvailable = false;
}
}
catch ( Exception e )
{
// Browser not implemented
}
if ( sh != null && !sh.isDisposed( ) )
{
sh.dispose( );
}
}
return embeddedBrowserAvailable;
}
开发者ID:eclipse,项目名称:birt,代码行数:41,代码来源:UIUtil.java
示例5: createGraphicalViewer
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
protected void createGraphicalViewer( Composite parent )
{
// bidi_hcg start
/*
* If Bidi support is enabled - check model orientation and set the view
* orientation accordingly
*/
if ( getModel( ).isDirectionRTL( ) )
rulerComp = new EditorRulerComposite( parent, SWT.RIGHT_TO_LEFT );
else
rulerComp = new EditorRulerComposite( parent, SWT.LEFT_TO_RIGHT );
// else
// // bidi_hcg end
// rulerComp = new EditorRulerComposite( parent, SWT.NONE );
super.createGraphicalViewer( rulerComp );
if(Constants.OS_LINUX.equalsIgnoreCase( Platform.getOS( ) )){//Linux and Windows has different color behavior.Add OS judgment to set rulerCompsite background color.
rulerComp.setBackground(ColorManager.getColor(240, 240, 240));
}
rulerComp.setGraphicalViewer( (ScrollingGraphicalViewer) getGraphicalViewer( ), getModel( ) );
// addAction( new ToggleRulerVisibilityAction( getGraphicalViewer( ) ) {
//
// public boolean isChecked( )
// {
// return ( (LayoutEditor) editingDomainEditor ).getRulerState( );
// }
//
// public void run( )
// {
// // if ( getButtonPane( ) != null )
// // {
// // getButtonPane( ).setButtonSelection( ButtonPaneComposite.BUTTON3,
// // !isChecked( ) );
// // }
// getGraphicalViewer( ).setProperty(
// RulerProvider.PROPERTY_RULER_VISIBILITY,
// Boolean.valueOf( !isChecked( ) ) );
// ( (LayoutEditor) editingDomainEditor ).setRulerState( !isChecked( ),
// LayoutEditor.DESIGNER_INDEX );
// }
// } );
//
// addAction( new ToggleMarginVisibilityAction( getGraphicalViewer( ) )
// );
}
开发者ID:eclipse,项目名称:birt,代码行数:48,代码来源:ReportEditorWithRuler.java
示例6: init
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Initialize
*/
private void init( )
{
// Find all available browsers
browsersDescriptors = createBrowserDescriptors( );
// 1. set default browser from preferences
String defBrowserID = ViewerPlugin.getDefault( )
.getPluginPreferences( )
.getDefaultString( DEFAULT_BROWSER_ID_KEY );
if ( defBrowserID != null && ( !"".equals( defBrowserID ) ) ) //$NON-NLS-1$
{
setDefaultBrowserID( defBrowserID );
}
// 2. set default browser to embedded
if ( defaultBrowserDesc == null )
{
setDefaultBrowserID( BROWSER_ID_EMBEDDED );
}
// 3. set default browser to help implementation of system specific
// browser
String os = Platform.getOS( );
if ( defaultBrowserDesc == null )
{
if ( Constants.WS_WIN32.equalsIgnoreCase( os ) )
{
// Win32 uses system browser
setDefaultBrowserID( BROWSER_ID_SYSTEM );
}
}
// 4. set browser to one of externally contributed
if ( defaultBrowserDesc == null )
{
for ( int i = 0; i < browsersDescriptors.length; i++ )
{
if ( BROWSER_ID_CUSTOM.equals( browsersDescriptors[i].getID( ) ) )
{
defaultBrowserDesc = browsersDescriptors[i];
}
}
}
// 5. let user specify program
if ( defaultBrowserDesc == null )
{
setDefaultBrowserID( BROWSER_ID_CUSTOM );
}
// initialize current browser
String curBrowserID = ViewerPlugin.getDefault( )
.getPluginPreferences( )
.getString( DEFAULT_BROWSER_ID_KEY );
if ( curBrowserID != null && ( !"".equals( curBrowserID ) ) ) //$NON-NLS-1$
{
setCurrentBrowserID( curBrowserID );
// may fail if such browser does not exist
}
if ( currentBrowserDesc == null )
{
setCurrentBrowserID( getDefaultBrowserID( ) );
}
setAlwaysUseExternal( ViewerPlugin.getDefault( )
.getPluginPreferences( )
.getBoolean( ALWAYS_EXTERNAL_BROWSER_KEY ) );
}
开发者ID:eclipse,项目名称:birt,代码行数:76,代码来源:BrowserManager.java
示例7: getCodeFontNameAndHeight
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Selects a proper font name and height for various usage cases of monospaced fonts throughout Pydev.
*
* @param usage intended usage. See {@link IFontUsage} for valid values.
* @return a {@link Tuple} containing the font name as {@link String} and the base height as {@link Integer}.
* @throws IllegalArgumentException if <tt>usage</tt> is not found in {@link IFontUsage}.
*/
private static Tuple<String, Integer> getCodeFontNameAndHeight(int usage) throws IllegalArgumentException {
String fontName = "Courier New";
int fontHeight = 10;
if (Platform.getOS().equals(Constants.OS_MACOSX)) {
switch (usage) {
case IFontUsage.STYLED:
fontName = "Monaco";
fontHeight = 11;
break;
case IFontUsage.DIALOG:
// on OS X we need a different font because
// under Mac SWT the bitmap font rasterizer
// doesn't take hinting into account and thus
// makes small fonts rendered as bitmaps unreadable
// see http://aptanastudio.tenderapp.com/discussions/problems/2052-some-dialogs-have-unreadable-small-font-size
fontName = "Courier";
fontHeight = 11;
break;
case IFontUsage.WIDGET:
fontName = "Monaco";
fontHeight = 9;
break;
case IFontUsage.IMAGECACHE:
fontName = "Monaco";
fontHeight = 11;
break;
case IFontUsage.SMALLUI:
fontName = "Monaco";
fontHeight = 9;
break;
default:
throw new IllegalArgumentException(
"Invalid usage. See IFontUsage for valid values.");
}
} else {
switch (usage) {
case IFontUsage.STYLED:
fontName = "Courier New";
fontHeight = 10;
break;
case IFontUsage.DIALOG:
fontName = "Courier New";
fontHeight = 8;
break;
case IFontUsage.WIDGET:
fontName = "Courier New";
fontHeight = 10;
break;
case IFontUsage.IMAGECACHE:
fontName = "Courier New";
fontHeight = 9;
break;
case IFontUsage.SMALLUI:
fontName = "Courier New";
fontHeight = 8;
break;
default:
throw new IllegalArgumentException(
"Invalid usage. See IFontUsage for valid values.");
}
}
return new Tuple<String, Integer>(fontName, fontHeight);
}
开发者ID:fabioz,项目名称:Pydev,代码行数:73,代码来源:FontUtils.java
示例8: getPluginProvider
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Returns the plug-in provider
*
* @param pluginId
* the identify of the plugin
*
* @return the plug-in provider, or null if the plug-in is not found
*/
public static String getPluginProvider( String pluginId )
{
return getBundleValue( pluginId,
org.osgi.framework.Constants.BUNDLE_VENDOR );
}
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:UIUtil.java
示例9: getPluginName
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Returns the plug-in name
*
* @param pluginId
* the identify of the plugin
*
* @return the plug-in name, or null if the plug-in is not found
*/
public static String getPluginName( String pluginId )
{
return getBundleValue( pluginId,
org.osgi.framework.Constants.BUNDLE_NAME );
}
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:UIUtil.java
示例10: getPluginVersion
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Returns the plug-in version
*
* @param pluginId
* the identify of the plugin
*
* @return the plug-in version, or null if the plug-in is not found
*/
public static String getPluginVersion( String pluginId )
{
return getBundleValue( pluginId,
org.osgi.framework.Constants.BUNDLE_VERSION );
}
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:UIUtil.java
示例11: isAvailable
import org.eclipse.osgi.service.environment.Constants; //导入依赖的package包/类
/**
* Is system browser factory available.
*
* @return browser factory available or not
*/
public boolean isAvailable( )
{
return Constants.WS_WIN32.equalsIgnoreCase( Platform.getOS( ) );
}
开发者ID:eclipse,项目名称:birt,代码行数:10,代码来源:SystemBrowserFactory.java
注:本文中的org.eclipse.osgi.service.environment.Constants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论