diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java index 79499e8a68e5..ec762c3ace72 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java @@ -116,23 +116,30 @@ public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements public Value getValue() { // the following code makes sense only if we do not use ObjectReference.enableCollection() / disableCollection() // to keep temporary objects - if (Patches.IBM_JDK_DISABLE_COLLECTION_BUG && myStoredEvaluationContext != null && !myStoredEvaluationContext.getSuspendContext().isResumed() && + if (Patches.IBM_JDK_DISABLE_COLLECTION_BUG) { + final EvaluationContextImpl evalContext = myStoredEvaluationContext; + if (evalContext != null && !evalContext.getSuspendContext().isResumed() && myValue instanceof ObjectReference && VirtualMachineProxyImpl.isCollected((ObjectReference)myValue)) { - final Semaphore semaphore = new Semaphore(); - semaphore.down(); - myStoredEvaluationContext.getDebugProcess().getManagerThread().invoke(new SuspendContextCommandImpl(myStoredEvaluationContext.getSuspendContext()) { - public void contextAction() throws Exception { - // re-setting the context will cause value recalculation - try { - setContext(myStoredEvaluationContext); + final Semaphore semaphore = new Semaphore(); + semaphore.down(); + evalContext.getDebugProcess().getManagerThread().invoke(new SuspendContextCommandImpl(evalContext.getSuspendContext()) { + public void contextAction() throws Exception { + // re-setting the context will cause value recalculation + try { + setContext(myStoredEvaluationContext); + } + finally { + semaphore.up(); + } } - finally { + + protected void commandCancelled() { semaphore.up(); } - } - }); - semaphore.waitFor(); + }); + semaphore.waitFor(); + } } return myValue; @@ -264,30 +271,20 @@ public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements private String getCustomLabel(String label) { //translate only strings in quotes - final StringBuilder buf = StringBuilderSpinAllocator.alloc(); - try { - final Value value = getValue(); - if(isShowIdLabel()) { - Renderer lastRenderer = getLastRenderer(); - final String idLabel = myStoredEvaluationContext != null && lastRenderer != null ? - ((NodeRendererImpl)lastRenderer).getIdLabel(value, myStoredEvaluationContext.getDebugProcess()) : - null; - if(idLabel != null && !label.startsWith(idLabel)) { - buf.append(idLabel); - } + String customLabel = null; + final Value value = getValue(); + if(isShowIdLabel()) { + Renderer lastRenderer = getLastRenderer(); + final EvaluationContextImpl evalContext = myStoredEvaluationContext; + final String idLabel = evalContext != null && lastRenderer != null && !evalContext.getSuspendContext().isResumed()? + ((NodeRendererImpl)lastRenderer).getIdLabel(value, evalContext.getDebugProcess()) : + null; + if(idLabel != null && !label.startsWith(idLabel)) { + customLabel = idLabel; } - if(label == null) { - //noinspection HardCodedStringLiteral - buf.append("null"); - } - else { - buf.append(label); - } - return buf.toString(); - } - finally { - StringBuilderSpinAllocator.dispose(buf); } + final String originalLabel = label == null ? "null" : label; + return customLabel == null? originalLabel : customLabel + originalLabel; } diff --git a/platform/vcs-log/impl/icons/apply-16.png b/platform/vcs-log/impl/icons/apply-16.png deleted file mode 100644 index e8927b4f76c8..000000000000 Binary files a/platform/vcs-log/impl/icons/apply-16.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/arrow-32.png b/platform/vcs-log/impl/icons/arrow-32.png deleted file mode 100644 index 3867b9a30531..000000000000 Binary files a/platform/vcs-log/impl/icons/arrow-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/bricks-multicolor-32.png b/platform/vcs-log/impl/icons/bricks-multicolor-32.png deleted file mode 100644 index 9f40e5f1f420..000000000000 Binary files a/platform/vcs-log/impl/icons/bricks-multicolor-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/bricks-user-32.png b/platform/vcs-log/impl/icons/bricks-user-32.png deleted file mode 100644 index e30f6046d08e..000000000000 Binary files a/platform/vcs-log/impl/icons/bricks-user-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/cancel-16.png b/platform/vcs-log/impl/icons/cancel-16.png deleted file mode 100644 index d6d28630a45f..000000000000 Binary files a/platform/vcs-log/impl/icons/cancel-16.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/cherry-pick-32.png b/platform/vcs-log/impl/icons/cherry-pick-32.png deleted file mode 100644 index d705810529fc..000000000000 Binary files a/platform/vcs-log/impl/icons/cherry-pick-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/edit-32.png b/platform/vcs-log/impl/icons/edit-32.png deleted file mode 100644 index 4331ce4a1eed..000000000000 Binary files a/platform/vcs-log/impl/icons/edit-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/fixup-32.png b/platform/vcs-log/impl/icons/fixup-32.png deleted file mode 100644 index 150c8f519243..000000000000 Binary files a/platform/vcs-log/impl/icons/fixup-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/forbidden-32.png b/platform/vcs-log/impl/icons/forbidden-32.png deleted file mode 100644 index e8d2f5a3cd6a..000000000000 Binary files a/platform/vcs-log/impl/icons/forbidden-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/move-32.png b/platform/vcs-log/impl/icons/move-32.png deleted file mode 100644 index cd7c217db794..000000000000 Binary files a/platform/vcs-log/impl/icons/move-32.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/spider-1-16.png b/platform/vcs-log/impl/icons/spider-1-16.png deleted file mode 100644 index f79a856ac991..000000000000 Binary files a/platform/vcs-log/impl/icons/spider-1-16.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/spider-16-2.png b/platform/vcs-log/impl/icons/spider-16-2.png deleted file mode 100644 index f69f4c4aafbe..000000000000 Binary files a/platform/vcs-log/impl/icons/spider-16-2.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/spider-16.png b/platform/vcs-log/impl/icons/spider-16.png deleted file mode 100644 index ce80f0fa6e78..000000000000 Binary files a/platform/vcs-log/impl/icons/spider-16.png and /dev/null differ diff --git a/platform/vcs-log/impl/icons/web-16.png b/platform/vcs-log/impl/icons/web-16.png deleted file mode 100644 index bea4be079d6f..000000000000 Binary files a/platform/vcs-log/impl/icons/web-16.png and /dev/null differ diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogDataHolder.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogDataHolder.java index 874f29778373..764c3d219f59 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogDataHolder.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogDataHolder.java @@ -447,7 +447,7 @@ public class VcsLogDataHolder implements Disposable { } }); } - }, "Retrieving filtered results from the VCS..."); + }, "Looking for more results..."); } @NotNull diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogFilterer.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogFilterer.java index 715eb4f05410..d0a2b5103b22 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogFilterer.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogFilterer.java @@ -55,7 +55,7 @@ public class VcsLogFilterer { AbstractVcsLogTableModel model; if (!detailsFilters.isEmpty()) { List filteredCommits = filterByDetails(graphModel, detailsFilters); - model = new NoGraphTableModel(myLogDataHolder, myUI, filteredCommits, myLogDataHolder.getDataPack().getRefsModel(), true); + model = new NoGraphTableModel(myUI, filteredCommits, myLogDataHolder.getDataPack().getRefsModel(), true); } else { model = new GraphTableModel(myLogDataHolder, myUI); @@ -69,12 +69,13 @@ public class VcsLogFilterer { } } - public void requestVcs(@NotNull Collection filters) { + public void requestVcs(@NotNull Collection filters, final Runnable onSuccess) { myLogDataHolder.getFilteredDetailsFromTheVcs(filters, new Consumer>() { @Override public void consume(List details) { - myUI.setModel(new NoGraphTableModel(myLogDataHolder, myUI, details, myLogDataHolder.getDataPack().getRefsModel(), false)); + myUI.setModel(new NoGraphTableModel(myUI, details, myLogDataHolder.getDataPack().getRefsModel(), false)); myUI.updateUI(); + onSuccess.run(); } }); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogImpl.java index abe3006c2ece..e4e4c84cd5cb 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogImpl.java @@ -42,6 +42,14 @@ public class VcsLogImpl implements VcsLog { myUi = vcsLogManager.getLogUi(); } + /** + * Checks if the log is initialized. + * TODO Temporary method until the old Git log is switched off and removed + */ + public boolean isReady() { + return myDataHolder != null && myUi != null; + } + @NotNull @Override public List getSelectedCommits() { diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/GitLogIcons.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/GitLogIcons.java deleted file mode 100644 index f66c3d2da670..000000000000 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/GitLogIcons.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.intellij.vcs.log.ui; - -import com.intellij.openapi.util.IconLoader; - -import javax.swing.Icon; - -public class GitLogIcons { - public static final Icon CHERRY_PICK = IconLoader.getIcon("/cherry-pick-32.png"); - public static final Icon MOVE = IconLoader.getIcon("/move-32.png"); - public static final Icon REBASE = IconLoader.getIcon("/arrow-32.png"); - public static final Icon REBASE_INTERACTIVE = IconLoader.getIcon("/edit-32.png"); - public static final Icon FIX_UP = IconLoader.getIcon("/fixup-32.png"); - public static final Icon FORBIDDEN = IconLoader.getIcon("/forbidden-32.png"); - - public static final Icon APPLY = IconLoader.getIcon("/apply-16.png"); - public static final Icon CANCEL = IconLoader.getIcon("/cancel-16.png"); - //public static final Icon SPIDER = IconLoader.getIcon("/spider-16.png"); - public static final Icon SPIDER = IconLoader.getIcon("/spider-1-16.png"); - //public static final Icon SPIDER = IconLoader.getIcon("/spider-16-2.png"); - public static final Icon WEB = IconLoader.getIcon("/web-16.png"); -} diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java index f436d275b11f..80319317196e 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java @@ -10,7 +10,6 @@ import com.intellij.ui.SeparatorComponent; import com.intellij.ui.SeparatorOrientation; import com.intellij.vcs.log.data.VcsLogDataHolder; import com.intellij.vcs.log.data.VcsLogUiProperties; -import com.intellij.vcs.log.ui.GitLogIcons; import com.intellij.vcs.log.ui.VcsLogUI; import com.intellij.vcs.log.ui.filter.VcsLogClassicFilterUi; import com.intellij.vcs.log.ui.filter.VcsLogFilterUi; @@ -64,14 +63,14 @@ public class MainFrame { } private JComponent createActionsToolbar() { - AnAction hideBranchesAction = new DumbAwareAction("Collapse linear branches", "Collapse linear branches", GitLogIcons.SPIDER) { + AnAction hideBranchesAction = new DumbAwareAction("Collapse linear branches", "Collapse linear branches", AllIcons.Actions.Collapseall) { @Override public void actionPerformed(AnActionEvent e) { myUI.hideAll(); } }; - AnAction showBranchesAction = new DumbAwareAction("Expand all branches", "Expand all branches", GitLogIcons.WEB) { + AnAction showBranchesAction = new DumbAwareAction("Expand all branches", "Expand all branches", AllIcons.Actions.Expandall) { @Override public void actionPerformed(AnActionEvent e) { myUI.showAll(); @@ -90,8 +89,9 @@ public class MainFrame { } }; - AnAction showFullPatchAction = new ToggleAction("Show full patch", "Expand all branches even if they occupy a lot of space", - AllIcons.Actions.Expandall) { + AnAction showFullPatchAction = new ToggleAction("Show long edges", + "Show long branch edges even if commits are invisible in the current view.", + AllIcons.Ide.UpDown) { @Override public boolean isSelected(AnActionEvent e) { return !myUI.areLongEdgesHidden(); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java index adb438c862c6..b6a9fae6a66c 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java @@ -15,7 +15,6 @@ import com.intellij.vcs.log.graph.render.*; import com.intellij.vcs.log.printmodel.GraphPrintCell; import com.intellij.vcs.log.printmodel.SpecialPrintElement; import com.intellij.vcs.log.ui.VcsLogUI; -import com.intellij.vcs.log.ui.render.AbstractPaddingCellRender; import com.intellij.vcs.log.ui.render.CommitCellRender; import com.intellij.vcs.log.ui.render.GraphCommitCellRender; import com.intellij.vcs.log.ui.tables.AbstractVcsLogTableModel; @@ -234,12 +233,7 @@ public class VcsLogGraphTable extends JBTable { Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Object commit = getValueAt(row, AbstractVcsLogTableModel.COMMIT_COLUMN); if (commit instanceof GraphCommitCell) { - if (AbstractPaddingCellRender.isMarked(commit) && !isSelected) { - rendererComponent.setBackground(AbstractPaddingCellRender.MARKED_BACKGROUND); - } - else { - setBackground(isSelected ? table.getSelectionBackground() : JBColor.WHITE); - } + setBackground(isSelected ? table.getSelectionBackground() : JBColor.WHITE); } return rendererComponent; } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java index 3d81ed94df23..b80cb3c61e8a 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/AbstractPaddingCellRender.java @@ -55,12 +55,7 @@ public abstract class AbstractPaddingCellRender implements TableCellRenderer { boolean isSelected, boolean hasFocus, int row, int column) { myValue = value; super.getTableCellRendererComponent(table, getCellText(value), isSelected, hasFocus, row, column); - if (isMarked(value) && !isSelected) { - setBackground(MARKED_BACKGROUND); - } - else { - setBackground(isSelected ? table.getSelectionBackground() : JBColor.WHITE); - } + setBackground(isSelected ? table.getSelectionBackground() : JBColor.WHITE); Border paddingBorder = BorderFactory.createEmptyBorder(0, getLeftPadding(table, value), 0, 0); setBorder(BorderFactory.createCompoundBorder(this.getBorder(), paddingBorder)); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/NoGraphTableModel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/NoGraphTableModel.java index 87731c93831c..1d4c10fac244 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/NoGraphTableModel.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/NoGraphTableModel.java @@ -8,7 +8,6 @@ import com.intellij.vcs.log.VcsFullCommitDetails; import com.intellij.vcs.log.VcsRef; import com.intellij.vcs.log.VcsShortCommitDetails; import com.intellij.vcs.log.data.RefsModel; -import com.intellij.vcs.log.data.VcsLogDataHolder; import com.intellij.vcs.log.graph.render.CommitCell; import com.intellij.vcs.log.ui.VcsLogUI; import org.jetbrains.annotations.NotNull; @@ -20,15 +19,13 @@ public class NoGraphTableModel extends AbstractVcsLogTableModel { private static final Logger LOG = Logger.getInstance(NoGraphTableModel.class); - @NotNull private final VcsLogDataHolder myLogDataHolder; @NotNull private final VcsLogUI myUi; @NotNull private final List myCommits; @NotNull private final RefsModel myRefsModel; - private final boolean myAllowLoadingMoreRequest; + private boolean myAllowLoadingMoreRequest; - public NoGraphTableModel(@NotNull VcsLogDataHolder logDataHolder, @NotNull VcsLogUI UI, - @NotNull List commits, @NotNull RefsModel refsModel, boolean allowLoadingMoreRequest) { - myLogDataHolder = logDataHolder; + public NoGraphTableModel(@NotNull VcsLogUI UI, @NotNull List commits, @NotNull RefsModel refsModel, + boolean allowLoadingMoreRequest) { myUi = UI; myCommits = commits; myRefsModel = refsModel; @@ -56,23 +53,14 @@ public class NoGraphTableModel extends AbstractVcsLogTableModel { return; } - Runnable success = new Runnable() { + myUi.getTable().setPaintBusy(true); + myUi.getFilterer().requestVcs(myUi.collectFilters(), new Runnable() { @Override public void run() { - myUi.applyFiltersAndUpdateUi(); myUi.getTable().setPaintBusy(false); } - }; - VcsLogDataHolder.LoadingState state = myLogDataHolder.loadMoreDetails(success); - if (state == VcsLogDataHolder.LoadingState.LOADING) { - myUi.getTable().setPaintBusy(true); - } - else if (state == VcsLogDataHolder.LoadingState.LIMIT_REACHED) { - myUi.getFilterer().requestVcs(myUi.collectFilters()); - } - else { - myUi.getTable().setPaintBusy(false); - } + }); + myAllowLoadingMoreRequest = false; // Don't send the request to VCS twice } @Nullable diff --git a/plugins/git4idea/src/git4idea/cherrypick/GitCherryPickAction.java b/plugins/git4idea/src/git4idea/cherrypick/GitCherryPickAction.java index 50cf5cf9e8c3..5878c074f229 100644 --- a/plugins/git4idea/src/git4idea/cherrypick/GitCherryPickAction.java +++ b/plugins/git4idea/src/git4idea/cherrypick/GitCherryPickAction.java @@ -31,6 +31,7 @@ import com.intellij.vcs.log.Hash; import com.intellij.vcs.log.VcsFullCommitDetails; import com.intellij.vcs.log.VcsLog; import com.intellij.vcs.log.VcsLogObjectsFactory; +import com.intellij.vcs.log.impl.VcsLogImpl; import git4idea.GitLocalBranch; import git4idea.GitPlatformFacade; import git4idea.GitVcs; @@ -174,7 +175,11 @@ public class GitCherryPickAction extends DumbAwareAction { if (project == null) { return null; } - List selectedCommits = getVcsLog(project).getSelectedCommits(); + VcsLog log = getVcsLog(project); + if (log == null) { + return null; + } + List selectedCommits = log.getSelectedCommits(); // don't allow to cherry-pick if a non-Git commit was selected // we could cherry-pick just Git commits filtered from the list, but it might provide confusion boolean nonGitCommitSelected = ContainerUtil.find(selectedCommits, new Condition() { @@ -207,7 +212,8 @@ public class GitCherryPickAction extends DumbAwareAction { } private static VcsLog getVcsLog(@NotNull Project project) { - return ServiceManager.getService(project, VcsLog.class); + VcsLog logService = ServiceManager.getService(project, VcsLog.class); + return logService != null && ((VcsLogImpl)logService).isReady() ? logService : null; } // TODO remove after removing the old Vcs Log implementation @@ -220,7 +226,11 @@ public class GitCherryPickAction extends DumbAwareAction { if (event.getProject() == null) { return null; } - return getVcsLog(event.getProject()).getContainingBranches(commit.getHash()); + VcsLog log = getVcsLog(event.getProject()); + if (log == null) { + return null; + } + return log.getContainingBranches(commit.getHash()); } } diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/completion/EmmetAbbreviationCompletionProvider.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/completion/EmmetAbbreviationCompletionProvider.java index b0528125f8b5..9968f635a72a 100644 --- a/xml/impl/src/com/intellij/codeInsight/template/emmet/completion/EmmetAbbreviationCompletionProvider.java +++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/completion/EmmetAbbreviationCompletionProvider.java @@ -51,6 +51,11 @@ abstract public class EmmetAbbreviationCompletionProvider extends CompletionProv return; } + final ZenCodingGenerator generator = getGenerator(); + if (!generator.isMyContext(parameters.getPosition(), false) || !generator.isAppliedByDefault(parameters.getPosition())) { + return; + } + final PsiFile file = parameters.getPosition().getContainingFile(); final Editor editor = parameters.getEditor(); @@ -78,7 +83,7 @@ abstract public class EmmetAbbreviationCompletionProvider extends CompletionProv }; final Collection extraFilters = ContainerUtil.newLinkedList(new SingleLineEmmetFilter()); - ZenCodingTemplate.expand(templatePrefix, callback, null, getGenerator(), extraFilters, false); + ZenCodingTemplate.expand(templatePrefix, callback, null, generator, extraFilters, false); if (!generatedTemplate.isNull()) { result = result.withPrefixMatcher(templatePrefix); final TemplateImpl template = generatedTemplate.get();