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


Java UIVcsUtil类代码示例

本文整理汇总了Java中com.intellij.vcsUtil.UIVcsUtil的典型用法代码示例。如果您正苦于以下问题:Java UIVcsUtil类的具体用法?Java UIVcsUtil怎么用?Java UIVcsUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UIVcsUtil类属于com.intellij.vcsUtil包,在下文中一共展示了UIVcsUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dataToPresentation

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
@Override
protected JPanel dataToPresentation(ValueWithVcsException<PreparedFragmentedContent> value) {
  final PreparedFragmentedContent requestForChange;
  try {
    if (value == null) return noDifferences();
    requestForChange = value.get();
    if (requestForChange == null) return noDifferences();
    if (requestForChange.isEmpty()) {
      return noDifferences();
    }
  }
  catch (VcsException e) {
    return UIVcsUtil.errorPanel(e.getMessage(), true);
  }
  myDiffPanel.refreshData(requestForChange);
  return myDiffPanel.getPanel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VcsChangeDetailsManager.java

示例2: setDetails

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
@Nullable
private FilePath setDetails() {
  FilePath currentFilePath = null;
  final Change[] selectedChanges = myMaster.get();
  if (selectedChanges.length == 0) {
    myDetailsPanel.nothingSelected();
  } else {
    final String freezed = ChangeListManager.getInstance(myProject).isFreezed();
    if (freezed != null) {
      myDetailsPanel.data(UIVcsUtil.errorPanel(freezed, false));
      return currentFilePath;
    }

    myDetailsPanel.notAvailable();
    for (Change change : selectedChanges) {
      if (change.getBeforeRevision() instanceof FakeRevision || change.getAfterRevision() instanceof FakeRevision) {
        myDetailsPanel.loadingInitial();
        return currentFilePath;
      }
      if (myVcsChangeDetailsManager.canComment(change)) {
        currentFilePath = ChangesUtil.getFilePath(change);
        myDetailsLoader.updateSelection(change, true);
        return currentFilePath;
      }
    }

    myDetailsPanel.notAvailable();
  }
  return currentFilePath;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ShortDiffDetails.java

示例3: DetailsPanel

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
public DetailsPanel() {
  myPanel = new JPanel();
  myLayout = new CardLayout();
  myPanel.setLayout(myLayout);
  JPanel dataPanel = new JPanel(new BorderLayout());

  myPanel.add(UIVcsUtil.errorPanel("No details available", false), Layer.notAvailable.name());
  myPanel.add(UIVcsUtil.errorPanel("Nothing selected", false), Layer.nothingSelected.name());
  myPanel.add(UIVcsUtil.errorPanel("Changes content is not loaded yet", false), Layer.notLoadedInitial.name());
  myPanel.add(UIVcsUtil.errorPanel("Loading...", false), Layer.loading.name());
  myPanel.add(dataPanel, Layer.data.name());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DetailsPanel.java

示例4: createComponent

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
@NotNull
@Override
public DiffViewer createComponent(@NotNull DiffContext context, @NotNull DiffRequest request) {
  return new DiffViewer() {
    @NotNull
    @Override
    public JComponent getComponent() {
      return UIVcsUtil.infoPanel("Technical record",
                                 "This change is recorded because its target file was deleted,\nand some parent directory was copied (or moved) into the new place.");
    }

    @Nullable
    @Override
    public JComponent getPreferredFocusedComponent() {
      return null;
    }

    @NotNull
    @Override
    public ToolbarComponents init() {
      return new ToolbarComponents();
    }

    @Override
    public void dispose() {
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SvnPhantomChangeDiffRequestProvider.java

示例5: comment

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
@Override
public RefreshablePanel comment(Change change, JComponent parent, BackgroundTaskQueue queue) {
  return new RefreshablePanel() {
    @Override
    public boolean refreshDataSynch() {
      return true;
    }

    @Override
    public void dataChanged() {
    }

    @Override
    public void refresh() {
    }

    @Override
    public JPanel getPanel() {
      return UIVcsUtil.infoPanel("Technical record", "This change is recorded because its target file was deleted,\nand some parent directory was copied (or moved) into the new place.");
    }

    @Override
    public void away() {
    }

    @Override
    public boolean isStillValid(Object o) {
      return ((Change) o).isPhantom();
    }

    @Override
    public void dispose() {
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:SvnPhantomChangeDetailsProvider.java

示例6: noDifferences

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
private static JPanel noDifferences() {
  return UIVcsUtil.errorPanel(DiffBundle.message("diff.contents.have.differences.only.in.line.separators.or.whitespaces"), false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:VcsChangeDetailsManager.java

示例7: GitLogDetailsPanel

import com.intellij.vcsUtil.UIVcsUtil; //导入依赖的package包/类
public GitLogDetailsPanel(final Project myProject,
                          final DetailsCache detailsCache,
                          final Convertor<VirtualFile, CachedRefs> refsProvider,
                          Processor<AbstractHash> markProcessor) {
  myRefsProvider = refsProvider;
  myMarkProcessor = markProcessor;
  myPanel = new JPanel(new CardLayout());
  myPanel.add(UIVcsUtil.errorPanel("Nothing selected", false), NOTHING_SELECTED);
  myPanel.add(UIVcsUtil.errorPanel("Loading...", false), LOADING);
  myPanel.add(UIVcsUtil.errorPanel("Several commits selected", false), MULTIPLE_SELECTED);

  myHtmlHighlighter = new HtmlHighlighter();
  myPresentationData = new MyPresentationData(myProject, detailsCache, myHtmlHighlighter);

  final JPanel wrapper = new JPanel(new GridBagLayout());
  final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                           new Insets(1, 1, 1, 1), 0, 0);

  myJEditorPane = new JEditorPane(UIUtil.HTML_MIME, "");
  myJEditorPane.setPreferredSize(new Dimension(150, 100));
  myJEditorPane.setEditable(false);
  myJEditorPane.setBackground(UIUtil.getComboBoxDisabledBackground());
  myJEditorPane.addHyperlinkListener(new BrowserHyperlinkListener() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      if (CONFIGURE_BRANCHES.equals(e.getDescription())) {
        if (myRoot == null) return;
        final CachedRefs symbolicRefs = refsProvider.convert(myRoot);
        if (symbolicRefs == null) return;
        final TreeSet<String> localBranches = symbolicRefs.getLocalBranches();
        if (localBranches == null || localBranches.isEmpty()) {
          VcsBalloonProblemNotifier.showOverChangesView(myProject, "Branches is not loaded yet", MessageType.WARNING);
          return;
        }
        final ContainedInBranchesConfigDialog dialog =
          new ContainedInBranchesConfigDialog(myProject, localBranches, symbolicRefs.getRemoteBranches(),
                                              symbolicRefs.getCurrentName(), symbolicRefs.getTrackedRemoteName());
        dialog.show();
        if (dialog.isChanged()) {
          //detailsCache.clearBranches();
          myPresentationData.branchesPresentation();
          changeDetailsText();
        }
        return;
      }
      super.hyperlinkActivated(e);
    }
  });

  myMarksPanel = new JPanel();
  final BoxLayout boxLayout = new BoxLayout(myMarksPanel, BoxLayout.X_AXIS);
  myMarksPanel.setLayout(boxLayout);
  gb.weightx = 1;
  wrapper.add(myMarksPanel, gb);
  ++ gb.gridy;
  gb.weighty = 1;
  gb.fill = GridBagConstraints.BOTH;
  final JBScrollPane tableScroll = new JBScrollPane(myJEditorPane);
  tableScroll.setBorder(null);
  myJEditorPane.setBorder(null);
  wrapper.add(tableScroll, gb);
  myJEditorPane.setBackground(UIUtil.getTableBackground());
  myMarksPanel.setBackground(UIUtil.getTableBackground());
  wrapper.setBackground(UIUtil.getTableBackground());

  myPanel.add(wrapper, DATA);
  ((CardLayout) myPanel.getLayout()).show(myPanel, NOTHING_SELECTED);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:69,代码来源:GitLogDetailsPanel.java


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