當前位置: 首頁>>代碼示例>>Java>>正文


Java DataObjectExistsException類代碼示例

本文整理匯總了Java中org.openide.loaders.DataObjectExistsException的典型用法代碼示例。如果您正苦於以下問題:Java DataObjectExistsException類的具體用法?Java DataObjectExistsException怎麽用?Java DataObjectExistsException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataObjectExistsException類屬於org.openide.loaders包,在下文中一共展示了DataObjectExistsException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: LayerDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public LayerDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
    final CookieSet cookies = getCookieSet();
    final Lookup baseLookup = cookies.getLookup();
    lkp = new ProxyLookup(baseLookup) {
        final AtomicBoolean checked = new AtomicBoolean();
        protected @Override void beforeLookup(Template<?> template) {
            if (template.getType() == LayerHandle.class && checked.compareAndSet(false, true)) {
                FileObject xml = getPrimaryFile();
                Project p = FileOwnerQuery.getOwner(xml);
                if (p != null) {
                    setLookups(baseLookup, Lookups.singleton(new LayerHandle(p, xml)));
                }
            }
        }
    };
    registerEditor("text/x-netbeans-layer+xml", true);
    cookies.add(new ValidateXMLSupport(DataObjectAdapters.inputSource(this)));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:LayerDataObject.java

示例2: HtmlDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
/** New instance.
 * @param pf primary file object for this data object
 * @param loader the data loader creating it
 * @exception DataObjectExistsException if there was already a data object for it
 */
