Example #1
0
 protected void createChange(BundleModel model) {
   IBundle bundle = model.getBundle();
   if (bundle instanceof Bundle) {
     BundleClasspathHeader header =
         (BundleClasspathHeader) bundle.getManifestHeader(Constants.BUNDLE_CLASSPATH);
     if (header != null) header.addLibrary(fValue);
     else model.getBundle().setHeader(Constants.BUNDLE_CLASSPATH, fValue);
   }
 }
 @Override
 protected IBaseModel createModel(IEditorInput input) throws CoreException {
   BundleModel model = null;
   boolean isReconciling = input instanceof IFileEditorInput;
   IDocument document = getDocumentProvider().getDocument(input);
   model = new BundleModel(document, isReconciling);
   if (input instanceof IFileEditorInput) {
     IFile file = ((IFileEditorInput) input).getFile();
     model.setUnderlyingResource(file);
     model.setCharset(file.getCharset());
   } else if (input instanceof IURIEditorInput) {
     IFileStore store = EFS.getStore(((IURIEditorInput) input).getURI());
     model.setInstallLocation(store.getParent().getParent().toString());
     model.setCharset(getDefaultCharset());
   } else if (input instanceof JarEntryEditorInput) {
     File file = (File) ((JarEntryEditorInput) input).getAdapter(File.class);
     model.setInstallLocation(file.toString());
     model.setCharset(getDefaultCharset());
   } else {
     model.setCharset(getDefaultCharset());
   }
   model.load();
   return model;
 }