Package org.openide.loaders

Examples of org.openide.loaders.DataObject


        if (source == null) {
            return -1;
        }
        final int[] result = new int[]{-1};

        final DataObject dataObject;
        try {
            dataObject = DataObject.find(fo);
        } catch (DataObjectNotFoundException ex) {
            return -1;
        }
View Full Code Here


    public int getMethodLineNumber(
            String url,
            final String className,
            final String methodName,
            final String methodSignature) {
        final DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return -1;
        }
        int[] lns = getMethodLineNumbers(dataObject.getPrimaryFile(), className, null, methodName, methodSignature);
        if (lns.length == 0) {
            return -1;
        } else {
            return lns[0];
        }
View Full Code Here

        if (source == null) {
            return new int[]{};
        }
        final List<Integer> result = new ArrayList<Integer>();

        final DataObject dataObject;
        try {
            dataObject = DataObject.find(fo);
        } catch (DataObjectNotFoundException ex) {
            return new int[]{};
        }
View Full Code Here

     *
     * @return binary class name for given url and line number or null
     */
    @Override
    public String getClassName(String url, final int lineNumber) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return null;
        }
        FileObject fo = dataObject.getPrimaryFile();
        if (fo == null) {
            return null;
        }
        Source source = Source.create(fo);
        if (source == null) {
            return "";
        }
        if (!"text/x-scala".equals(fo.getMIMEType())) {
            /** Should return null instead of "" here,
             * @see org.netbeans.modules.debugger.jpda.EditorContextBridge#CompoundContextProvider#getClassName
             * @notice this has been fixed in main's rev: 30100e497ae4
             */
            return null;
        }
        EditorCookie ec = (EditorCookie) dataObject.getLookup().lookup(EditorCookie.class);
        if (ec == null) {
            return "";
        }
        StyledDocument doc;
        try {
View Full Code Here

    }

    @Override
    public Operation[] getOperations(String url, final int lineNumber,
            final BytecodeProvider bytecodeProvider) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return null;
        }
        FileObject fileObject = dataObject.getPrimaryFile();
        if (fileObject == null) {
            return null;
        }
        if (!"text/x-scala".equals(fileObject.getMIMEType())) {
            return null;
        }

        // at the following step, do not return null to avoid another EditorContextImpl to process
        final Operation ops[][] = new Operation[1][];
        Source source = Source.create(dataObject.getPrimaryFile());
        if (source == null) {
            return ops[0];
        }
        EditorCookie ec = (EditorCookie) dataObject.getLookup().lookup(EditorCookie.class);
        if (ec == null) {
            return ops[0];
        }
        final StyledDocument doc;
        try {
View Full Code Here

        return offset;
    }

    @Override
    public MethodArgument[] getArguments(String url, final Operation operation) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return null;
        }
        FileObject fo = dataObject.getPrimaryFile();
        if (fo == null) {
            return null;
        }
        Source source = Source.create(fo);
        if (source == null) {
View Full Code Here

        return args[0];
    }

    @Override
    public MethodArgument[] getArguments(String url, final int methodLineNumber) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return null;
        }
        FileObject fo = dataObject.getPrimaryFile();
        if (fo == null) {
            return null;
        }
        Source source = Source.create(fo);
        if (source == null) {
            return null;
        }
        EditorCookie ec = (EditorCookie) dataObject.getLookup().lookup(EditorCookie.class);
        if (ec == null) {
            return null;
        }
        final StyledDocument doc;
        try {
View Full Code Here

     *
     * @return list of imports for given source url
     */
    public String[] getImports(
            String url) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return new String[0];
        }
        FileObject fo = dataObject.getPrimaryFile();
        if (fo == null) {
            return new String[0];
        }
        Source source = Source.create(fo);
        if (source == null) {
View Full Code Here

     * @return the visitor value or <code>null</code>.
     */
    public <R, D> R parseExpression(final String expression, String url, final int line,
            final TreePathScanner<R, D> visitor, final D context,
            final SourcePathProvider sp) {
        DataObject dataObject = getDataObject(url);
        if (dataObject == null) {
            return null;
        }
        FileObject fo = dataObject.getPrimaryFile();
        if (fo == null) {
            return null;
        }
        if (!"text/x-scala".equals(fo.getMIMEType())) {
            return null;
View Full Code Here

        Node[] nodes = getExplorerManager().getSelectedNodes();
        if (nodes.length!=1) {
            assert false : "Illegal number of selected nodes";      //NOI18N
            return;
        }
        DataObject dobj = nodes[0].getLookup().lookup(DataObject.class);
        if (dobj == null) {
            assert false : "Can not find platform definition for node: "+ nodes[0].getDisplayName();      //NOI18N
            return;
        }
        try {
            dobj.delete();
            this.getChildren().refreshPlatforms();
            this.expandPlatforms(null);
        } catch (IOException ioe) {
            ErrorManager.getDefault().notify (ioe);
        }
View Full Code Here

TOP

Related Classes of org.openide.loaders.DataObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.