javax.swing.JFileChooser.putClientProperty()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.swing.JFileChooser.putClientProperty()方法的一些代码示例,展示了JFileChooser.putClientProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.putClientProperty()方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:putClientProperty

JFileChooser.putClientProperty介绍

暂无

代码示例

代码示例来源:origin: RaiMan/SikuliX2

fchooser = new JFileChooser();
if (SX.isMac()) {
 fchooser.putClientProperty("JFileChooser.packageIsTraversable", "always");

代码示例来源:origin: openpreserve/jhove

/**
 *  Makes a JFileChooser dialog treat packages and applications
 *  as opaque entities.  Has no effect on other platforms.
 */
public static void makeChooserOpaque (JFileChooser chooser)
{
  // Apple TN 2042 LIES; we need to set both properties.
  chooser.putClientProperty
    ("JFileChooser.appBundleIsTraversable", "never");
  chooser.putClientProperty
    ("JFileChooser.packageIsTraversable", "never");
}

代码示例来源:origin: org.gephi/directory-chooser

private void markStartTime () {
  if (fileChooser.getClientProperty(DelegatingChooserUI.START_TIME) == null) {
    fileChooser.putClientProperty(DelegatingChooserUI.START_TIME,
        Long.valueOf(System.currentTimeMillis()));
  }
}

代码示例来源:origin: net.sf.taverna.t2.ui-impl/configuration-impl

public void actionPerformed(ActionEvent e) {
    System.setProperty("com.apple.macos.use-file-dialog-packages", "false");
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.putClientProperty("JFileChooser.appBundleIsTraversable", "always");
    fileChooser.putClientProperty("JFileChooser.packageIsTraversable", "always");
    
    fileChooser.setDialogTitle("Browse for dot");
    fileChooser.resetChoosableFileFilters();
    fileChooser.setAcceptAllFileFilterUsed(false);
    
    fileChooser.setMultiSelectionEnabled(false);
    
    int returnVal = fileChooser.showOpenDialog(WorkbenchConfigurationPanel.this);
    if (returnVal==JFileChooser.APPROVE_OPTION) {
      dotLocation.setText(fileChooser.getSelectedFile().getAbsolutePath());
    }
  }
});

代码示例来源:origin: org.gephi/directory-chooser

fileChooser.putClientProperty(DelegatingChooserUI.START_TIME, null);

代码示例来源:origin: org.gephi/directory-chooser

fc.putClientProperty(USE_SHELL_FOLDER, Boolean.getBoolean(NB_USE_SHELL_FOLDER));
} else {
  String jv = System.getProperty("java.version");
      "1.6.0_10".compareToIgnoreCase(jv) >= 0) {
    if (!Boolean.TRUE.equals(fc.getClientProperty(USE_SHELL_FOLDER))) {
      fc.putClientProperty(USE_SHELL_FOLDER, Boolean.FALSE);
fc.putClientProperty(START_TIME, Long.valueOf(System.currentTimeMillis()));

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private JFileChooser createDirPanel(String seed, final PropertyEditorSupport editor, PropertyEnv propenv) {
  String titleText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("Run_Directory");
  String buttonText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("SelectLabel");
  final JFileChooser chooser = RemoteFileUtil.createFileChooser(getSourceExecutionEnvironment(), titleText, buttonText,
      JFileChooser.DIRECTORIES_ONLY, null, seed, true);
  chooser.putClientProperty("title", chooser.getDialogTitle()); // NOI18N
  chooser.setControlButtonsAreShown(false);
  propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
  propenv.addPropertyChangeListener(new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) && evt.getNewValue() == PropertyEnv.STATE_VALID) {
        File selectedFile= chooser.getSelectedFile();
        String path = CndPathUtilities.toRelativePath(makeConfiguration.getBaseDir(), selectedFile.getPath()); // FIXUP: not always relative path
        path = CndPathUtilities.normalizeSlashes(path);
        editor.setValue(path);
      }
    }
  });
  return chooser;
}

代码示例来源:origin: com.sikulix/sikulixapi

fchooser.putClientProperty("JFileChooser.packageIsTraversable", "always");

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-j2me-cdc-project

/** Factory method for project chooser
 */
public static JFileChooser createProjectChooser() {
  ProjectManager.getDefault().clearNonProjectCache(); // #41882
  
  JFileChooser chooser = new ProjectFileChooser();
  chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
  if ("GTK".equals(javax.swing.UIManager.getLookAndFeel().getID())) { // NOI18N
    // see BugTraq #5027268
    chooser.putClientProperty("GTKFileChooser.showDirectoryIcons", Boolean.TRUE); // NOI18N
    //chooser.putClientProperty("GTKFileChooser.showFileIcons", Boolean.TRUE); // NOI18N
  }
    //#61789 on old macosx (jdk 1.4.1) these two method need to be called in this order.
  chooser.setAcceptAllFileFilterUsed( false );
  chooser.setFileFilter( ProjectDirFilter.INSTANCE );
  File currDir = ProjectChooser.getProjectsFolder();
  FileUtil.preventFileChooserSymlinkTraversal(chooser, currDir);
  chooser.setFileView( new ProjectFileView( chooser.getFileSystemView() ) );
  return chooser;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

projectChooser.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, // NOI18N
                 new Integer(1));
jarFileChooser.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, // NOI18N
               new Integer(1));

代码示例来源:origin: freeplane/freeplane

chooser.putClientProperty(FactoryFileFilter.class, fileFilter);
chooser.setAccessory(new ImagePreview(chooser));
final int returnVal = chooser.showOpenDialog(Controller.getCurrentController().getViewController()

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

true);
chooser.setControlButtonsAreShown(false);
chooser.putClientProperty("title", chooser.getDialogTitle()); // NOI18N
setElfFilters(chooser, filters, latch);
propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION);

相关文章

JFileChooser类方法