protected void updateComponents() {
    final boolean querySelected = queryNameList.getSelectedIndex() != -1;
    final boolean hasQueries = queryNameList.getModel().getSize() > 0;

    queryNameTextField.setEnabled(querySelected);
    queryTextArea.setEnabled(querySelected);

    getConfirmAction().setEnabled(hasQueries && languageField.getSelectedIndex() != -1);
    queryTextArea.setSyntaxEditingStyle(
        mapLanguageToSyntaxHighlighting((String) languageField.getSelectedValue()));
    initScriptTextArea.setSyntaxEditingStyle(
        mapLanguageToSyntaxHighlighting((String) languageField.getSelectedValue()));
    shutdownScriptTextArea.setSyntaxEditingStyle(
        mapLanguageToSyntaxHighlighting((String) languageField.getSelectedValue()));
    previewAction.setEnabled(querySelected);
  }
Ejemplo n.º 2
0
  public Main() {

    JPanel contentPane = new JPanel(new BorderLayout());
    RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);
    contentPane.add(new RTextScrollPane(textArea));

    // A CompletionProvider is what knows of all possible completions, and
    // analyzes the contents of the text area at the caret position to
    // determine what completion choices should be presented. Most
    // instances of CompletionProvider (such as DefaultCompletionProvider)
    // are designed so that they can be shared among multiple text
    // components.
    CompletionProvider provider = createCompletionProvider();

    // An AutoCompletion acts as a "middle-man" between a text component
    // and a CompletionProvider. It manages any options associated with
    // the auto-completion (the popup trigger key, whether to display a
    // documentation window along with completion choices, etc.). Unlike
    // CompletionProviders, instances of AutoCompletion cannot be shared
    // among multiple text components.
    AutoCompletion ac = new AutoCompletion(provider);
    ac.install(textArea);

    setContentPane(contentPane);
    setTitle("AutoComplete Demo");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
  }
  private void init(final DesignTimeContext designTimeContext) {
    if (designTimeContext == null) {
      throw new NullPointerException();
    }
    this.designTimeContext = designTimeContext;

    setTitle(Messages.getString("ScriptableDataSourceEditor.Title"));
    setModal(true);

    previewAction = new PreviewAction();

    queryNameTextField = new JTextField(null, 0);
    queryNameTextField.setColumns(35);
    queryNameTextField.getDocument().addDocumentListener(new QueryNameTextFieldDocumentListener());

    queryTextArea = new RSyntaxTextArea();
    queryTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
    queryTextArea.getDocument().addDocumentListener(new QueryDocumentListener());

    initScriptTextArea = new RSyntaxTextArea();
    initScriptTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);

    shutdownScriptTextArea = new RSyntaxTextArea();
    shutdownScriptTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);

    languageField =
        new JList(new DefaultComboBoxModel(InternalBSFManager.getRegisteredLanguages()));
    languageField.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    languageField.getSelectionModel().addListSelectionListener(new UpdateLanguageHandler());

    queryNameList = new JList();
    queryNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    queryNameList.setVisibleRowCount(5);
    queryNameList.addListSelectionListener(new QueryNameListSelectionListener());
    queryNameList.setCellRenderer(new QueryNameListCellRenderer());

    final QueryRemoveAction removeQueryAction = new QueryRemoveAction();
    queryNameList.addListSelectionListener(removeQueryAction);

    super.init();
  }
Ejemplo n.º 4
0
  private void setCodePane(final SwingNode swingNode, final JPanel cp, int width, int height) {
    RSyntaxTextArea textArea = new RSyntaxTextArea(width, height); // 32,45
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);
    textArea.doLayout();
    RTextScrollPane sp = new RTextScrollPane(textArea);
    sp.setFoldIndicatorEnabled(true);
    cp.add(sp);

    swingNode.setContent(cp);
  }
