| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | |
| | | import javax.swing.text.html.FormView; |
| | | import javax.swing.text.html.HTMLEditorKit; |
| | | |
| | | /** |
| | | * Class used to be able to detect events in the button inside an HTML pane. |
| | | */ |
| | | /** Class used to be able to detect events in the button inside an HTML pane. */ |
| | | public class CustomHTMLEditorKit extends HTMLEditorKit |
| | | { |
| | | private HashSet<ActionListener> listeners = new HashSet<>(); |
| | | private static final long serialVersionUID = 298103926252426388L; |
| | | |
| | | /** |
| | | * Default constructor. |
| | | */ |
| | | /** Default constructor. */ |
| | | public CustomHTMLEditorKit() |
| | | { |
| | | super(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ViewFactory getViewFactory() |
| | | { |
| | | return new MyHTMLFactory(); |
| | |
| | | listeners.remove(l); |
| | | } |
| | | |
| | | /** |
| | | * Class used to be able to detect events in the button inside an HTML pane. |
| | | */ |
| | | /** Class used to be able to detect events in the button inside an HTML pane. */ |
| | | class MyHTMLFactory extends HTMLFactory |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public View create(Element elem) |
| | | { |
| | | View v = super.create(elem); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Class used to be able to detect events in the button inside an HTML pane. |
| | | */ |
| | | /** Class used to be able to detect events in the button inside an HTML pane. */ |
| | | class MyFormView extends FormView |
| | | { |
| | | /** |
| | |
| | | super(elem); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | if (ev != null && ev.getWhen() != lastActionWhen) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected Component createComponent() |
| | | { |
| | | Component comp = super.createComponent(); |