AccountOptionsExplorerAction.java

gui/src/net/sourceforge/pain/tools/guitool/action/admin/AccountOptionsExplorerAction.java · 1.4 KB

From the archive pain_0_44.tgz

Download the archive   « Back to the archive contents

package net.sourceforge.pain.tools.guitool.action.admin;

import net.sourceforge.pain.tools.guitool.*;
import net.sourceforge.pain.tools.guitool.action.*;
import net.sourceforge.pain.tools.guitool.dialog.*;

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;

public class AccountOptionsExplorerAction implements GTAction {

    private static JEditorPane instance;

    public void executeAction() {
        try {
            GuiTool.appFrame.workspacePanel.setActiveComponent(getComponent());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private Component getComponent() throws Exception {
        if (instance == null) {
            instance = HtmlComponentRegistry.get(getClass());
            instance.addHyperlinkListener(new HyperlinkListener() {
                public void hyperlinkUpdate(HyperlinkEvent ev) {
                    if (ev.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
                        return;
                    }
                    try {
                        GlobalPerformer.ensureConnected();
                        showChangePassDialog();
                    } catch (IllegalStateException e) {
                    }
                }
            });
        }
        return instance;
    }

    private void showChangePassDialog() {
        GuiTool.log("change pass");
        new ChangePassPerformer().changePass();
    }

}

Site Stats

Snippets: 1791
Codebases: 571