Ejemplo n.º 5
0
  /**
   * @param parent
   * @param xmlViewTA
   */
  public XMlViewDialog(Frame parent) {
    super(parent);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosed(WindowEvent e) {
            setVisible(false);
          }
        });

    setModal(false);
    xmlViewTA = new RSyntaxTextArea();
    xmlViewTA.setEditable(false);
    xmlViewTA.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
    RTextScrollPane sp = new RTextScrollPane(xmlViewTA);
    add(sp, BorderLayout.CENTER);
    JButton button = new JButton("Close");
    button.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            setVisible(false);
          }
        });
    add(button, BorderLayout.SOUTH);

    // Create a toolbar with searching options.
    JToolBar toolBar = new JToolBar();
    toolBar.add(new JLabel("Search: "));
    searchField = new JTextField(30);
    toolBar.add(searchField);
    JButton b = new JButton("Find Next");
    b.setActionCommand("FindNext");
    b.addActionListener(this);
    toolBar.add(b);
    b = new JButton("Find Previous");
    b.setActionCommand("FindPrev");
    b.addActionListener(this);
    toolBar.add(b);
    regexCB = new JCheckBox("Regex");
    toolBar.add(regexCB);
    matchCaseCB = new JCheckBox("Match Case");
    toolBar.add(matchCaseCB);
    add(toolBar, BorderLayout.NORTH);
  }
  public FindAndReplaceDemo() {

    JPanel cp = new JPanel(new BorderLayout());

    textArea = new RSyntaxTextArea(20, 60);
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);
    RTextScrollPane sp = new RTextScrollPane(textArea);
    sp.setFoldIndicatorEnabled(true);
    cp.add(sp);

    // Create a toolbar with searching options.
    JPanel toolBar = new JPanel();
    searchField = new JTextField(30);
    toolBar.add(searchField);
    final JButton nextButton = new JButton("Find Next");
    nextButton.setActionCommand("FindNext");
    nextButton.addActionListener(this);
    toolBar.add(nextButton);
    searchField.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            nextButton.doClick(0);
          }
        });
    JButton prevButton = new JButton("Find Previous");
    prevButton.setActionCommand("FindPrev");
    prevButton.addActionListener(this);
    toolBar.add(prevButton);
    regexCB = new JCheckBox("Regex");
    toolBar.add(regexCB);
    matchCaseCB = new JCheckBox("Match Case");
    toolBar.add(matchCaseCB);
    cp.add(toolBar, BorderLayout.NORTH);

    setContentPane(cp);
    setTitle("Find and Replace Demo");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
    setLocationRelativeTo(null);
  }
Ejemplo n.º 7
0
  private JPanel createScriptPanel() {
    scriptField = new RSyntaxTextArea();
    scriptField.setSyntaxEditingStyle("text/java");

    JLabel label = new JLabel(JMeterUtils.getResString("bsh_assertion_script")); // $NON-NLS-1$
    label.setLabelFor(scriptField);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(label, BorderLayout.NORTH);
    panel.add(new RTextScrollPane(scriptField), BorderLayout.CENTER);

    JTextArea explain =
        new JTextArea(JMeterUtils.getResString("bsh_assertion_script_variables")); // $NON-NLS-1$
    explain.setLineWrap(true);
    explain.setEditable(false);
    explain.setBackground(this.getBackground());
    panel.add(explain, BorderLayout.SOUTH);

    return panel;
  }
