当前位置: 首页>>代码示例>>Java>>正文


Java FileListRenderer类代码示例

本文整理汇总了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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:NonProjectFileWritingAccessDialog.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:ChangelistConflictDialog.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:NonProjectFileWritingAccessDialog.java


注:本文中的com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。