private static int getServerState(org.openide.nodes.Node node) { String displayName = node.getDisplayName(); try { Deployment deployment = Deployment.getDefault(); for (String serverInstanceId : deployment.getServerInstanceIDs()) { ServerInstance serverInstance = deployment.getServerInstance(serverInstanceId); if (serverInstance.getDisplayName().equals(displayName)) { return getServerState(serverInstanceId); } } throw new JemmyException("Server instance not found for node " + node); //NOI18N } catch (Exception e) { throw new JemmyException("Server state cannot be determined for node " + node, e); //NOI18N } }
public void activateHyperLink(String linkText) { HyperlinkEvent hyperlinkEvent = eventFactory.createHyperLinkEvent(linkText); try { editorPaneOperator.fireHyperlinkUpdate(hyperlinkEvent); } catch (JemmyException e) { Throwable innerThrowable = e.getInnerThrowable(); throw new RuntimeException(innerThrowable); } } }
/** * Disables or enables spell checking. By default spell checking is enabled. * * @param enabled true to enable spell checker, false to disable */ public static void setSpellcheckerEnabled(boolean enabled) { FileObject root = FileUtil.getConfigFile("Spellcheckers"); if (root != null) { FileObject[] children = root.getChildren(); for (FileObject fileObject : children) { try { fileObject.setAttribute("Hidden", !enabled); } catch (IOException ex) { throw new JemmyException("Error while disabling spellchecker.", ex); } } } } }
/** * Disables or enables spell checking. By default spell checking is enabled. * * @param enabled true to enable spell checker, false to disable */ public static void setSpellcheckerEnabled(boolean enabled) { FileObject root = FileUtil.getConfigFile("Spellcheckers"); if (root != null) { FileObject[] children = root.getChildren(); for (FileObject fileObject : children) { try { fileObject.setAttribute("Hidden", !enabled); } catch (IOException ex) { throw new JemmyException("Error while disabling spellchecker.", ex); } } } } }
private static Object waitFor(Waitable action) { Waiter waiter = new Waiter(action); waiter.getTimeouts().setTimeout("Waiter.WaitingTime", 120000); try { return waiter.waitAction(null); } catch (InterruptedException ex) { throw new JemmyException(action.getDescription() + " has been " + "interrupted.", ex); } } }
private static Object waitFor(Waitable action) { Waiter waiter = new Waiter(action); waiter.getTimeouts().setTimeout("Waiter.WaitingTime", 120000); try { return waiter.waitAction(null); } catch (InterruptedException ex) { throw new JemmyException(action.getDescription() + " has been " + "interrupted.", ex); } } }