Ejemplo n.º 8
0
 /**
  * Définit la colorisation de cet éditeur.
  *
  * @param syntax Nom de la syntaxe : "Java", "Jvs", "None".
  * @return Cet objet, permettant de définir la construction <tt>new
  *     TextEditor().setProperty(..)</tt>.
  */
 public TextEditor setSyntax(String syntax) {
   syntax = syntax.toLowerCase();
   toolBar.removeTool("Reformater le code");
   clearCompletions();
   if ("jvs".equals(syntax) || "java".equals(syntax)) {
     textArea.setSyntaxEditingStyle(org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_JAVA);
   }
   if ("jvs".equals(syntax)) {
     toolBar.addTool(
         "Reformater le code",
         new Runnable() {
           @Override
           public void run() {
             setText(org.javascool.core.JvsBeautifier.run(getText()));
           }
         });
     addCompletions("org/javascool/macros/completion-langage.xml")
         .addCompletions("org/javascool/macros/completion-stdout.xml")
         .addCompletions("org/javascool/macros/completion-stdin.xml")
         .addCompletions("org/javascool/macros/completion-macros.xml");
   }
   return this;
 }
  /**
   * ERROR (exceptions) WARN (when something happens that's not supposed to) INFO (wire output)
   * DEBUG (test/displaying intermediate values), TRACE (start/end method)
   */
  public ConnectionConsoleWindow(ToolBar toolBar) {
    final ConnectionConsoleWindow thisConsole = this;
    this.toolBar = toolBar;

    java.net.URL url = ClassLoader.getSystemResource("ethereum-icon.png");
    Toolkit kit = Toolkit.getDefaultToolkit();
    Image img = kit.createImage(url);
    this.setIconImage(img);
    addCloseAction();

    JPanel cp = new JPanel(new BorderLayout());

    AbstractTokenMakerFactory atmf =
        (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
    atmf.putMapping("text/console", "org.ethereum.gui.ConsoleTokenMaker");

    textArea = new RSyntaxTextArea(16, 44);
    textArea.setSyntaxEditingStyle("text/console");
    //        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_LISP);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);

    changeStyleProgrammatically();
    RTextScrollPane sp = new RTextScrollPane(textArea);

    cp.add(sp);

    setContentPane(cp);
    setTitle("Connection Console");
    //        setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
    setLocation(802, 460);

    if (CONFIG.peerDiscovery()) UIEthereumManager.ethereum.startPeerDiscovery();

    Thread t =
        new Thread() {
          public void run() {

            UIEthereumManager.ethereum.connect(
                SystemProperties.CONFIG.activePeerIP(), SystemProperties.CONFIG.activePeerPort());
          }
        };

    UIEthereumManager.ethereum.addListener(
        new EthereumListenerAdapter() {
          @Override
          public void trace(final String output) {
            SwingUtilities.invokeLater(
                new Runnable() {
                  public void run() {
                    textArea.append(output);
                    textArea.append("\n");

                    if (autoScroll) textArea.setCaretPosition(textArea.getText().length());
                  }
                });
          }
        });
    t.start();
  }
Ejemplo n.º 10
0
  public void setContents() {
    String name = this.name.toLowerCase();
    panelArea.setCodeFoldingEnabled(true);
    panelArea.setAntiAliasingEnabled(true);
    RTextScrollPane scrollPane = new RTextScrollPane(panelArea);
    panelArea.addKeyListener(
        new KeyListener() {
          public void keyPressed(KeyEvent e) {
            if ((e.getKeyCode() == KeyEvent.VK_F)
                && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
              field.requestFocus();
            }

            BytecodeViewer.checkHotKey(e);
          }

          @Override
          public void keyReleased(KeyEvent arg0) {}

          @Override
          public void keyTyped(KeyEvent arg0) {}
        });

    String contentsS = new String(contents);

    if (!isPureAscii(contentsS)) {
      if (name.endsWith(".png")
          || name.endsWith(".jpg")
          || name.endsWith(".jpeg")
          || name.endsWith(".gif")
          || name.endsWith(".tif")
          || name.endsWith(".bmp")) {
        canRefresh = true;
        try {
          image = ImageIO.read(new ByteArrayInputStream(contents)); // gifs fail cause of this
          JLabel label = new JLabel("", new ImageIcon(image), JLabel.CENTER);
          panel2.add(label, BorderLayout.CENTER);
          panel2.addMouseWheelListener(
              new MouseWheelListener() {
                @Override
                public void mouseWheelMoved(MouseWheelEvent e) {
                  int notches = e.getWheelRotation();
                  if (notches < 0) {
                    image =
                        Scalr.resize(
                            image,
                            Scalr.Method.SPEED,
                            image.getWidth() + 10,
                            image.getHeight() + 10);
                  } else {
                    image =
                        Scalr.resize(
                            image,
                            Scalr.Method.SPEED,
                            image.getWidth() - 10,
                            image.getHeight() - 10);
                  }
                  panel2.removeAll();
                  JLabel label = new JLabel("", new ImageIcon(image), JLabel.CENTER);
                  panel2.add(label, BorderLayout.CENTER);
                  panel2.updateUI();
                }
              });
          return;
        } catch (Exception e) {
          new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
        }
      } else {
        JHexEditor hex = new JHexEditor(contents);
        panel2.add(hex);
        return;
      }
    }

    if (name.endsWith(".xml") || contentsS.startsWith("<?xml") || contentsS.startsWith(("<xml"))) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".py") || name.endsWith(".python")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PYTHON);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".rb") || name.endsWith(".ruby")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_RUBY);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".java")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".html")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".css")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CSS);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".properties") || name.endsWith(".mf") || name.endsWith(".sf")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".php") || contentsS.startsWith("<?php")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PHP);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".js")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".bat")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_WINDOWS_BATCH);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".sh")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_UNIX_SHELL);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".c")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_C);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".cpp")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CPLUSPLUS);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".scala")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SCALA);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".clojure")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CLOJURE);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".groovy")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".lua")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_LUA);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".sql")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".json")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON);
      panelArea.setText(contentsS);
    } else if (name.endsWith(".jsp")) {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSP);
      panelArea.setText(contentsS);
    } else {
      panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
      panelArea.setText(contentsS);
    }

    panelArea.setCaretPosition(0);
    scrollPane.setColumnHeaderView(panel);
    panel2.add(scrollPane);
  }
 private void changeContentType(String type) {
   RSyntaxTextArea editor = ui.editor;
   editor.setSyntaxEditingStyle(type);
 }
