Examples of BasePanel


Examples of net.sf.jabref.BasePanel

                    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

Examples of net.sf.jabref.BasePanel

                            Globals.lang("Warnings"),
                            JOptionPane.WARNING_MESSAGE);
                }
            }).start();
        }
        BasePanel bp = new BasePanel(frame, db, file, meta, pr.getEncoding());

        // file is set to null inside the EventDispatcherThread
        SwingUtilities.invokeLater(new OpenItSwingHelper(bp, file, raisePanel));

        frame.output(Globals.lang("Opened database") + " '" + fileName +
View Full Code Here

Examples of net.sf.jabref.BasePanel

            // TODO: undo is not handled properly here, except for the entries
      // added by
            //  the import inspection dialog.
            if (bibtexResult != null) {
                if (!openInNew) {
                    final BasePanel panel = (BasePanel) frame.getTabbedPane().getSelectedComponent();
                    BibtexDatabase toAddTo = panel.database();
                   
                    // Use the import inspection dialog if it is enabled in preferences, and
                    // (there are more than one entry or the inspection dialog is also enabled
                    // for single entries):
                    if (Globals.prefs.getBoolean("useImportInspectionDialog") &&
                            (Globals.prefs.getBoolean("useImportInspectionDialogForSingle")
                                    || (bibtexResult.getDatabase().getEntryCount() > 1))) {
                        ImportInspectionDialog diag = new ImportInspectionDialog(frame, panel,
                                BibtexFields.DEFAULT_INSPECTION_FIELDS,
                                Globals.lang("Import"), openInNew);
                        diag.addEntries(bibtexResult.getDatabase().getEntries());
                        diag.entryListComplete();
                        Util.placeDialog(diag, frame);
                        diag.setVisible(true);
                        diag.toFront();
                    } else {
                        boolean generateKeys = Globals.prefs.getBoolean("generateKeysAfterInspection");
                        NamedCompound ce = new NamedCompound(Globals.lang("Import entries"));

                        // Check if we should unmark entries before adding the new ones:
                        if (Globals.prefs.getBoolean("unmarkAllEntriesBeforeImporting"))
                            for (BibtexEntry entry : toAddTo.getEntries()) {
                                Util.unmarkEntry(entry, toAddTo, ce);
                            }


                        for (BibtexEntry entry : bibtexResult.getDatabase().getEntries()){
                            try {
                                // Check if the entry is a duplicate of an existing one:
                                boolean keepEntry = true;
                                BibtexEntry duplicate = DuplicateCheck.containsDuplicate(toAddTo, entry);
                                if (duplicate != null) {
                                    int answer = DuplicateResolverDialog.resolveDuplicateInImport
                                            (frame, duplicate, entry);
                                    // The upper entry is the
                                    if (answer == DuplicateResolverDialog.DO_NOT_IMPORT)
                                        keepEntry = false;
                                    if (answer == DuplicateResolverDialog.IMPORT_AND_DELETE_OLD) {
                                        // Remove the old one and import the new one.
                                        toAddTo.removeEntry(duplicate.getId());
                                        ce.addEdit(new UndoableRemoveEntry(toAddTo, duplicate, panel));
                                    }
                                }
                                // Add the entry, if we are supposed to:
                                if (keepEntry) {
                                    toAddTo.insertEntry(entry);
                                    // Generate key, if we are supposed to:
                                    if (generateKeys) {
                                        LabelPatternUtil.makeLabel(Globals.prefs.getKeyPattern(), toAddTo, entry);
                                        //System.out.println("gen:"+entry.getCiteKey());
                                    }
                                    // Let the autocompleters, if any, harvest words from the entry:
                                    Util.updateCompletersForEntry(panel.getAutoCompleters(), entry);

                                    ce.addEdit(new UndoableInsertEntry(toAddTo, entry, panel));
                                }
                            } catch (KeyCollisionException e) {
                                e.printStackTrace();
                            }
                        }
                        ce.end();
                        if (ce.hasEdits()) {
                            panel.undoManager.addEdit(ce);
                            panel.markBaseChanged();
                        }

                    }

                }
View Full Code Here

Examples of net.sf.jabref.BasePanel

            ParserResult pr = null;
            while (!done) {
                pr = JabRef.openBibFile(fileToLoad.getPath(), true);
                if ((pr != null) && !pr.isInvalid()) {
                    loaded.add(pr);
                    BasePanel panel = frame.addTab(pr.getDatabase(), file,
                                    pr.getMetaData(), pr.getEncoding(), first);
                    location.put(pr, frame.baseCount()-1);
                    if (tryingAutosave)
                        panel.markNonUndoableBaseChanged();
                   
                    first = false;
                    done = true;
                } else {
                    if (tryingAutosave) {
View Full Code Here

Examples of net.sf.jabref.BasePanel

                        ParserResult pr = loaded.elementAt(i);
                        if (!pr.toOpenTab()) {
                            jabref.jrf.addTab(pr.getDatabase(), pr.getFile(), pr.getMetaData(), pr.getEncoding(), (i == 0));
                        } else {
                            // Add the entries to the open tab.
                            BasePanel panel = jabref.jrf.basePanel();
                            if (panel == null) {
                                // There is no open tab to add to, so we create a new tab:
                                jabref.jrf.addTab(pr.getDatabase(), pr.getFile(), pr.getMetaData(), pr.getEncoding(), (i == 0));
                            } else {
                                List<BibtexEntry> entries = new ArrayList<BibtexEntry>(pr.getDatabase().getEntries());
View Full Code Here

Examples of net.sf.jabref.BasePanel

        // Setup open/close database listeners
          tp = jrFrame.getTabbedPane();
          tp.addContainerListener(new ContainerListener() {

            public void componentAdded(ContainerEvent ce) {
              BasePanel bp = (BasePanel) ce.getChild();
                databases.add(new LuceneBibtexDatabase(bp));
            }

            public void componentRemoved(ContainerEvent ce) {
              BasePanel bp = (BasePanel) ce.getChild();
              LuceneBibtexDatabase toRemove = null;
              for (LuceneBibtexDatabase ldb : databases) {
                if (ldb.getBp() == bp) {
                  toRemove = ldb;
                }
View Full Code Here

Examples of net.sf.jabref.BasePanel

        }

        private void runQuery() {
          // Check if current db is in searchable state
          LuceneBibtexDatabase ldb = null;
          BasePanel current = jrFrame.basePanel();
          for (LuceneBibtexDatabase db: databases) {
            if (db.getBp() == current) {
              ldb = db;
            }
          }
View Full Code Here

Examples of org.apache.openmeetings.web.common.BasePanel

  public void setType(String type) {
    this.type = type;
  }
 
  public static BasePanel getPanel(AreaKeys area, String type) {
    BasePanel basePanel = null;
    switch(area) {
      case admin:
        if (TYPE_USER.equals(type)) {
          basePanel = new UsersPanel(CHILD_ID);
        } else if (TYPE_CONNECTION.equals(type)) {
View Full Code Here

Examples of org.apache.openmeetings.web.common.BasePanel

      }
    });
  }
 
  public void updateContents(OmUrlFragment f, AjaxRequestTarget target) {
    BasePanel panel = getPanel(f.getArea(), f.getType());
    if (panel != null) {
      Component prev = contents.get(CHILD_ID);
      if (prev != null && prev instanceof BasePanel) {
        ((BasePanel)prev).cleanup(target);
      }
      target.add(contents.replace(panel));
      UrlFragment uf = new UrlFragment(target);
      uf.set(f.getArea().name(), f.getType());
      panel.onMenuPanelLoad(target);
    }
    if (dev != null){
      target.add(dev);
    }
  }
View Full Code Here

Examples of org.apache.openmeetings.web.common.BasePanel

  public void setType(String type) {
    this.type = type;
  }
 
  public static BasePanel getPanel(AreaKeys area, String type) {
    BasePanel basePanel = null;
    switch(area) {
      case admin:
        if (TYPE_USER.equals(type)) {
          basePanel = new UsersPanel(CHILD_ID);
        } else if (TYPE_CONNECTION.equals(type)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.