當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。