Package ketUI

Examples of ketUI.DocumentManager


  public void openDocument(String filename) {
    if ( ! getDocument().getFrameManager().isStandAlone() ) {
      Ket.out.println("[Can't open "+filename+"]");
      return;
    }
    DocumentManager documentManager = getDocument().getDocumentManager();
    Document document = new Document(documentManager, null, filename);
    document.getKetPanel().toggleGridDisplay();
    if (documentManager!=null) {
      documentManager.addDocument(document);
    }
  }
View Full Code Here


    }
    if (branch==null || branch.getFunction()!=Function.LINK) {
      Ket.out.println(" !!! Open link reqiures the current or parent branch to be a link !!! ");
      return false;
    }
    DocumentManager documentManager = getDocumentManager();
    if (documentManager==null) {
      Ket.out.println(" !!! Can't follow links from within another GUI !!! ");
      return false;
    }
    switch (branch.size()) {
View Full Code Here

  class WindowOpener implements Runnable {
    public WindowOpener() {

    }
    public void run() {
      DocumentManager documentManager = getDocumentManager();
      Document d = new Document(documentManager, null, null);
      documentManager.addDocument(d);
    }
View Full Code Here

      1, 1// Alignment
      5, 5); // Gaps
    setLayout(layout);
    Container contentPane = this.getContentPane();

    DocumentManager dm = new DocumentManager(new String[]{});
    document = new Document(dm, (JFrame) this, null);

    ketPanel = document.getKetPanel();
    ketPanel.setSize(420, 300);
    ketPanel.addKeyListener(this);
View Full Code Here

    boolean matchInThisDocument = modes.getSearch().search(topic, Search.FORWARDS);
    if (matchInThisDocument) {
      return true;
    }

    DocumentManager documentManager = modes.getDocumentManager();
    // FUTURE: It is possible to use a document manager
    // specifically to coordinate help files when the program is
    // embedded in another program.  The document manager would no
    // longer be null.
    if (documentManager==null) {
      Ket.out.println(" !!! Can't load another document: document manager is null !!! ");
      return false;
    }

    // BUG: Restrict search to help files: check that these files are help files.
    // Search (via document manager) all other open documents;
    //  Request focus for that frame [how]?
    for (Document document : documentManager.getDocs()) {
      if (document!=modes.getDocument()) { // Don't bother re-checking this document.
        boolean ok = selectWithinAnotherDocument(document, topic);
        if (ok) {
          return true;
        }
      }
    }

    // Load the non-open help files as plain text;
    for (String filename : helpFiles) {
      boolean helpFileMatches = searchJar(filename, topic);
      //?+ boolean helpFileMatches = searchPlainText(filename, topic);
      if (helpFileMatches) {
        Document document = new Document(documentManager, null, filename); // TODO: Use this.getDocument()'s clipboard?
        documentManager.addDocument(document);
        //- boolean ok = selectWithinAnotherDocument(document, topic);
        selectWithinAnotherDocument(document, topic);
        return true;
      }
    }
View Full Code Here

TOP

Related Classes of ketUI.DocumentManager

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.