Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r8390 r8510  
    182182        p.add(new JScrollPane(help), BorderLayout.CENTER);
    183183
    184         addWindowListener(new WindowAdapter(){
     184        addWindowListener(new WindowAdapter() {
    185185            @Override public void windowClosing(WindowEvent e) {
    186186                setVisible(false);
     
    190190        p.add(buildToolBar(), BorderLayout.NORTH);
    191191        help.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "Close");
    192         help.getActionMap().put("Close", new AbstractAction(){
     192        help.getActionMap().put("Close", new AbstractAction() {
    193193            @Override
    194194            public void actionPerformed(ActionEvent e) {
     
    208208                    WindowGeometry.centerInWindow(
    209209                            getParent(),
    210                             new Dimension(600,400)
     210                            new Dimension(600, 400)
    211211                    )
    212212            ).applySafe(this);
     
    215215        }
    216216        if (Main.main != null && Main.main.menu != null && Main.main.menu.windowMenu != null) {
    217             if(windowMenuItem != null && !visible) {
     217            if (windowMenuItem != null && !visible) {
    218218                Main.main.menu.windowMenu.remove(windowMenuItem);
    219219                windowMenuItem = null;
    220220            }
    221             if(windowMenuItem == null && visible) {
     221            if (windowMenuItem == null && visible) {
    222222                windowMenuItem = MainMenu.add(Main.main.menu.windowMenu, focusAction, MainMenu.WINDOW_MENU_GROUP.VOLATILE);
    223223            }
     
    306306        try {
    307307            content = reader.fetchHelpTopicContent(url, true);
    308         } catch(MissingHelpContentException e) {
     308        } catch (MissingHelpContentException e) {
    309309            url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.BASELANGUAGE));
    310310            try {
    311311                content = reader.fetchHelpTopicContent(url, true);
    312             } catch(MissingHelpContentException e1) {
     312            } catch (MissingHelpContentException e1) {
    313313                url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH));
    314314                try {
    315315                    content = reader.fetchHelpTopicContent(url, true);
    316                 } catch(MissingHelpContentException e2) {
     316                } catch (MissingHelpContentException e2) {
    317317                    this.url = url;
    318318                    handleMissingHelpContent(relativeHelpTopic);
    319319                    return;
    320                 } catch(HelpContentReaderException e2) {
     320                } catch (HelpContentReaderException e2) {
    321321                    Main.error(e2);
    322322                    handleHelpContentReaderException(relativeHelpTopic, e2);
    323323                    return;
    324324                }
    325             } catch(HelpContentReaderException e1) {
     325            } catch (HelpContentReaderException e1) {
    326326                Main.error(e1);
    327327                handleHelpContentReaderException(relativeHelpTopic, e1);
    328328                return;
    329329            }
    330         } catch(HelpContentReaderException e) {
     330        } catch (HelpContentReaderException e) {
    331331            Main.error(e);
    332332            handleHelpContentReaderException(relativeHelpTopic, e);
     
    349349        try {
    350350            content = reader.fetchHelpTopicContent(url, true);
    351         } catch(MissingHelpContentException e) {
     351        } catch (MissingHelpContentException e) {
    352352            this.url = url;
    353353            handleMissingHelpContent(absoluteHelpTopic);
    354354            return;
    355         } catch(HelpContentReaderException e) {
     355        } catch (HelpContentReaderException e) {
    356356            Main.error(e);
    357357            handleHelpContentReaderException(absoluteHelpTopic, e);
     
    386386                history.setCurrentUrl(url);
    387387                this.url = url;
    388             } catch(Exception e) {
     388            } catch (Exception e) {
    389389                Main.warn(e);
    390390                HelpAwareOptionPane.showOptionDialog(
     
    439439
    440440    class EditAction extends AbstractAction {
     441        /**
     442         * Constructs a new {@code EditAction}.
     443         */
    441444        public EditAction() {
    442445            putValue(SHORT_DESCRIPTION, tr("Edit the current help page"));
    443             putValue(SMALL_ICON,ImageProvider.get("dialogs", "edit"));
     446            putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
    444447        }
    445448
     
    447450        public void actionPerformed(ActionEvent e) {
    448451            String url = getUrl();
    449             if(url == null)
     452            if (url == null)
    450453                return;
    451454            if (!url.startsWith(HelpUtil.getWikiBaseHelpUrl())) {
     
    484487    static class BackAction extends AbstractAction implements Observer {
    485488        private transient HelpBrowserHistory history;
     489
    486490        public BackAction(HelpBrowserHistory history) {
    487491            this.history = history;
     
    496500            history.back();
    497501        }
     502
    498503        @Override
    499504        public void update(Observable o, Object arg) {
     
    504509    static class ForwardAction extends AbstractAction implements Observer {
    505510        private transient HelpBrowserHistory history;
     511
    506512        public ForwardAction(HelpBrowserHistory history) {
    507513            this.history = history;
     
    516522            history.forward();
    517523        }
     524
    518525        @Override
    519526        public void update(Observable o, Object arg) {
     
    523530
    524531    class HomeAction extends AbstractAction  {
     532        /**
     533         * Constructs a new {@code HomeAction}.
     534         */
    525535        public HomeAction() {
    526536            putValue(SHORT_DESCRIPTION, tr("Go to the JOSM help home page"));
     
    578588            Object value = set.getAttribute(Tag.A);
    579589            if (!(value instanceof SimpleAttributeSet)) return null;
    580             SimpleAttributeSet atts = (SimpleAttributeSet)value;
     590            SimpleAttributeSet atts = (SimpleAttributeSet) value;
    581591            value = atts.getAttribute(javax.swing.text.html.HTML.Attribute.HREF);
    582592            if (value == null) return null;
    583             String s = (String)value;
     593            String s = (String) value;
    584594            if (s.matches("#.*"))
    585595                return s.substring(1);
     
    592602                return;
    593603            if (e.getURL() == null || e.getURL().toString().startsWith(url+"#")) {
    594                 // Probably hyperlink event on a an A-element with a href consisting of
    595                 // a fragment only, i.e. "#ALocalFragment".
    596                 //
     604                // Probably hyperlink event on a an A-element with a href consisting of a fragment only, i.e. "#ALocalFragment".
    597605                String fragment = getUrlFragment(e);
    598606                if (fragment != null) {
Note: See TracChangeset for help on using the changeset viewer.