/** * Get the activation window. * * @returns Window - the activation window if activatated from a modal * modal dialog, otherwise null. */ public Window getActivationWindow() { debug("getActivationWindow"); return ownerWindow; }
/** * Destory the window on exit */ public void setDestroyOnExit(boolean destroy) { debug("setDestoryOnExit"); destroyOnExit = destroy; }
/** * Determines if the presentation should be distroyed on exit */ public boolean isDestroyedOnExit() { debug("isDestoryedOnExit"); return destroyOnExit; }
/** * Is the title set from the Document. This is generally useful * in SecondaryWindows. * @return boolean True if title is set from the Document, false otherwise. */ public boolean isTitleSetFromDocument() { debug("isTitleSetFromDocument"); return titleFromDocument; }
/** * Hides/Shows view. */ public void setViewDisplayed(boolean displayed) { debug ("setViewDisplayed"); if (jhelp != null) { jhelp.setNavigatorDisplayed(displayed); } viewDisplayed = displayed; }
/** * Determines if the toolbar is visible. */ public boolean isToolbarDisplayed() { debug ("isToolbarDisplayed"); if (jhelp != null) { return jhelp.isToolbarDisplayed(); } return toolbarDisplayed; }
/** * Determines if the current view is visible. */ public boolean isViewDisplayed() { debug ("isViewDisplayed"); if (jhelp != null) { return jhelp.isNavigatorDisplayed(); } return viewDisplayed; }
/** * Hides/Shows Toolbar */ public void setToolbarDisplayed(boolean displayed) { debug ("setToolbarDisplayed=" + displayed); if (jhelp != null) { jhelp.setToolbarDisplayed(displayed); } toolbarDisplayed = displayed; }
/** * Set the activation window. If the window is an instance of a * Dialog and the is modal, modallyActivated help is set to true and * ownerDialog is set to the window. In all other instances * modallyActivated is set to false and ownerDialog is set to null. * @param window the activating window */ public void setActivationWindow(Window window) { debug("setActivationWindow"); if (window != null && window instanceof Dialog) { Dialog tmpDialog = (Dialog) window; if (tmpDialog.isModal()) { ownerWindow = window; modallyActivated = true; } else { ownerWindow = null; modallyActivated = false; } } else { ownerWindow = null; modallyActivated = false; } }
/** * Sets the font for this this WindowPresentation. * @param f The font. */ public void setFont (Font f) { debug("setFont"); super.setFont(f); if (jhelp != null && f != null) { jhelp.setFont(f); } }
/** * Determines the current navigator. */ public String getCurrentView() { debug("getCurrentView"); // always use the current view if the jhelp exists. if (jhelp != null) { currentView = jhelp.getCurrentNavigator().getNavigatorName(); } return currentView; }
/** * Sets the locale of this Presentation. The locale is propagated to * the presentation. * @param l The locale to become this component's locale. A null locale * is the same as the defaultLocale. * @see #getLocale */ public void setLocale(Locale l) { debug("setLocale"); super.setLocale(l); if (jhelp != null) { jhelp.setLocale(l); } }
public void setTitle(String title) { debug("setTitle"); this.title = title; if (jhelp != null) { if (modallyActivated) { dialog.setTitle(title); dialog.validate(); } else { frame.setTitle(title); frame.validate(); } } }
/** * Gets the font for this WindowPresentation */ public Font getFont() { debug("getFont"); Font font = super.getFont(); if (font == null) { if (jhelp == null) { createHelpWindow(); } return jhelp.getFont(); } return font; }
/** * Requests the presentation be set to a given size. Updates the * the presentation on the fly. This is an override of * Presentation.SetSize. */ public void setSize(Dimension d) { debug("setSize"); super.setSize(d); if (jhelp != null) { if (modallyActivated) { dialog.setSize(d); dialog.validate(); } else { frame.setSize(d); frame.validate(); } } }
/** * Requests the size of the presentation. * @returns Point the location of the presentation. */ public Dimension getSize() { debug("getSize"); // if the jhelp is created then just use the current sizes if (jhelp != null) { if (modallyActivated) { if (dialog != null) { return dialog.getSize(); } } else { if (frame != null) { return frame.getSize(); } } } return super.getSize(); }
/** * Set the activation window from given Component or MenuItem. It find Window component * in the component tree from given Component or MenuItem end call * <pre>setActivationWindow</pre>. * @parem comp the activation Component or MenuItem * @since 2.0 * * @see setActivationWindow */ public void setActivationObject(Object comp) { debug("setActivationObject"); while (comp instanceof MenuComponent) { comp = ((MenuComponent)comp).getParent(); } Window owner = null; if (comp instanceof Frame) { owner = (Window)comp; } else if (comp instanceof Component) { owner = SwingUtilities.windowForComponent((Component)comp); } setActivationWindow(owner); }
/** * Changes the HelpSet for this presentation. * @param hs The HelpSet to set for this presentation. * A null hs is valid parameter. */ public void setHelpSet(HelpSet hs) { debug("setHelpSet"); HelpSet helpset = super.getHelpSet(); // If we already have a model check if the HelpSet has changed. // If so change the model // This could be made smarter to cache the helpmodels per HelpSet if (hs != null && helpset != hs) { super.setHelpSet(hs); if (jhelp != null) { jhelp.setModel(super.getHelpModel()); } } }
public String getTitle() { debug("getTitle"); // if the title comes from the document use that first if // jhelp exists if (titleFromDocument && jhelp != null) { String docTitle = jhelp.getContentViewer().getDocumentTitle(); if (docTitle != null) { return docTitle; } } // otherwise use the title that has been set... if (title != null) { return title; } else { // Unless there wasn't a title set and then use the HelpSet // title HelpSet hs = getHelpSet(); if (hs != null) { title = hs.getTitle(); } } return title; }
/** * Set the title from the Document. * @param b if true will set the title form the document, otherwise will * set the title from the HelpSet. */ public void setTitleFromDocument(boolean b) { debug("setTitleFromDocument"); if (titleFromDocument != b) { titleFromDocument = b; if (titleFromDocument) { propertyChangeListener = new WindowPropertyChangeListener(); if (jhelp != null) { jhelp.getContentViewer(). addPropertyChangeListener("page", propertyChangeListener); } } else { if (jhelp != null) { jhelp.getContentViewer(). removePropertyChangeListener("page", propertyChangeListener); } } } }