本文整理汇总了Java中com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer类的典型用法代码示例。如果您正苦于以下问题:Java FileListRenderer类的具体用法?Java FileListRenderer怎么用?Java FileListRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileListRenderer类属于com.intellij.openapi.vcs.readOnlyHandler包,在下文中一共展示了FileListRenderer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NonProjectFileWritingAccessDialog
import com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer; //导入依赖的package包/类
protected NonProjectFileWritingAccessDialog(@NotNull Project project, @NotNull List<VirtualFile> nonProjectFiles) {
super(project);
setTitle("Non-Project Files Access");
myFileList.setCellRenderer(new FileListRenderer());
myFileList.setModel(new CollectionListModel<VirtualFile>(nonProjectFiles));
getOKAction().putValue(DEFAULT_ACTION, null);
getCancelAction().putValue(DEFAULT_ACTION, true);
init();
}
示例2: ChangelistConflictDialog
import com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer; //导入依赖的package包/类
public ChangelistConflictDialog(Project project, List<ChangeList> changeLists, List<VirtualFile> conflicts) {
super(project);
myProject = project;
setTitle("Resolve Changelist Conflict");
myFileList.setCellRenderer(new FileListRenderer());
myFileList.setModel(new CollectionListModel(conflicts));
ChangeListManagerImpl manager = ChangeListManagerImpl.getInstanceImpl(myProject);
ChangelistConflictResolution resolution = manager.getConflictTracker().getOptions().LAST_RESOLUTION;
if (changeLists.size() > 1) {
mySwitchToChangelistRadioButton.setEnabled(false);
if (resolution == ChangelistConflictResolution.SWITCH) {
resolution = ChangelistConflictResolution.IGNORE;
}
}
mySwitchToChangelistRadioButton.setText(VcsBundle.message("switch.to.changelist", changeLists.iterator().next().getName()));
myMoveChangesToActiveRadioButton.setText(VcsBundle.message("move.to.changelist", manager.getDefaultChangeList().getName()));
switch (resolution) {
case SHELVE:
myShelveChangesRadioButton.setSelected(true);
break;
case MOVE:
myMoveChangesToActiveRadioButton.setSelected(true);
break;
case SWITCH:
mySwitchToChangelistRadioButton.setSelected(true) ;
break;
case IGNORE:
myIgnoreRadioButton.setSelected(true);
break;
}
init();
}
示例3: NonProjectFileWritingAccessDialog
import com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer; //导入依赖的package包/类
public NonProjectFileWritingAccessDialog(@Nonnull Project project,
@Nonnull List<VirtualFile> nonProjectFiles,
@Nonnull String filesType) {
super(project);
setTitle(filesType + " Protection");
myFileList.setPreferredSize(ReadOnlyStatusDialog.getDialogPreferredSize());
myFileList.setCellRenderer(new FileListRenderer());
myFileList.setModel(new CollectionListModel<>(nonProjectFiles));
String theseFilesMessage = ReadOnlyStatusDialog.getTheseFilesMessage(nonProjectFiles);
myListTitle.setText(StringUtil.capitalize(theseFilesMessage)
+ " " + (nonProjectFiles.size() > 1 ? "do" : "does")
+ " not belong to the project:");
myUnlockOneButton.setSelected(true);
setTextAndMnemonicAndListeners(myUnlockOneButton, "I want to edit " + theseFilesMessage + " anyway", "edit");
int dirs = ContainerUtil.map2Set(nonProjectFiles, VirtualFile::getParent).size();
setTextAndMnemonicAndListeners(myUnlockDirButton, "I want to edit all files in "
+ StringUtil.pluralize("this", dirs)
+ " " + StringUtil.pluralize("directory", dirs), "dir");
setTextAndMnemonicAndListeners(myUnlockAllButton, "I want to edit any non-project file in the current session", "any");
// disable default button to avoid accidental pressing, if user typed something, missed the dialog and pressed 'enter'.
getOKAction().putValue(DEFAULT_ACTION, null);
getCancelAction().putValue(DEFAULT_ACTION, null);
getRootPane().registerKeyboardAction(e -> doOKAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
getRootPane().registerKeyboardAction(e -> doOKAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.META_DOWN_MASK),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
init();
}