Ejemplo n.º 12
0
  /**
   * Update the display to show the information about the specified example.
   *
   * @param example the currently-selected example
   */
  private void display(Example example) {
    if (example == null) {
      tabbedPane.removeAll();
      runButton.setEnabled(false);
    } else {
      tabbedPane.removeAll();

      JEditorPane description = new JEditorPane();
      description.setContentType("text/html");
      description.setText(example.getDescription());
      description.setEditable(false);

      description.addHyperlinkListener(
          new HyperlinkListener() {

            @Override
            public void hyperlinkUpdate(HyperlinkEvent hle) {
              if (HyperlinkEvent.EventType.ACTIVATED.equals(hle.getEventType())) {
                Desktop desktop = Desktop.getDesktop();

                try {
                  desktop.browse(hle.getURL().toURI());
                } catch (Exception ex) {
                  // unable to launch browser
                }
              }
            }
          });

      tabbedPane.addTab("Description", description);

      for (String resource : example.getResources()) {
        try {
          RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);

          if (resource.endsWith(".java")) {
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
          } else {
            textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
          }

          textArea.setCodeFoldingEnabled(true);
          textArea.setText(load(resource));
          textArea.setSelectionStart(0);
          textArea.setSelectionEnd(0);
          textArea.setEditable(false);
          RTextScrollPane sp = new RTextScrollPane(textArea);

          tabbedPane.addTab(new File(resource).getName(), sp);
        } catch (IOException ex) {
          ex.printStackTrace();
        }
      }

      if (example.getMainClass() == null) {
        runButton.setEnabled(false);
      } else {
        runButton.setEnabled(true);
      }
    }
  }
