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


Java PDECore类代码示例

本文整理汇总了Java中org.eclipse.pde.internal.core.PDECore的典型用法代码示例。如果您正苦于以下问题:Java PDECore类的具体用法?Java PDECore怎么用?Java PDECore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PDECore类属于org.eclipse.pde.internal.core包,在下文中一共展示了PDECore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFeatures

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
protected Object[] getFeatures() {
	List<String> identifiers = new ArrayList<>();
	EList<Iu> ius = solution.getIus().getItems();
	for (Iterator<Iu> iterator = ius.iterator(); iterator.hasNext();) {
		Iu tag = iterator.next();
		String id = tag.getMixed().getValue(0).toString();
		identifiers.add(id);
	}
	IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels();
	ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>();
	for (int i = 0; i < allModels.length; i++) {
		if (identifiers.contains(allModels[i].getFeature().getId())) {
			newModels.add(allModels[i]);
		}
	}
	return newModels.toArray(new IFeatureModel[0]);		
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:18,代码来源:OverviewPage.java

示例2: basicValidation

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private static void basicValidation(IProduct product, Collection<String> errorMessages) {
	IResource productFile = product.getModel().getUnderlyingResource();
	String baseName = FilenameUtils.getBaseName(productFile.getName());
	if (!baseName.equals(product.getId())) {
		errorMessages.add(String.format("Mismatching product ID and filename - expected filename %s.%s",
				product.getId(), productFile.getFileExtension()));
	}

	if (product.useFeatures()) {
		FeatureModelManager featureModelManager = PDECore.getDefault().getFeatureModelManager();
		for (IProductFeature feature : product.getFeatures()) {
			String version = feature.getVersion().length() > 0 ? feature.getVersion() : "0.0.0";
			if (featureModelManager.findFeatureModel(feature.getId(), version) == null) {
				errorMessages.add(String.format("Missing feature: %s (%s)", feature.getId(), version));
			}
		}
	} else {
		PluginModelManager pluginModelManager = PDECore.getDefault().getModelManager();
		for (IProductPlugin plugin : product.getPlugins()) {
			if (pluginModelManager.findModel(plugin.getId()) == null) {
				errorMessages.add(String.format("Missing plugin: %s", plugin.getId()));
			}
		}
	}
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:26,代码来源:ProductValidator.java

示例3: doImport

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
@Override
public void doImport(Version version) {

	version.getBundles().clear();
	version.getFeatures().clear();
	version.getFragments().clear();

	version.getFeatures().clear();
	IProject[] projects = PDECore.getWorkspace().getRoot().getProjects();

	IFeatureModel[] featureModels = PDECore.getDefault().getFeatureModelManager()
			.getWorkspaceModels();
	for (IFeatureModel featureModel : featureModels) {
		loadFeature(version, featureModel.getFeature());

	}

	IPluginModelBase[] workspaceModels = PDECore.getDefault().getModelManager()
			.getWorkspaceModels();
	for (IPluginModelBase model : workspaceModels) {
		loadBundle(version, model.getPluginBase());
	}
}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:24,代码来源:WorkspaceImport.java

示例4: addBundle

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private Bundle addBundle(Version version, String id) {
	Manifest manifest = version.findManifest(id);
	if (manifest != null) {
		if (manifest instanceof Bundle)
			return (Bundle) manifest;
		else
			return null;
	}
	Bundle bundle = ModelFactory.eINSTANCE.createBundle();
	bundle.setId(id);
	version.getBundles().add(bundle);

	IPluginModelBase entry = PDECore.getDefault().getModelManager().findModel(id);
	if (entry != null) {
		BundleDescription bundleDescription = entry.getBundleDescription();
		bundle.setName(bundleDescription.getName());
		bundle.setVendor(bundleDescription.getSupplier().getName());
		bundle.setVersion(bundleDescription.getVersion().toString());
	}
	return bundle;
}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:22,代码来源:WorkspaceImport.java

示例5: addFragment

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private Fragment addFragment(Version version, String Id) {
		Manifest manifest = version.findManifest(Id);
		if (manifest != null) {
			if (manifest instanceof Fragment)
				return (Fragment) manifest;
			else
				return null;
		}
		Fragment fragment = ModelFactory.eINSTANCE.createFragment();
		fragment.setId(Id);
		version.getFragments().add(fragment);

		IPluginModelBase entry = PDECore.getDefault().getModelManager().findModel(Id);

		if (entry != null) {
			BundleDescription bundleDescription = entry.getBundleDescription().getHost()
.getHosts()[0];
			Bundle bundle = addBundle(version, bundleDescription.getSymbolicName());
			fragment.setName(bundleDescription.getName());
			fragment.setParentBundle(bundle);
			fragment.setVendor(bundleDescription.getSupplier().getName());
			fragment.setVersion(bundleDescription.getVersion().toString());
		}
		return fragment;
	}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:26,代码来源:WorkspaceImport.java

示例6: checkApplicationExtensionStillThere

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
@Test
public void checkApplicationExtensionStillThere()
{
	PDEExtensionRegistry pdeReg = PDECore.getDefault().getExtensionsRegistry();

	IPluginModelBase base = PluginRegistry.getWorkspaceModels()[0];
	Collection<IPluginExtension> appliExt = new ArrayList<IPluginExtension>();

	for (IPluginExtension e : pdeReg.findExtensionsForPlugin(base))
	{
		if (e.getPoint().equals("org.eclipse.core.runtime.applications"))
			appliExt.add(e);

	}

	assertEquals("The application extension must be still there and only once", 1, appliExt.size());

}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:19,代码来源:TestExtensionGeneration.java

示例7: getOSGiPath

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private static String getOSGiPath( )
{
	ModelEntry entry = PDECore.getDefault( )
			.getModelManager( )
			.findEntry( "org.eclipse.osgi" ); //$NON-NLS-1$
	if ( entry != null && entry.getActiveModels( ).length > 0 )
	{
		IPluginModelBase model = entry.getActiveModels( )[0];
		if ( model.getUnderlyingResource( ) != null )
		{
			return model.getUnderlyingResource( )
					.getLocation( )
					.removeLastSegments( 2 )
					.toOSString( );
		}
		return model.getInstallLocation( );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ReportLauncherUtils.java

示例8: getSchema

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
public static ISchema getSchema(String uniqueIdentifier) {
	// Try to find the schema using the PDECore access...
	ISchema s = PDECore.getDefault().getSchemaRegistry().getSchema(uniqueIdentifier);
	if (s == null) {

		// Try to find it in the list of local schema
		s = getLocalSchema(uniqueIdentifier);
	}

	if (s == null) {
		// Must warn user that schema can not be found ! 
		Bundle b = FrameworkUtil.getBundle(SchemaUtil.class);
		IStatus st = new Status(IStatus.ERROR, b.getSymbolicName(), "Schema for " + uniqueIdentifier
				+ " can not be found. Check if extension point schema are in the launch configuration");
		Platform.getLog(b).log(st);
	}

	return s;
}
 
开发者ID:opcoach,项目名称:E34MigrationTooling,代码行数:20,代码来源:SchemaUtil.java

示例9: init

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
public void init(IWorkbench workbench) {
	// ensures default targets are created when page is opened (if not created yet)
	PluginModelManager manager = PDECore.getDefault().getModelManager();
	if (!manager.isInitialized()) {
		manager.getExternalModelManager();
	}

	allDefinitions = new ArrayList<Object>();
	identifiers = new HashMap<Integer, Object>();
	// reserve -1 as a special value defining undefined
	identifiers.put(NULL_DEFINITION, new Object());

	targetDefinitions = new ArrayList<ITargetDefinition>();
	baselineDefinitions = new ArrayList<IApiBaseline>();

	removed_Definitions = new ArrayList<Object>();
	moved_TargetDefinitions = new HashMap<ITargetDefinition, IPath>(1);

	baseline_Manager = ApiPlugin.getDefault().getApiBaselineManager();
}
 
开发者ID:jd-carroll,项目名称:target-baselines,代码行数:21,代码来源:TargetBaselinePreferencePage.java

示例10: handleMove

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
/**
 * Move the selected target to a workspace location
 */
private void handleMove() {
	MoveTargetDefinitionWizard wizard = new MoveTargetDefinitionWizard(moved_TargetDefinitions.values());
	WizardDialog dialog = new WizardDialog(getShell(), wizard);
	dialog.create();
	SWTUtil.setDialogSize(dialog, 400, 450);
	if (dialog.open() == IDialogConstants.OK_ID) {
		TableItem ti = fTableViewer.getTable().getItem(fTableViewer.getTable().getSelectionIndex());
		IPath newTargetLoc = wizard.getTargetFileLocation();
		IFile file = PDECore.getWorkspace().getRoot().getFile(newTargetLoc);
		ti.setData(DATA_KEY_MOVED_LOCATION, file.getFullPath().toString());
		IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
		moved_TargetDefinitions.put((ITargetDefinition) selection.getFirstElement(), wizard.getTargetFileLocation());
		fTableViewer.refresh(true);
	}
}
 
开发者ID:jd-carroll,项目名称:target-baselines,代码行数:19,代码来源:TargetBaselinePreferencePage.java

示例11: addFeatureAndChildren

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private static void addFeatureAndChildren(String id, String version, List<IFeatureModel> featureModels) {
	FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager();
	IFeatureModel model = manager.findFeatureModel(id, version);
	if (model == null || featureModels.contains(model)) {
		return;
	}

	featureModels.add(model);

	IFeatureChild[] children = model.getFeature().getIncludedFeatures();
	for (int i = 0; i < children.length; i++) {
		addFeatureAndChildren(children[i].getId(), children[i].getVersion(), featureModels);
	}
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:15,代码来源:ProductValidator.java

示例12: findProjectForActiveTargetPlatform

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
private IProject findProjectForActiveTargetPlatform() throws CoreException {
    ITargetPlatformService service = (ITargetPlatformService) PDECore.getDefault().acquireService(ITargetPlatformService.class.getName());

    ITargetHandle workspaceTargetHandle = service.getWorkspaceTargetHandle();
    if (workspaceTargetHandle != null && workspaceTargetHandle.exists()) {
        String memento = workspaceTargetHandle.getMemento();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        return root.getProject(getProjectNameFromMemento(memento));
    } else {
        return null;
    }
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:14,代码来源:KarafLaunchConfigurationInitializer.java

示例13: GenerateExtensions

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
public GenerateExtensions(final IProject p) {
  try {
    this.project = p;
    final IFile pluginXml = PDEProject.getPluginXml(this.project);
    final IFile manifest = PDEProject.getManifest(this.project);
    WorkspaceBundlePluginModel _workspaceBundlePluginModel = new WorkspaceBundlePluginModel(manifest, pluginXml);
    this.fModel = _workspaceBundlePluginModel;
    IPluginModelBase sourceModel = null;
    IPluginModelBase[] _workspaceModels = PluginRegistry.getWorkspaceModels();
    for (final IPluginModelBase m : _workspaceModels) {
      if (((m.getBundleDescription() != null) && this.project.getName().equals(m.getBundleDescription().getSymbolicName()))) {
        sourceModel = m;
      }
    }
    IPluginExtensionPoint[] _extensionPoints = sourceModel.getExtensions().getExtensionPoints();
    for (final IPluginExtensionPoint ept : _extensionPoints) {
      this.fModel.getPluginBase().add(this.copyExtensionPoint(ept));
    }
    IPluginExtension[] _extensions = sourceModel.getExtensions().getExtensions();
    for (final IPluginExtension e : _extensions) {
      this.fModel.getPluginBase().add(this.copyExtension(e));
    }
    PDECore.getDefault().getModelManager().bundleRootChanged(this.project);
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:28,代码来源:GenerateExtensions.java

示例14: generateOrUpdateExtensions

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
/**
 * Check if factory_override or generated_package are correct in the plugin.xml
 *  Must be checked in case the class names have changed between 2 generations
 * factories : map<model uri, classForFactory>
 * packages : map<model uri, classForPackage>
 */
public void generateOrUpdateExtensions(final Map<String, String> factories, final Map<String, String> packages) {
  Set<Map.Entry<String, String>> _entrySet = factories.entrySet();
  for (final Map.Entry<String, String> entry : _entrySet) {
    this.generateOrUpdateExtension(GenerateExtensions.FACTORY_OVERRIDE, entry.getKey(), GenerateExtensions.FACTORY_ELT, entry.getValue());
  }
  Set<Map.Entry<String, String>> _entrySet_1 = packages.entrySet();
  for (final Map.Entry<String, String> entry_1 : _entrySet_1) {
    this.generateOrUpdateExtension(GenerateExtensions.EMF_GENERATED_PACKAGE, entry_1.getKey(), GenerateExtensions.PACKAGE_ELT, entry_1.getValue());
  }
  this.fModel.save();
  PDECore.getDefault().getModelManager().bundleRootChanged(this.project);
}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:19,代码来源:GenerateExtensions.java

示例15: createConfigArea

import org.eclipse.pde.internal.core.PDECore; //导入依赖的package包/类
public static File createConfigArea( String name )
{
	IPath statePath = PDECore.getDefault( ).getStateLocation( );
	File dir = new File( statePath.toOSString( ) );
	if ( name.length( ) > 0 )
	{
		dir = new File( dir, name );
		if ( !dir.exists( ) )
		{
			dir.mkdirs( );
		}
	}
	return dir;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:ReportLauncherUtils.java


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