当前位置: 首页>>代码示例>>Java>>正文


Java Version.toString方法代码示例

本文整理汇总了Java中org.osgi.framework.Version.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Version.toString方法的具体用法?Java Version.toString怎么用?Java Version.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgi.framework.Version的用法示例。


在下文中一共展示了Version.toString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createVersionData

import org.osgi.framework.Version; //导入方法依赖的package包/类
public static VersionData createVersionData(Bundle bundle) {
	if (bundle == null) {
		return VersionData.UNKNOWN;
	}
	Version osgiVersion = bundle.getVersion();
	if (osgiVersion == null) {
		return VersionData.UNKNOWN;
	}
	return new VersionData(osgiVersion.toString());
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:11,代码来源:EclipseUtil.java

示例2: makeVersion

import org.osgi.framework.Version; //导入方法依赖的package包/类
private static String makeVersion ( final Version version )
{
    if ( version == null )
    {
        return "0.0.0";
    }
    return version.toString ();
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:9,代码来源:InstallableUnit.java

示例3: createDialogArea

import org.osgi.framework.Version; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	/* Titre dialogue. */
	this.getShell().setText("About KSP Plugin");

	/* Layout */
	Composite container = (Composite) super.createDialogArea(parent);
	GridLayout layout = new GridLayout(1, false);
	layout.marginRight = 5;
	layout.marginLeft = 10;
	Color white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);
	container.setBackground(white);
	container.setLayout(layout);

	/* Logo */
	Label lblLogo = new Label(container, SWT.NONE);
	lblLogo.setBackgroundImage(getImage());
	lblLogo.setBackground(white);
	lblLogo.setText("      ");
	lblLogo.setSize(LOGO_SIZE, LOGO_SIZE);

	/* Produit */
	Label lblProduct = new Label(container, SWT.NONE);
	lblProduct.setText("Vertigo Chroma KSP Plugin");
	lblProduct.setBackground(white);

	/* Version */
	Version version = FrameworkUtil.getBundle(getClass()).getVersion();
	String fullVersion = version.toString();
	Label lblVersion = new Label(container, SWT.NONE);
	lblVersion.setText("Version : " + fullVersion);
	lblVersion.setBackground(white);

	/* Version */
	Label lblAuthor = new Label(container, SWT.NONE);
	lblAuthor.setText("Author : @sebez");
	lblAuthor.setBackground(white);

	/* Libellé documentation */
	Label lblDoc = new Label(container, SWT.NONE);
	lblDoc.setText("Documentation, sources, releases are published in the KSP plugin github repository : ");
	lblDoc.setBackground(white);

	/* Lien vers le github */
	Link link = new Link(container, SWT.NONE);
	String message = "<a href=\"" + GITHUB_URL + "\">" + GITHUB_URL + "</a>";
	link.setText(message);
	link.setBackground(white);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			Program.launch(GITHUB_URL);
		}
	});

	return container;
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:58,代码来源:AboutDialog.java

示例4: getKey

import org.osgi.framework.Version; //导入方法依赖的package包/类
private String getKey(Resource res) {
    Version version = res.getVersion();
    Version simpleVersion = new Version(version.getMajor(), version.getMinor(), version.getMicro());
    return res.getSymbolicName() + ";" + simpleVersion.toString();
}
 
开发者ID:cschneider,项目名称:reactive-components,代码行数:6,代码来源:BundleUris.java

示例5: makeRange

import org.osgi.framework.Version; //导入方法依赖的package包/类
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( version.toString () );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:6,代码来源:FeatureInformation.java

示例6: processVirtualize

import org.osgi.framework.Version; //导入方法依赖的package包/类
private void processVirtualize ( final Context context ) throws Exception
{
    // The group ID will be set using the provided channel meta data or the default one.
    String groupId = null;

    // Extract some informations (e.g. group ID) from the provided channel meta data.
    final Map<MetaKey, String> channelMetaData = context.getProvidedChannelMetaData ();
    for ( final Entry<MetaKey, String> entry : channelMetaData.entrySet () )
    {
        final MetaKey metaKey = entry.getKey ();

        if ( metaKey.getNamespace ().equals ( Constants.METADATA_NAMESPACE ) )
        {
            switch ( metaKey.getKey () )
            {
                case Constants.METADATA_KEY_GROUPID:
                    groupId = entry.getValue ();
                    break;
                default:
                    break;
            }
        }
    }

    // If the group ID is not set or empty, use the default one.
    if ( groupId == null || groupId.isEmpty () )
    {
        groupId = Constants.DEFAULT_GROUPID;
    }

    final ArtifactInformation art = context.getArtifactInformation ();

    final BundleInformation bi = OsgiAspectFactory.fetchBundleInformation ( art.getMetaData () );
    if ( bi != null )
    {
        final Version version = bi.getVersion ();
        final Pom pom = new Pom ( groupId, bi.getId (), version.toString () );
        createArtifact ( context, pom );
        return;
    }

    //final FeatureInformation fi = OsgiAspectFactory.fetchFeatureInformation ( art.getMetaData () );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:44,代码来源:VirtualizerImpl.java

示例7: getVersion

import org.osgi.framework.Version; //导入方法依赖的package包/类
private String getVersion(long bundleId) {
    Bundle bundle = bundleContext.getBundle(bundleId);
    Version version = bundle.getVersion();

    return version != null ? version.toString() : "";
}
 
开发者ID:motech,项目名称:motech,代码行数:7,代码来源:SettingsServiceImpl.java

示例8: changeVersionTo

import org.osgi.framework.Version; //导入方法依赖的package包/类
public void changeVersionTo(Version version, Password password, IdentificationWeb id) throws PageException {
	checkWriteAccess();
   	
   	ConfigServerImpl cs=(ConfigServerImpl) ConfigImpl.getConfigServer(config,password);
   	
   	try {
       	CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
       	cleanUp(factory);
       	// do we have the core file?
       	final File patchDir = factory.getPatchDirectory();
   		File localPath=new File(version.toString()+".lco");
       	
   		if(!localPath.isFile()) {
   			localPath=null;
   			Version v;
   			final File[] patches = patchDir.listFiles(new ExtensionFilter(new String[] { ".lco" }));
       		for (final File patch : patches) {
       			v=CFMLEngineFactory.toVersion(patch.getName(),null);
       			// not a valid file get deleted
       			if(v==null){
       				patch.delete();
       			}
       			else {
        			if(v.equals(version)) { // match!
        				localPath=patch;
        			}
        			// delete newer files
        			else if(OSGiUtil.isNewerThan(v,version)) {
        				patch.delete();
        			}
       			}
   			}
   		}
       	
   		// download patch
       	if(localPath==null) {
       		
       		downloadCore(factory, version, id);
       	}
       	
       	
       	
       	
       	factory.restart(password);
       } 
       catch (Exception e) {
           throw Caster.toPageException(e);
       }
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:50,代码来源:XMLConfigAdmin.java


注:本文中的org.osgi.framework.Version.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。