Ejemplo n.º 1
0
  // {{{ init() method
  private void init() {
    EditBus.addToBus(this);

    /* Setup panes */
    JPanel content = new JPanel(new BorderLayout(12, 12));
    content.setBorder(new EmptyBorder(12, 12, 12, 12));
    setContentPane(content);

    tabPane = new JTabbedPane();
    tabPane.addTab(jEdit.getProperty("manage-plugins.title"), manager = new ManagePanel(this));
    tabPane.addTab(
        jEdit.getProperty("update-plugins.title"), updater = new InstallPanel(this, true));
    tabPane.addTab(
        jEdit.getProperty("install-plugins.title"), installer = new InstallPanel(this, false));
    EditBus.addToBus(installer);
    content.add(BorderLayout.CENTER, tabPane);

    tabPane.addChangeListener(new ListUpdater());

    /* Create the buttons */
    Box buttons = new Box(BoxLayout.X_AXIS);

    ActionListener al = new ActionHandler();
    mgrOptions = new JButton(jEdit.getProperty("plugin-manager.mgr-options"));
    mgrOptions.addActionListener(al);
    pluginOptions = new JButton(jEdit.getProperty("plugin-manager.plugin-options"));
    pluginOptions.addActionListener(al);
    done = new JButton(jEdit.getProperty("plugin-manager.done"));
    done.addActionListener(al);

    buttons.add(Box.createGlue());
    buttons.add(mgrOptions);
    buttons.add(Box.createHorizontalStrut(6));
    buttons.add(pluginOptions);
    buttons.add(Box.createHorizontalStrut(6));
    buttons.add(done);
    buttons.add(Box.createGlue());

    getRootPane().setDefaultButton(done);

    content.add(BorderLayout.SOUTH, buttons);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    setIconImage(GUIUtilities.getPluginIcon());

    pack();
    GUIUtilities.loadGeometry(this, parent, "plugin-manager");
    GUIUtilities.addSizeSaver(this, parent, "plugin-manager");
    setVisible(true);
  } // }}}
Ejemplo n.º 2
0
 // {{{ addNotify() method
 @Override
 public void addNotify() {
   super.addNotify();
   EditBus.addToBus(this);
   multiStatus = jEdit.getBooleanProperty("hypersearch-results.multi");
   updateHighlightStatus();
   updateMultiStatus();
 } // }}}
Ejemplo n.º 3
0
 // {{{ Class initializer
 static {
   EditBus.addToBus(
       new EBComponent() {
         public void handleMessage(EBMessage msg) {
           if (msg instanceof PropertiesChanged) {
             synchronized (lock) {
               colors = null;
             }
           }
         }
       });
 } // }}}
Ejemplo n.º 4
0
  EditPane(View view, BufferSet bufferSetSource, Buffer buffer) {
    super(new BorderLayout());
    bufferSet = new BufferSet(bufferSetSource);
    init = true;

    this.view = view;

    textArea = new JEditTextArea(view);
    bufferSet.addBufferSetListener(this);
    textArea.getPainter().setAntiAlias(new AntiAlias(jEdit.getProperty("view.antiAlias")));
    textArea.setMouseHandler(new MouseHandler(textArea));
    textArea.setTransferHandler(new TextAreaTransferHandler());
    markerHighlight = new MarkerHighlight();
    Gutter gutter = textArea.getGutter();
    gutter.setGutterEnabled(GutterOptionPane.isGutterEnabled());
    gutter.setMinLineNumberDigitCount(GutterOptionPane.getMinLineNumberDigits());
    gutter.setSelectionAreaEnabled(GutterOptionPane.isSelectionAreaEnabled());
    gutter.addExtension(markerHighlight);
    gutter.setSelectionPopupHandler(
        new GutterPopupHandler() {
          public void handlePopup(int x, int y, int line) {
            Buffer buffer = getBuffer();
            buffer.addOrRemoveMarker('\0', buffer.getLineStartOffset(line));
          }
        });

    textArea.addStatusListener(new StatusHandler());
    add(BorderLayout.CENTER, textArea);

    propertiesChanged();
    setBuffer(buffer);

    if (bufferSet.indexOf(buffer) == -1) bufferSet.addBuffer(buffer);

    loadBufferSwitcher();

    init = false;
    EditBus.addToBus(this);
  }
Ejemplo n.º 5
0
 /** **if using these without call to super,view empty! no cnsl, no cpc */
 public void addNotify() {
   logger.info("");
   super.addNotify();
   EditBus.addToBus(this);
 }