Package net.sf.jabref

Examples of net.sf.jabref.BasePanel


  }

  void generate_actionPerformed( ActionEvent e )
  {
    generateButton.setEnabled( false ) ;
    BasePanel bp = ( BasePanel ) parentTabbedPane.getComponentAt(
        dbChooser.getSelectedIndex() ) ;
    notFoundList.removeAll() ;
    statusInfos.setText( null ) ;
    BibtexDatabase refBase = bp.getDatabase() ;
    String auxName = auxFileField.getText() ;

    if ( auxName != null )
    {
      if ( ( refBase != null ) && ( auxName.length() > 0 ) )
View Full Code Here


        JTabbedPane tabbedPane = frame.getTabbedPane();
       // Make a sorted Map that compares case-insensitively:
        TreeMap<String, BasePanel> map = new TreeMap<String, BasePanel>(this);

        for (int i=0; i<tabbedPane.getTabCount(); i++) {
            BasePanel panel = (BasePanel)tabbedPane.getComponent(i);
            map.put(tabbedPane.getTitleAt(i), panel);
        }
        tabbedPane.removeAll();
        for (Iterator<String> i=map.keySet().iterator(); i.hasNext();) {
            String title = i.next();
            BasePanel panel = map.get(title);
            tabbedPane.addTab(title, panel);
        }
    }
View Full Code Here

            if (selected.size() > 0) {

                if (newDatabase) {
                    // Create a new BasePanel for the entries:
                    BibtexDatabase base = new BibtexDatabase();
                    panel = new BasePanel(frame, base, null, new HashMap<String, String>(),
                        Globals.prefs.get("defaultEncoding"));
                }

                boolean groupingCanceled = false;
View Full Code Here

            // A double click on an entry should highlight the entry in its BasePanel:
            if (e.getClickCount() == 2) {
                // Get the selected entry:
                BibtexEntry toShow = model.getElementAt(row);
                // Look up which BasePanel it belongs to:
                BasePanel p = entryHome.get(toShow);
                // Show the correct tab in the main window:
                frame.showBasePanel(p);
                // Highlight the entry:
                p.highlightEntry(toShow);
            }
        }
View Full Code Here

            //if (e.)
            final int col = entryTable.columnAtPoint(e.getPoint()),
                    row = entryTable.rowAtPoint(e.getPoint());
            if (col < PAD) {
                BibtexEntry entry = sortedEntries.get(row);
                BasePanel p = entryHome.get(entry);
                switch (col) {
                    case FILE_COL:
                        Object o = entry.getField(GUIGlobals.FILE_FIELD);
                        if (o != null) {
                            FileListTableModel tableModel = new FileListTableModel();
                            tableModel.setContent((String) o);
                            if (tableModel.getRowCount() == 0)
                                return;
                            FileListEntry fl = tableModel.getEntry(0);
                            (new ExternalFileMenuItem(frame, entry, "", fl.getLink(), null,
                                p.metaData(), fl.getType())).actionPerformed(null);
                        }
                        break;
                    case URL_COL:
                        Object link = entry.getField("url");
                        try {
                            if (link != null)
                                Util.openExternalViewer(p.metaData(), (String) link, "url");
                        } catch (IOException ex) {
                            ex.printStackTrace();
                        }
                        break;
View Full Code Here

         * menu should be shown.
         * @param e The triggering mouse event.
         */
        public void processPopupTrigger(MouseEvent e) {
            BibtexEntry entry = sortedEntries.get(entryTable.rowAtPoint(e.getPoint()));
            BasePanel p = entryHome.get(entry);
            int col = entryTable.columnAtPoint(e.getPoint());
            JPopupMenu menu = new JPopupMenu();
            int count = 0;

            if (col == FILE_COL) {
                // We use a FileListTableModel to parse the field content:
                Object o = entry.getField(GUIGlobals.FILE_FIELD);
                FileListTableModel fileList = new FileListTableModel();
                fileList.setContent((String)o);
                // If there are one or more links, open the first one:
                for (int i=0; i<fileList.getRowCount(); i++) {
                    FileListEntry flEntry = fileList.getEntry(i);
                    String description = flEntry.getDescription();
                    if ((description == null) || (description.trim().length() == 0))
                        description = flEntry.getLink();
                    menu.add(new ExternalFileMenuItem(p.frame(), entry, description,
                            flEntry.getLink(), flEntry.getType().getIcon(), p.metaData(),
                            flEntry.getType()));
                    count++;
                }

            }
View Full Code Here

            public void listChanged(ListEvent<BibtexEntry> listEvent) {
                if (listEvent.getSourceList().size() == 1) {
                    BibtexEntry entry = listEvent.getSourceList().get(0);
                    // Find out which BasePanel the selected entry belongs to:
                    BasePanel p = entryHome.get(entry);
                    // Update the preview's metadata reference:
                    preview.setMetaData(p.metaData());
                    // Update the preview's entry:
                    preview.setEntry(entry);
                    contentPane.setDividerLocation(0.5f);
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
View Full Code Here

    // run third, on EDT:
    public void update() {

        if (database != null) {

            BasePanel pan = frame.addTab(database, null, metaData,
                    Globals.prefs.get("defaultEncoding"), true);
            pan.metaData().setDBStrings(dbs);
            return;
        }
        /*String url = SQLutil.createJDBCurl(metaData.getDBStrings());

        // if no error, report success
View Full Code Here

            Util.pr(NAME);
            Util.pr(e.getActionCommand());
            filesToOpen.add(new File(Util.checkName(e.getActionCommand())));
        }

        BasePanel toRaise = null;
        int initialCount = filesToOpen.size(), removed = 0;
       
        // Check if any of the files are already open:
        for (Iterator<File> iterator = filesToOpen.iterator(); iterator.hasNext();) {
            File file = iterator.next();
            for (int i=0; i<frame.getTabbedPane().getTabCount(); i++) {
                BasePanel bp = frame.baseAt(i);
                if ((bp.getFile() != null) && bp.getFile().equals(file)) {
                    iterator.remove();
                    removed++;
                    // See if we removed the final one. If so, we must perhaps
                    // raise the BasePanel in question:
                    if (removed == initialCount) {
View Full Code Here

                    else
                        done = true;
                    continue;
                } else done = true;

                final BasePanel panel = addNewDatabase(pr, file, raisePanel);
                if (tryingAutosave)
                    panel.markNonUndoableBaseChanged();

                // After adding the database, go through our list and see if
                // any post open actions need to be done. For instance, checking
                // if we found new entry types that can be imported, or checking
                // if the database contents should be modified due to new features
View Full Code Here

TOP

Related Classes of net.sf.jabref.BasePanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.