/** * Returns the shared SearchFactory. * * @return the shared <code>SearchFactory</code> */ public static SearchFactory getInstance() { if (searchFactory == null) { searchFactory = new SearchFactory(); } return searchFactory; }
/** * Returns the shared JXFindBar. Creates and configures on * first call. * * @return the shared <code>JXFindBar</code> */ public JXFindBar getSharedFindBar() { if (findBar == null) { findBar = createFindBar(); configureSharedFindBar(); } return findBar; }
/** * Returns the shared JXFindPanel. Lazyly creates and configures on * first call. * * @return the shared <code>JXFindPanel</code> */ public JXFindPanel getSharedFindPanel() { if (findPanel == null) { findPanel = createFindPanel(); configureSharedFindPanel(); } else { // JW: temporary hack around #718-swingx // no longer needed with cleanup of hideSharedFindPanel // if (findPanel.getParent() == null) { // SwingUtilities.updateComponentTreeUI(findPanel); // } } return findPanel; }
SearchFactory factory = new SearchFactory() { @Override public JXFindBar createFindBar() { return new PromptSearchBar(); } }; SearchFactory.setInstance(factory); factory.setUseFindBar(true);
private void init(boolean filterEnabled) { setFilterEnabled(filterEnabled); Action findAction = createFindAction(); getActionMap().put("find", findAction); KeyStroke findStroke = SearchFactory.getInstance().getSearchAccelerator(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(findStroke, "find"); }
/** * Starts a search on this List's visible items. This implementation asks the * SearchFactory to open a find widget on itself. */ protected void doFind() { SearchFactory.getInstance().showFindInput(this, getSearchable()); }
JXDialog topLevel = getDialogForSharedFindPanel(); JXDialog findDialog; if ((topLevel != null) && (topLevel.getOwner().equals(frame))) { Point location = hideSharedFindPanel(true); if (frame instanceof Frame) { findDialog = new JXDialog((Frame) frame, getSharedFindPanel()); } else if (frame instanceof Dialog) { findDialog = new JXDialog((Dialog) frame, getSharedFindPanel()); } else { findDialog = new JXDialog(JOptionPane.getRootFrame(), getSharedFindPanel()); findDialog.setLocale(target.getLocale()); getSharedFindPanel().setSearchable(searchable); installFindRemover(target, findDialog); findDialog.setVisible(true);
if (target == null) return; if (findBar == null) { findBar = getSharedFindBar(); } else { releaseFindBar(); findBar.setLocale(target.getLocale()); target.putClientProperty(AbstractSearchable.MATCH_HIGHLIGHTER, Boolean.TRUE); getSharedFindBar().setSearchable(searchable); installFindRemover(target, findBar);
/** * Sets the default search type to incremental or batch, for a * true/false boolean. The default value is false (== batch). * * @param incremental a boolean to indicate the default search * type, true for incremental and false for batch. */ public void setUseFindBar(boolean incremental) { if (incremental == useFindBar) return; this.useFindBar = incremental; getFindRemover().endSearching(); }
/** * Register the actions that this class can handle. */ protected void initActions() { ActionMap map = getActionMap(); map.put(ACTION_FIND, new Actions(ACTION_FIND)); map.put(ACTION_UNDO, new Actions(ACTION_UNDO)); map.put(ACTION_REDO, new Actions(ACTION_REDO)); map.put(ACTION_CUT, new Actions(ACTION_CUT)); map.put(ACTION_COPY, new Actions(ACTION_COPY)); map.put(ACTION_PASTE, new Actions(ACTION_PASTE)); KeyStroke findStroke = SearchFactory.getInstance().getSearchAccelerator(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(findStroke, "find"); }
/** * Starts a search on this Tree's visible nodes. This implementation asks the * SearchFactory to open a find widget on itself. */ protected void doFind() { SearchFactory.getInstance().showFindInput(this, getSearchable()); }
JXDialog topLevel = getDialogForSharedFindPanel(); JXDialog findDialog; if ((topLevel != null) && (topLevel.getOwner().equals(frame))) { Point location = hideSharedFindPanel(true); if (frame instanceof Frame) { findDialog = new JXDialog((Frame) frame, getSharedFindPanel()); } else if (frame instanceof Dialog) { findDialog = new JXDialog((Dialog) frame, getSharedFindPanel()); } else { findDialog = new JXDialog(JOptionPane.getRootFrame(), getSharedFindPanel()); findDialog.setLocale(target.getLocale()); getSharedFindPanel().setSearchable(searchable); installFindRemover(target, findDialog); findDialog.setVisible(true);
if (target == null) return; if (findBar == null) { findBar = getSharedFindBar(); } else { releaseFindBar(); findBar.setLocale(target.getLocale()); target.putClientProperty(AbstractSearchable.MATCH_HIGHLIGHTER, Boolean.TRUE); getSharedFindBar().setSearchable(searchable); installFindRemover(target, findBar);
protected void installFindRemover(Container target, Container findWidget) { if (target != null) { getFindRemover().addTarget(target); } getFindRemover().addTarget(findWidget); }
/** * Register the actions that this class can handle. */ protected void initActions() { ActionMap map = getActionMap(); map.put(ACTION_FIND, new Actions(ACTION_FIND)); map.put(ACTION_UNDO, new Actions(ACTION_UNDO)); map.put(ACTION_REDO, new Actions(ACTION_REDO)); map.put(ACTION_CUT, new Actions(ACTION_CUT)); map.put(ACTION_COPY, new Actions(ACTION_COPY)); map.put(ACTION_PASTE, new Actions(ACTION_PASTE)); KeyStroke findStroke = SearchFactory.getInstance().getSearchAccelerator(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(findStroke, "find"); }
/** * Starts a search on this Tree's visible nodes. This implementation asks the * SearchFactory to open a find widget on itself. */ protected void doFind() { SearchFactory.getInstance().showFindInput(this, getSearchable()); }
JXDialog topLevel = getDialogForSharedFindPanel(); JXDialog findDialog; if ((topLevel != null) && (topLevel.getOwner().equals(frame))) { Point location = hideSharedFindPanel(true); if (frame instanceof Frame) { findDialog = new JXDialog((Frame) frame, getSharedFindPanel()); } else if (frame instanceof Dialog) { findDialog = new JXDialog((Dialog) frame, getSharedFindPanel()); } else { findDialog = new JXDialog(JOptionPane.getRootFrame(), getSharedFindPanel()); findDialog.setLocale(target.getLocale()); getSharedFindPanel().setSearchable(searchable); installFindRemover(target, findDialog); findDialog.setVisible(true);
if (target == null) return; if (findBar == null) { findBar = getSharedFindBar(); } else { releaseFindBar(); findBar.setLocale(target.getLocale()); target.putClientProperty(AbstractSearchable.MATCH_HIGHLIGHTER, Boolean.TRUE); getSharedFindBar().setSearchable(searchable); installFindRemover(target, findBar);
/** * Returns the shared JXFindBar. Creates and configures on * first call. * * @return the shared <code>JXFindBar</code> */ public JXFindBar getSharedFindBar() { if (findBar == null) { findBar = createFindBar(); configureSharedFindBar(); } return findBar; }
/** * Returns the shared JXFindPanel. Lazyly creates and configures on * first call. * * @return the shared <code>JXFindPanel</code> */ public JXFindPanel getSharedFindPanel() { if (findPanel == null) { findPanel = createFindPanel(); configureSharedFindPanel(); } else { // JW: temporary hack around #718-swingx // no longer needed with cleanup of hideSharedFindPanel // if (findPanel.getParent() == null) { // SwingUtilities.updateComponentTreeUI(findPanel); // } } return findPanel; }