--- /dev/null
+/*
+ * 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.
+ */
+package com.jetbrains.python.actions;
+
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.EditorTextField;
+import com.intellij.xdebugger.impl.ui.TextViewer;
+import com.intellij.xdebugger.impl.ui.tree.actions.XFetchValueActionBase;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * Created by Alexander.Marchuk
+ */
+
+public class PyViewArrayAction extends XFetchValueActionBase {
+ @Override
+ protected void handle(Project project, String value) {
+ final MyDialog dialog = new MyDialog(project);
+ dialog.setTitle("View Array");
+ dialog.setText(StringUtil.unquoteString(value));
+ dialog.show();
+ }
+
+ private static class MyDialog extends DialogWrapper {
+ private final EditorTextField myTextViewer;
+
+ private MyDialog(Project project) {
+ super(project, false);
+ setModal(false);
+ setCancelButtonText("Close");
+ setCrossClosesWindow(true);
+
+ myTextViewer = new TextViewer(project, true, true);
+ init();
+ }
+
+ public void setText(String text) {
+ myTextViewer.setText(text);
+ }
+
+ @Override
+ @NotNull
+ protected Action[] createActions() {
+ return new Action[] {getCancelAction()};
+ }
+
+ @Override
+ protected String getDimensionServiceKey() {
+ return "#com.jetbrains.python.actions.PyViewArrayAction";
+ }
+
+ @Override
+ protected JComponent createCenterPanel() {
+ final JPanel panel = new JPanel(new BorderLayout());
+ panel.add(myTextViewer, BorderLayout.CENTER);
+ panel.setPreferredSize(new Dimension(300, 200));
+ return panel;
+ }
+ }
+}