本文整理汇总了Java中com.intellij.openapi.fileChooser.ex.FileChooserKeys类的典型用法代码示例。如果您正苦于以下问题:Java FileChooserKeys类的具体用法?Java FileChooserKeys怎么用?Java FileChooserKeys使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileChooserKeys类属于com.intellij.openapi.fileChooser.ex包,在下文中一共展示了FileChooserKeys类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.openapi.fileChooser.ex.FileChooserKeys; //导入依赖的package包/类
protected void update(FileSystemTree fileSystemTree, AnActionEvent e) {
Presentation presentation = e.getPresentation();
final FileType fileType = e.getData(FileChooserKeys.NEW_FILE_TYPE);
if (fileType != null) {
presentation.setVisible(true);
VirtualFile selectedFile = fileSystemTree.getNewFileParent();
presentation.setEnabled(selectedFile != null && selectedFile.isDirectory());
presentation.setIcon(LayeredIcon.create(fileType.getIcon(), AllIcons.Actions.New));
}
else {
presentation.setVisible(false);
}
}
示例2: actionPerformed
import com.intellij.openapi.fileChooser.ex.FileChooserKeys; //导入依赖的package包/类
protected void actionPerformed(FileSystemTree fileSystemTree, AnActionEvent e) {
final FileType fileType = e.getData(FileChooserKeys.NEW_FILE_TYPE);
final String initialContent = e.getData(FileChooserKeys.NEW_FILE_TEMPLATE_TEXT);
if (fileType != null && initialContent != null) {
createNewFile(fileSystemTree, fileType, initialContent);
}
}
示例3: update
import com.intellij.openapi.fileChooser.ex.FileChooserKeys; //导入依赖的package包/类
@Override
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
final Boolean available = event.getData(FileChooserKeys.DELETE_ACTION_AVAILABLE);
if (available != null && !available) {
presentation.setEnabled(false);
presentation.setVisible(false);
return;
}
super.update(event);
}
示例4: AddContentEntryAction
import com.intellij.openapi.fileChooser.ex.FileChooserKeys; //导入依赖的package包/类
public AddContentEntryAction() {
super(ProjectBundle.message("module.paths.add.content.action"),
ProjectBundle.message("module.paths.add.content.action.description"), AllIcons.Modules.AddContentEntry);
myDescriptor = new FileChooserDescriptor(false, true, true, false, true, true) {
@Override
public void validateSelectedFiles(VirtualFile[] files) throws Exception {
validateContentEntriesCandidates(files);
}
};
myDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, getModule());
myDescriptor.setTitle(ProjectBundle.message("module.paths.add.content.title"));
myDescriptor.setDescription(ProjectBundle.message("module.paths.add.content.prompt"));
myDescriptor.putUserData(FileChooserKeys.DELETE_ACTION_AVAILABLE, false);
}
示例5: ScriptFileChooserDescriptor
import com.intellij.openapi.fileChooser.ex.FileChooserKeys; //导入依赖的package包/类
public ScriptFileChooserDescriptor() {
super(true, false, false, false, false, false);
putUserData(FileChooserKeys.NEW_FILE_TYPE, UiScriptFileType.getInstance());
putUserData(FileChooserKeys.NEW_FILE_TEMPLATE_TEXT, "");
}