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


Java JFileChooser.FILES_AND_DIRECTORIES屬性代碼示例

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


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

示例1: JPathBrowser

public JPathBrowser(int type)
{
	this.setLayout(new MigLayout("fill, insets 0"));

	path = new JTextField();
	browse = new JButton("Browse");
	browse.addActionListener(this);

	fchBrowse = new JFileChooser();

	if( type == JFileChooser.DIRECTORIES_ONLY )
	{
		fchBrowse.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
	}
	else if( type == JFileChooser.FILES_AND_DIRECTORIES )
	{
		fchBrowse.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
	}

	this.add(path, "pushx, grow");
	this.add(browse);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:22,代碼來源:JPathBrowser.java

示例2: buildMiscTab

private JComponent buildMiscTab()
{
	// Labels and Controls
	JLabel lblOpt = new JLabel("-- Optional --");
	JLabel lblConPath = new JLabel("Conversion Path: ");
	JLabel lblDevInst = new JLabel("Development Install: ");
	JLabel lblPlug = new JLabel("-- Plugins --");
	JLabel lblImageMagick = new JLabel("Image Magik Path: ");

	pbrImageMagick = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	pbrConPath = new JPathBrowser(JFileChooser.FILES_AND_DIRECTORIES);
	chkDevInst = new JCheckBox();
	chkDevInst.addActionListener(this);

	JSeparator sep1 = new JSeparator();

	// Layout
	JPanel all = new JPanel(new MigLayout("wrap 2, fillx", "[align label][grow, fill]"));
	all.add(lblOpt, "span");

	all.add(lblDevInst);
	all.add(chkDevInst);
	all.add(lblConPath);
	all.add(pbrConPath);

	all.add(sep1, "grow, span");

	all.add(lblPlug, "span");
	all.add(lblImageMagick);
	all.add(pbrImageMagick);

	return all;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:33,代碼來源:ConfigEditorGUI.java

示例3: MutableFileNode

public MutableFileNode(File file, MutableFileNode parent) {
	this.file = file;
	this.parent = parent;
	children = null;
	if( parent==null )filter = new Filter(JFileChooser.FILES_AND_DIRECTORIES, false);
	else filter = parent.filter;
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:7,代碼來源:MutableFileNode.java

示例4: FileNode

public FileNode(File file, FileNode parent) {
	this.file = file;
	this.parent = parent;
	children = null;
	if( parent==null )filter = new Filter(JFileChooser.FILES_AND_DIRECTORIES, false);
	else filter = parent.filter;
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:7,代碼來源:FileNode.java

示例5: attachEnv

/**
 * This method is called by the IDE to pass
 * the environment to the property editor.
 * @param env Environment passed by the ide.
 */
public void attachEnv(PropertyEnv env) {
    this.env = env;

    // clearing to defaults
    directories = true;
    files = true;
    fileFilter = null;
    fileHiding = false;

    Object dirs = env.getFeatureDescriptor().getValue(PROPERTY_SHOW_DIRECTORIES);
    if (dirs instanceof Boolean) {
        directories = ((Boolean)dirs).booleanValue();
    } // XXX else if != null, warn
    Object fil = env.getFeatureDescriptor().getValue(PROPERTY_SHOW_FILES);
    if (fil instanceof Boolean) {
        files = ((Boolean)fil).booleanValue();
    } // XXX else if != null, warn
    Object filter = env.getFeatureDescriptor().getValue(PROPERTY_FILTER);
    if (filter instanceof FilenameFilter) {
        fileFilter = new DelegatingFilenameFilter((FilenameFilter)filter);
    } else if (filter instanceof javax.swing.filechooser.FileFilter) {
        fileFilter = (javax.swing.filechooser.FileFilter)filter;
    } else if (filter instanceof java.io.FileFilter) {
        fileFilter = new DelegatingFileFilter((java.io.FileFilter)filter);
    } // XXX else if != null, warn

    Object curDir = env.getFeatureDescriptor().getValue(PROPERTY_CURRENT_DIR);
    if (curDir instanceof File) {
        currentDirectory = (File)curDir;
        if(! currentDirectory.isDirectory()) {
            Logger.getAnonymousLogger().warning("java.io.File will not accept currentDir=" + currentDirectory); // NOI18N
            currentDirectory = null;
        }
    } // XXX else if != null, warn

    Object baseDir = env.getFeatureDescriptor().getValue(PROPERTY_BASE_DIR);
    if(baseDir instanceof File) {
        baseDirectory = (File)baseDir;
        // As baseDir accept only directories in their absolute form.
        if(!baseDirectory.isDirectory() || !baseDirectory.isAbsolute()) {
            Logger.getAnonymousLogger().warning("java.io.File will not accept baseDir=" + baseDirectory); // NOI18N
            baseDirectory = null;
        }
    } // XXX else if != null, warn
    if (files) {
        mode = directories ? JFileChooser.FILES_AND_DIRECTORIES : 
            JFileChooser.FILES_ONLY;
    } else {
        mode = directories ? JFileChooser.DIRECTORIES_ONLY :
            JFileChooser.FILES_AND_DIRECTORIES; // both false, what now? XXX warn
    }
    
    Object fileHide = env.getFeatureDescriptor().getValue(PROPERTY_FILE_HIDING);
    if (fileHide instanceof Boolean) {
        fileHiding = ((Boolean)fileHide).booleanValue();
    }
    
    if (env.getFeatureDescriptor() instanceof Node.Property){
        Node.Property prop = (Node.Property)env.getFeatureDescriptor();
        editable = prop.canWrite();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:67,代碼來源:FileEditor.java

示例6: buildManTab

private JComponent buildManTab()
{
	// Labels
	JLabel lblTomcat = new JLabel("Tomcat Ports: ");
	JLabel lblFiles = new JLabel("Path to Filestore: ");
	JLabel lblJava = new JLabel("Path to Java Home: ");
	JLabel lblAdminURL = new JLabel("Admin URL: ");
	JLabel lblFreeText = new JLabel("Path to Freetext: ");
	JLabel lblStopWords = new JLabel("Path to StopWords: ");
	JLabel lblReporting = new JLabel("Path to Reporting: ");
	JLabel lblPlugins = new JLabel("Path to Plugins: ");

	// Controls
	txtHttp = new JTextField();
	txtHttps = new JTextField();
	txtAjp = new JTextField();
	pbrFiles = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	pbrJava = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	txtAdminURL = new JTextField("http://");
	pbrFree = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	pbrStop = new JPathBrowser(JFileChooser.FILES_AND_DIRECTORIES);
	pbrReport = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	pbrPlugins = new JPathBrowser(JFileChooser.FILES_AND_DIRECTORIES);

	// Layout
	JPanel all = new JPanel(new MigLayout("wrap 2, fillx", "[align label][grow, fill]"));

	all.add(lblTomcat);
	all.add(txtHttp);
	all.add(txtHttps, "skip 1");
	all.add(txtAjp, "skip 1");
	all.add(lblFiles);
	all.add(pbrFiles);
	all.add(lblJava);
	all.add(pbrJava);
	all.add(lblAdminURL);
	all.add(txtAdminURL);
	all.add(lblFreeText);
	all.add(pbrFree);
	all.add(lblStopWords);
	all.add(pbrStop);
	all.add(lblReporting);
	all.add(pbrReport);
	all.add(lblPlugins);
	all.add(pbrPlugins);

	return all;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:48,代碼來源:ConfigEditorGUI.java


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