Ejemplo n.º 13
0
  private Component createEntryViewer(JarEntry entry) {
    if (entry.getType().equals(JarEntryType.classEntry)
        || entry.getType().equals(JarEntryType.javaEntry)
        || entry.getType().equals(JarEntryType.fileEntry)) {
      String ext = FileUtils.getFileExtPart(entry.getName(), false).toLowerCase();
      if (GlobalConstants.IMAGE_FORMATS.contains(ext)) {
        // todo A better image viewer (actually a new component - WebImageViewer)

        // Image file viewer
        WebImage image = new WebImage();
        image.setIcon(ImageUtils.loadImage(getEntryInputStream(entry)));

        // Image scroll
        WebScrollPane imageScroll = new WebScrollPane(image, false);
        imageScroll.setVerticalScrollBarPolicy(WebScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        imageScroll.setHorizontalScrollBarPolicy(WebScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        return imageScroll;
      } else {
        // Source code viewer
        final RSyntaxTextArea source = new RSyntaxTextArea();

        // Syntax style
        boolean libraryCode = false;
        if (ext.equals("java") || ext.equals("class")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
          libraryCode = true;
        } else if (ext.equals("xml")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
        } else if (ext.equals("html")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);
        } else if (ext.equals("css")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CSS);
        } else if (ext.equals("js")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
        } else if (ext.equals("php")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PHP);
        } else if (ext.equals("sql")) {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
        } else {
          source.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
        }

        // Settings
        source.setEditable(false);
        source.setMargin(new Insets(0, 5, 0, 0));
        source.setAntiAliasingEnabled(true);
        source.setUseFocusableTips(true);
        source.setTabSize(4);
        // source.setLineWrap ( true );
        // source.setWrapStyleWord ( true );
        source.setCodeFoldingEnabled(allowCodeFolding.isSelected());
        source.setPaintTabLines(paintTabLines.isSelected());
        source.setWhitespaceVisible(showWhitespaces.isSelected());
        source.setEOLMarkersVisible(showEol.isSelected());
        source.addHyperlinkListener(
            new HyperlinkListener() {
              @Override
              public void hyperlinkUpdate(HyperlinkEvent e) {
                WebUtils.browseSiteSafely(e.getURL().toExternalForm());
              }
            });
        ((RSyntaxTextAreaHighlighter) source.getHighlighter()).setDrawsLayeredHighlights(false);

        // Source code
        source.setText(libraryCode ? loadSource(entry) : loadString(entry));
        source.setCaretPosition(0);

        // "Jump to source"-like action
        source.addMouseListener(
            new MouseAdapter() {
              @Override
              public void mousePressed(MouseEvent e) {
                // todo Fix when clicked in class "MyName" on string "MyName"
                // Additional feature to dive into related classes
                if (SwingUtilities.isMiddleMouseButton(e)
                    || SwingUtils.isCtrl(e) && SwingUtilities.isLeftMouseButton(e)) {
                  int pos = source.getUI().viewToModel(source, e.getPoint());
                  String word = TextUtils.getWord(source.getText(), pos);
                  if (word != null) {
                    JarEntry classByName = jarStructure.findEntryByName(word);
                    if (classByName != null
                        && (classByName.getType().equals(JarEntryType.classEntry)
                            || classByName.getType().equals(JarEntryType.javaEntry))) {
                      updateClassPath(classByName, true);
                    }
                  }
                }
              }
            });

        // Saving opened editor
        synchronized (activeEditorsLock) {
          activeEditors.put(entry, source);
        }

        // Special code viewer scroll pane
        RTextScrollPane sourceScroll = new RTextScrollPane(source);
        sourceScroll.setVerticalScrollBarPolicy(WebScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        ((WebScrollPaneUI) sourceScroll.getUI()).setDrawBorder(false);

        // Source code viewer theme
        loadTheme(theme.getSelectedItem().toString().toLowerCase(), source);

        return sourceScroll;
      }
    }
    return new WebLabel();
  }