本文整理汇总了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();
}
示例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;
}
示例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());
}
示例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() {
}
};
}
示例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() {
}
};
}
示例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);
}
示例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);
}