You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/08/15 07:04:09 UTC

[GitHub] geertjanw closed pull request #683: No need to show Apache license on first startup

geertjanw closed pull request #683: No need to show Apache license on first startup
URL: https://github.com/apache/incubator-netbeans/pull/683
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ide/launcher/unix/netbeans b/ide/launcher/unix/netbeans
index a2a1667dde..e7fecb8e31 100644
--- a/ide/launcher/unix/netbeans
+++ b/ide/launcher/unix/netbeans
@@ -196,7 +196,6 @@ case "`uname`" in
             --branding nb \
             --clusters '"$netbeans_clusters"' \
             -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \
-            -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense \
             ${netbeans_default_options} \
             '"$@"'
         ;;
@@ -206,7 +205,6 @@ case "`uname`" in
             --branding nb \
             --clusters '"$netbeans_clusters"' \
             -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \
-            -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense \
             ${netbeans_default_options} \
             '"$@"'
         ;;
diff --git a/ide/launcher/windows/nblauncher.cpp b/ide/launcher/windows/nblauncher.cpp
index ffb8c51e0c..b4dc14df34 100644
--- a/ide/launcher/windows/nblauncher.cpp
+++ b/ide/launcher/windows/nblauncher.cpp
@@ -53,7 +53,6 @@ const char *NbLauncher::CON_ATTACH_MSG =
 
 const char *NbLauncher::staticOptions[] = {
     "-J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade",
-    "-J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense",
     "--branding",
     "nb"
 };
diff --git a/o.n.upgrader/src/org/netbeans/license/AcceptLicense.java b/o.n.upgrader/src/org/netbeans/license/AcceptLicense.java
index e1179404fc..8113a6880c 100644
--- a/o.n.upgrader/src/org/netbeans/license/AcceptLicense.java
+++ b/o.n.upgrader/src/org/netbeans/license/AcceptLicense.java
@@ -19,194 +19,12 @@
 
 package org.netbeans.license;
 
-import java.awt.BorderLayout;
-import java.awt.Dialog;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.URL;
-import java.util.ResourceBundle;
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JPanel;
-import javax.swing.KeyStroke;
-import org.netbeans.util.Util;
-import org.openide.util.NbBundle;
-import org.openide.util.Utilities;
-/**
- * Displays LicensePanel to user. User must accept license to continue. 
- * if user does not accept license UserCancelException is thrown.
- *
- * @author  Marek Slama
+/** No need to display Apache license before starting for the 1st time.
+ * The class is kept empty for compatibility.
  */