public HtmlDataObject(FileObject pf, UniFileLoader loader) throws DataObjectExistsException {
    super(pf, loader);
    CookieSet set = getCookieSet();
    set.add(HtmlEditorSupport.class, this);
    set.add(ViewSupport.class, this);
    set.assign(SaveAsCapable.class, new SaveAsCapable() {
        public void saveAs( FileObject folder, String fileName ) throws IOException {
            HtmlEditorSupport es = getCookie( HtmlEditorSupport.class );
            try {
                es.updateEncoding();
                es.saveAs( folder, fileName );
            } catch (UserCancelException e) {
                //ignore, just not save anything
            }
        }
    });

    set.assign(FileEncodingQueryImplementation.class, new FileEncodingQueryImpl());
            
    //add check/validate xml cookies
    InputSource in = DataObjectAdapters.inputSource(this);
    set.add(new ValidateXMLSupport(in));
    set.add(new CheckXMLSupport(in));
    
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:31,代碼來源:HtmlDataObject.java

示例3: GsfDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public GsfDataObject(FileObject pf, MultiFileLoader loader, Language language) throws DataObjectExistsException {
    super(pf, loader);

    // If the user creates a file with a filename where we can't figure out the language
    // (e.g. the PHP New File wizard doesn't enforce a file extension, so if you create
    // a file named "pie.class" (issue 124044) the data loader doesn't know which language
    // to associate this with since it isn't a GSF file extension or mimetype). However
    // during template creation we know the language anyway so we can use it. On subsequent
    // IDE restarts the file won't be recognized so the user will have to rename or
    // add a new file extension to file type mapping.
    if (language == null) {
        language = templateLanguage;
    }
    this.language = language;
    getCookieSet().add(new Class[]{
            GenericEditorSupport.class, // NOI18N
            SaveAsCapable.class, Openable.class, EditorCookie.Observable.class, 
            PrintCookie.class, CloseCookie.class, Editable.class, LineCookie.class,
            DataEditorSupport.class, CloneableEditorSupport.class,
            CloneableOpenSupport.class
        }, new EditorSupportFactory());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:GsfDataObject.java

示例4: TLDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public TLDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
            getCookieSet().assign(SaveCookie.class, saveDB);
            setModified(true);

    if (pf.getSize() > 0) {
        database = getDBFromFile(pf);
    } else {
        database = new TLDatabase();
    }

    CookieSet cookies = getCookieSet();
    cookies.assign(TLDatabase.class, database);
    cookies.add(new TLOpenSupport(this.getPrimaryEntry()));


    cookies.assign(Node.class, this.getNodeDelegate());

    // Set modified if current time of db changes
    database.addDBListener(changeListener);
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:22,代碼來源:TLDataObject.java

示例5: AntProjectDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public AntProjectDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
    CookieSet cookies = getCookieSet();
    cookies.add (new AntProjectDataEditor (this));
    FileObject prim = getPrimaryFile ();
    AntProjectCookie proj = new AntProjectSupport (prim);
    cookies.add (proj);
    if (proj.getFile () != null) {
        cookies.add (new AntActionInstance (proj));
    }
    cookies.add(new CheckXMLSupport(DataObjectAdapters.inputSource(this)));
    addPropertyChangeListener (this);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:AntProjectDataObject.java

示例6: FormDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public FormDataObject(FileObject ffo, FileObject jfo, FormDataLoader loader)
    throws DataObjectExistsException
{
    super(jfo, loader);
    formEntry = (FileEntry)registerEntry(ffo);
    getCookieSet().assign( SaveAsCapable.class, new SaveAsCapable() {
        @Override
        public void saveAs(FileObject folder, String fileName) throws IOException {
            getFormEditorSupport().saveAs( folder, fileName );
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:FormDataObject.java

示例7: TestNGSuiteDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public TestNGSuiteDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
    CookieSet cookies = getCookieSet();
    cookies.add(new CheckXMLSupport(DataObjectAdapters.inputSource(this)));
    cookies.add(new ValidateXMLSupport(DataObjectAdapters.inputSource(this)));
    registerEditor(MIME_TYPE, true);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:TestNGSuiteDataObject.java

示例8: PoshDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public PoshDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);

    ic = new InstanceContent();
    lookup = new AbstractLookup(ic);
    ic.add(new PoshEditorSupport(this));
    ic.add(this);
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:9,代碼來源:PoshDataObject.java

示例9: createMultiObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
@Override
protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException {
    if (getExtensions().isRegistered(primaryFile)) {
        return new TopDataObject(primaryFile, this);
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:EmbeddedIndexerTest.java

示例10: createMultiObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
@Override
protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException {
    if (primaryFile.getExt().equals(JAVA_EXTENSION)) {
        return new GuardedDataObject(primaryFile, this);
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:GuardedBlockTest.java

示例11: JnlpDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public JnlpDataObject(FileObject pf, JnlpDataLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
    registerEditor(JnlpDataLoader.REQUIRED_MIME, true);
    CookieSet cookies = getCookieSet();
    InputSource in = DataObjectAdapters.inputSource(this);
    CheckXMLSupport checkCookieImpl = new CheckXMLSupport(in);
    ValidateXMLSupport validateCookieImpl = new ValidateXMLSupport(in);
    cookies.add(checkCookieImpl);
    cookies.add(validateCookieImpl);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:JnlpDataObject.java

示例12: PoshDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public PoshDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);

    ic = new InstanceContent();
    lookup = new AbstractLookup(ic);
    ic.add(support = new PoshEditorSupport(this));
    ic.add(this);

}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:10,代碼來源:PoshDataObject.java

示例13: HibernateRevengDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public HibernateRevengDataObject(FileObject pf, HibernateRevengDataLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);
    CookieSet cookies = getCookieSet();
    org.xml.sax.InputSource in = DataObjectAdapters.inputSource(this);
    CheckXMLCookie checkCookie = new CheckXMLSupport(in);
    cookies.add(checkCookie);
    ValidateXMLCookie validateCookie = new ValidateXMLSupport(in);
    cookies.add(validateCookie);
    registerEditor(HibernateRevengDataLoader.REQUIRED_MIME, true);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:HibernateRevengDataObject.java

示例14: HibernateMappingDataObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
public HibernateMappingDataObject(FileObject pf, HibernateMappingDataLoader loader) throws DataObjectExistsException, IOException {
    super(pf, loader);

    CookieSet cookies = getCookieSet();
    org.xml.sax.InputSource in = DataObjectAdapters.inputSource(this);
    CheckXMLCookie checkCookie = new CheckXMLSupport(in);
    cookies.add(checkCookie);
    ValidateXMLCookie validateCookie = new ValidateXMLSupport(in);
    cookies.add(validateCookie);
    registerEditor(HibernateMappingDataLoader.REQUIRED_MIME, true);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:HibernateMappingDataObject.java

示例15: createMultiObject

import org.openide.loaders.DataObjectExistsException; //導入依賴的package包/類
protected MultiDataObject createMultiObject(FileObject primaryFile)
        throws DataObjectExistsException, IOException {

    if (primaryFile.getExt().equals(CLASS_EXTENSION)) {
        return new ClassDataObject(primaryFile, this);
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:ClassDataLoader.java


注:本文中的org.openide.loaders.DataObjectExistsException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。