Tabnine Logo
EMFNature
Code IndexAdd Tabnine to your IDE (free)

How to use
EMFNature
in
org.eclipse.jem.util.emf.workbench.nature

Best Java code snippets using org.eclipse.jem.util.emf.workbench.nature.EMFNature (Showing top 20 results out of 315)

origin: org.eclipse/org.eclipse.jem.util

/**
 * @deprecated use getResourceSet()
 */
public ResourceSet getXmiResourceSet() {
  return getResourceSet();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Create a folder relative to the project based on aProjectRelativePathString.
 * 
 * @param aProjectRelativePathString
 * @return
 * @throws CoreException
 * 
 * @since 1.0.0
 */
public IFolder createFolder(String aProjectRelativePathString) throws CoreException {
  if (aProjectRelativePathString != null && aProjectRelativePathString.length() > 0)
    return createFolder(new Path(aProjectRelativePathString));
  return null;
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * @deprecated use createResource(URI)
 */
public Resource makeXmiResource(String uri) {
  return createResource(URI.createURI(uri));
}
origin: org.eclipse/org.eclipse.jst.j2ee

  protected boolean flushPrimaryKeyClass(JavaClass primaryKeyClass) {
    // ensure the primary key class is flushed and reloaded to get latest
    // content
    IProject p = ProjectUtilities.getProject(primaryKeyClass);
    try {
      List natures = EMFNature.getRegisteredRuntimes(p);
      EMFNature nature = null;
      for (int i = 0; i < natures.size(); i++) {
        if (natures.get(i) instanceof EMFNature)
          nature = (EMFNature) natures.get(i);
      }
      List adapterFactories = nature.getResourceSet().getAdapterFactories();
      AdapterFactory factory = EcoreUtil.getAdapterFactory(adapterFactories, ReadAdaptor.TYPE_KEY);
      if (factory instanceof JavaJDOMAdapterFactory) {
        JavaJDOMAdapterFactory javaFactory = (JavaJDOMAdapterFactory) factory;
        javaFactory.flushReflectionNoNotification(primaryKeyClass.getQualifiedName());
        return true;
      }
    } catch (Exception e) {
      // We don't really care what the exception was, we'll just bail out
      // and return false;
    }
    return false;
  }
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Get the server property of the project from the supplied key
 * 
 * @param key
 *            java.lang.String
 * @deprecated we cannont use persistent properties because they are not stored in the repository
 * @since 1.0.0
 */
protected String getProjectServerValue(String key) {
  if (key == null)
    return null;
  try {
    QualifiedName wholeName = qualifiedKey(key);
    return getProject().getPersistentProperty(wholeName);
  } catch (CoreException exception) {
    //If we can't find it assume it is null
    exception.printStackTrace();
    return null;
  }
}
origin: org.eclipse/org.eclipse.jem.util

protected boolean initializeEMFContextFromContributors(IProject aProject, EMFWorkbenchContextBase emfContext, IEMFContextContributor contributor) {
  boolean contributorFound = false;
  if (aProject == null || emfContext == null)
    return contributorFound;
  List runtimes = EMFNature.getRegisteredRuntimes(aProject);
  for (int i = 0; i < runtimes.size(); i++) {
    IProjectNature nature = (IProjectNature) runtimes.get(i);
    if (nature != null && CONTRIBUTOR_CLASS.isInstance(nature)) {
      if (nature == contributor)
        contributorFound = true;
      ((IEMFContextContributor) nature).primaryContributeToContext(emfContext);
    }
  }
  return contributorFound;
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Create a folder relative to the project based on aProjectRelativePathString.
 * 
 * @param aProjectRelativePath
 * @return
 * @throws CoreException
 * 
 * @since 1.0.0
 */
public IFolder createFolder(IPath aProjectRelativePath) throws CoreException {
  if (aProjectRelativePath != null && !aProjectRelativePath.isEmpty()) {
    IFolder folder = getWorkspace().getRoot().getFolder(getProjectPath().append(aProjectRelativePath));
    if (!folder.exists()) {
      ProjectUtilities.ensureContainerNotReadOnly(folder);
      folder.create(true, true, null);
    }
    return folder;
  }
  return null;
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Returns the EMF root folder for the project. Defaults to the project. Subclasses can override.
 * 
 * @return EMF root folder for the project.
 * 
 * @since 1.0.0
 */
public IContainer getEMFRoot() {
  return getProject();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * @deprecated use getResource(URI)
 */
public Resource getXmiResource(String uri) {
  return getResource(URI.createURI(uri));
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Get the resource set for the project
 * 
 * @return
 * 
 * @since 1.0.0
 */
public ResourceSet getResourceSet() {
  return getEmfContextBase().getResourceSet();
}
origin: org.eclipse/org.eclipse.jem.util

private QualifiedName qualifiedKey(String key) {
  return new QualifiedName(getPluginID(), key);
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Lazy initializer; for migration of existing workspaces where configure will never get called.
 * 
 * @return context base for the project.
 * 
 * @since 1.0.0
 */
protected EMFWorkbenchContextBase getEmfContextBase() {
  if (emfContext == null) {
    try {
      createEmfContext();
    } catch (CoreException ex) {
      Logger.getLogger().logError(ex);
    }
  }
  return emfContext;
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Set the server property of the project from the supplied value
 * 
 * @param key
 *            java.lang.String
 * @param value
 *            String
 * @deprecated we cannont use persistent properties because they are not stored in the repository
 */
protected void setProjectServerValue(String key, String value) {
  if (key != null) {
    try {
      QualifiedName wholeName = qualifiedKey(key);
      getProject().setPersistentProperty(wholeName, value);
    } catch (CoreException exception) {
      //If we can't find it assume it is null
      exception.printStackTrace();
      return;
    }
  }
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Create an EMF context for the project.
 * 
 * @throws CoreException
 * 
 * @since 1.0.0
 */
protected void createEmfContext() throws CoreException {
  WorkbenchResourceHelperBase.createEMFContext(getProject(), this);
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Shutdown the EMF nature
 * 
 * 
 * @since 1.0.0
 */
public void shutdown() {
  if (getResourceSet() != null)
    ((ProjectResourceSet) getResourceSet()).release();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Return the full path of the project.
 * 
 * @return full project path (relative to workspace)
 * @since 1.0.0
 */
public IPath getProjectPath() {
  return getProject().getFullPath();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Create the resource for this uri. It will use the resource set of the project to create it.
 * 
 * @param uri
 * @return resource
 * 
 * @since 1.0.0
 */
public Resource createResource(URI uri) {
  return getResourceSet().createResource(uri);
}
origin: org.eclipse/org.eclipse.jem.util

public IWorkspace getWorkspace() {
  return getProject().getWorkspace();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Get WorkbenchURIConverter for this project.
 * <p>
 * This method assumes the URIConverter on the ResourceSet is the one that was created for the ResourceSet on behalf of this nature runtime.
 * </p>
 * 
 * @return
 * 
 * @since 1.0.0
 */
protected WorkbenchURIConverter getWorkbenchURIConverter() {
  return (WorkbenchURIConverter) getResourceSet().getURIConverter();
}
origin: org.eclipse/org.eclipse.jem.util

/**
 * Get the resource for this uri. It will use the resource set of the project to find it. It will load if not already loaded.
 * 
 * @param uri
 * @return resource or <code>null</code> if resource is not found.
 * 
 * @since 1.0.0
 */
public Resource getResource(URI uri) {
  try {
    return getResourceSet().getResource(uri, true);
  } catch (WrappedException ex) {
    if (!WorkbenchResourceHelperBase.isResourceNotFound(ex))
      throw ex;
  }
  return null;
}
org.eclipse.jem.util.emf.workbench.natureEMFNature

Javadoc

The base EMFNature.

This is expected to be subclassed by clients, but there are default subclasses available.

Most used methods

  • getRegisteredRuntimes
    Return a list of EMFNatures based on the natures that have been configured for this project.
  • getResourceSet
    Get the resource set for the project
  • createEmfContext
    Create an EMF context for the project.
  • createFolder
    Create a folder relative to the project based on aProjectRelativePathString.
  • createResource
    Create the resource for this uri. It will use the resource set of the project to create it.
  • getEmfContextBase
    Lazy initializer; for migration of existing workspaces where configure will never get called.
  • getPluginID
    Return the ID of the plugin that this nature is contained within.
  • getProject
    Returns the project to which this project nature applies.
  • getProjectPath
    Return the full path of the project.
  • getResource
    Get the resource for this uri. It will use the resource set of the project to find it. It will load
  • getWorkbenchURIConverter
    Get WorkbenchURIConverter for this project. This method assumes the URIConverter on the ResourceSet
  • getWorkspace
  • getWorkbenchURIConverter,
  • getWorkspace,
  • hasResourceSet,
  • hasRuntime,
  • makeXmiResource,
  • primConfigure,
  • qualifiedKey

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now