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


Java DataObject.getLookup方法代碼示例

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


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

示例1: runAction

import org.openide.loaders.DataObject; //導入方法依賴的package包/類
private void runAction(String action) {
    Project project = getProject();
    if (project != null) {
        Lookup lookup = project.getLookup();
        if (fileForDocument != null) {
            try {
                DataObject dobj = DataObject.find(fileForDocument);
                lookup = dobj.getLookup();
            } catch (DataObjectNotFoundException ex) {
                Exceptions.printStackTrace(ex);
            }
        }

        ActionProvider provider = project.getLookup().lookup(ActionProvider.class);
        if (provider != null) {
            if (provider.isActionEnabled(action, lookup)) {
                provider.invokeAction(action, lookup);
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:CoverageSideBar.java

示例2: testLookup

import org.openide.loaders.DataObject; //導入方法依賴的package包/類
public void testLookup() throws Exception {
    clearWorkDir();
    File propFile = new File(getWorkDir(), "foo.properties");
    propFile.createNewFile();
    DataObject propDO = DataObject.find(FileUtil.toFileObject(propFile));
    Lookup lookup = propDO.getLookup();
    PropertiesEncoding encoding = lookup.lookup(PropertiesEncoding.class);
    assertNotNull(encoding);
    assertSame(encoding, lookup.lookup(FileEncodingQueryImplementation.class));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:PropertiesDataObjectTest.java

示例3: SimpleES

import org.openide.loaders.DataObject; //導入方法依賴的package包/類
public SimpleES(DataObject obj, Entry entry, CookieSet set, Callable<Pane> paneFactory) {
    super(obj, obj.getLookup(), new Environment(obj, entry));
    this.set = set;
    this.factory = paneFactory;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:SimpleES.java

示例4: DataEditorSupport

import org.openide.loaders.DataObject; //導入方法依賴的package包/類
/** Editor support for given data object. The content of editor is taken
 * from the primary file of the data object. The lookup can be anything,
 * but it is recommended to use {@link DataObject#getLookup()}. 
 * 
 * @param obj object to create editor for
 * @param lkp lookup to use. if <code>null</code>, then {@link DataObject#getLookup()} is used.
 * @param env environment responsible for loading/storing the strams
 * @since 7.28
 */
public DataEditorSupport(DataObject obj, @NullAllowed Lookup lkp, CloneableEditorSupport.Env env) {
    super (env, lkp == null ? obj.getLookup() : lkp);
    this.obj = obj;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:DataEditorSupport.java

示例5: SimpleES

import org.openide.loaders.DataObject; //導入方法依賴的package包/類
/** Constructor. 
 * @param obj data object to work on
 * @param set set to add/remove save cookie from
 */
public SimpleES (DataObject obj, MultiDataObject.Entry entry) {
    super(obj, obj.getLookup(), new ESEnv(obj, entry));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:JShellDataObject.java


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