/** * Sets the current device controller to the given value. * * @param aDeviceName the name of the device controller to set, cannot be <code>null</code>. */ public synchronized void setDeviceController(final String aDeviceName) { if (LOG.isLoggable(Level.INFO)) { final String name = (aDeviceName == null) ? "no device" : aDeviceName; LOG.log(Level.INFO, "Setting current device controller to: \"{0}\" ...", name); } final Collection<DeviceController> devices = getDevices(); for (DeviceController device : devices) { if (aDeviceName.equals(device.getName())) { this.currentDevCtrl = device; } } updateActions(); }
/** * Runs the tool denoted by the given name. * * @param aToolName the name of the tool to run, cannot be <code>null</code>; * @param aParent the parent window to use, can be <code>null</code>. */ public void runTool(final String aToolName, final Window aParent) { if (LOG.isLoggable(Level.INFO)) { LOG.log(Level.INFO, "Running tool: \"{0}\" ...", aToolName); } final Tool tool = findToolByName(aToolName); if (tool == null) { JOptionPane.showMessageDialog( aParent, "No such tool found: " + aToolName, "Error ...", JOptionPane.ERROR_MESSAGE); } else { final ToolContext context = createToolContext(); tool.process(aParent, this.dataContainer, context, this); } updateActions(); }
// /home/jean/Área de Trabalho/Link para Dropbox/workspace/GSPAnalyzer/grails app // examples/rgms-master/grails-app/views/bookChapter/show.gsp private void process(String uri) { try { URL url; try { url = new URL(uri); } catch (java.net.MalformedURLException mfu) { int idx = uri.indexOf(':'); if (idx == -1 || idx == 1) { // try file url = new URL("file:" + uri); } else { throw mfu; } } // Call SimpleHtmlRendererContext.navigate() // which implements incremental rendering. this.rcontext.navigate(url, null); } catch (Exception err) { logger.log(Level.SEVERE, "Error trying to load URI=[" + uri + "].", err); } }