Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vladimir.Orlov
2015-02-20 17:59:37 +03:00
12 changed files with 16 additions and 340 deletions
@@ -1,34 +0,0 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.impl.DebuggerContextImpl;
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.diff.DiffDialogHints;
import com.intellij.diff.DiffManager;
import com.intellij.diff.DiffRequestFactory;
import com.intellij.diff.requests.DiffRequest;
import com.intellij.openapi.project.Project;
/**
* @author Jeka
*/
public class CompareValueWithClipboardAction extends BaseValueAction {
protected void processText(final Project project, final String text, DebuggerTreeNodeImpl node, DebuggerContextImpl debuggerContext) {
DiffRequest request = DiffRequestFactory.getInstance().createClipboardVsValue(text);
DiffManager.getInstance().showDiff(project, request);
}
}
@@ -1,32 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.impl.DebuggerContextImpl;
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import java.awt.datatransfer.StringSelection;
/*
* @author Jeka
*/
public class CopyValueAction extends BaseValueAction {
protected void processText(final Project project, final String text, DebuggerTreeNodeImpl node, DebuggerContextImpl debuggerContext) {
CopyPasteManager.getInstance().setContents(new StringSelection(text));
}
}
@@ -1,51 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.ui.DebuggerPanelsManager;
import com.intellij.debugger.ui.impl.MainWatchPanel;
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
/**
* User: lex
* Date: Sep 26, 2003
* Time: 8:34:01 PM
*/
public class EditWatchAction extends DebuggerAction {
public void actionPerformed(final AnActionEvent e) {
final DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
if(selectedNode == null || !(selectedNode.getDescriptor() instanceof WatchItemDescriptor)) return;
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
MainWatchPanel watchPanel = DebuggerPanelsManager.getInstance(project).getWatchPanel();
if(watchPanel != null) {
watchPanel.editNode(selectedNode);
}
}
public void update(AnActionEvent e) {
final DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
e.getPresentation().setVisible(selectedNode != null && selectedNode.getDescriptor() instanceof WatchItemDescriptor);
}
};
@@ -1,43 +0,0 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Class NewWatchAction
* @author Jeka
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.ui.DebuggerPanelsManager;
import com.intellij.debugger.ui.impl.MainWatchPanel;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
public class NewWatchAction extends DebuggerAction {
public void actionPerformed(final AnActionEvent e) {
getWatchPanel(e).newWatch();
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(getWatchPanel(e) != null);
}
private static MainWatchPanel getWatchPanel(AnActionEvent e) {
Project project = e.getProject();
return project != null ? DebuggerPanelsManager.getInstance(project).getWatchPanel() : null;
}
}
@@ -1,46 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.ui.impl.watch.DebuggerTree;
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import java.util.Enumeration;
/**
* User: lex
* Date: Sep 26, 2003
* Time: 6:24:44 PM
*/
public class RemoveAllWatchesAction extends RemoveWatchAction {
protected DebuggerTreeNodeImpl[] getNodesToDelete(AnActionEvent e) {
DebuggerTree tree = getTree(e.getDataContext());
if(tree == null) return null;
DebuggerTreeNodeImpl root = (DebuggerTreeNodeImpl)tree.getModel().getRoot();
DebuggerTreeNodeImpl [] result = new DebuggerTreeNodeImpl[root.getChildCount()];
int i = 0;
for(Enumeration enumeration = root.children(); enumeration.hasMoreElements(); i++) {
DebuggerTreeNodeImpl node = (DebuggerTreeNodeImpl)enumeration.nextElement();
result[i] = node;
}
return result;
}
protected void updatePresentation(Presentation presentation, int watchesCount) {
}
}
@@ -1,68 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.ui.impl.MainWatchPanel;
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import java.util.ArrayList;
public class RemoveWatchAction extends DebuggerAction {
protected DebuggerTreeNodeImpl[] getNodesToDelete(AnActionEvent e) {
DebuggerTreeNodeImpl[] selectedNodes = getSelectedNodes(e.getDataContext());
if(selectedNodes == null) return null;
ArrayList<DebuggerTreeNodeImpl> selectedWatches = new ArrayList<DebuggerTreeNodeImpl>();
for (int i = 0; i < selectedNodes.length; i++) {
if(selectedNodes[i].getDescriptor() instanceof WatchItemDescriptor) {
selectedWatches.add(selectedNodes[i]);
}
}
return selectedWatches.toArray(new DebuggerTreeNodeImpl[selectedWatches.size()]);
}
public void actionPerformed(AnActionEvent e) {
DebuggerTreeNodeImpl [] nodes = getNodesToDelete(e);
if (nodes == null || nodes.length == 0) return;
MainWatchPanel watchPanel = (MainWatchPanel)getPanel(e.getDataContext());
for (int i = 0; i < nodes.length; i++) {
DebuggerTreeNodeImpl node = nodes[i];
watchPanel.getWatchTree().removeWatch(node);
}
}
protected void updatePresentation(Presentation presentation, int watchesCount) {
presentation.setText(DebuggerBundle.message("action.remove.watch.text", watchesCount));
}
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
DebuggerTreeNodeImpl[] nodes = getNodesToDelete(event);
if (nodes != null && nodes.length > 0) {
presentation.setEnabled(true);
}
else {
presentation.setEnabled(false);
}
updatePresentation(presentation, nodes != null? nodes.length : 0);
}
}
@@ -1,38 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.impl.DebuggerSession;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.impl.actions.DebuggerActionHandler;
import org.jetbrains.annotations.NotNull;
public class ShowExecutionPointActionHandler extends DebuggerActionHandler {
public void perform(@NotNull final Project project, final AnActionEvent event) {
final DebuggerSession session = (DebuggerManagerEx.getInstanceEx(project)).getContext().getDebuggerSession();
if (session != null) {
session.showExecutionPoint();
}
}
public boolean isEnabled(@NotNull final Project project, final AnActionEvent event) {
DebuggerSession debuggerSession = (DebuggerManagerEx.getInstanceEx(project)).getContext().getDebuggerSession();
return debuggerSession != null && debuggerSession.isPaused() &&
debuggerSession.getContextManager().getContext().getSuspendContext().getThread() != null;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
import org.jetbrains.annotations.NotNull;
/**
* @author egor
@@ -36,10 +37,10 @@ public class ShowLibraryFramesAction extends ToggleAction {
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean shouldShow = !(Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean shouldShow = !Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
presentation.setText(shouldShow ? ourTextWhenShowIsOn : ourTextWhenShowIsOff);
}
@@ -137,11 +137,7 @@ public class JavaDebugProcess extends XDebugProcess {
myNodeManager = new NodeManagerImpl(session.getProject(), null) {
@Override
public DebuggerTreeNodeImpl createNode(final NodeDescriptor descriptor, EvaluationContext evaluationContext) {
// value gathered here is required for correct renderers work. e.g. array renderer
//((NodeDescriptorImpl)descriptor).setContext((EvaluationContextImpl)evaluationContext);
final DebuggerTreeNodeImpl node = new DebuggerTreeNodeImpl(null, descriptor);
//((NodeDescriptorImpl)descriptor).updateRepresentation((EvaluationContextImpl)evaluationContext, DescriptorLabelListener.DUMMY_LISTENER);
return node;
return new DebuggerTreeNodeImpl(null, descriptor);
}
@Override
@@ -322,7 +318,6 @@ public class JavaDebugProcess extends XDebugProcess {
public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) {
Constraints beforeRunner = new Constraints(Anchor.BEFORE, "Runner.Layout");
leftToolbar.add(Separator.getInstance(), beforeRunner);
//leftToolbar.add(ActionManager.getInstance().getAction(DebuggerActions.EXPORT_THREADS), beforeRunner);
leftToolbar.add(ActionManager.getInstance().getAction(DebuggerActions.DUMP_THREADS), beforeRunner);
leftToolbar.add(Separator.getInstance(), beforeRunner);
@@ -339,10 +334,10 @@ public class JavaDebugProcess extends XDebugProcess {
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean autoModeEnabled = (Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean autoModeEnabled = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
presentation.setText(autoModeEnabled ? "All-Variables Mode" : "Auto-Variables Mode");
}
@@ -374,10 +369,10 @@ public class JavaDebugProcess extends XDebugProcess {
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean watchValues = (Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean watchValues = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
DebugProcessImpl process = getCurrentDebugProcess(e.getProject());
final String actionText = watchValues ? myMyTextDisable : myTextEnable;
if (process == null || process.canGetMethodReturnValue()) {
@@ -287,7 +287,6 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
}
leftToolbar.addSeparator();
//addAction(leftToolbar, DebuggerActions.EXPORT_THREADS);
addAction(leftToolbar, DebuggerActions.DUMP_THREADS);
leftToolbar.addSeparator();
@@ -523,10 +522,10 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean autoModeEnabled = (Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean autoModeEnabled = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
presentation.setText(autoModeEnabled ? "All-Variables Mode" : "Auto-Variables Mode");
}
@@ -558,10 +557,10 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean watchValues = (Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean watchValues = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
final DebugProcessImpl process = getDebugProcess();
final String actionText = watchValues ? myMyTextDisable : myTextEnable;
if (process != null && process.canGetMethodReturnValue()) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -710,10 +710,10 @@ public class FramesPanel extends UpdatableDebuggerView implements DataProvider {
}
@Override
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
final boolean shouldShow = !(Boolean)presentation.getClientProperty(SELECTED_PROPERTY);
final boolean shouldShow = !Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
presentation.setText(shouldShow ? ourTextWhenShowIsOn : ourTextWhenShowIsOff);
}
-7
View File
@@ -127,7 +127,6 @@
</group>
<action id="ExportThreads" class="com.intellij.debugger.actions.ExportThreadsAction" icon="AllIcons.Actions.Export">
<!--<add-to-group group-id="RunMenu" anchor="last"/>-->
<add-to-group group-id="XDebugger.Frames.Tree.Popup"/>
</action>
<action id="DumpThreads" class="com.intellij.debugger.actions.ThreadDumpAction" text="Get thread dump" icon="AllIcons.Actions.Dump">
@@ -166,19 +165,13 @@
<action id="Debugger.ViewText" class="com.intellij.debugger.actions.ViewTextAction">
<add-to-group group-id="XDebugger.ValueGroup" anchor="last"/>
</action>
<!--<action id="Debugger.CopyValue" class="com.intellij.debugger.actions.CopyValueAction"/>-->
<!--<action id="Debugger.CompareValueWithClipboard" class="com.intellij.debugger.actions.CompareValueWithClipboardAction"/>-->
<action id="Debugger.CustomizeThreadsView" class="com.intellij.debugger.actions.CustomizeThreadsViewAction">
<add-to-group group-id="XDebugger.Frames.Tree.Popup" anchor="last"/>
</action>
<!--<action id="Debugger.NewWatch" class="com.intellij.debugger.actions.NewWatchAction" icon="AllIcons.Debugger.NewWatch"/>-->
<!--<action id="Debugger.EditWatch" class="com.intellij.debugger.actions.EditWatchAction"/>-->
<action id="Debugger.EditFrameSource" class="com.intellij.debugger.actions.EditFrameSourceAction"/>
<action id="Debugger.EditNodeSource" class="com.intellij.debugger.actions.EditSourceAction"/>
<action id="Debugger.EditTypeSource" class="com.intellij.debugger.actions.JumpToObjectAction"/>
<reference ref="Debugger.PopFrame"/>
<!--<action id="Debugger.RemoveAllWatches" class="com.intellij.debugger.actions.RemoveAllWatchesAction"/>-->
<!--<action id="Debugger.RemoveWatch" class="com.intellij.debugger.actions.RemoveWatchAction" icon="AllIcons.Actions.Delete"/>-->
<action id="Debugger.ViewAsGroup" class="com.intellij.debugger.actions.ViewAsGroup">
<add-to-group group-id="XDebugger.ValueGroup" anchor="last"/>
</action>