From 87f636ebc1046ce5f961065280f99fa403c88a43 Mon Sep 17 00:00:00 2001 From: "talisman%anamorphic.com" Date: Sun, 8 Apr 2001 09:50:54 +0000 Subject: [PATCH] Missed this on last reorg checkin. jrg git-svn-id: svn://10.0.0.236/trunk@91689 18797224-902f-48f8-a5cc-f745e15eee43 --- .../sources/grendel/ui/PreferencesAction.java | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 mozilla/grendel/sources/grendel/ui/PreferencesAction.java diff --git a/mozilla/grendel/sources/grendel/ui/PreferencesAction.java b/mozilla/grendel/sources/grendel/ui/PreferencesAction.java new file mode 100644 index 00000000000..6ea98da6aff --- /dev/null +++ b/mozilla/grendel/sources/grendel/ui/PreferencesAction.java @@ -0,0 +1,93 @@ +/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Grendel mail/news client. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1997 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Created: Jeff Galyan (talisman@anamorphic.com), 20 March, 2001. + * + * Contributors: + */ + +package grendel.ui; + +import java.awt.Component; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.Enumeration; +import java.util.ResourceBundle; + +import javax.swing.JFrame; +import javax.swing.ToolTipManager; + +//import netscape.orion.uimanager.AbstractUICmd; +//import netscape.orion.uimanager.IUICmd; + +import grendel.prefs.base.UIPrefs; +import grendel.prefs.ui.Identities; +import grendel.prefs.ui.Servers; +import grendel.prefs.ui.General; +import grendel.prefs.ui.UI; +import grendel.storage.MailDrop; +import grendel.search.SearchFrame; + +/* Temporarily removed because FilterMaster is broken (edwin) +import grendel.filters.FilterMaster; +*/ + +import grendel.composition.Composition; +import grendel.ui.UIAction; + + +class PreferencesAction extends UIAction { + PreferencesAction fThis; + + public PreferencesAction() { + super("appPrefs"); + fThis = this; + + setEnabled(true); + } + + public void actionPerformed(ActionEvent aEvent) { + Object source = aEvent.getSource(); + if (source instanceof Component) { + Frame frame = Util.GetParentFrame((Component) source); + if (frame instanceof JFrame) { + new Thread(new PrefThread((JFrame) frame), "Prefs").start(); + } + } + } + + class PrefThread implements Runnable { + JFrame fFrame; + PrefThread(JFrame aFrame) { + fFrame = aFrame; + } + public void run() { + synchronized(fThis) { + setEnabled(false); + new PrefsDialog(fFrame); + setEnabled(true); + } + } + } +} +