dialog.add(optPane); dialog.pack(); frame.add(new JLabel(frame.getTitle(), JLabel.CENTER)); frame.setVisible(true); dialog.setLocationRelativeTo(frame);
@Nullable public static String getWindowTitle(Window documentRoot) { String windowTitle = null; if (documentRoot instanceof Frame) { windowTitle = ((Frame)documentRoot).getTitle(); } else if (documentRoot instanceof Dialog) { windowTitle = ((Dialog)documentRoot).getTitle(); } return windowTitle; }
/** Returns an array containing the titles of non-image Frames and Dialogs. */ public synchronized static String[] getNonImageTitles() { ArrayList list = new ArrayList(); for (int i=0; i<nonImageList.size(); i++) { Object win = nonImageList.get(i); String title = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); list.add(title); } String[] titles = new String[list.size()]; list.toArray(titles); return titles; }
/** Returns the window (a Frame or a Dialog) with the specified title, or null if a window with that title is not found. */ public static Window getWindow(String title) { for (int i=0; i<nonImageList.size(); i++) { Object win = nonImageList.get(i); String winTitle = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); if (title.equals(winTitle)) return (Window)win; } return getImageWindow(title); }
/** Return a unique tag to help identify the given component. */ public String deriveTag(java.awt.Component comp) { // If the component class is custom, don't provide a tag if (isCustom(comp.getClass())) return null; String tag = ((java.awt.Frame)comp).getTitle(); if (tag == null || "".equals(tag)) { tag = super.deriveTag(comp); } return tag; }
static JFrame getBurpFrame() { for(Frame f : Frame.getFrames()) { if(f.isVisible() && f.getTitle().startsWith(("Burp Suite"))) { return (JFrame) f; } } return null; }
public static String getTitle(Component c) { if (c instanceof Dialog) return ((Dialog)c).getTitle(); else if (c instanceof Frame) return ((Frame)c).getTitle(); else if (c instanceof JInternalFrame) return ((JInternalFrame)c).getTitle(); return null; } /** Returns whether it is possible to resize windows that are not an
/** * Returns the String to display as the title. */ private String getTitle() { Window w = getWindow(); if(w instanceof Frame) { return ((Frame)w).getTitle(); } else if(w instanceof Dialog) { return ((Dialog)w).getTitle(); } return null; }
protected boolean isMatching( Frame frame ) { if (log.isTraceEnabled()) { log.trace("WindowFinder isMatching(): Title: " + frame.getTitle() + ", Frame + " + frame + ", Owner: " + frame.getOwner()); } return frame.isShowing() && frame.getOwner() == null; // owner == null - top frame. Two independent frames are both considered a top ones } })
private void queryClearAllStats() { if (tornDown.get()) { return; } XLabel msg = new XLabel(bundle.getString("clear.all.counters.confirm")); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new ClearAllStatsWorker()); } }
private void queryFlushCache() { XLabel msg = new XLabel(bundle.getString("flush.cache.confirm")); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new FlushCacheWorker()); } else { flushButton.setSelected(false); flushButton.setEnabled(true); } }
private void queryClearSelectedCaches(JPopupMenu popupMenu) { if (tornDown.get()) { return; } XLabel msg = new XLabel(bundle.getString("clear.selected.caches.confirm")); msg.setFont((Font) bundle.getObject("message.label.font")); msg.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(currentPage.createClearCachesWorker(popupMenu)); } }
private void queryEnableAllRegions() { XLabel msg = new XLabel(bundle.getString("enable.all.cache.regions.confirm")); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new EnableAllRegionsWorker()); } else { enableAllRegionsButton.setSelected(false); enableAllRegionsButton.setEnabled(true); } }
private String getWindowTitle() { Window win = WindowManager.getActiveWindow(); if (IJ.debugMode) IJ.log("getWindowTitle: "+win); if (win==null) return ""; else if (win instanceof Frame) return ((Frame)win).getTitle(); else if (win instanceof Dialog) return ((Dialog)win).getTitle(); else return ""; }
private void queryDisableBulkLoad() { XLabel msg = new XLabel(MessageFormat.format(bundle.getString("disable.cache.bulkload.confirm"), cacheModel.getCacheName())); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this.getParent(), msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new BulkLoadControlWorker(false)); } }
private void queryFlushCache() { XLabel msg = new XLabel(MessageFormat.format(bundle.getString("evict.all.entries.in.cache.confirm"), cacheModel .getCacheName())); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this.getParent(), msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new FlushCacheWorker()); } else { flushButton.setSelected(false); flushButton.setEnabled(true); } }
private void queryFlushRegion() { XLabel msg = new XLabel(MessageFormat.format(bundle.getString("evict.all.entries.in.region.confirm"), regionInfo .getRegionName())); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this.getParent(), msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new FlushRegionWorker()); } else { flushButton.setSelected(false); flushButton.setEnabled(true); } }
private void queryFlushCache() { String currLabel = flushButton.getText(); XLabel msg = new XLabel(bundle.getString("flush.cache.confirm")); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new FlushCacheWorker()); } else { flushButton.setText(currLabel); flushButton.setSelected(false); flushButton.setEnabled(true); } }
public void actionPerformed(final ActionEvent e) { Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, CacheRegionsPanel.this); JDialog dialog = new JDialog(frame, frame.getTitle(), true); XTextArea textArea = new XTextArea(); textArea.setEditable(false); textArea.setText(beanProvider.getBean().generateActiveConfigDeclaration()); dialog.getContentPane().add(new XScrollPane(textArea)); dialog.setSize(500, 600); WindowHelper.center(dialog); dialog.setVisible(true); } }
private void queryClearAllStats() { String currLabel = clearAllStatsButton.getText(); XLabel msg = new XLabel(bundle.getString("clear.all.counters.confirm")); Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); int answer = JOptionPane.showConfirmDialog(this, msg, frame.getTitle(), JOptionPane.OK_CANCEL_OPTION); if (answer == JOptionPane.OK_OPTION) { appContext.submit(new ClearAllStatsWorker()); } else { clearAllStatsButton.setText(currLabel); clearAllStatsButton.setSelected(false); clearAllStatsButton.setEnabled(true); } }