/** * @param args */ public static void main(String[] args) { Svansprogram app = new Svansprogram(); app.run(); }
@Override public void actionPerformed(ActionEvent e) { styleRulesPlugInImpl.saveManager(true); } }
@Override public void actionPerformed(ActionEvent e) { styleRulesPlugInImpl.importManager(); }
private void reOpenFiles() { Set<String> rememeberedFiles = reOpener.getRememeberedFiles(); for (String filename : rememeberedFiles) { log.debug("Reopening file: " + filename); File file = new File(filename); if (file.canRead()) { try { fileOpener.openFile(file); } catch (ResourceNotFoundException ex) { log.info("Missing configuration", ex); } } else { log.info("Unable to reopen file for reading: " + filename); } } } }
public ShowStyleRulesAction(Messages messages, String nameKey) { super(messages, new JCheckBoxMenuItem()); setNameFromMessages(nameKey); setMnemonicKey(KeyEvent.VK_N); setAcceleratorKey(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK); }
public TailFrameTracker(final FileReopener reopener, final File fileToTrack) { this.reopener = reopener; this.fileToTrack = fileToTrack; try { reopener.remember(fileToTrack); } catch (IOException ex) { log.warn("Unable to remember file for reopening: " + fileToTrack); } }
@Override public void frameWillDispose(WorkbenchFrame frame) { log.debug("Frame disposing, forgetting file " + fileToTrack.getName()); try { reopener.forget(fileToTrack); } catch (IOException ex) { log.warn("Unable to forget file for re-opening", ex); } }
@Override public void close() { Set<String> rememeberedFiles = getRememeberedFiles(); log.debug("Rememebering: " + rememeberedFiles.size() + " filenames"); try { PreferencesUtil.rememeberOpenedFiles(preferences, rememeberedFiles); } catch (InvalidDataTypeException ex) { // Ignore, nothing we can do and nothing the user wants to know about log.warn("Unable to save rememebered files", ex); } catch (BackendException ex) { // Ignore, nothing we can do and nothing the user wants to know about log.warn("Unable to save rememebered files", ex); } } }
public BackgroundAction(LocalizedResources messages) throws ResourceNotFoundException { super(); setName(messages.getMessage("nu.zoom.catonine.stylerule.background")); setToolTip(messages.getMessage("nu.zoom.catonine.stylerule.background.tt")); this.chooserTooltip = messages.getMessage("nu.zoom.catonine.stylerule.foreground.tt"); }
public ForegroundAction(LocalizedResources messages) throws ResourceNotFoundException { super(); setName(messages.getMessage("nu.zoom.catonine.stylerule.foreground")); setToolTip(messages.getMessage("nu.zoom.catonine.stylerule.foreground.tt")); this.chooserTooltip = messages.getMessage("nu.zoom.catonine.stylerule.foreground.tt"); }
@Override public void actionPerformed(ActionEvent e) { styleRulesPlugInImpl.openManager(); } }
private StyleRulesManager readManager(String managerFileName) { StyleRulesManager newManager = null; if (managerFileName != null) { final File managerFile = new File(managerFileName); newManager = readManager(managerFile); } return newManager; }
private void editStyleRules() { StyleRules selectedRules = (StyleRules) stylesList.getSelectedValue(); if (selectedRules != null) { editStyleRules(selectedRules); } }
public FileReopenerImpl( final Workbench workbench, final Preferences preferences) { this.workbench = workbench; this.preferences = preferences; try { filenames.addAll(PreferencesUtil.getOpenedFiles(preferences)); } catch (InvalidDataTypeException ex) { log.warn("Unable to retrieve the rememebered files", ex); } catch (BackendException ex) { log.warn("Unable to retrieve the rememebered files", ex); } }
@Override public void start() { workbench.setTitle("Svansprogram \u00a9 2006 Johan Maasing"); workbench.setIcon(Svansprogram.getTailIcon()); }
private boolean loadManager() throws InvalidDataTypeException, BackendException { boolean success = loadManager(preferences.getString(PreferencesUtil.MANAGER_FILENAME_PREFS_KEY)); if (!success) { // Failed to load default manager. Remove the preferences string since it is obviously wrong. preferences.setString(PreferencesUtil.MANAGER_FILENAME_PREFS_KEY, null); } return success; }
public TailFrameTracker(final FileReopener reopener, final File fileToTrack) { this.reopener = reopener; this.fileToTrack = fileToTrack; try { reopener.remember(fileToTrack); } catch (IOException ex) { log.warn("Unable to remember file for reopening: " + fileToTrack); } }
@Override public void frameWillDispose(WorkbenchFrame frame) { log.debug("Frame disposing, forgetting file " + fileToTrack.getName()); try { reopener.forget(fileToTrack); } catch (IOException ex) { log.warn("Unable to forget file for re-opening", ex); } } }