Refine search
private static synchronized List<MIMEResolver> declarativeResolvers() { List<MIMEResolver> declmimes = new ArrayList<MIMEResolver>(); if (declarativeFolder == null) { declarativeFolder = FileUtil.getConfigFile("Services/MIMEResolver"); // NOI18N } if (declarativeFolder != null) { for (FileObject f : Ordering.getOrder(Arrays.asList(declarativeFolder.getChildren()), true)) { if (f.hasExt("xml")) { // NOI18N try { // For now, just assume it has the right DTD. Could check this if desired. declmimes.add(MIMEResolverImpl.forDescriptor(f)); // NOI18N } catch (IOException ex) { Exceptions.printStackTrace(ex); } } } declarativeFolder.removeFileChangeListener(weakDeclarativeFolderListener); declarativeFolder.addFileChangeListener(weakDeclarativeFolderListener); } return declmimes; }
Action contextAwareAction = ((ContextAwareAction) action).createContextAwareInstance(context); if (contextAwareAction == null) { Logger.getLogger(Utilities.class.getName()).log(Level.WARNING,"ContextAwareAction.createContextAwareInstance(context) returns null. That is illegal!" + " action={0}, context={1}", new Object[] {action, context}); } else { action = contextAwareAction; item = ((Presenter.Popup) action).getPopupPresenter(); if (item == null) { Logger.getLogger(Utilities.class.getName()).log(Level.WARNING, "findContextMenuImpl, getPopupPresenter returning null for {0}", action); continue; components.add(null); } else { components.add(c); components.add(null); Exceptions.attachMessage(ex, "List of components: " + components); // NOI18N Exceptions.attachMessage(ex, "List of actions: " + Arrays.asList(actions)); // NOI18N Exceptions.printStackTrace(ex);
final String msg = "Parameter file was not " + // NOI18N "normalized. Was " + toDebugString(file) + " instead of " + toDebugString(normFile); // NOI18N LOG.log(Level.WARNING, msg); LOG.log(Level.INFO, msg, new IllegalArgumentException(msg)); setDiskFileSystem(fs); } catch (FileStateInvalidException ex) { Exceptions.printStackTrace(ex);
@Override public String call() throws Exception { try { try (ResultSet rs = dmd.getTables(catalog, schema, "%", new String[] {"TABLE"})) { while (rs.next()) { tables.add(rs.getString("TABLE_NAME")); // NOI18N } } return null; } catch (SQLException e) { Exceptions.printStackTrace(e); return NbBundle.getMessage(TableGeneratorPanel.class, "ERR_DatabaseMetadata"); } } });
@Override protected Node[] createNodes(Node key) { List<Node> result = new ArrayList<>(); for (Node node : super.createNodes(key)) { try { FileObject sensorFileObject = node.getLookup().lookup(FileObject.class); DataObject dataObject = DataObject.find(sensorFileObject); if (dataObject instanceof SensorDataObject) { SensorFileLayer layer = new SensorFileLayer((SensorDataObject) dataObject); SensorFileNode sensorFileNode = new SensorFileNode(node, (SensorDataObject) dataObject, layer); result.add(sensorFileNode); } } catch (DataObjectNotFoundException ex) { Exceptions.printStackTrace(ex); } } return result.toArray(new Node[0]); } }
@Override protected boolean createKeys(List<Step> toPopulate) { // The query node is reloadable, isn't it? Then just // get this ability from the lookup ... Reloadable r = getLookup().lookup(Reloadable.class); // ... and use the ability if (r != null) { try { r.reload(); } catch (Exception ex) { Exceptions.printStackTrace(ex); } } toPopulate.addAll(steps); return true; }
@Override public org.openide.nodes.Node createLogicalView() { try { //Get the Text directory, creating if deleted FileObject projectDirectory = project.getProjectDirectory(); DataFolder farmFolder = DataFolder.findFolder(projectDirectory); FarmManager farmManager = project.getLookup().lookup(FarmManager.class); Farm farm = farmManager.load(projectDirectory.getFileObject(FarmProject.FARM_FILE)); //This FilterNode will be our project node return new FarmNode(farm, farmFolder.getNodeDelegate(), project); } catch (DataObjectNotFoundException ex) { Exceptions.printStackTrace(ex); LOGGER.log(Level.SEVERE,"Farm data object {0} not found: {1}",new Object[]{ex.getFileObject(),ex.getMessage()}); return new AbstractNode(Children.LEAF); } }
@Override public void actionPerformed(ActionEvent ev, List<? extends Object> data, Provider everything) { String clazz = (String) delegate.get("injectable"); // NOI18N ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); if (l == null) { l = Thread.currentThread().getContextClassLoader(); } if (l == null) { l = Actions.class.getClassLoader(); } try { Class<?> clazzC = Class.forName(clazz, true, l); Constructor c = clazzC.getConstructor(List.class); ActionListener action = (ActionListener) c.newInstance(data); action.actionPerformed(ev); } catch (Exception ex) { Exceptions.printStackTrace(ex); } } }
comp = impl.getComponent(); } catch (UnsupportedOperationException ex) { Exceptions.printStackTrace(ex); impl = new SwingBrowserImpl(); comp = impl.getComponent(); NbBundle.getMessage(HtmlBrowser.class, "EXC_Module")); Exceptions.printStackTrace(e); getAccessibleContext().setAccessibleName(NbBundle.getMessage(HtmlBrowser.class, "ACS_HtmlBrowser")); getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(HtmlBrowser.class, "ACSD_HtmlBrowser"));
for (String c : DEFAULT_COMPLETIONS) { if (c.startsWith(userText)) { res.add(Completions.of("\"" + c + '/', NbBundle.getMessage(ActionProcessor.class, "HINT_" + c))); String pathCompletions = System.getProperty(ActionReference.class.getName() + ".completion"); if (pathCompletions != null) { ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); if (l == null) { l = Thread.currentThread().getContextClassLoader(); COMPLETIONS = (Processor)Class.forName(pathCompletions, true, l).newInstance(); } catch (Exception ex) { Exceptions.printStackTrace(ex);
public String getAsText () { try { org.openide.awt.HtmlBrowser.Factory f = (org.openide.awt.HtmlBrowser.Factory)getValue (); Lookup.Item<org.openide.awt.HtmlBrowser.Factory> i = Lookup.getDefault().lookupItem( new Lookup.Template<org.openide.awt.HtmlBrowser.Factory> (org.openide.awt.HtmlBrowser.Factory.class, null, f) ); if (i != null) return i.getDisplayName(); } catch (Exception ex) { Exceptions.printStackTrace(ex); } return NbBundle.getMessage (FactoryEditor.class, "CTL_UnspecifiedBrowser"); //NOI18N }
private static SourceGroup[] checkNotNull (SourceGroup[] groups, Sources sources) { List<SourceGroup> sourceGroups = new ArrayList<SourceGroup> (); for (SourceGroup sourceGroup : groups) if (sourceGroup == null) Exceptions.printStackTrace (new NullPointerException (sources + " returns null SourceGroup!")); else sourceGroups.add (sourceGroup); return sourceGroups.toArray (new SourceGroup [sourceGroups.size ()]); }
@Override public LayoutProperty[] getProperties() { List<LayoutProperty> properties = new ArrayList<>(); try { properties.add(LayoutProperty.createProperty( this, Double.class, NbBundle.getMessage(getClass(), "rotate.angle.name"), null, "clockwise.angle.name", NbBundle.getMessage(getClass(), "rotate.angle.desc"), "getAngle", "setAngle")); } catch (Exception e) { Exceptions.printStackTrace(e); } return properties.toArray(new LayoutProperty[0]); }
@Override protected boolean createKeys(List<FileObject> files) { keysCount = 0; FileObject fld = getFolder(); if (fld != null) { for (FileObject f : fld.getChildren()) { try { if (JCConstants.JAVACARD_PLATFORM_FILE_EXTENSION.equals(f.getExt()) || DataObject.find(f).getNodeDelegate().getLookup().lookup(JavacardPlatform.class) != null) { keysCount++; files.add(f); } } catch (DataObjectNotFoundException ex) { Exceptions.printStackTrace(ex); } } } return true; }
Action contextAwareAction = ((ContextAwareAction) action).createContextAwareInstance(context); if (contextAwareAction == null) { Logger.getLogger(Utilities.class.getName()).log(Level.WARNING,"ContextAwareAction.createContextAwareInstance(context) returns null. That is illegal!" + " action={0}, context={1}", new Object[] {action, context}); } else { action = contextAwareAction; item = ((Presenter.Popup) action).getPopupPresenter(); if (item == null) { Logger.getLogger(Utilities.class.getName()).log(Level.WARNING, "findContextMenuImpl, getPopupPresenter returning null for {0}", action); continue; components.add(null); } else { components.add(c); components.add(null); Exceptions.attachMessage(ex, "List of components: " + components); // NOI18N Exceptions.attachMessage(ex, "List of actions: " + Arrays.asList(actions)); // NOI18N Exceptions.printStackTrace(ex);
@Override public void run() { err.log(Level.FINE, "onValidPerformer on next button entry."); //#163078 - validate first then store storeSettingsAndNotify(data); panels.nextPanel(); try { // change UI to show next step, show wait cursor during // the change goToNextStep(previousSize); } catch (IllegalStateException ise) { panels.previousPanel(); String msg = ise.getMessage(); if (msg != null) { // this is only for backward compatitility DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg)); } else { // this should be used (it checks for exception // annotations and severity) Exceptions.printStackTrace(ise); } _updateState(); } err.log(Level.FINE, "onValidPerformer on next button exit."); } };
@Override public void actionPerformed(ActionEvent ev, List<? extends Object> data, Provider everything) { if (data.size() != 1) { return; } String clazz = (String) delegate.get("injectable"); // NOI18N String type = (String) delegate.get("type"); // NOI18N ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); if (l == null) { l = Thread.currentThread().getContextClassLoader(); } if (l == null) { l = Actions.class.getClassLoader(); } try { Class<?> typeC = Class.forName(type, true, l); Class<?> clazzC = Class.forName(clazz, true, l); Constructor c = clazzC.getConstructor(typeC); ActionListener action = (ActionListener) c.newInstance(data.get(0)); action.actionPerformed(ev); } catch (Exception ex) { Exceptions.printStackTrace(ex); } } }
public void actionPerformed(ActionEvent e) { try { URLDisplayer.getDefault().showURL( new URL(NbBundle.getMessage(DashboardImpl.class, "URL_KenaiOverview"))); //NOI18N } catch( MalformedURLException ex ) { //shouldn't happen Exceptions.printStackTrace(ex); } } };
@Override public void actionPerformed(ActionEvent e) { JXHyperlink link = (JXHyperlink) e.getSource(); File file = (File) link.getClientProperty(LINK_PATH); FileObject fileObject = FileUtil.toFileObject(file); if (fileObject.hasExt(GEPHI_EXTENSION)) { ProjectControllerUI pc = Lookup.getDefault().lookup(ProjectControllerUI.class); try { pc.openProject(file); } catch (Exception ex) { Exceptions.printStackTrace(ex); NotifyDescriptor.Message msg = new NotifyDescriptor.Message(NbBundle.getMessage(WelcomeTopComponent.class, "WelcomeTopComponent.openGephiError"), NotifyDescriptor.WARNING_MESSAGE); DialogDisplayer.getDefault().notify(msg); } } else { ImportControllerUI importController = Lookup.getDefault().lookup(ImportControllerUI.class); if (importController.getImportController().isFileSupported(FileUtil.toFile(fileObject))) { importController.importFile(fileObject); } } closeDialog(); } };
public synchronized Iterable<? extends URL> getMainClasses (URL root) { ensureLoad(root); List<URL> result = new ArrayList<URL>(mainSources.size()); for (String surl : mainSources) { try { result.add(new URL(surl)); } catch (MalformedURLException ex) { //Report and ignore broken url Exceptions.printStackTrace(ex); } } return result; }