Ejemplo n.º 1
0
 public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
   final boolean isVisible = super.isFileVisible(file, showHiddenFiles);
   if (!isVisible || file.isDirectory()) {
     return isVisible;
   }
   return StdFileTypes.IDEA_MODULE.equals(FileTypeManager.getInstance().getFileTypeByFile(file));
 }
Ejemplo n.º 2
0
 public boolean validate() {
   if (myRbImportModule.isSelected()) {
     final String path = myModulePathFieldPanel.getText().trim();
     if (path.length() == 0) {
       Messages.showErrorDialog(
           IdeBundle.message(
               "error.please.specify.path.to.module.file",
               ApplicationNamesInfo.getInstance().getProductName()),
           IdeBundle.message("title.module.file.path.not.specified"));
       myModulePathFieldPanel.getTextField().requestFocus();
       return false;
     }
     final File file = new File(path);
     if (!file.exists()) {
       Messages.showErrorDialog(
           IdeBundle.message("error.module.file.does.not.exist"),
           IdeBundle.message("title.module.file.does.not.exist"));
       myModulePathFieldPanel.getTextField().requestFocus();
       return false;
     }
     if (!StdFileTypes.IDEA_MODULE.equals(
         FileTypeManager.getInstance().getFileTypeByFileName(file.getName()))) {
       Messages.showErrorDialog(
           IdeBundle.message(
               "error.module.not.iml", path, ApplicationNamesInfo.getInstance().getProductName()),
           IdeBundle.message("title.incorrect.file.type"));
       myModulePathFieldPanel.getTextField().requestFocus();
       return false;
     }
   }
   return true;
 }