@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 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; }
import java.awt.Window; import javax.swing.JDialog; public class Test { public static void main(String[] args) { JDialog d = new JDialog((Window)null,"Demo Dialog"); for (Window w : JDialog.getWindows()) { if ( w instanceof JDialog) { System.out.println(((JDialog)w).getTitle()); } } } }
protected String getTitle() { if (window instanceof Frame) { return ((Frame) window).getTitle(); } else if (window instanceof Dialog) { return ((Dialog) window).getTitle(); } return null; }
private static void printDialogs() { System.out.println(); String indent = ""; Iterator ii = DIALOGS.iterator(); while(ii.hasNext()) { JDialog d = (JDialog)ii.next(); System.out.println(indent + d.getTitle()); indent += " "; } }
protected boolean isMatching( Dialog dialog ) { return windowTitle.equals(dialog.getTitle()) && dialog.isShowing(); } })
/** 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(Component comp) { // If the component class is custom, don't provide a tag if (isCustom(comp.getClass())) return null; String tag = ((Dialog)comp).getTitle(); if (tag == null || "".equals(tag)) { tag = super.deriveTag(comp); } return tag; } }
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
public String getTitle() { if( f != null ) { return f.getTitle(); } else if( d != null ) { return d.getTitle(); } else if( jif != null ) { return jif.getTitle(); } else { return null; // throw new IllegalStateException(); } }
/** @return 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; }
/** * 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; }
/** * Creates a new instance of WSHandlerDialog */ public WSHandlerDialog(Project project, boolean isJaxWS) { this.isJaxWS = isJaxWS; sPanel = new SelectHandlerPanel(project); dlgDesc = new AddMessageHandlerDialogDesc(sPanel); dialog = DialogDisplayer.getDefault().createDialog(dlgDesc); dialog.getAccessibleContext().setAccessibleDescription(dialog.getTitle()); handlerMap = new TreeMap<String, Integer>(); }
@RunsInEDT static @Nullable String titleOf(final @Nonnull JOptionPane optionPane) { return execute(() -> ((Dialog) optionPane.getRootPane().getParent()).getTitle()); }
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 ""; }
@Override protected boolean isMatching(@Nonnull Dialog component) { return component.getTitle().equals("Are you sure?"); } }).using(robot);
public CacioDialogPeer(Dialog awtC, PlatformWindowFactory pwf) { super(awtC, pwf); setResizable(awtC.isResizable()); setTitle(awtC.getTitle()); }
public void resetMaximizedSelectedImagePane(final ViewCanvas<E> viewCanvas) { if (grid.getComponentCount() == 1) { Dialog fullscreenDialog = WinUtil.getParentDialog(grid); if (fullscreenDialog != null && fullscreenDialog.getTitle().equals(Messages.getString("ImageViewerPlugin.fullscreen"))) { //$NON-NLS-1$ maximizedSelectedImagePane(viewCanvas, null); } } }
public boolean matches(Component c) { return super.matches(c) && (c.isShowing() || !mustBeShowing) && (stringsMatch(id, c.getName()) || (c instanceof Frame && stringsMatch(id, ((Frame)c).getTitle())) || (c instanceof Dialog && stringsMatch(id, ((Dialog)c).getTitle()))); } public String toString() {