-
 public final class AcceptLicense {
-    
-    private static String command;
-    
     /** If License was not accepted during installation user must accept it here. 
      */
     public static void showLicensePanel () throws Exception {
-        Util.setDefaultLookAndFeel();
-        URL url = AcceptLicense.class.getResource("LICENSE.txt"); // NOI18N
-        if (url == null) return ;
-        LicensePanel licensePanel = new LicensePanel(url);
-        ResourceBundle bundle = NbBundle.getBundle(AcceptLicense.class);
-        String yesLabel = bundle.getString("MSG_LicenseYesButton");
-        String noLabel = bundle.getString("MSG_LicenseNoButton");
-        JButton yesButton = new JButton();
-        JButton noButton = new JButton();
-        setLocalizedText(yesButton,yesLabel);
-        setLocalizedText(noButton,noLabel);
-        
-        yesButton.setActionCommand("yes"); // NOI18N
-        noButton.setActionCommand("no"); // NOI18N
-        
-        yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_AcceptButton"));
-        yesButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_AcceptButton"));
-        
-        noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_RejectButton"));
-        noButton.getAccessibleContext().setAccessibleName(bundle.getString("ACSD_RejectButton"));
-        
-        Dimension yesPF = yesButton.getPreferredSize();
-        Dimension noPF = noButton.getPreferredSize();
-        int maxWidth = Math.max(yesButton.getPreferredSize().width, noButton.getPreferredSize().width);
-        int maxHeight = Math.max(yesButton.getPreferredSize().height, noButton.getPreferredSize().height);
-        yesButton.setPreferredSize(new Dimension(maxWidth, maxHeight));
-        noButton.setPreferredSize(new Dimension(maxWidth, maxHeight));
-        
-        final JDialog d = new JDialog(null, bundle.getString("MSG_LicenseDlgTitle"), Dialog.ModalityType.APPLICATION_MODAL);
-        Util.initIcons(d);
-        d.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_LicenseDlg"));
-        d.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_LicenseDlg"));
-        d.getContentPane().add(licensePanel,BorderLayout.CENTER);
-        ActionListener listener = new ActionListener () {
-            public void actionPerformed (ActionEvent e) {
-                command = e.getActionCommand();
-                d.setVisible(false);
-            }
-        };
-        yesButton.addActionListener(listener);
-        noButton.addActionListener(listener);
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
-        buttonPanel.setBorder(BorderFactory.createEmptyBorder(17,12,11,11));
-        buttonPanel.add(yesButton);
-        buttonPanel.add(noButton);
-        d.getContentPane().add(buttonPanel,BorderLayout.SOUTH);
-        d.setSize(new Dimension(600,600));
-        d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        d.setResizable(true);
-        d.getRootPane().setDefaultButton(yesButton);
-        d.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("ESCAPE"), "exit"); //NOI18N
-        d.getRootPane().getActionMap().put("exit", new AbstractAction() { //NOI18N
-            public void actionPerformed(ActionEvent e) {
-                command = "no"; //NOI18N
-                d.setVisible(false);
-            }
-        });
-
-        licensePanel.jEditorPane1.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "accept"); //NOI18N
-        licensePanel.jEditorPane1.getActionMap().put("accept", new AbstractAction() { //NOI18N
-            public void actionPerformed(ActionEvent e) {
-                command = "yes"; //NOI18N
-                d.setVisible(false);
-            }
-        });
-
-        //Center on screen
-        d.setLocationRelativeTo(null);
-        d.setVisible(true);
-        
-        if ("yes".equals(command)) {  // NOI18N
-            return;
-        } else {
-            throw new org.openide.util.UserCancelException();
-        }
-    }
-
-    /**
-     * Actual setter of the text & mnemonics for the AbstractButton or
-     * their subclasses. We must copy necessary code from org.openide.awt.Mnemonics
-     * because org.openide.awt module is not available yet when this code is called.
-     * @param item AbstractButton
-     * @param text new label
-     */
-    private static void setLocalizedText (AbstractButton button, String text) {
-        if (text == null) {
-            button.setText(null);
-            return;
-        }
-
-        int i = findMnemonicAmpersand(text);
-
-        if (i < 0) {
-            // no '&' - don't set the mnemonic
-            button.setText(text);
-            button.setMnemonic(0);
-        } else {
-            button.setText(text.substring(0, i) + text.substring(i + 1));
-            
-            if (Utilities.isMac()) {
-                // there shall be no mnemonics on macosx.
-                //#55864
-                return;
-            }
-
-            char ch = text.charAt(i + 1);
-
-            // it's latin character or arabic digit,
-            // setting it as mnemonics
-            button.setMnemonic(ch);
-
-            // If it's something like "Save &As", we need to set another
-            // mnemonic index (at least under 1.4 or later)
-            // see #29676
-            button.setDisplayedMnemonicIndex(i);
-        }
-    }
-    
-    /**
-     * Searches for an ampersand in a string which indicates a mnemonic.
-     * Recognizes the following cases:
-     * <ul>
-     * <li>"Drag & Drop", "Ampersand ('&')" - don't have mnemonic ampersand.
-     *      "&" is not found before " " (space), or if enclosed in "'"
-     *     (single quotation marks).
-     * <li>"&File", "Save &As..." - do have mnemonic ampersand.
-     * <li>"Rock & Ro&ll", "Underline the '&' &character" - also do have
-     *      mnemonic ampersand, but the second one.
-     * </ul>
-     * @param text text to search
-     * @return the position of mnemonic ampersand in text, or -1 if there is none
-     */
-    public static int findMnemonicAmpersand(String text) {
-        int i = -1;
-
-        do {
-            // searching for the next ampersand
-            i = text.indexOf('&', i + 1);
-
-            if ((i >= 0) && ((i + 1) < text.length())) {
-                // before ' '
-                if (text.charAt(i + 1) == ' ') {
-                    continue;
-
-                    // before ', and after '
-                } else if ((text.charAt(i + 1) == '\'') && (i > 0) && (text.charAt(i - 1) == '\'')) {
-                    continue;
-                }
-
-                // ampersand is marking mnemonics
-                return i;
-            }
-        } while (i >= 0);
-
-        return -1;
     }
 }
