Java 类org.mozilla.javascript.SecurityUtilities 实例源码

项目:pizzascript    文件:MainWindow.java   
private String chooseFile(FileDialog fileDialog, String title, int mode) {
    fileDialog.setTitle(title);
    fileDialog.setMode(mode);
    String dir = SecurityUtilities.getSystemProperty("user.dir");
    if (dir != null) {
        fileDialog.setDirectory(dir);
    }
    fileDialog.setVisible(true);
    String file = fileDialog.getFile();
    if (file != null) {
        try {
            Properties props = System.getProperties();
            props.put("user.dir", fileDialog.getDirectory());
            System.setProperties(props);
            return Path.join(fileDialog.getDirectory(), file);
        } catch (SecurityException ignored) {
        }
    }
    return null;
}
项目:code404    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:S3F    文件:MyJSConsole.java   
public String chooseFile() {
    if (CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if (dir != null) {
            CWD = new File(dir);
        }
    }
    if (CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:S3F    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:rhino-jscover    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:astor    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:Rhino-Prov-Mod    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:closure-compiler-old    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}
项目:closure-compiler-copy    文件:JSConsole.java   
public String chooseFile() {
    if(CWD == null) {
        String dir = SecurityUtilities.getSystemProperty("user.dir");
        if(dir != null) {
            CWD = new File(dir);
        }
    }
    if(CWD != null) {
        dlg.setCurrentDirectory(CWD);
    }
    dlg.setDialogTitle("Select a file to load");
    int returnVal = dlg.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
        String result = dlg.getSelectedFile().getPath();
        CWD = new File(dlg.getSelectedFile().getParent());
        return result;
    }
    return null;
}