diff --git a/o.n.upgrader/src/org/netbeans/license/Bundle.properties b/o.n.upgrader/src/org/netbeans/license/Bundle.properties
deleted file mode 100644
index cab3db2fb1..0000000000
--- a/o.n.upgrader/src/org/netbeans/license/Bundle.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-#Licence dialog
-MSG_LicenseDlgTitle=License Agreement
-MSG_LicenseDlgLabelTop=Please read the following license agreement carefully.
-MSG_LicenseDlgLabelBottom=If you accept all terms of the agreement, click I Accept \
-to start NetBeans IDE. You must accept the agreement to start NetBeans IDE.
-MSG_LicenseYesButton=I &Accept
-MSG_LicenseNoButton=E&xit
-
-ACSN_LicensePanel=License Panel
-ACSD_LicensePanel=N/A
-
-ACSN_LicenseDlg=License Dialog
-ACSD_LicenseDlg=License Agreement
-
-ACSN_EditorPane=License Text
-ACSD_EditorPane=Please read the following license agreement carefully. \
-If you accept all terms of the agreement, click I Accept \
-to start NetBeans IDE. You must accept the agreement to start NetBeans IDE.
-
-ACSN_AcceptButton=Accept Button
-ACSD_AcceptButton=Click to accept license and continue
-
-ACSN_RejectButton=Reject Button
-ACSD_RejectButton=Click to reject license and exit 
diff --git a/o.n.upgrader/src/org/netbeans/license/LicensePanel.form b/o.n.upgrader/src/org/netbeans/license/LicensePanel.form
deleted file mode 100644
index 05a134773d..0000000000
--- a/o.n.upgrader/src/org/netbeans/license/LicensePanel.form
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
-  <Properties>
-    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
-      <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
-        <EmptyBorder bottom="0" left="12" right="11" top="12"/>
-      </Border>
-    </Property>
-  </Properties>
-  <AuxValues>
-    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
-    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
-    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,27,0,0,2,124"/>
-  </AuxValues>
-
-  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
-    <Property name="axis" type="int" value="1"/>
-  </Layout>
-  <SubComponents>
-    <Component class="javax.swing.JTextArea" name="jTextAreaTop">
-      <Properties>
-        <Property name="background" type="java.awt.Color" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
-          <Connection component="Form" name="background" type="property"/>
-        </Property>
-        <Property name="columns" type="int" value="20"/>
-        <Property name="editable" type="boolean" value="false"/>
-        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
-          <Font name="Dialog" size="12" style="1"/>
-        </Property>
-        <Property name="lineWrap" type="boolean" value="true"/>
-        <Property name="rows" type="int" value="1"/>
-        <Property name="text" preCode="jTextAreaTop.setText(bundle.getString(&quot;MSG_LicenseDlgLabelTop&quot;));"/>
-        <Property name="wrapStyleWord" type="boolean" value="true"/>
-        <Property name="focusable" type="boolean" value="false"/>
-        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
-          <Insets value="[0, 0, 2, 0]"/>
-        </Property>
-        <Property name="requestFocusEnabled" type="boolean" value="false"/>
-      </Properties>
-    </Component>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
-      <AuxValues>
-        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
-      </AuxValues>
-
-      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
-      <SubComponents>
-        <Component class="javax.swing.JEditorPane" name="jEditorPane1">
-          <Properties>
-            <Property name="editable" type="boolean" value="false"/>
-            <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
-              <Dimension value="[500, 500]"/>
-            </Property>
-          </Properties>
-          <AuxValues>
-            <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
-          </AuxValues>
-        </Component>
-      </SubComponents>
-    </Container>
-    <Component class="javax.swing.JTextArea" name="jTextAreaBottom">
-      <Properties>
-        <Property name="background" type="java.awt.Color" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
-          <Connection component="Form" name="background" type="property"/>
-        </Property>
-        <Property name="columns" type="int" value="20"/>
-        <Property name="editable" type="boolean" value="false"/>
-        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
-          <Font name="Dialog" size="12" style="1"/>
-        </Property>
-        <Property name="lineWrap" type="boolean" value="true"/>
-        <Property name="rows" type="int" value="2"/>
-        <Property name="text" preCode="jTextAreaBottom.setText(bundle.getString(&quot;MSG_LicenseDlgLabelBottom&quot;));"/>
-        <Property name="wrapStyleWord" type="boolean" value="true"/>
-        <Property name="focusable" type="boolean" value="false"/>
-        <Property name="requestFocusEnabled" type="boolean" value="false"/>
-      </Properties>
-    </Component>
-  </SubComponents>
-</Form>
diff --git a/o.n.upgrader/src/org/netbeans/license/LicensePanel.java b/o.n.upgrader/src/org/netbeans/license/LicensePanel.java
deleted file mode 100644
index 6cb9079f19..0000000000
--- a/o.n.upgrader/src/org/netbeans/license/LicensePanel.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.license;
-
-import java.awt.Rectangle;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ResourceBundle;
-
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.SwingConstants;
-import javax.swing.text.DefaultEditorKit;
-import org.openide.util.NbBundle;
-
-/**
- * This class displays license during first start of IDE.
- *
- * @author  Marek Slama
- */
-final class LicensePanel extends javax.swing.JPanel {
-
-    /** Creates new form LicensePanel */
-    public LicensePanel(URL url) {
-        this.url = url;
-        initComponents();
-        initAccessibility();
-        try {
-            jEditorPane1.setPage(url);
-        } catch (IOException exc) {
-            //Problem with locating file
-            System.err.println("Exception: " + exc.getMessage()); //NOI18N
-            exc.printStackTrace();
-        }
-        ActionMap actionMap = jEditorPane1.getActionMap();
-        actionMap.put(DefaultEditorKit.upAction, new ScrollAction(-1));
-        actionMap.put(DefaultEditorKit.downAction, new ScrollAction(1));
-    }
-    
-    private void initAccessibility() {
-        this.getAccessibleContext().setAccessibleName
-        (bundle.getString("ACSN_LicensePanel"));
-        this.getAccessibleContext().setAccessibleDescription
-        (bundle.getString("ACSD_LicensePanel"));
-        
-        jEditorPane1.getAccessibleContext().setAccessibleName
-        (bundle.getString("ACSN_EditorPane"));
-        jEditorPane1.getAccessibleContext().setAccessibleDescription
-        (bundle.getString("ACSD_EditorPane"));
-    }
-    
-    /** This method is called from within the constructor to
-     * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
-     */
-    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents() {
-
-        jTextAreaTop = new javax.swing.JTextArea();
-        jScrollPane1 = new javax.swing.JScrollPane();
-        jEditorPane1 = new javax.swing.JEditorPane();
-        jTextAreaBottom = new javax.swing.JTextArea();
-
-        setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 0, 11));
-        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
-
-        jTextAreaTop.setBackground(getBackground());
-        jTextAreaTop.setColumns(20);
-        jTextAreaTop.setEditable(false);
-        jTextAreaTop.setFont(new java.awt.Font("Dialog", 1, 12));
-        jTextAreaTop.setLineWrap(true);
-        jTextAreaTop.setRows(1);
-        jTextAreaTop.setText(bundle.getString("MSG_LicenseDlgLabelTop"));
-        jTextAreaTop.setWrapStyleWord(true);
-        jTextAreaTop.setFocusable(false);
-        jTextAreaTop.setMargin(new java.awt.Insets(0, 0, 2, 0));
-        jTextAreaTop.setRequestFocusEnabled(false);
-        add(jTextAreaTop);
-
-        jEditorPane1.setEditable(false);
-        jEditorPane1.setPreferredSize(new java.awt.Dimension(500, 500));
-        jScrollPane1.setViewportView(jEditorPane1);
-
-        add(jScrollPane1);
-
-        jTextAreaBottom.setBackground(getBackground());
-        jTextAreaBottom.setColumns(20);
-        jTextAreaBottom.setEditable(false);
-        jTextAreaBottom.setFont(new java.awt.Font("Dialog", 1, 12));
-        jTextAreaBottom.setLineWrap(true);
-        jTextAreaBottom.setRows(2);
-        jTextAreaBottom.setText(bundle.getString("MSG_LicenseDlgLabelBottom"));
-        jTextAreaBottom.setWrapStyleWord(true);
-        jTextAreaBottom.setFocusable(false);
-        jTextAreaBottom.setRequestFocusEnabled(false);
-        add(jTextAreaBottom);
-    }// </editor-fold>//GEN-END:initComponents
-    
-    
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    javax.swing.JEditorPane jEditorPane1;
-    private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JTextArea jTextAreaBottom;
-    private javax.swing.JTextArea jTextAreaTop;
-    // End of variables declaration//GEN-END:variables
-    private URL url;
-    private static final ResourceBundle bundle = NbBundle.getBundle(LicensePanel.class);
-
-    /**
-     * An action to scroll the browser content up or down.
-     */
-    private class ScrollAction extends AbstractAction {
-        int direction;
-
-        public ScrollAction(int direction) {
-            this.direction = direction;
-        }
-
-        public void actionPerformed(java.awt.event.ActionEvent e) {
-            Rectangle r = jEditorPane1.getVisibleRect();
-            int increment = jEditorPane1.getScrollableUnitIncrement(r, SwingConstants.VERTICAL, direction);
-            r.y += (increment * direction);
-            jEditorPane1.scrollRectToVisible(r);
-        }
-    }
-}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists