mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Let's get grendel runnin' :D. This checkin might be a bit rough so expect a couple of build bustages.
bug 86953 - Grendel uses old jaxp bug 272345 - Grendel doesn't compile on Java 1.4 bug 292916 - Move Grendel to use Ant instead of Makefiles for compilation (partial fix) partial fix for bug 293079 - Move grendel to use XUL
This commit is contained in:
parent
5db2c09a41
commit
3cd6e9d811
126
grendel/build.xml
Normal file
126
grendel/build.xml
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- 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 Grendel mail/news client.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- R.J. Keller.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2005
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<project name="Grendel" default="build" basedir=".">
|
||||
|
||||
<target name="build" description="Compiles Grendel.">
|
||||
<mkdir dir="dist"/>
|
||||
<unzip dest="dist" overwrite="false">
|
||||
<fileset dir="extlibs">
|
||||
<include name="**/*.jar"/>
|
||||
</fileset>
|
||||
</unzip>
|
||||
|
||||
<copy todir="dist">
|
||||
<fileset dir="sources/grendel">
|
||||
<include name="**/*.gif"/>
|
||||
<include name="**/*.jpg"/>
|
||||
<include name="**/*.tmpl"/>
|
||||
<include name="**/*.xml"/>
|
||||
<include name="**/*.dtd"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="dist">
|
||||
<fileset dir="sources">
|
||||
<include name="**/*.properties"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<javac srcdir="." destdir="dist"
|
||||
optimize="false"
|
||||
debug="true"
|
||||
includes="**/*.java"/>
|
||||
</target>
|
||||
|
||||
<target name="unzipResources">
|
||||
<copy todir="dist/resources">
|
||||
<fileset dir="sources/grendel">
|
||||
<include name="**/*.gif"/>
|
||||
<include name="**/*.jpg"/>
|
||||
<include name="**/*.tmpl"/>
|
||||
<include name="**/*.xml"/>
|
||||
<include name="**/*.dtd"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="dist">
|
||||
<fileset dir="sources">
|
||||
<include name="**/*.properties"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="makeJar" description="Pumps all the libs into one big JAR for distribution. Grendel must be built before running this.">
|
||||
<jar destfile="grendel.jar">
|
||||
<fileset dir="dist">
|
||||
<include name="**/*.*"/>
|
||||
</fileset>
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="grendel.Main"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<zip destfile="dist/grendel.zip">
|
||||
<fileset dir="dist">
|
||||
<include name="images/*.gif"/>
|
||||
<include name="xml/*.xml"/>
|
||||
<include name="dtd/*.dtd"/>
|
||||
<include name="templates/*.tmpl"/>
|
||||
<include name="images/*.jpg"/>
|
||||
</fileset>
|
||||
<fileset dir=".">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</zip>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="run" description="Runs Grendel after compiling.">
|
||||
<java classname="grendel.Main" classpath="dist"/>
|
||||
</target>
|
||||
|
||||
<target name="clean" description="Cleans up generated class files.">
|
||||
<delete dir="dist"/>
|
||||
<delete file="grendel.jar"/>
|
||||
<delete dir="javadoc"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc" description="Generate JavaDoc API information">
|
||||
<mkdir dir="javadoc"/>
|
||||
<javadoc destdir="javadoc">
|
||||
<fileset dir="." includes="**/*.java"/>
|
||||
</javadoc>
|
||||
</target>
|
||||
</project>
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Frank Tang <ftang@netscape.com>
|
||||
*/
|
||||
@ -32,7 +32,7 @@ import java.lang.String;
|
||||
* ByteToCharConverterEnumeration return a Enumeration of String which
|
||||
* represent ByteToCharConverter available in the classpath
|
||||
* @author ftang
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@ -41,7 +41,7 @@ public class ByteToCharConverterEnumeration extends PrefetchEnumeration {
|
||||
/*
|
||||
*
|
||||
* @author ftang
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@ -52,7 +52,7 @@ public class ByteToCharConverterEnumeration extends PrefetchEnumeration {
|
||||
/*
|
||||
*
|
||||
* @author ftang
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@ -69,7 +69,7 @@ public class ByteToCharConverterEnumeration extends PrefetchEnumeration {
|
||||
/*
|
||||
*
|
||||
* @author ftang
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
* The default NNTP port.
|
||||
*/
|
||||
public static final int DEFAULT_PORT = 119;
|
||||
|
||||
|
||||
static int fetchsize = 1024;
|
||||
|
||||
Socket socket;
|
||||
@ -92,7 +92,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
Hashtable articles = new Hashtable(); // hashtable of articles by message-id
|
||||
|
||||
Vector statusListeners = new Vector();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@ -101,7 +101,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
String ccs = session.getProperty("mail.nntp.fetchsize");
|
||||
if (ccs!=null) try { fetchsize = Math.max(Integer.parseInt(ccs), 1024); } catch (NumberFormatException e) {}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Connects to the NNTP server and authenticates with the specified parameters.
|
||||
*/
|
||||
@ -114,7 +114,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
socket = new Socket(host, port);
|
||||
in = new CRLFInputStream(new BufferedInputStream(socket.getInputStream()));
|
||||
out = new CRLFOutputStream(new BufferedOutputStream(socket.getOutputStream()));
|
||||
|
||||
|
||||
switch (getResponse()) {
|
||||
case READY:
|
||||
postingAllowed = true;
|
||||
@ -125,7 +125,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
default:
|
||||
throw new MessagingException("unexpected server response: "+response);
|
||||
}
|
||||
|
||||
|
||||
send("MODE READER"); // newsreader extension
|
||||
switch (getResponse()) {
|
||||
case READY:
|
||||
@ -133,9 +133,9 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
case READ_ONLY:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
readNewsrc();
|
||||
|
||||
|
||||
return true;
|
||||
} catch(UnknownHostException e) {
|
||||
throw new MessagingException("unknown host", e);
|
||||
@ -252,7 +252,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
if (current!=null && !current.equals(group)) close(current);
|
||||
group.open = false;
|
||||
}
|
||||
|
||||
|
||||
// Returns the (approximate) number of articles in a newsgroup.
|
||||
synchronized int getMessageCount(Newsgroup group) throws MessagingException {
|
||||
String name = group.getName();
|
||||
@ -317,7 +317,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
throw new MessagingException("I/O error", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Returns the content for an article.
|
||||
synchronized byte[] getContent(Article article) throws MessagingException {
|
||||
String mid = article.messageId;
|
||||
@ -376,7 +376,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
for (int i=0; i<a.length; i++)
|
||||
post(article, a[i]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a Transport that can be used to send articles to this news server.
|
||||
*/
|
||||
@ -802,13 +802,13 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
statusListeners.addElement(l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeStatusListener(StatusListener l) {
|
||||
synchronized (statusListeners) {
|
||||
statusListeners.removeElement(l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void processStatusEvent(StatusEvent event) {
|
||||
StatusListener[] listeners;
|
||||
synchronized (statusListeners) {
|
||||
@ -830,7 +830,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The root holds the newsgroups in an NNTPStore.
|
||||
*/
|
||||
@ -892,7 +892,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
* Returns the permanent flags for this folder.
|
||||
*/
|
||||
public Flags getPermanentFlags() { return new Flags(); }
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of articles in this folder.
|
||||
*/
|
||||
@ -904,7 +904,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
public Message[] getMessages() throws MessagingException {
|
||||
throw new MessagingException("Folder can't contain messages");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the specified message in this folder.
|
||||
* Since NNTP articles are not stored in sequential order,
|
||||
@ -913,7 +913,7 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
public Message getMessage(int msgnum) throws MessagingException {
|
||||
throw new MessagingException("Folder can't contain messages");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Root folder is read-only.
|
||||
*/
|
||||
@ -951,8 +951,8 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
*/
|
||||
public Folder[] listSubscribed() throws MessagingException {
|
||||
Vector groups = new Vector();
|
||||
for (Enumeration enum = newsgroups.elements(); enum.hasMoreElements(); ) {
|
||||
Newsgroup group = (Newsgroup)enum.nextElement();
|
||||
for (Enumeration enumer = newsgroups.elements(); enumer.hasMoreElements(); ) {
|
||||
Newsgroup group = (Newsgroup)enumer.nextElement();
|
||||
if (group.subscribed)
|
||||
groups.addElement(group);
|
||||
}
|
||||
@ -1003,21 +1003,21 @@ public class NNTPStore extends Store implements StatusSource {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class NNTPTransport extends Transport {
|
||||
|
||||
|
||||
NNTPTransport(Session session, URLName urlname) {
|
||||
super(session, urlname);
|
||||
}
|
||||
|
||||
|
||||
public boolean protocolConnect(String host, int port, String user, String password) throws MessagingException {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void sendMessage(Message message, Address[] addresses) throws MessagingException {
|
||||
postArticle(message, addresses);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,11 +26,13 @@
|
||||
package grendel.addressbook;
|
||||
|
||||
import grendel.addressbook.addresscard.*;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.ui.GeneralFrame;
|
||||
import grendel.widgets.*;
|
||||
import grendel.ui.XMLMenuBuilder;
|
||||
import calypso.util.*;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.io.*;
|
||||
@ -43,8 +45,6 @@ import javax.swing.table.*;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
||||
import netscape.ldap.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lester Schueler
|
||||
@ -54,7 +54,7 @@ public class AddressBook extends GeneralFrame {
|
||||
private Hashtable mMenuItems;
|
||||
// private ACS_Personal myLocalAddressBook;
|
||||
|
||||
private MenuBarCtrl mMenuBarCtrl;
|
||||
private JMenuBar mMenuBarCtrl;
|
||||
private GrendelToolBar mTtoolbar;
|
||||
// private Component mStatusbar;
|
||||
private JTable mTable;
|
||||
@ -70,7 +70,7 @@ public class AddressBook extends GeneralFrame {
|
||||
public static void main(String[] args) {
|
||||
AddressBook AddressBookFrame = new AddressBook();
|
||||
AddressBookFrame.addWindowListener(new AppCloser());
|
||||
AddressBookFrame.show();
|
||||
AddressBookFrame.setVisible(true);
|
||||
}
|
||||
|
||||
protected static final class AppCloser extends WindowAdapter {
|
||||
@ -96,75 +96,75 @@ public class AddressBook extends GeneralFrame {
|
||||
public String getReadableName () { return mReadableName; }
|
||||
public Vector query (String aSearchString) {
|
||||
Vector retVecVec = new Vector(); //return vector of vectors.
|
||||
|
||||
|
||||
// try {
|
||||
//open a connection to the LDAP server
|
||||
System.out.println ("Opening server " + mReadableName);
|
||||
ICardSource Four11AddressBook = getCardSource();
|
||||
|
||||
|
||||
|
||||
|
||||
//create the query
|
||||
ITerm query = new TermEqual (new AC_Attribute ("sn", aSearchString));
|
||||
|
||||
|
||||
String[] attributes = {"givenName", "sn", "cn", "o", "mail", "telephoneNumber", "city"};
|
||||
|
||||
|
||||
//query the LDAP server.
|
||||
System.out.println ("Send query" + query);
|
||||
ICardSet cardSet = Four11AddressBook.getCardSet (query, attributes);
|
||||
|
||||
|
||||
//Sort the list.
|
||||
String[] sortOrder = {"sn", "cn"};
|
||||
cardSet.sort (sortOrder);
|
||||
|
||||
|
||||
//hack. I've put the for loop in a try block to catch the exception
|
||||
//thrown when cardEnum.hasMoreElements() incorrectly returns true.
|
||||
try {
|
||||
//enumerate thru the cards.
|
||||
for (Enumeration cardEnum = cardSet.getEnumeration();
|
||||
for (Enumeration cardEnum = cardSet.getEnumeration();
|
||||
cardEnum.hasMoreElements(); ) {
|
||||
System.out.println ("got card");
|
||||
//get the addres card
|
||||
ICard card = (ICard) cardEnum.nextElement();
|
||||
ICard card = (ICard) cardEnum.nextElement();
|
||||
//get the attributes for this card
|
||||
IAttributeSet attrSet = card.getAttributeSet ();
|
||||
IAttributeSet attrSet = card.getAttributeSet ();
|
||||
//create a simple vector to hold the attributes values for this card.
|
||||
Vector thisRow = new Vector(6);
|
||||
|
||||
Vector thisRow = new Vector(6);
|
||||
|
||||
String commonName = "";
|
||||
String organization = "";
|
||||
String mail = "";
|
||||
String phone = "";
|
||||
String city = "";
|
||||
String nickName = "";
|
||||
|
||||
|
||||
// enumerate thru the card attributes.
|
||||
for (Enumeration attEnum = attrSet.getEnumeration();
|
||||
for (Enumeration attEnum = attrSet.getEnumeration();
|
||||
attEnum.hasMoreElements(); ) {
|
||||
IAttribute attr = (IAttribute) attEnum.nextElement();
|
||||
String attrName = attr.getName();
|
||||
|
||||
|
||||
if (attrName.equals ("cn")) {
|
||||
commonName = attr.getValue();
|
||||
}
|
||||
|
||||
|
||||
else if (attrName.equals ("o")) {
|
||||
organization = attr.getValue();
|
||||
}
|
||||
|
||||
|
||||
else if (attrName.equals ("mail")) {
|
||||
mail = attr.getValue();
|
||||
}
|
||||
|
||||
|
||||
else if (attrName.equals ("telephoneNumber")) {
|
||||
phone = attr.getValue();
|
||||
}
|
||||
|
||||
|
||||
else if (attrName.equals ("city")) {
|
||||
city = attr.getValue();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//create this row for the table.
|
||||
thisRow.addElement (commonName);
|
||||
thisRow.addElement (mail);
|
||||
@ -172,7 +172,7 @@ public class AddressBook extends GeneralFrame {
|
||||
thisRow.addElement (phone);
|
||||
thisRow.addElement (city);
|
||||
thisRow.addElement (nickName);
|
||||
|
||||
|
||||
//add this row to the table
|
||||
retVecVec.addElement (thisRow);
|
||||
}
|
||||
@ -183,7 +183,7 @@ public class AddressBook extends GeneralFrame {
|
||||
// catch( LDAPException e ) {
|
||||
// System.out.println( "Error: " + e.toString() );
|
||||
// }
|
||||
|
||||
|
||||
System.out.println ("Done.");
|
||||
return retVecVec;
|
||||
}
|
||||
@ -224,7 +224,7 @@ public class AddressBook extends GeneralFrame {
|
||||
return new ACS_Personal (mFileName, false);
|
||||
}
|
||||
public String getFileName () { return mFileName; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
//***************************
|
||||
@ -270,17 +270,18 @@ public class AddressBook extends GeneralFrame {
|
||||
// FIXME - need to build the menu bar
|
||||
// (Jeff)
|
||||
|
||||
mMenuBarCtrl = buildMenu("menus.xml",defaultActions);
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(defaultActions);
|
||||
mMenuBarCtrl = builder.buildFrom("ui/menus.xml", this);
|
||||
|
||||
JMenuItem aMenuItem = mMenuBarCtrl.getCtrlByName("sortAscending");
|
||||
JMenuItem aMenuItem = (JMenuItem)builder.getElementsAndIDs().get("sortAscending");
|
||||
if (aMenuItem != null) {
|
||||
aMenuItem.setSelected(true);
|
||||
}
|
||||
}
|
||||
|
||||
aMenuItem = mMenuBarCtrl.getCtrlByName("byName");
|
||||
aMenuItem = (JMenuItem)builder.getElementsAndIDs().get("byName");
|
||||
if (aMenuItem != null) {
|
||||
aMenuItem.setSelected(true);
|
||||
}
|
||||
}
|
||||
|
||||
setJMenuBar(mMenuBarCtrl);
|
||||
|
||||
@ -398,7 +399,7 @@ public class AddressBook extends GeneralFrame {
|
||||
public static final String myAddressBookCardTag ="myAddressBookCard";
|
||||
|
||||
// --- action implementations -----------------------------------
|
||||
private UIAction[] defaultActions = {
|
||||
private Event[] defaultActions = {
|
||||
//"File" actions
|
||||
new NewCard(),
|
||||
// new NewList(),
|
||||
@ -442,9 +443,9 @@ public class AddressBook extends GeneralFrame {
|
||||
//-----------------------
|
||||
/**
|
||||
*/
|
||||
class NewCard extends UIAction {
|
||||
class NewCard extends Event {
|
||||
NewCard() {
|
||||
super(newCardTag);
|
||||
super(newCardTag, null);
|
||||
this.setEnabled(true);
|
||||
}
|
||||
|
||||
@ -452,14 +453,14 @@ public class AddressBook extends GeneralFrame {
|
||||
NewCardDialog aDialog = new NewCardDialog(getParentFrame());
|
||||
|
||||
//display the new card dialog
|
||||
aDialog.show ();
|
||||
aDialog.setVisible(true);
|
||||
aDialog.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
class SearchDirectory extends UIAction {
|
||||
class SearchDirectory extends Event {
|
||||
SearchDirectory() {
|
||||
super(searchDirectoryTag);
|
||||
super(searchDirectoryTag, null);
|
||||
this.setEnabled(true);
|
||||
}
|
||||
|
||||
@ -467,13 +468,13 @@ public class AddressBook extends GeneralFrame {
|
||||
SearchDirectoryDialog aDialog = new SearchDirectoryDialog(getParentFrame());
|
||||
|
||||
//display the new card dialog
|
||||
aDialog.show ();
|
||||
aDialog.setVisible(true);
|
||||
aDialog.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class SaveAs extends UIAction {
|
||||
class SaveAs extends Event {
|
||||
SaveAs() {
|
||||
super(saveAsTag);
|
||||
this.setEnabled(true);
|
||||
@ -482,12 +483,12 @@ public class AddressBook extends GeneralFrame {
|
||||
NewCardDialog aDialog = new NewCardDialog(getParentFrame());
|
||||
|
||||
//display the new card dialog
|
||||
aDialog.show ();
|
||||
aDialog.setVisible(true);
|
||||
aDialog.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
class CloseWindow extends UIAction {
|
||||
class CloseWindow extends Event {
|
||||
CloseWindow() {
|
||||
super(closeWindowTag);
|
||||
this.setEnabled(true);
|
||||
@ -506,7 +507,7 @@ public class AddressBook extends GeneralFrame {
|
||||
//-----------------------
|
||||
//"Edit" actions
|
||||
//-----------------------
|
||||
class Undo extends UIAction {
|
||||
class Undo extends Event {
|
||||
Undo() {
|
||||
super(undoTag);
|
||||
this.setEnabled(true);
|
||||
@ -517,7 +518,7 @@ public class AddressBook extends GeneralFrame {
|
||||
//-----------------------
|
||||
//"View" actions
|
||||
//-----------------------
|
||||
class HideMessageToolbar extends UIAction {
|
||||
class HideMessageToolbar extends Event {
|
||||
HideMessageToolbar() {
|
||||
super(hideMessageToolbarTag);
|
||||
this.setEnabled(true);
|
||||
@ -528,7 +529,7 @@ public class AddressBook extends GeneralFrame {
|
||||
|
||||
//-----------------------
|
||||
//-----------------------
|
||||
class Search extends UIAction {
|
||||
class Search extends Event {
|
||||
Search() {
|
||||
super(newListTag);
|
||||
this.setEnabled(true);
|
||||
@ -560,7 +561,7 @@ public class AddressBook extends GeneralFrame {
|
||||
//----------------
|
||||
// Sort Ascending
|
||||
//----------------
|
||||
class SortAscending extends UIAction {
|
||||
class SortAscending extends Event {
|
||||
SortAscending() {
|
||||
super(sortAscendingTag);
|
||||
this.setEnabled(true);
|
||||
@ -584,7 +585,7 @@ public class AddressBook extends GeneralFrame {
|
||||
//----------------
|
||||
// Sort Descending
|
||||
//----------------
|
||||
class SortDescending extends UIAction {
|
||||
class SortDescending extends Event {
|
||||
SortDescending() {
|
||||
super(sortDescendingTag);
|
||||
this.setEnabled(true);
|
||||
@ -608,7 +609,7 @@ public class AddressBook extends GeneralFrame {
|
||||
//----------------------------------
|
||||
// Base class for sorting the names
|
||||
//----------------------------------
|
||||
class ResultSorter extends UIAction {
|
||||
class ResultSorter extends Event {
|
||||
String myLocalColumnName;
|
||||
ResultSorter(String Tag){
|
||||
super(Tag);
|
||||
@ -712,8 +713,8 @@ public class AddressBook extends GeneralFrame {
|
||||
* @param aToolTip The buttons tool tip. like "Save the current file".
|
||||
* @see createToolbar
|
||||
*/
|
||||
public void addToolbarButton(GrendelToolBar aToolBar,
|
||||
UIAction aActionListener,
|
||||
public void addToolbarButton(GrendelToolBar aToolBar,
|
||||
Event aActionListener,
|
||||
String aImageName, String aToolTip) {
|
||||
JButton b = new JButton();
|
||||
|
||||
@ -747,7 +748,7 @@ public class AddressBook extends GeneralFrame {
|
||||
// b.setPad(new Insets(3,3,3,3));
|
||||
if (aActionListener != null) {
|
||||
b.addActionListener(aActionListener);}
|
||||
|
||||
|
||||
aToolBar.add(b);
|
||||
}
|
||||
|
||||
@ -760,7 +761,7 @@ public class AddressBook extends GeneralFrame {
|
||||
|
||||
/* This function is now obsolete, the responsible for querying is now
|
||||
** the datasource, so that we can create other types of datasources (files!)
|
||||
public Vector queryLDAP (String aServerName, int aPort,
|
||||
public Vector queryLDAP (String aServerName, int aPort,
|
||||
String aSearchString) {
|
||||
|
||||
Vector retVecVec = new Vector(); //return vector of vectors.
|
||||
@ -788,15 +789,15 @@ public class AddressBook extends GeneralFrame {
|
||||
//thrown when cardEnum.hasMoreElements() incorrectly returns true.
|
||||
try {
|
||||
//enumerate thru the cards.
|
||||
for (Enumeration cardEnum = cardSet.getEnumeration();
|
||||
for (Enumeration cardEnum = cardSet.getEnumeration();
|
||||
cardEnum.hasMoreElements(); ) {
|
||||
System.out.println ("got card");
|
||||
//get the addres card
|
||||
ICard card = (ICard) cardEnum.nextElement();
|
||||
ICard card = (ICard) cardEnum.nextElement();
|
||||
//get the attributes for this card
|
||||
IAttributeSet attrSet = card.getAttributeSet ();
|
||||
IAttributeSet attrSet = card.getAttributeSet ();
|
||||
//create a simple vector to hold the attributes values for this card.
|
||||
Vector thisRow = new Vector(6);
|
||||
Vector thisRow = new Vector(6);
|
||||
|
||||
String commonName = "";
|
||||
String organization = "";
|
||||
@ -804,7 +805,7 @@ public class AddressBook extends GeneralFrame {
|
||||
String phone = "";
|
||||
String city = "";
|
||||
String nickName = "";
|
||||
|
||||
|
||||
// enumerate thru the card attributes.
|
||||
for (Enumeration attEnum = attrSet.getEnumeration();
|
||||
attEnum.hasMoreElements(); ) {
|
||||
@ -884,7 +885,7 @@ public class AddressBook extends GeneralFrame {
|
||||
/* This method is now obsolete, since I moved the query function
|
||||
** from the AddressBook to the datasource
|
||||
**
|
||||
public void reloadData (String aServerName, int aPort,
|
||||
public void reloadData (String aServerName, int aPort,
|
||||
String aSearchString) {
|
||||
//reload the data from LDAP.
|
||||
mVecVec = queryLDAP (aServerName, aPort, aSearchString);
|
||||
@ -981,55 +982,55 @@ public class AddressBook extends GeneralFrame {
|
||||
/**
|
||||
*/
|
||||
class AddressPanel extends JPanel {
|
||||
|
||||
|
||||
public AddressPanel(DataSourceList aDataSourceList) {
|
||||
//super(true);
|
||||
|
||||
|
||||
setBorder (new EmptyBorder(10,10,10,10));
|
||||
this.setLayout (new BorderLayout(10, 5));
|
||||
|
||||
|
||||
add(createSearchPane(aDataSourceList), BorderLayout.NORTH);
|
||||
add(createTable(), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
|
||||
private Box createSearchPane (DataSourceList aDataSourceList) {
|
||||
//explaination
|
||||
JLabel explaination = new JLabel ("Type in the name you're looking for:");
|
||||
explaination.setAlignmentX((float)0.0); //align left
|
||||
|
||||
|
||||
//text field
|
||||
mSearchField = new JTextField (20);
|
||||
mSearchField.setAlignmentX((float)0.0); //align left
|
||||
|
||||
|
||||
//box for explain and text field
|
||||
Box innerBoxPane = new Box (BoxLayout.Y_AXIS);
|
||||
// innerBoxPane.setAlignmentY((float)0.0); //align to bottom
|
||||
innerBoxPane.add (explaination);
|
||||
innerBoxPane.add (mSearchField);
|
||||
|
||||
|
||||
//drop down combo box
|
||||
mSearchSource = new JComboBox();
|
||||
mSearchSource.setAlignmentY((float)0.0); //align to bottom
|
||||
for (Enumeration e = aDataSourceList.getEnumeration() ;
|
||||
for (Enumeration e = aDataSourceList.getEnumeration() ;
|
||||
e.hasMoreElements() ;) {
|
||||
DataSource ds = (DataSource) e.nextElement();
|
||||
mSearchSource.addItem(ds.getReadableName());
|
||||
}
|
||||
|
||||
|
||||
//label
|
||||
JLabel lbl = new JLabel ("in:");
|
||||
lbl.setAlignmentY((float)0.0); //align to bottom
|
||||
|
||||
|
||||
//search button
|
||||
mSearchButton = new JButton ("Search");
|
||||
mSearchButton.addActionListener(new Search());
|
||||
mSearchButton.setAlignmentY((float)0.0); //align to bottom
|
||||
|
||||
|
||||
Dimension spacer = new Dimension (10, 10);
|
||||
|
||||
|
||||
//assemble all the pieces together.
|
||||
Box boxPane = new Box (BoxLayout.X_AXIS);
|
||||
|
||||
|
||||
boxPane.add (innerBoxPane); //explaination and text field
|
||||
boxPane.add (Box.createRigidArea(spacer)); //spacer
|
||||
boxPane.add (lbl); //"in:" label
|
||||
@ -1037,10 +1038,10 @@ public class AddressBook extends GeneralFrame {
|
||||
boxPane.add (mSearchSource); //drop down combo box
|
||||
boxPane.add (Box.createRigidArea(spacer)); //spacer
|
||||
boxPane.add (mSearchButton); //search buttton
|
||||
|
||||
|
||||
return boxPane;
|
||||
}
|
||||
|
||||
|
||||
private JScrollPane createTable () {
|
||||
String[] columnNames = {
|
||||
"Name",
|
||||
@ -1049,52 +1050,52 @@ public class AddressBook extends GeneralFrame {
|
||||
"Phone",
|
||||
"City",
|
||||
"Nickname"};
|
||||
|
||||
|
||||
//create the data model.
|
||||
DataModel dm = new DataModel (columnNames);
|
||||
|
||||
|
||||
//create the table.
|
||||
mTable = new JTable(dm);
|
||||
|
||||
|
||||
// mTable.setAutoCreateColumnsFromModel(false);
|
||||
|
||||
|
||||
// Add our columns into the column model
|
||||
// for (int columnIndex = 0; columnIndex < columnNames.length; columnIndex++){
|
||||
// Create a column object for each column of data
|
||||
// TableColumn newColumn = new TableColumn(columnNames[columnIndex]);
|
||||
|
||||
|
||||
// Set a tool tip for the column header cell
|
||||
// TableCellRenderer renderer2 = newColumn.getHeaderRenderer();
|
||||
// if (renderer2 instanceof DefaultCellRenderer)
|
||||
// ((DefaultCellRenderer)renderer2).setToolTipText(columnNames[columnIndex]);
|
||||
|
||||
|
||||
// newColumn.setWidth(200);
|
||||
// mTable.addColumn(newColumn);
|
||||
// }
|
||||
|
||||
|
||||
//no selection, no grid.
|
||||
mTable.setColumnSelectionAllowed(false);
|
||||
mTable.setShowGrid(false);
|
||||
|
||||
|
||||
// Put the table and header into a scrollPane
|
||||
JScrollPane scrollpane = new JScrollPane(mTable);
|
||||
// JTableHeader tableHeader = mTable.getTableHeader();
|
||||
|
||||
|
||||
// create and add the column heading to the scrollpane's
|
||||
// column header viewport
|
||||
// JViewport headerViewport = new JViewport();
|
||||
// headerViewport.setLayout(new BoxLayout(headerViewport, BoxLayout.X_AXIS));
|
||||
// headerViewport.add(tableHeader);
|
||||
// scrollpane.setColumnHeader(headerViewport);
|
||||
|
||||
|
||||
// add the table to the viewport
|
||||
/// JViewport mainViewPort = scrollpane.getViewport();
|
||||
// mainViewPort.add(mTable);
|
||||
// mainViewPort.setBackground (Color.white);
|
||||
|
||||
|
||||
// speed up resizing repaints by turning off live cell updates
|
||||
// tableHeader.setUpdateTableInRealTime(false);
|
||||
|
||||
|
||||
//return the JScrollPane with the table in it.
|
||||
return scrollpane;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Lester Schueler <lesters@netscape.com>, 14 Nov 1997.
|
||||
*
|
||||
@ -77,7 +77,7 @@ public class ACS_Personal implements ICardSource, IQuerySet {
|
||||
|
||||
try {
|
||||
//write the new value out to the DB.
|
||||
fDB.assert ("Control", "NextCardID", nextCardStrID);
|
||||
fDB.addassert ("Control", "NextCardID", nextCardStrID);
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ public class ACS_Personal implements ICardSource, IQuerySet {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* No-op implementations for now (just to get this building properly)
|
||||
* (Jeff)
|
||||
*/
|
||||
@ -148,16 +148,16 @@ public class ACS_Personal implements ICardSource, IQuerySet {
|
||||
aCard.setID (thisCardID);
|
||||
|
||||
//get the set of attributes and enumerate thruough them.
|
||||
AddressCardAttributeSet attrSet =
|
||||
AddressCardAttributeSet attrSet =
|
||||
(AddressCardAttributeSet)aCard.getAttributeSet();
|
||||
|
||||
for (Enumeration enum = attrSet.elements (); enum.hasMoreElements(); ) {
|
||||
for (Enumeration enumer = attrSet.elements (); enumer.hasMoreElements(); ) {
|
||||
//get the next attribute
|
||||
AddressCardAttribute attr = (AddressCardAttribute) enum.nextElement ();
|
||||
AddressCardAttribute attr = (AddressCardAttribute) enumer.nextElement ();
|
||||
|
||||
//write the attribute to the DB
|
||||
try {
|
||||
fDB.assert (thisCardID, attr.getName(), attr.getValue());
|
||||
fDB.addassert (thisCardID, attr.getName(), attr.getValue());
|
||||
} catch (IOException ioe) {}
|
||||
}
|
||||
}
|
||||
@ -165,8 +165,8 @@ public class ACS_Personal implements ICardSource, IQuerySet {
|
||||
/** Add a set of cards to this addressbook.
|
||||
*/
|
||||
public void add (AddressCardSet aCardSet, boolean OverWrite) {
|
||||
for (Enumeration enum = aCardSet.getCardEnumeration (); enum.hasMoreElements() ;) {
|
||||
AddressCard card = (AddressCard) enum.nextElement();
|
||||
for (Enumeration enumer = aCardSet.getCardEnumeration (); enumer.hasMoreElements() ;) {
|
||||
AddressCard card = (AddressCard) enumer.nextElement();
|
||||
add (card, OverWrite);
|
||||
}
|
||||
}
|
||||
@ -196,8 +196,8 @@ public class ACS_Personal implements ICardSource, IQuerySet {
|
||||
|
||||
if (null != ACA) {
|
||||
try { //the RDFish DB returns an enumeration of a matching card ID's
|
||||
for (Enumeration enum = fDB.findAll(ACA.getName(), ACA.getValue (), false); enum.hasMoreElements() ;) {
|
||||
retIDSet.addElement (enum.nextElement());
|
||||
for (Enumeration enumer = fDB.findAll(ACA.getName(), ACA.getValue (), false); enumer.hasMoreElements() ;) {
|
||||
retIDSet.addElement (enumer.nextElement());
|
||||
}
|
||||
} catch (IOException exc) {
|
||||
exc.printStackTrace();
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Jeff Galyan. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Jeff Galyan <talisman@anamorphic.com>, 16 Jan 1999
|
||||
*/
|
||||
@ -59,8 +59,8 @@ public class AddressCardSet implements ICardSet {
|
||||
}
|
||||
|
||||
public void sort(String[] anAttributeArray) {
|
||||
Enumeration enum = getEnumeration();
|
||||
while (enum.hasMoreElements()) {
|
||||
Enumeration enumer = getEnumeration();
|
||||
while (enumer.hasMoreElements()) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Lester Schueler <lesters@netscape.com>, 14 Nov 1997.
|
||||
*
|
||||
@ -133,10 +133,10 @@ public class LDAP_Server implements ICardSource, IQueryString {
|
||||
LDAPAttributeSet LDAP_attrSet = new LDAPAttributeSet(); //To LDAP
|
||||
|
||||
//enumerate thru each attribute and translate from CA attributes into LDAP attributes.
|
||||
for (Enumeration enum = AC_attrSet.getEnumeration(); enum.hasMoreElements() ;) {
|
||||
for (Enumeration enumer = AC_attrSet.getEnumeration(); enumer.hasMoreElements() ;) {
|
||||
|
||||
//Get the old
|
||||
IAttribute AC_attr = (IAttribute) enum.nextElement();
|
||||
IAttribute AC_attr = (IAttribute) enumer.nextElement();
|
||||
//Create the new
|
||||
LDAPAttribute LDAP_attr = new LDAPAttribute(AC_attr.getName(), AC_attr.getValue());
|
||||
|
||||
@ -221,8 +221,8 @@ public class LDAP_Server implements ICardSource, IQueryString {
|
||||
LDAPModificationSet LDAP_modSet = new LDAPModificationSet();
|
||||
|
||||
//enumerate thru each attribute
|
||||
for (Enumeration enum = AC_attrSet.getEnumeration() ; enum.hasMoreElements() ;) {
|
||||
IAttribute AC_attr = (IAttribute) enum.nextElement();
|
||||
for (Enumeration enumer = AC_attrSet.getEnumeration() ; enumer.hasMoreElements() ;) {
|
||||
IAttribute AC_attr = (IAttribute) enumer.nextElement();
|
||||
int LDAP_mod = 0;
|
||||
boolean attributeModified = false;
|
||||
|
||||
|
@ -78,10 +78,10 @@ class AddressDialog extends Dialog implements ActionListener {
|
||||
frame.setBackground(Color.lightGray);
|
||||
|
||||
AddressDialog aDialog = new AddressDialog(frame);
|
||||
aDialog.show ();
|
||||
aDialog.setVisible(true);
|
||||
aDialog.dispose();
|
||||
|
||||
frame.show();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -534,7 +534,7 @@ public class AddressList extends JScrollPane implements Serializable {
|
||||
|
||||
//create image icon for drag and drop.
|
||||
|
||||
mIcon = new ImageIcon(getClass().getResource("images/card.gif"));
|
||||
mIcon = new ImageIcon("composition/images/card.gif");
|
||||
}
|
||||
|
||||
public void paint (Graphics g) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
package grendel.composition;
|
||||
@ -74,7 +74,7 @@ public class AttachmentsListBeanInfo extends SimpleBeanInfo {
|
||||
|
||||
//showDialog requests that the AddressList display its file dialog.
|
||||
//public void showDialog () {
|
||||
mthd = beanClass.getMethod ("showDialog", null);
|
||||
mthd = beanClass.getMethod("showDialog");
|
||||
MethodDescriptor showDialogDesc = new MethodDescriptor (mthd);
|
||||
showDialogDesc.setShortDescription ("Displays the file dialog");
|
||||
|
||||
@ -91,7 +91,7 @@ public class AttachmentsListBeanInfo extends SimpleBeanInfo {
|
||||
|
||||
//Delets all attachments from the list.
|
||||
//public void removeAllAttachments () {
|
||||
mthd = beanClass.getMethod ("removeAllAttachments", null);
|
||||
mthd = beanClass.getMethod ("removeAllAttachments");
|
||||
MethodDescriptor removeAllAttachmentsDesc = new MethodDescriptor (mthd);
|
||||
removeAllAttachmentsDesc.setShortDescription ("Delets all attachments from the list");
|
||||
|
||||
|
@ -42,6 +42,7 @@ import grendel.widgets.GrendelToolBar;
|
||||
import grendel.ui.FolderPanel;
|
||||
import grendel.ui.GeneralFrame;
|
||||
import grendel.ui.StoreFactory;
|
||||
import grendel.ui.XMLMenuBuilder;
|
||||
|
||||
import javax.mail.Address;
|
||||
import javax.mail.Message;
|
||||
@ -87,8 +88,8 @@ public class Composition extends GeneralFrame {
|
||||
//create menubar (top)
|
||||
// fMenu = buildMenu("mainMenubar",
|
||||
// mCompositionPanel.getActions());
|
||||
fMenu = buildMenu("menus.xml",
|
||||
mCompositionPanel.getActions());
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(mCompositionPanel.getActions());
|
||||
fMenu = builder.buildFrom("ui/menus.xml", (JFrame)this);
|
||||
|
||||
getRootPane().setJMenuBar(fMenu);
|
||||
|
||||
@ -122,12 +123,14 @@ public class Composition extends GeneralFrame {
|
||||
fPanel.add(BorderLayout.NORTH, mBox);
|
||||
fStatusBar = buildStatusBar();
|
||||
fPanel.add(BorderLayout.SOUTH, fStatusBar);
|
||||
|
||||
|
||||
fPanel.add(mCompositionPanel);
|
||||
|
||||
restoreBounds();
|
||||
|
||||
|
||||
restoreBounds();
|
||||
|
||||
mCompositionPanel.AddSignature();
|
||||
|
||||
setSize(670, 490);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
@ -194,7 +197,7 @@ public class Composition extends GeneralFrame {
|
||||
mCompositionPanel.QuoteOriginalMessage();
|
||||
}
|
||||
|
||||
/** Initialize the headers and body of this composition
|
||||
/** Initialize the headers and body of this composition
|
||||
as being a message that is forwarded 'quoted'. */
|
||||
public void initializeAsForward(Message msg, int aScope) {
|
||||
mCompositionPanel.setReferredMessage(msg);
|
||||
@ -213,7 +216,7 @@ public class Composition extends GeneralFrame {
|
||||
if (aScope == FolderPanel.kInline) {
|
||||
mCompositionPanel.InlineOriginalMessage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class PanelListener implements CompositionPanelListener {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 20 Oct 1997.
|
||||
*
|
||||
@ -89,10 +89,11 @@ import grendel.storage.MessageExtra;
|
||||
import grendel.storage.MessageExtraFactory;
|
||||
import grendel.ui.ActionFactory;
|
||||
import grendel.ui.GeneralPanel;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.widgets.CollapsiblePanel;
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class CompositionPanel extends GeneralPanel {
|
||||
private Hashtable mCommands;
|
||||
private Hashtable mMenuItems;
|
||||
@ -150,7 +151,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* of actions supported by the embedded JTextComponent
|
||||
* augmented with the actions defined locally.
|
||||
*/
|
||||
public UIAction[] getActions() {
|
||||
public Event[] getActions() {
|
||||
return defaultActions;
|
||||
// XXX WHS need to translate Actions to UICmds
|
||||
// return TextAction.augmentList(mEditor.getActions(), defaultActions);
|
||||
@ -187,7 +188,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
public void addCompositionPanelListener(CompositionPanelListener l) {
|
||||
mListeners.add(CompositionPanelListener.class, l);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a CompositionPanelListener
|
||||
*/
|
||||
@ -199,7 +200,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
/**
|
||||
* Quote the orgininal message in a reply
|
||||
*/
|
||||
|
||||
|
||||
public void QuoteOriginalMessage() {
|
||||
QuoteOriginalText qot = new QuoteOriginalText();
|
||||
qot.actionPerformed(new ActionEvent(this,0,""));
|
||||
@ -208,7 +209,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
/**
|
||||
* Inline the orgininal message when forwarding
|
||||
*/
|
||||
|
||||
|
||||
public void InlineOriginalMessage() {
|
||||
InlineOriginalText iot = new InlineOriginalText();
|
||||
iot.actionPerformed(new ActionEvent(this,0,""));
|
||||
@ -217,7 +218,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
/**
|
||||
* Add a signature
|
||||
*/
|
||||
|
||||
|
||||
public void AddSignature() {
|
||||
AddSignatureAction asa = new AddSignatureAction();
|
||||
asa.actionPerformed(new ActionEvent(this,0,""));
|
||||
@ -316,11 +317,11 @@ public class CompositionPanel extends GeneralPanel {
|
||||
public static final String viewAttachmentsTag ="viewAttachments";
|
||||
public static final String viewOptionsTag ="viewOptions";
|
||||
public static final String wrapLongLinesTag ="wrapLongLines";
|
||||
|
||||
|
||||
|
||||
|
||||
// --- action implementations -----------------------------------
|
||||
private UIAction[] defaultActions = {
|
||||
private Event[] defaultActions = {
|
||||
//"File" actions
|
||||
// new SaveDraft(),
|
||||
new SaveAs(),
|
||||
@ -370,7 +371,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* Try to save the message to the "draft" mailbox.
|
||||
* @see SaveAs
|
||||
*/
|
||||
class SaveDraft extends UIAction {
|
||||
class SaveDraft extends Event {
|
||||
SaveDraft() {
|
||||
super(saveDraftTag);
|
||||
this.setEnabled(true);
|
||||
@ -382,7 +383,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* Try to save the message to a text file.
|
||||
* @see SaveDraft
|
||||
*/
|
||||
class SaveAs extends UIAction {
|
||||
class SaveAs extends Event {
|
||||
SaveAs() {
|
||||
super(saveAsTag);
|
||||
this.setEnabled(true);
|
||||
@ -391,7 +392,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FileDialog fileDialog = new FileDialog (getParentFrame(), "Save As", FileDialog.SAVE);
|
||||
fileDialog.setFile("untitled.txt");
|
||||
fileDialog.show(); //blocks
|
||||
fileDialog.setVisible(true); //blocks
|
||||
|
||||
String fileName = fileDialog.getFile();
|
||||
//check for canel
|
||||
@ -420,7 +421,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
/**
|
||||
* Send the mail message now.
|
||||
*/
|
||||
class SendNow extends UIAction {
|
||||
class SendNow extends Event {
|
||||
SendNow() {
|
||||
super(sendNowTag);
|
||||
this.setEnabled(true);
|
||||
@ -462,7 +463,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
try {
|
||||
IdentityStructure ident = IdentityArray.GetMaster().get(
|
||||
mAddressBar.getOptionsPanel().getSelectedIdentity());
|
||||
|
||||
|
||||
//set who's sending this message.
|
||||
msg.setFrom (new InternetAddress(ident.getEMail(), ident.getName()));
|
||||
|
||||
@ -492,7 +493,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
msg.setSubject(mSubject.getText()); //set subject from text
|
||||
//field.
|
||||
msg.setHeader("X-Mailer", "Grendel [development version]");
|
||||
//and proud of it!
|
||||
//and proud of it!
|
||||
msg.setSentDate(new java.util.Date()); //set date to now.
|
||||
|
||||
String [] attachments = mAttachmentsList.getAttachments();
|
||||
@ -500,7 +501,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
msg.setContent(messageText, "text/plain"); //contents.
|
||||
} else {
|
||||
MimeMultipart multi = new MimeMultipart();
|
||||
|
||||
|
||||
MimeBodyPart mainText = new MimeBodyPart();
|
||||
mainText.setText(messageText);
|
||||
multi.addBodyPart(mainText);
|
||||
@ -530,7 +531,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
encName = "base64";
|
||||
}
|
||||
|
||||
att.setText(new String(bs));
|
||||
att.setText(new String(bs));
|
||||
att.setHeader("Content-Type", mimeString);
|
||||
att.setHeader("Content-Transfer-Encoding", encName);
|
||||
att.setFileName(new File(attachments[i]).getName());
|
||||
@ -553,7 +554,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
} catch (MessagingException exc) {
|
||||
exc.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
success = true;
|
||||
} catch (javax.mail.SendFailedException sex) {
|
||||
sex.printStackTrace();
|
||||
@ -584,7 +585,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* Quote the original text message into the editor.
|
||||
* @see PasteAsQuotation
|
||||
*/
|
||||
class QuoteOriginalText extends UIAction {
|
||||
class QuoteOriginalText extends Event {
|
||||
QuoteOriginalText() {
|
||||
super(quoteOriginalTextTag);
|
||||
this.setEnabled(true);
|
||||
@ -669,7 +670,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* Inline the original text message into the editor.
|
||||
* @see QuoteOriginalText
|
||||
*/
|
||||
class InlineOriginalText extends UIAction {
|
||||
class InlineOriginalText extends Event {
|
||||
InlineOriginalText() {
|
||||
super(inlineOriginalTextTag);
|
||||
this.setEnabled(true);
|
||||
@ -762,7 +763,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
/**
|
||||
* Add a signature
|
||||
*/
|
||||
class AddSignatureAction extends UIAction {
|
||||
class AddSignatureAction extends Event {
|
||||
AddSignatureAction() {
|
||||
super(addSignatureTag);
|
||||
this.setEnabled(true);
|
||||
@ -771,7 +772,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
|
||||
Document doc = mEditor.getDocument();
|
||||
int oldPosition = mEditor.getCaretPosition();
|
||||
|
||||
|
||||
//remove the old signature
|
||||
for (int i=0; i<doc.getLength()-4;i++) {
|
||||
try {
|
||||
@ -784,10 +785,10 @@ public class CompositionPanel extends GeneralPanel {
|
||||
ble.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//the signature will be added at the end
|
||||
int position = doc.getEndPosition().getOffset() - 1;
|
||||
|
||||
|
||||
//compose the string including the separator
|
||||
String s = "\n-- \n";
|
||||
int ident = mAddressBar.getOptionsPanel().getSelectedIdentity();
|
||||
@ -801,13 +802,13 @@ public class CompositionPanel extends GeneralPanel {
|
||||
ble.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mEditor.setCaretPosition(oldPosition);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class SelectAddresses extends UIAction {
|
||||
class SelectAddresses extends Event {
|
||||
SelectAddresses() {
|
||||
super(selectAddressesTag);
|
||||
this.setEnabled(true);
|
||||
@ -822,7 +823,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
|
||||
//display the addressee dialog
|
||||
aDialog.setAddresses (mAddresses); //initialize the dialog
|
||||
aDialog.show (); //blocks
|
||||
aDialog.setVisible (true); //blocks
|
||||
|
||||
if (false == aDialog.getCanceled()) {
|
||||
//get the addresses from dialog
|
||||
@ -843,7 +844,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
//-----------------------
|
||||
// "file->attach" actions
|
||||
//-----------------------
|
||||
class AttachFile extends UIAction {
|
||||
class AttachFile extends Event {
|
||||
AttachFile() {
|
||||
super(fileTag);
|
||||
this.setEnabled(true);
|
||||
@ -864,7 +865,7 @@ public class CompositionPanel extends GeneralPanel {
|
||||
* Quote and paste whatever string that's on the clipboard into the editor.
|
||||
* @see QuoteOriginalText
|
||||
*/
|
||||
class PasteAsQuotation extends UIAction {
|
||||
class PasteAsQuotation extends Event {
|
||||
PasteAsQuotation() {
|
||||
super(pasteAsQuotationTag);
|
||||
this.setEnabled(true);
|
||||
|
@ -50,7 +50,7 @@ class CompositionTest extends JPanel implements ActionListener {
|
||||
frame.add (new CompositionTest(), BorderLayout.CENTER);
|
||||
//frame.setSize(450, 200);
|
||||
frame.pack();
|
||||
frame.show();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,7 +101,7 @@ class CompositionTest extends JPanel implements ActionListener {
|
||||
//This is where the compsiton editor is started.
|
||||
Composition CompFrame = new Composition();
|
||||
CompFrame.pack();
|
||||
CompFrame.show();
|
||||
CompFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Class FilterMaster.
|
||||
*
|
||||
@ -193,7 +193,9 @@ public class FilterMaster extends Object {
|
||||
public Folder getFolder(String name) {
|
||||
Session session = StoreFactory.Instance().getSession();
|
||||
// ### Definitely wrong:
|
||||
Store store = BerkeleyStore.GetDefaultStore(session);
|
||||
//XXXrlk: WARNING, DANGEROUS, BAD, GUARANTEED CRASH HERE
|
||||
// temporary change to make Grendel compile
|
||||
Store store = null;
|
||||
Folder folder;
|
||||
|
||||
try {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 16 Oct 1997.
|
||||
*
|
||||
@ -180,7 +180,9 @@ public class MailServerPrefsEditor implements PropertyEditor
|
||||
fHostListModel = new HostListModel();
|
||||
|
||||
URL url = getClass().getResource("PrefDialogs.xml");
|
||||
fPanel = new PageUI(url, "id", "serverPrefs", fModel, getClass());
|
||||
//XXXrlk: why does this constructor have parameters?
|
||||
// fPanel = new PageUI(url, "id", "serverPrefs", fModel, getClass());
|
||||
fPanel = new PageUI();
|
||||
|
||||
JComponent c;
|
||||
ChangeAction ca = new ChangeAction();
|
||||
@ -193,7 +195,7 @@ public class MailServerPrefsEditor implements PropertyEditor
|
||||
|
||||
c = fPanel.getCtrlByName(kMailDirectoryKey);
|
||||
c.addPropertyChangeListener(ca);
|
||||
|
||||
|
||||
c = fPanel.getCtrlByName(kChooseKey);
|
||||
c.addPropertyChangeListener(ca);
|
||||
|
||||
@ -274,7 +276,7 @@ public class MailServerPrefsEditor implements PropertyEditor
|
||||
fListeners.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
class ListListener
|
||||
class ListListener
|
||||
implements ListSelectionListener {
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
System.out.println("foo");
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 23 Dec 1997.
|
||||
*
|
||||
@ -85,7 +85,9 @@ public class UIPrefsEditor extends JPanel
|
||||
|
||||
// XMLNode root = null;
|
||||
URL url = getClass().getResource("PrefDialogs.xml");
|
||||
fPanel = new PageUI(url, "id", "UIPrefs", fModel, getClass());
|
||||
//XXXrlk: why does this constructor have parameters?
|
||||
// fPanel = new PageUI(url, "id", "UIPrefs", fModel, getClass());
|
||||
fPanel = new PageUI();
|
||||
|
||||
JComponent c;
|
||||
ChangeAction ca = new ChangeAction();
|
||||
@ -120,7 +122,7 @@ public class UIPrefsEditor extends JPanel
|
||||
String str = (String)l.getSelectedValue();
|
||||
|
||||
// sigh. we now search for the LAF
|
||||
UIManager.LookAndFeelInfo[] info =
|
||||
UIManager.LookAndFeelInfo[] info =
|
||||
UIManager.getInstalledLookAndFeels();
|
||||
LookAndFeel lf = null;
|
||||
|
||||
@ -191,7 +193,7 @@ public class UIPrefsEditor extends JPanel
|
||||
LookAndFeel fLAFs[] = null;
|
||||
|
||||
LAFListModel() {
|
||||
UIManager.LookAndFeelInfo[] info =
|
||||
UIManager.LookAndFeelInfo[] info =
|
||||
UIManager.getInstalledLookAndFeels();
|
||||
fLAFs = new LookAndFeel[info.length];
|
||||
for (int i = 0; i < info.length; i++) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 16 Oct 1997.
|
||||
*
|
||||
@ -62,7 +62,7 @@ import grendel.ui.XMLPageBuilder;
|
||||
import grendel.ui.PageModel;
|
||||
import grendel.ui.PageUI;
|
||||
|
||||
public class UserPrefsEditor
|
||||
public class UserPrefsEditor
|
||||
implements PropertyEditor {
|
||||
UserPrefs fPrefs = new UserPrefs();
|
||||
PropertyChangeSupport fListeners = new PropertyChangeSupport(this);
|
||||
@ -114,7 +114,9 @@ public class UserPrefsEditor
|
||||
public UserPrefsEditor() {
|
||||
fModel = new UserPrefsModel();
|
||||
URL url = getClass().getResource("PrefDialogs.xml");
|
||||
fPanel = new PageUI(url, "id", "userPrefs", fModel, getClass());
|
||||
//XXXrlk: why does this constructor have parameters?
|
||||
// fPanel = new PageUI(url, "id", "userPrefs", fModel, getClass());
|
||||
fPanel = new PageUI();
|
||||
|
||||
ChangeAction ca = new ChangeAction();
|
||||
JComponent c;
|
||||
|
@ -12,12 +12,12 @@
|
||||
*
|
||||
* The Original Code is the Grendel mail/news client.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Edwin Woudt
|
||||
* The Initial Developer of the Original Code is Edwin Woudt
|
||||
* <edwin@woudt.nl>. Portions created by Edwin Woudt are
|
||||
* Copyright (C) 1999 Edwin Woudt. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
package grendel.prefs.ui;
|
||||
@ -51,18 +51,18 @@ public class General extends JFrame {
|
||||
GeneralPrefs prefs = GeneralPrefs.GetMaster();
|
||||
|
||||
JTextField tfSMTP;
|
||||
|
||||
|
||||
public static void main(String argv[]) {
|
||||
|
||||
|
||||
General ui = new General();
|
||||
ui.show();
|
||||
|
||||
ui.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public General() {
|
||||
|
||||
|
||||
super();
|
||||
|
||||
|
||||
setSize(500,354);
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
getContentPane().setLayout(null);
|
||||
@ -88,37 +88,37 @@ public class General extends JFrame {
|
||||
|
||||
getData();
|
||||
}
|
||||
|
||||
|
||||
void getData() {
|
||||
tfSMTP.setText(prefs.getSMTPServer());
|
||||
}
|
||||
|
||||
|
||||
void setData() {
|
||||
prefs.setSMTPServer(tfSMTP.getText());
|
||||
}
|
||||
|
||||
|
||||
class FinishActionListener implements ActionListener {
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
|
||||
setData();
|
||||
prefs.writePrefs();
|
||||
hide();
|
||||
setVisible(false);
|
||||
dispose();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CancelActionListener implements ActionListener {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
hide();
|
||||
dispose();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class CancelActionListener implements ActionListener {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
setVisible(false);
|
||||
dispose();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,12 +12,12 @@
|
||||
*
|
||||
* The Original Code is the Grendel mail/news client.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Edwin Woudt
|
||||
* The Initial Developer of the Original Code is Edwin Woudt
|
||||
* <edwin@woudt.nl>. Portions created by Edwin Woudt are
|
||||
* Copyright (C) 1999 Edwin Woudt. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
package grendel.prefs.ui;
|
||||
@ -51,7 +51,7 @@ import grendel.prefs.base.IdentityStructure;
|
||||
|
||||
|
||||
public class Identities extends JFrame {
|
||||
|
||||
|
||||
JList list;
|
||||
JTextField tfDesc;
|
||||
JTextField tfName;
|
||||
@ -59,28 +59,28 @@ public class Identities extends JFrame {
|
||||
JTextField tfReply;
|
||||
JTextField tfOrg;
|
||||
JTextArea taSig;
|
||||
|
||||
|
||||
IdentityArray ida;
|
||||
IdentityListModel ilm;
|
||||
int currentSelection = -1;
|
||||
|
||||
|
||||
public static void main(String argv[]) {
|
||||
|
||||
|
||||
Identities ident = new Identities();
|
||||
ident.show();
|
||||
|
||||
ident.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Identities() {
|
||||
|
||||
|
||||
super();
|
||||
|
||||
|
||||
ida = IdentityArray.GetMaster();
|
||||
|
||||
setSize(500,354);
|
||||
getContentPane().setLayout(null);
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
|
||||
|
||||
ilm = new IdentityListModel();
|
||||
list = new JList(ilm);
|
||||
list.setSelectedIndex(0);
|
||||
@ -88,7 +88,7 @@ public class Identities extends JFrame {
|
||||
list.setBounds(12,12,142,306);
|
||||
list.addListSelectionListener(new SelectionChangedListener());
|
||||
getContentPane().add(list);
|
||||
|
||||
|
||||
JLabel label = new JLabel("Description");
|
||||
label.setBounds(174,12,label.getPreferredSize().width,label.getPreferredSize().height);
|
||||
getContentPane().add(label);
|
||||
@ -107,7 +107,7 @@ public class Identities extends JFrame {
|
||||
label = new JLabel("Signature");
|
||||
label.setBounds(174,172,label.getPreferredSize().width,label.getPreferredSize().height);
|
||||
getContentPane().add(label);
|
||||
|
||||
|
||||
tfDesc = new JTextField();
|
||||
tfDesc.setBounds(254,12,228,tfDesc.getPreferredSize().height);
|
||||
getContentPane().add(tfDesc);
|
||||
@ -127,7 +127,7 @@ public class Identities extends JFrame {
|
||||
tfOrg = new JTextField();
|
||||
tfOrg.setBounds(254,140,228,tfOrg.getPreferredSize().height);
|
||||
getContentPane().add(tfOrg);
|
||||
|
||||
|
||||
taSig = new JTextArea();
|
||||
taSig.setFont(new Font("monospaced",Font.PLAIN,12));
|
||||
JScrollPane scroll = new JScrollPane(taSig);
|
||||
@ -150,9 +150,9 @@ public class Identities extends JFrame {
|
||||
update();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void update() {
|
||||
|
||||
|
||||
if (currentSelection > -1) {
|
||||
ida.get(currentSelection).setDescription(tfDesc.getText());
|
||||
ida.get(currentSelection).setName(tfName.getText());
|
||||
@ -161,56 +161,56 @@ public class Identities extends JFrame {
|
||||
ida.get(currentSelection).setOrganization(tfOrg.getText());
|
||||
ida.get(currentSelection).setSignature(taSig.getText());
|
||||
}
|
||||
|
||||
|
||||
tfDesc.setText(ida.get(list.getSelectedIndex()).getDescription());
|
||||
tfName.setText(ida.get(list.getSelectedIndex()).getName());
|
||||
tfEMail.setText(ida.get(list.getSelectedIndex()).getEMail());
|
||||
tfReply.setText(ida.get(list.getSelectedIndex()).getReplyTo());
|
||||
tfOrg.setText(ida.get(list.getSelectedIndex()).getOrganization());
|
||||
taSig.setText(ida.get(list.getSelectedIndex()).getSignature());
|
||||
|
||||
|
||||
currentSelection = list.getSelectedIndex();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class SelectionChangedListener implements ListSelectionListener {
|
||||
|
||||
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
|
||||
|
||||
if (e.getValueIsAdjusting()) {
|
||||
|
||||
|
||||
update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class AddNewActionListener implements ActionListener {
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
|
||||
ida.add(new IdentityStructure("New Identity"));
|
||||
ilm.fireAdded(ida.size()-1);
|
||||
list.setSelectedIndex(ida.size()-1);
|
||||
update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class DeleteActionListener implements ActionListener {
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
|
||||
int index = list.getSelectedIndex();
|
||||
ida.remove(index);
|
||||
ilm.fireRemoved(index);
|
||||
currentSelection = -1;
|
||||
if (index >= ida.size()) {
|
||||
index = ida.size()-1;
|
||||
if (index >= ida.size()) {
|
||||
index = ida.size()-1;
|
||||
}
|
||||
if (ida.size() <= 0) {
|
||||
ida.add(new IdentityStructure("New Identity"));
|
||||
@ -218,42 +218,42 @@ public class Identities extends JFrame {
|
||||
}
|
||||
list.setSelectedIndex(index);
|
||||
update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class FinishActionListener implements ActionListener {
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
|
||||
update();
|
||||
ida.writePrefs();
|
||||
hide();
|
||||
setVisible(false);
|
||||
dispose();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class IdentityListModel extends AbstractListModel {
|
||||
|
||||
|
||||
public Object getElementAt(int index) {
|
||||
return ida.get(index).getDescription();
|
||||
}
|
||||
|
||||
|
||||
public int getSize() {
|
||||
return ida.size();
|
||||
}
|
||||
|
||||
|
||||
public void fireAdded(int index) {
|
||||
fireIntervalAdded(this, index, index);
|
||||
}
|
||||
|
||||
|
||||
public void fireRemoved(int index) {
|
||||
fireIntervalRemoved(this, index, index);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 26 Sep 1997.
|
||||
*/
|
||||
@ -92,7 +92,7 @@ public final class BGDB extends BaseDB implements Runnable {
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public synchronized void assert(String name, String slot, String value)
|
||||
public synchronized void addassert(String name, String slot, String value)
|
||||
throws IOException
|
||||
{
|
||||
logfid.seek(logfid.length());
|
||||
@ -177,7 +177,8 @@ public final class BGDB extends BaseDB implements Runnable {
|
||||
c);
|
||||
}
|
||||
if (c.command.equals("assert")) {
|
||||
base.assert(c.name, c.slot, c.value);
|
||||
//XXXrlk: doing asserts later.
|
||||
// base.assert(c.name, c.slot, c.value);
|
||||
} else if (c.command.equals("unassert")) {
|
||||
base.unassert(c.name, c.slot, c.value);
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 26 Sep 1997.
|
||||
*/
|
||||
@ -30,7 +30,7 @@ import java.util.Enumeration;
|
||||
/** An interface to a RDF-ish database. */
|
||||
|
||||
public interface DB {
|
||||
public void assert(String name, String slot, String value)
|
||||
public void addassert(String name, String slot, String value)
|
||||
throws IOException;
|
||||
public void unassert(String name, String slot, String value)
|
||||
throws IOException;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 26 Sep 1997.
|
||||
*/
|
||||
@ -124,8 +124,7 @@ final class HackDB extends BaseDB {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized void assert(String name, String slot, String value)
|
||||
public synchronized void addassert(String name, String slot, String value)
|
||||
throws IOException
|
||||
{
|
||||
File s = findSlotFile(slot, false);
|
||||
@ -135,7 +134,6 @@ final class HackDB extends BaseDB {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized void unassert(String name, String slot, String value)
|
||||
throws IOException
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 4 Oct 1997.
|
||||
*/
|
||||
@ -82,7 +82,8 @@ public class PhoneTest {
|
||||
// value + "'");
|
||||
System.out.print(".");
|
||||
count++;
|
||||
db.assert(name, slot, value);
|
||||
//XXXrlk: doing asserts later.
|
||||
// db.assert(name, slot, value);
|
||||
} else {
|
||||
name = str;
|
||||
}
|
||||
@ -135,7 +136,8 @@ public class PhoneTest {
|
||||
db.unassert(name.substring(1), slot, value);
|
||||
System.out.println("Unasserted.");
|
||||
} else {
|
||||
db.assert(name, slot, value);
|
||||
//XXXrlk: doing asserts later.
|
||||
// db.assert(name, slot, value);
|
||||
System.out.println("Asserted.");
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 26 Sep 1997.
|
||||
*/
|
||||
@ -40,12 +40,12 @@ public class SelfTest {
|
||||
// DB db = new HackDB(top);
|
||||
DB db = new SimpleDB(top);
|
||||
db = new BGDB(db, new File(home, "__hackdb__queue"));
|
||||
db.assert("terry", "fullname", "Terry Weissman");
|
||||
db.assert("jwz", "fullname", "Jamie Zawinski");
|
||||
db.assert("terry", "phone", "650-937-2756");
|
||||
db.assert("terry", "phone", "408-338-8227");
|
||||
db.assert("jwz", "phone", "650-937-2620");
|
||||
db.assert("jwz", "phone", "415-ACRIDHE");
|
||||
db.addassert("terry", "fullname", "Terry Weissman");
|
||||
db.addassert("jwz", "fullname", "Jamie Zawinski");
|
||||
db.addassert("terry", "phone", "650-937-2756");
|
||||
db.addassert("terry", "phone", "408-338-8227");
|
||||
db.addassert("jwz", "phone", "650-937-2620");
|
||||
db.addassert("jwz", "phone", "415-ACRIDHE");
|
||||
|
||||
for (int j=0 ; j<2 ; j++) {
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 30 Sep 1997.
|
||||
*/
|
||||
@ -236,7 +236,7 @@ public final class SimpleDB extends BaseDB {
|
||||
|
||||
|
||||
|
||||
public synchronized void assert(String name, String slot, String value)
|
||||
public synchronized void addassert(String name, String slot, String value)
|
||||
throws IOException
|
||||
{
|
||||
int n = LookupString(name, true);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Terry Weissman <terry@netscape.com>, 7 Oct 1997.
|
||||
*/
|
||||
@ -81,13 +81,13 @@ public class Twingle implements Runnable {
|
||||
thread.start();
|
||||
}
|
||||
|
||||
void assert(String name, String slot, String value) {
|
||||
void addassert(String name, String slot, String value) {
|
||||
if (name != null && value != null) {
|
||||
try {
|
||||
db.assert(name, slot, value);
|
||||
db.addassert(name, slot, value);
|
||||
} catch (IOException e) {
|
||||
// ### What to do...
|
||||
System.out.println("db.assert() failed in Twingle.assert: " + e);
|
||||
System.out.println("db.addassert() failed in Twingle.assert: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -142,9 +142,9 @@ public class Twingle implements Runnable {
|
||||
addr = str.trim();
|
||||
}
|
||||
if (name != null) {
|
||||
assert(addr, "fullname", name);
|
||||
addassert(addr, "fullname", name);
|
||||
}
|
||||
assert(id, slot, addr);
|
||||
addassert(id, slot, addr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,11 +181,11 @@ public class Twingle implements Runnable {
|
||||
if (id.charAt(0) == '<' && id.endsWith(">")) {
|
||||
id = id.substring(1, id.length() - 1);
|
||||
}
|
||||
assert(id, "parent", folder.getName());
|
||||
addassert(id, "parent", folder.getName());
|
||||
|
||||
String subj[] = headers.getHeader("Subject");
|
||||
if (subj != null && subj.length != 0)
|
||||
assert(id, "subject", subj[0]);
|
||||
addassert(id, "subject", subj[0]);
|
||||
|
||||
hackAddressList(id, headers, "from");
|
||||
hackAddressList(id, headers, "to");
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 8 Sep 1997.
|
||||
*
|
||||
@ -55,7 +55,7 @@ import grendel.filters.FilterMaster;
|
||||
*/
|
||||
|
||||
import grendel.composition.Composition;
|
||||
import grendel.ui.UIAction;
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class ActionFactory {
|
||||
static ExitAction fExitAction = new ExitAction();
|
||||
@ -69,9 +69,9 @@ public class ActionFactory {
|
||||
static RunServerPrefsAction fRunServerPrefsAction = new RunServerPrefsAction();
|
||||
static RunGeneralPrefsAction fRunGeneralPrefsAction = new RunGeneralPrefsAction();
|
||||
static RunUIPrefsAction fRunUIPrefsAction = new RunUIPrefsAction();
|
||||
|
||||
|
||||
static int fIdent = 0;
|
||||
|
||||
|
||||
static Runnable fComposeMessageThread = new DummyComposeMessageThread();
|
||||
|
||||
static public ExitAction GetExitAction() {
|
||||
@ -89,7 +89,7 @@ public class ActionFactory {
|
||||
static public void SetComposeMessageThread(Runnable aThread) {
|
||||
fComposeMessageThread = aThread;
|
||||
}
|
||||
|
||||
|
||||
static public void setIdent(int aIdent) {
|
||||
System.out.println("setIdent "+aIdent);
|
||||
fIdent = aIdent;
|
||||
@ -115,11 +115,11 @@ public class ActionFactory {
|
||||
static public ShowTooltipsAction GetShowTooltipsAction() {
|
||||
return fShowTooltipsAction;
|
||||
}
|
||||
|
||||
|
||||
static public RunIdentityPrefsAction GetRunIdentityPrefsAction() {
|
||||
return fRunIdentityPrefsAction;
|
||||
}
|
||||
|
||||
|
||||
static public RunServerPrefsAction GetRunServerPrefsAction() {
|
||||
return fRunServerPrefsAction;
|
||||
}
|
||||
@ -127,20 +127,20 @@ public class ActionFactory {
|
||||
static public RunGeneralPrefsAction GetRunGeneralPrefsAction() {
|
||||
return fRunGeneralPrefsAction;
|
||||
}
|
||||
|
||||
|
||||
static public RunUIPrefsAction GetRunUIPrefsAction() {
|
||||
return fRunUIPrefsAction;
|
||||
}
|
||||
}
|
||||
|
||||
class ExitAction extends UIAction {
|
||||
class ExitAction extends Event {
|
||||
|
||||
public ExitAction() {
|
||||
super("appExit");
|
||||
|
||||
setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
GeneralFrame.CloseAllFrames();
|
||||
@ -151,21 +151,21 @@ class ExitAction extends UIAction {
|
||||
}
|
||||
}
|
||||
|
||||
class NewMailAction extends UIAction {
|
||||
class NewMailAction extends Event {
|
||||
|
||||
public NewMailAction() {
|
||||
super("msgGetNew");
|
||||
|
||||
setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
ProgressFactory.NewMailProgress();
|
||||
}
|
||||
}
|
||||
|
||||
class ComposeMessageAction extends UIAction {
|
||||
class ComposeMessageAction extends Event {
|
||||
|
||||
public ComposeMessageAction() {
|
||||
super("msgNew");
|
||||
@ -185,55 +185,20 @@ class DummyComposeMessageThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SearchAction extends UIAction {
|
||||
class SearchAction extends Event {
|
||||
SearchAction() {
|
||||
super("appSearch");
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
Frame frame = new SearchFrame();
|
||||
frame.show();
|
||||
frame.setVisible(true);
|
||||
frame.toFront();
|
||||
frame.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
class RunFiltersAction extends UIAction {
|
||||
class RunFiltersAction extends Event {
|
||||
|
||||
RunFiltersAction() {
|
||||
super("appRunFilters");
|
||||
@ -247,7 +212,7 @@ class RunFiltersAction extends UIAction {
|
||||
}
|
||||
}
|
||||
|
||||
class ShowTooltipsAction extends UIAction {
|
||||
class ShowTooltipsAction extends Event {
|
||||
|
||||
ShowTooltipsAction() {
|
||||
super("appShowTooltips");
|
||||
@ -266,50 +231,50 @@ class ShowTooltipsAction extends UIAction {
|
||||
}
|
||||
}
|
||||
|
||||
class RunIdentityPrefsAction extends UIAction {
|
||||
|
||||
class RunIdentityPrefsAction extends Event {
|
||||
|
||||
RunIdentityPrefsAction() {
|
||||
super("prefIds");
|
||||
}
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
JFrame prefs = new Identities();
|
||||
prefs.show();
|
||||
prefs.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
class RunServerPrefsAction extends UIAction {
|
||||
|
||||
class RunServerPrefsAction extends Event {
|
||||
|
||||
RunServerPrefsAction() {
|
||||
super("prefSrvs");
|
||||
}
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
JFrame prefs = new Servers();
|
||||
prefs.show();
|
||||
prefs.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
class RunGeneralPrefsAction extends UIAction {
|
||||
|
||||
class RunGeneralPrefsAction extends Event {
|
||||
|
||||
RunGeneralPrefsAction() {
|
||||
super("prefGeneral");
|
||||
}
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
JFrame prefs = new General();
|
||||
prefs.show();
|
||||
prefs.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
class RunUIPrefsAction extends UIAction {
|
||||
|
||||
class RunUIPrefsAction extends Event {
|
||||
|
||||
RunUIPrefsAction() {
|
||||
super("prefUI");
|
||||
}
|
||||
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
JFrame prefs = new UI();
|
||||
prefs.show();
|
||||
prefs.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
@ -49,11 +49,11 @@ class BiffIcon extends JLabel implements ChangeListener {
|
||||
public BiffIcon() {
|
||||
if (fIconUnknown == null) {
|
||||
fIconUnknown =
|
||||
new ImageIcon(getClass().getResource("images/biffUnknown.gif"));
|
||||
new ImageIcon("ui/images/biffUnknown.gif");
|
||||
fIconNew =
|
||||
new ImageIcon(getClass().getResource("images/biffNew.gif"));
|
||||
new ImageIcon("ui/images/biffNew.gif");
|
||||
fIconNone =
|
||||
new ImageIcon(getClass().getResource("images/biffNone.gif"));
|
||||
new ImageIcon("ui/images/biffNone.gif");
|
||||
}
|
||||
setText(null); // Necessary for icon size to be used for preferred size
|
||||
setBiffState(MailDrop.UNKNOWN);
|
||||
|
@ -118,7 +118,7 @@ public class FolderCombo extends JComboBox {
|
||||
|
||||
class FolderRenderer extends JLabel implements ListCellRenderer {
|
||||
public FolderRenderer() {
|
||||
setIcon(new ImageIcon(getClass().getResource("/grendel/ui/images/folder-small.gif")));
|
||||
setIcon(new ImageIcon("ui/images/folder-small.gif"));
|
||||
setOpaque(true);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 18 Nov 1997.
|
||||
*
|
||||
@ -40,10 +40,11 @@ import grendel.view.ViewedMessage;
|
||||
|
||||
import javax.swing.event.ChangeEvent;
|
||||
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.widgets.StatusEvent;
|
||||
import grendel.widgets.TreePath;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class FolderFrame extends GeneralFrame {
|
||||
static Vector fFolderFrames = new Vector();
|
||||
FolderPanel fFolderPanel;
|
||||
@ -56,8 +57,8 @@ public class FolderFrame extends GeneralFrame {
|
||||
fPanel.add(fFolderPanel);
|
||||
// fMenu = buildMenu("folderMain", Util.MergeActions(actions,
|
||||
// fFolderPanel.getActions()));
|
||||
fMenu = buildMenu("menus.xml",
|
||||
Util.MergeActions(actions, fFolderPanel.getActions()));
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(Util.MergeActions(actions, fFolderPanel.getActions()));
|
||||
fMenu = builder.buildFrom("ui/menus.xml", this);
|
||||
getRootPane().setJMenuBar(fMenu);
|
||||
|
||||
fToolBar = fFolderPanel.getToolBar();
|
||||
@ -142,7 +143,7 @@ public class FolderFrame extends GeneralFrame {
|
||||
}
|
||||
}
|
||||
}
|
||||
UIAction actions[] = { ActionFactory.GetExitAction(),
|
||||
Event actions[] = { ActionFactory.GetExitAction(),
|
||||
ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction()};
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
|
||||
*
|
||||
@ -72,7 +72,6 @@ import grendel.composition.Composition;
|
||||
import grendel.prefs.base.InvisiblePrefs;
|
||||
import grendel.storage.MessageExtra;
|
||||
import grendel.storage.MessageExtraFactory;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.view.FolderView;
|
||||
import grendel.view.FolderViewFactory;
|
||||
import grendel.view.MessageSetView;
|
||||
@ -100,6 +99,8 @@ import grendel.widgets.TreeTableDataModel;
|
||||
|
||||
import calypso.util.Assert;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
/**
|
||||
* Panel to display the <em>contents</em> of a folder.
|
||||
*/
|
||||
@ -214,7 +215,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
ThreadAction fThreadAction = new ThreadAction();
|
||||
// The big action list
|
||||
|
||||
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
Event fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction(),
|
||||
fDeleteMessageAction,
|
||||
fOpenMessageAction,
|
||||
@ -273,8 +274,8 @@ public class FolderPanel extends GeneralPanel {
|
||||
ToggleCellRenderer renderer;
|
||||
ToggleCellEditor editor;
|
||||
|
||||
Icon unreadIcon = new ImageIcon(getClass().getResource("images/unread.gif"));
|
||||
Icon readIcon = new ImageIcon(getClass().getResource("images/read.gif"));
|
||||
Icon unreadIcon = new ImageIcon("ui/images/unread.gif");
|
||||
Icon readIcon = new ImageIcon("ui/images/read.gif");
|
||||
|
||||
renderer = new ToggleCellRenderer();
|
||||
renderer.getCheckBox().setIcon(unreadIcon);
|
||||
@ -292,8 +293,8 @@ public class FolderPanel extends GeneralPanel {
|
||||
column.setCellEditor(editor);
|
||||
fMessageTree.addColumn(column);
|
||||
|
||||
Icon unflaggedIcon = new ImageIcon(getClass().getResource("images/unflagged.gif"));
|
||||
Icon flaggedIcon = new ImageIcon(getClass().getResource("images/flagged.gif"));
|
||||
Icon unflaggedIcon = new ImageIcon("ui/images/unflagged.gif");
|
||||
Icon flaggedIcon = new ImageIcon("ui/images/flagged.gif");
|
||||
|
||||
renderer = new ToggleCellRenderer();
|
||||
renderer.getCheckBox().setIcon(unflaggedIcon);
|
||||
@ -311,8 +312,8 @@ public class FolderPanel extends GeneralPanel {
|
||||
column.setCellEditor(editor);
|
||||
fMessageTree.addColumn(column);
|
||||
|
||||
Icon deletedIcon = new ImageIcon(getClass().getResource("images/deleted.gif"));
|
||||
Icon undeletedIcon = new ImageIcon(getClass().getResource("images/unflagged.gif"));
|
||||
Icon deletedIcon = new ImageIcon("ui/images/deleted.gif");
|
||||
Icon undeletedIcon = new ImageIcon("ui/images/unflagged.gif");
|
||||
|
||||
renderer = new ToggleCellRenderer();
|
||||
renderer.getCheckBox().setIcon(undeletedIcon);
|
||||
@ -429,7 +430,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
* Returns the actions available for this panel
|
||||
*/
|
||||
|
||||
public UIAction[] getActions() {
|
||||
public Event[] getActions() {
|
||||
return Util.MergeActions(fActions, fSortActions);
|
||||
}
|
||||
|
||||
@ -751,7 +752,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class OpenMessageAction extends UIAction implements Runnable {
|
||||
class OpenMessageAction extends Event implements Runnable {
|
||||
|
||||
OpenMessageAction() {
|
||||
super("msgOpen");
|
||||
@ -785,7 +786,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// DeleteMessageAction class
|
||||
//
|
||||
|
||||
class DeleteMessageAction extends UIAction {
|
||||
class DeleteMessageAction extends Event {
|
||||
|
||||
DeleteMessageAction() {
|
||||
super("msgDelete");
|
||||
@ -801,7 +802,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// CopyMessageAction class
|
||||
//
|
||||
|
||||
class CopyMessageAction extends UIAction {
|
||||
class CopyMessageAction extends Event {
|
||||
|
||||
Folder fDest;
|
||||
|
||||
@ -820,7 +821,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// MoveMessageAction class
|
||||
//
|
||||
|
||||
class MoveMessageAction extends UIAction {
|
||||
class MoveMessageAction extends Event {
|
||||
|
||||
Folder fDest;
|
||||
|
||||
@ -839,7 +840,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// ThreadAction class
|
||||
//
|
||||
|
||||
class ThreadAction extends UIAction {
|
||||
class ThreadAction extends Event {
|
||||
|
||||
boolean selected;
|
||||
|
||||
@ -865,7 +866,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// SortAction class
|
||||
//
|
||||
|
||||
class SortAction extends UIAction {
|
||||
class SortAction extends Event {
|
||||
int fType;
|
||||
boolean selected;
|
||||
|
||||
@ -877,7 +878,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
public int getType() {
|
||||
return fType;
|
||||
}
|
||||
|
||||
|
||||
public void setSelected(boolean isSelected) {
|
||||
selected = isSelected;
|
||||
}
|
||||
@ -896,7 +897,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// ReplyAction class
|
||||
//
|
||||
|
||||
class ReplyAction extends UIAction {
|
||||
class ReplyAction extends Event {
|
||||
boolean replyall;
|
||||
public ReplyAction(String aAction, boolean r) {
|
||||
super(aAction);
|
||||
@ -913,7 +914,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
Composition frame = new Composition();
|
||||
frame.initializeAsReply((Message) (selection.elementAt(0)), replyall);
|
||||
frame.show();
|
||||
frame.setVisible(true);
|
||||
frame.requestFocus();
|
||||
}
|
||||
}
|
||||
@ -922,7 +923,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// ForwardAction class
|
||||
//
|
||||
|
||||
class ForwardAction extends UIAction {
|
||||
class ForwardAction extends Event {
|
||||
int fScope;
|
||||
|
||||
ForwardAction(String aName, int aScope) {
|
||||
@ -940,7 +941,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
Composition frame = new Composition();
|
||||
frame.initializeAsForward((Message) (selection.elementAt(0)), fScope);
|
||||
frame.show();
|
||||
frame.setVisible(true);
|
||||
frame.requestFocus();
|
||||
}
|
||||
}
|
||||
@ -949,7 +950,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
// MarkAction class
|
||||
//
|
||||
|
||||
class MarkAction extends UIAction {
|
||||
class MarkAction extends Event {
|
||||
int fScope;
|
||||
|
||||
MarkAction(String aName, int aScope) {
|
||||
@ -1021,7 +1022,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Cut-n-paste stuff
|
||||
@ -1033,7 +1034,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class CopyToClipboardAction extends UIAction {
|
||||
class CopyToClipboardAction extends Event {
|
||||
|
||||
CopyToClipboardAction() {
|
||||
super("copy-to-clipboard");
|
||||
@ -1051,7 +1052,7 @@ public class FolderPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class PasteFromClipboardAction extends UIAction {
|
||||
class PasteFromClipboardAction extends Event {
|
||||
|
||||
PasteFromClipboardAction() {
|
||||
super("paste-from-clipboard");
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
|
||||
*
|
||||
@ -158,12 +158,8 @@ public class GeneralFrame extends JFrame
|
||||
// We need to use Class.forName because getClass() might return a child
|
||||
// class in another package.
|
||||
|
||||
try {
|
||||
URL url = Class.forName("grendel.ui.GeneralFrame").getResource("images/GrendelIcon32.gif");
|
||||
setIconImage(getToolkit().getImage(url));
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ImageIcon curImage = new ImageIcon("ui/images/GrendelIcon32.gif");
|
||||
setIconImage(curImage.getImage());
|
||||
|
||||
fFrameList.addElement(this);
|
||||
}
|
||||
@ -266,30 +262,6 @@ public class GeneralFrame extends JFrame
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the MenuBar by reading from an XML file
|
||||
*
|
||||
* @param file the XML file to build the menu from
|
||||
* @return a menubar built from the file
|
||||
*/
|
||||
protected MenuBarCtrl buildMenu(String file, UIAction[] actions) {
|
||||
MenuBarCtrl menubar = null;
|
||||
URL url;
|
||||
XMLMenuBuilder builder =
|
||||
new XMLMenuBuilder(this, actions);
|
||||
|
||||
try {
|
||||
url = getClass().getResource(file);
|
||||
builder.buildFrom(url.openStream());
|
||||
menubar = builder.getComponent();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
menubar.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
return menubar;
|
||||
}
|
||||
|
||||
protected Component buildStatusBar() {
|
||||
JPanel res = new JPanel();
|
||||
res.setLayout(new BoxLayout(res, BoxLayout.X_AXIS));
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 13 Oct 1997.
|
||||
*
|
||||
@ -27,7 +27,6 @@
|
||||
|
||||
package grendel.ui;
|
||||
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.ui.ToolBarLayout;
|
||||
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
@ -50,6 +49,8 @@ import javax.swing.ImageIcon;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JButton;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class GeneralPanel extends JPanel {
|
||||
private final boolean DEBUG = false;
|
||||
static ResourceBundle fLabels = ResourceBundle.getBundle("grendel.ui.Labels",
|
||||
@ -65,21 +66,21 @@ public class GeneralPanel extends JPanel {
|
||||
setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
}
|
||||
|
||||
public UIAction[] getActions() {
|
||||
public Event[] getActions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected GrendelToolBar buildToolBar(String aToolbar, UIAction[] aActions) {
|
||||
protected GrendelToolBar buildToolBar(String aToolbar, Event[] aActions) {
|
||||
GrendelToolBar res = null;
|
||||
|
||||
Hashtable commands = new Hashtable();
|
||||
for (int i = 0; i < aActions.length; i++)
|
||||
{
|
||||
UIAction a = aActions[i];
|
||||
Event a = aActions[i];
|
||||
String name = a.getName();
|
||||
commands.put(name, a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
res = new GrendelToolBar();
|
||||
@ -94,11 +95,11 @@ public class GeneralPanel extends JPanel {
|
||||
if (DEBUG) {
|
||||
System.out.println("Local token = " + token);
|
||||
}
|
||||
UIAction action = (UIAction)commands.get(token);
|
||||
Event action = (Event)commands.get(token);
|
||||
String icon = toolbarresources.getString(token + "Icon");
|
||||
String label = toolbarresources.getString(token + "Label");
|
||||
String tooltip = toolbarresources.getString(token + "Tooltip");
|
||||
|
||||
|
||||
res.addButton(action, icon, label, tooltip);
|
||||
}
|
||||
} catch (MissingResourceException e) {
|
||||
|
@ -70,5 +70,6 @@ include ../../../rules.mk
|
||||
resources::
|
||||
cp *.xml $(DISTDIR)/grendel/ui
|
||||
cp *.properties $(DISTDIR)/grendel/ui
|
||||
cp *.dtd $(DISTDIR)/grendel/ui
|
||||
cp -r images $(DISTDIR)/grendel/ui
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
|
||||
*
|
||||
@ -80,7 +80,6 @@ import grendel.prefs.base.InvisiblePrefs;
|
||||
import grendel.prefs.base.ServerArray;
|
||||
import grendel.storage.FolderExtraFactory;
|
||||
import grendel.storage.SearchResultsFolderFactory;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.view.ViewedFolder;
|
||||
import grendel.view.ViewedStore;
|
||||
import grendel.view.ViewedStoreEvent;
|
||||
@ -104,6 +103,8 @@ import grendel.widgets.TreeTableModelBroadcaster;
|
||||
import grendel.widgets.TreeTableModelEvent;
|
||||
import grendel.widgets.TreeTableModelListener;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
/**
|
||||
* Panel to display the <em>contents</em> of a folder.
|
||||
*/
|
||||
@ -117,7 +118,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
StoreChangeListener fStoreChangeListener = null;
|
||||
ViewedStore fStores[];
|
||||
|
||||
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
Event fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction(),
|
||||
new CopyToClipboardAction(),
|
||||
new PasteFromClipboardAction(),
|
||||
@ -211,7 +212,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
|
||||
fStoreChangeListener = new StoreChangeListener();
|
||||
StoreFactory.Instance().addChangeListener(fStoreChangeListener);
|
||||
|
||||
|
||||
ActionFactory.SetComposeMessageThread(new ComposeMessageThread());
|
||||
fPanel.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
}
|
||||
@ -228,7 +229,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
* Returns the actions associated with this panel.
|
||||
*/
|
||||
|
||||
public UIAction[] getActions() {
|
||||
public Event[] getActions() {
|
||||
return fActions;
|
||||
}
|
||||
|
||||
@ -341,7 +342,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class NewFolderAction extends UIAction {
|
||||
class NewFolderAction extends Event {
|
||||
|
||||
NewFolderAction() {
|
||||
super("folderNew");
|
||||
@ -360,7 +361,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteFolderAction extends UIAction {
|
||||
class DeleteFolderAction extends Event {
|
||||
DeleteFolderAction() {
|
||||
super("folderDelete");
|
||||
}
|
||||
@ -394,8 +395,8 @@ public class MasterPanel extends GeneralPanel {
|
||||
ActionFactory.setIdent(identity);
|
||||
|
||||
Composition frame = new Composition();
|
||||
|
||||
frame.show();
|
||||
|
||||
frame.setVisible(true);
|
||||
frame.requestFocus();
|
||||
}
|
||||
}
|
||||
@ -406,7 +407,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class CopyToClipboardAction extends UIAction {
|
||||
class CopyToClipboardAction extends Event {
|
||||
|
||||
CopyToClipboardAction() {
|
||||
super("copy-to-clipboard");
|
||||
@ -424,7 +425,7 @@ public class MasterPanel extends GeneralPanel {
|
||||
}
|
||||
}
|
||||
|
||||
class PasteFromClipboardAction extends UIAction {
|
||||
class PasteFromClipboardAction extends Event {
|
||||
|
||||
PasteFromClipboardAction() {
|
||||
super("paste-from-clipboard");
|
||||
@ -714,7 +715,7 @@ class FolderModel implements TreeTableDataModel {
|
||||
node = getFolder(aNode);
|
||||
|
||||
if (aID == MasterPanel.kNameID) {
|
||||
|
||||
|
||||
parent = node.getParent();
|
||||
}
|
||||
String newName = (String) aValue;
|
||||
@ -765,7 +766,7 @@ class FolderModel implements TreeTableDataModel {
|
||||
} catch (MessagingException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Folder getFolder(Object aObject) {
|
||||
Folder res = null;
|
||||
|
190
grendel/sources/grendel/ui/MenuLabels.dtd
Normal file
190
grendel/sources/grendel/ui/MenuLabels.dtd
Normal file
@ -0,0 +1,190 @@
|
||||
<!--
|
||||
#
|
||||
# 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): Will Scullin <scullin@meer.net>
|
||||
# Edwin Woudt <edwin@woudt.nl>
|
||||
# R.J. Keller <rj.keller@beonex.com
|
||||
# -->
|
||||
|
||||
<!-- multipane menu labels -->
|
||||
|
||||
<!ENTITY multiFileLabel "File" >
|
||||
<!ENTITY multiFileAccel "F" >
|
||||
<!ENTITY multiEditLabel "Edit" >
|
||||
<!ENTITY multiEditAccel "E" >
|
||||
<!ENTITY multiViewLabel "View" >
|
||||
<!ENTITY multiViewAccel "V" >
|
||||
<!ENTITY multiMessageLabel "Message" >
|
||||
<!ENTITY multiMessageAccel "M" >
|
||||
|
||||
<!-- Master menu labels -->
|
||||
|
||||
<!ENTITY masterFileLabel "File" >
|
||||
<!ENTITY masterFileAccel "F" >
|
||||
<!ENTITY masterEditLabel "Edit" >
|
||||
<!ENTITY masterEditAccel "E" >
|
||||
|
||||
<!-- Folder menu labels -->
|
||||
|
||||
<!ENTITY folderFileLabel "File" >
|
||||
<!ENTITY folderFileAccel "F" >
|
||||
<!ENTITY folderEditLabel "Edit" >
|
||||
<!ENTITY folderEditAccel "E" >
|
||||
<!ENTITY folderMessageLabel "Message" >
|
||||
<!ENTITY folderMessageAccel "M" >
|
||||
|
||||
<!-- Message menu labels -->
|
||||
|
||||
<!ENTITY messageFileLabel "File" >
|
||||
<!ENTITY messageFileAccel "F" >
|
||||
<!ENTITY messageEditLabel "Edit" >
|
||||
<!ENTITY messageEditAccel "E" >
|
||||
<!ENTITY messageMessageLabel "Message" >
|
||||
<!ENTITY messageMessageAccel "M" >
|
||||
|
||||
<!-- View menu labels -->
|
||||
|
||||
<!ENTITY viewLayoutLabel "Layout" >
|
||||
<!ENTITY viewLayoutAccel "L" >
|
||||
<!ENTITY splitLeftLabel "Split Left" >
|
||||
<!ENTITY splitLeftAccel "L" >
|
||||
<!ENTITY splitRightLabel "Split Right" >
|
||||
<!ENTITY splitRightAccel "R" >
|
||||
<!ENTITY splitTopLabel "Split Top" >
|
||||
<!ENTITY splitTopAccel "T" >
|
||||
<!ENTITY stackedLabel "Stacked" >
|
||||
<!ENTITY stackedAccel "S" >
|
||||
<!ENTITY appShowTooltipsLabel "Show Tooltips" >
|
||||
<!ENTITY appShowTooltipsAccel "T" >
|
||||
|
||||
<!-- Common menu labels -->
|
||||
|
||||
<!ENTITY windowLabel "Window" >
|
||||
<!ENTITY windowAccel "W" >
|
||||
|
||||
<!-- Application menu item labels -->
|
||||
|
||||
<!ENTITY appExitLabel "Exit" >
|
||||
<!ENTITY appExitAccel "x" >
|
||||
<!ENTITY appPrefsLabel "Preferences..." >
|
||||
<!ENTITY appPrefsAccel "r" >
|
||||
<!ENTITY appSearchLabel "Search" >
|
||||
<!ENTITY appSearchAccel "S" >
|
||||
<!ENTITY appRunFiltersLabel "Run Filters on TestInbox" >
|
||||
<!ENTITY appRunFiltersAccel "F" >
|
||||
|
||||
<!-- Edit menu item labels -->
|
||||
|
||||
<!ENTITY editUndoLabel "Undo" >
|
||||
<!ENTITY editUndoAccel "U" >
|
||||
<!ENTITY editCutLabel "Cut" >
|
||||
<!ENTITY editCutAccel "t" >
|
||||
<!ENTITY editCopyLabel "Copy" >
|
||||
<!ENTITY editCopyAccel "C" >
|
||||
<!ENTITY editPasteLabel "Paste" >
|
||||
<!ENTITY editPasteAccel "P" >
|
||||
<!ENTITY editClearLabel "Delete" >
|
||||
<!ENTITY editClearAccel "D" >
|
||||
|
||||
<!-- Folder menu item labels -->
|
||||
|
||||
<!ENTITY folderOpenLabel "Open Folder" >
|
||||
<!ENTITY folderOpenAccel "O" >
|
||||
|
||||
<!-- Message menu item labels -->
|
||||
|
||||
<!ENTITY folderNewLabel "New Folder..." >
|
||||
<!ENTITY folderNewAccel "F" >
|
||||
<!ENTITY folderDeleteLabel "Delete Folder" >
|
||||
<!ENTITY folderDeleteAccel "D" >
|
||||
|
||||
<!ENTITY msgGetNewLabel "Get New Messages" >
|
||||
<!ENTITY msgGetNewAccel "G" >
|
||||
<!ENTITY msgOpenLabel "Open Message" >
|
||||
<!ENTITY msgOpenAccel "M" >
|
||||
<!ENTITY msgSaveAsLabel "Save As..." >
|
||||
<!ENTITY msgSaveAsAccel "A" >
|
||||
<!ENTITY msgNewLabel "New Message" >
|
||||
<!ENTITY msgNewAccel "N" >
|
||||
<!ENTITY msgReplyLabel "Reply" >
|
||||
<!ENTITY msgReplyAccel "R" >
|
||||
<!ENTITY msgReplyAllLabel "Reply All" >
|
||||
<!ENTITY msgReplyAllAccel "A" >
|
||||
<!ENTITY fwdQuotedLabel "Forward Quoted" >
|
||||
<!ENTITY fwdQuotedAccel "Q" >
|
||||
<!ENTITY fwdInlineLabel "Forward Inline" >
|
||||
<!ENTITY fwdInlineAccel "I" >
|
||||
<!ENTITY fwdAttachmentLabel "Forward Attachment" >
|
||||
<!ENTITY fwdAttachmentAccel "A" >
|
||||
<!ENTITY msgMoveLabel "File to" >
|
||||
<!ENTITY msgMoveAccel "F" >
|
||||
<!ENTITY msgMovePopupLabel "File to" >
|
||||
<!ENTITY msgCopyLabel "Copy to" >
|
||||
<!ENTITY msgCopyAccel "C" >
|
||||
<!ENTITY msgCopyPopupLabel "Copy to" >
|
||||
<!ENTITY msgDeleteLabel "Delete Message" >
|
||||
<!ENTITY msgDeleteAccel "D" >
|
||||
<!ENTITY msgDeletePopupLabel "Delete Message" >
|
||||
|
||||
<!ENTITY msgMarkLabel "Mark" >
|
||||
<!ENTITY msgMarkAccel "M" >
|
||||
|
||||
<!-- Mark menu labels -->
|
||||
|
||||
<!ENTITY markMsgReadLabel "As Read" >
|
||||
<!ENTITY markMsgReadAccel "R" >
|
||||
<!ENTITY markThreadReadLabel "Thread Read" >
|
||||
<!ENTITY markThreadReadAccel "T" >
|
||||
<!ENTITY markAllReadLabel "All Read" >
|
||||
<!ENTITY markAllReadAccel "A" >
|
||||
|
||||
<!-- Sort menu labels -->
|
||||
|
||||
<!ENTITY viewSortLabel "Sort" >
|
||||
<!ENTITY viewSortAccel "S" >
|
||||
|
||||
<!ENTITY toggleThreadingLabel "Toggle Threading" >
|
||||
<!ENTITY toggleThreadingAccel "T" >
|
||||
<!ENTITY sortDateLabel "by Date" >
|
||||
<!ENTITY sortDateAccel "D" >
|
||||
<!ENTITY sortSubjectLabel "by Subject" >
|
||||
<!ENTITY sortSubjectAccel "S" >
|
||||
<!ENTITY sortAuthorLabel "by Author" >
|
||||
<!ENTITY sortAuthorAccel "A" >
|
||||
<!ENTITY sortNumberLabel "by Number" >
|
||||
<!ENTITY sortNumberAccel "N" >
|
||||
|
||||
<!-- Window menu item labels -->
|
||||
|
||||
<!ENTITY windowListLabel "Window List..." >
|
||||
<!ENTITY windowListAccel "W" >
|
||||
|
||||
<!-- Preferences menu labels -->
|
||||
|
||||
<!ENTITY multiPrefsLabel "Preferences" >
|
||||
<!ENTITY multiPrefsAccel "P" >
|
||||
|
||||
<!ENTITY prefIdsLabel "Identities" >
|
||||
<!ENTITY prefIdsAccel "I" >
|
||||
<!ENTITY prefSrvsLabel "Servers" >
|
||||
<!ENTITY prefSrvsAccel "S" >
|
||||
<!ENTITY prefGeneralLabel "General" >
|
||||
<!ENTITY prefGeneralAccel "G" >
|
||||
<!ENTITY prefUILabel "User interface" >
|
||||
<!ENTITY prefUIAccel "U" >
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 18 Nov 1997.
|
||||
*
|
||||
@ -35,10 +35,9 @@ import java.util.Vector;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
|
||||
//import netscape.orion.toolbars.ToolbarFactory;
|
||||
//import netscape.orion.toolbars.ToolBarLayout;
|
||||
//import netscape.orion.uimanager.AbstractUICmd;
|
||||
//import netscape.orion.uimanager.IUICmd;
|
||||
import grendel.ui.XMLMenuBuilder;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class MessageFrame extends GeneralFrame {
|
||||
static Vector fMessageFrames = new Vector();
|
||||
@ -56,9 +55,9 @@ public class MessageFrame extends GeneralFrame {
|
||||
fPanel.add(fMessagePanel);
|
||||
// fMenu = buildMenu("messageMain", Util.MergeActions(actions,
|
||||
// fMessagePanel.getActions()));
|
||||
fMenu = buildMenu("menus.xml",
|
||||
Util.MergeActions(actions,
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(Util.MergeActions(actions,
|
||||
fMessagePanel.getActions()));
|
||||
fMenu = builder.buildFrom("ui/menus.xml", this);
|
||||
getRootPane().setJMenuBar(fMenu);
|
||||
|
||||
fToolBar = fMessagePanel.getToolBar();
|
||||
@ -128,6 +127,6 @@ public class MessageFrame extends GeneralFrame {
|
||||
return null;
|
||||
}
|
||||
|
||||
UIAction actions[] = { ActionFactory.GetExitAction(),
|
||||
Event actions[] = { ActionFactory.GetExitAction(),
|
||||
ActionFactory.GetComposeMessageAction() };
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ class MessageModel implements TreeTableDataModel {
|
||||
Icon fMessageReadIcon;
|
||||
|
||||
public MessageModel() {
|
||||
fMessageIcon = new ImageIcon(getClass().getResource("images/msg-small.gif"));
|
||||
fMessageReadIcon = new ImageIcon(getClass().getResource("images/msgRead-small.gif"));
|
||||
fMessageIcon = new ImageIcon("ui/images/msg-small.gif");
|
||||
fMessageReadIcon = new ImageIcon("ui/images/msgRead-small.gif");
|
||||
}
|
||||
|
||||
public void setFolderView(FolderView aView) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
|
||||
*
|
||||
@ -71,11 +71,12 @@ import grendel.mime.parser.MimeParserFactory;
|
||||
import grendel.mime.html.MimeHTMLOperatorFactory;
|
||||
import grendel.storage.MessageExtra;
|
||||
import grendel.storage.MessageExtraFactory;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
|
||||
import grendel.widgets.StatusEvent;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
/* ####
|
||||
import calypso.net.URLSource;
|
||||
*/
|
||||
@ -102,7 +103,7 @@ public class MessagePanel extends GeneralPanel {
|
||||
|
||||
EventListenerList fListeners = new EventListenerList();
|
||||
|
||||
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
Event fActions[] = {ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction()};
|
||||
/**
|
||||
* Constructs a new message panel.
|
||||
@ -270,7 +271,7 @@ public class MessagePanel extends GeneralPanel {
|
||||
if (makeRealHTML) {
|
||||
stream = new MakeItHTML(stream).getHTMLInputStream();
|
||||
}
|
||||
// Okay, let's try to read from the stream and set the
|
||||
// Okay, let's try to read from the stream and set the
|
||||
// text from the InputStream. We may need to put this
|
||||
// stuff back later. (talisman)
|
||||
//InputStreamReader reader = new InputStreamReader(stream);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
|
||||
*
|
||||
@ -39,11 +39,12 @@ import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Store;
|
||||
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.view.ViewedFolder;
|
||||
import grendel.view.ViewedMessage;
|
||||
import grendel.widgets.TreePath;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class MultiMessageDisplayManager extends MessageDisplayManager {
|
||||
MasterFrame fMasterFrame;
|
||||
|
||||
@ -136,7 +137,8 @@ class MasterFrame extends GeneralFrame {
|
||||
fMasterPanel.addMasterPanelListener(new FolderSelectionListener());
|
||||
fPanel.add(fMasterPanel);
|
||||
// fMenu = buildMenu("masterMain", actions);
|
||||
fMenu = buildMenu("menus.xml", actions);
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(actions);
|
||||
fMenu = builder.buildFrom("ui/menus.xml", this);
|
||||
getRootPane().setJMenuBar(fMenu);
|
||||
|
||||
fToolBar = fMasterPanel.getToolBar();
|
||||
@ -200,7 +202,7 @@ class MasterFrame extends GeneralFrame {
|
||||
|
||||
// Action array
|
||||
|
||||
UIAction actions[] = { ActionFactory.GetExitAction(),
|
||||
Event actions[] = { ActionFactory.GetExitAction(),
|
||||
ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction()};
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1999 Giao Nguyen. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
package grendel.ui;
|
||||
@ -59,11 +59,8 @@ import javax.swing.text.JTextComponent;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.sun.xml.parser.Resolver;
|
||||
import com.sun.xml.parser.Parser;
|
||||
import com.sun.xml.tree.XmlDocument;
|
||||
import com.sun.xml.tree.XmlDocumentBuilder;
|
||||
import com.sun.xml.tree.TreeWalker;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
@ -87,7 +84,7 @@ public class PageUI extends JPanel {
|
||||
|
||||
/**
|
||||
* Get the model for the page.
|
||||
*
|
||||
*
|
||||
* @return the model
|
||||
*/
|
||||
public PageModel getModel() {
|
||||
@ -96,7 +93,7 @@ public class PageUI extends JPanel {
|
||||
|
||||
/**
|
||||
* Set the model for the page.
|
||||
*
|
||||
*
|
||||
* @param model the model as the backing for the page
|
||||
*/
|
||||
public void setModel(PageModel model) {
|
||||
@ -112,7 +109,7 @@ public class PageUI extends JPanel {
|
||||
add(component);
|
||||
}
|
||||
|
||||
public void addCtrl(String name, JComponent component,
|
||||
public void addCtrl(String name, JComponent component,
|
||||
Object constraints) {
|
||||
System.out.println("addCtrl: "+name);
|
||||
if (name != null) table.put(name, component);
|
||||
@ -124,7 +121,7 @@ public class PageUI extends JPanel {
|
||||
|
||||
/**
|
||||
* Get a component by its name.
|
||||
*
|
||||
*
|
||||
* @param key the name of the component to retrieve
|
||||
* @param return the component identiified by the key
|
||||
*/
|
||||
|
@ -17,11 +17,11 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Jeff Galyan (talisman@anamorphic.com), 20 March, 2001.
|
||||
*
|
||||
* Contributors:
|
||||
* Contributors:
|
||||
*/
|
||||
|
||||
package grendel.ui;
|
||||
@ -53,10 +53,10 @@ import grendel.filters.FilterMaster;
|
||||
*/
|
||||
|
||||
import grendel.composition.Composition;
|
||||
import grendel.ui.UIAction;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
class PreferencesAction extends UIAction {
|
||||
class PreferencesAction extends Event {
|
||||
PreferencesAction fThis;
|
||||
|
||||
public PreferencesAction() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 26 Sep 1997.
|
||||
*
|
||||
@ -171,8 +171,8 @@ public abstract class ProgressFrame extends GeneralFrame implements Runnable {
|
||||
|
||||
fThread = null;
|
||||
// Is this right? (edwin)
|
||||
// this.dispose();
|
||||
this.hide();
|
||||
// this.dispose();
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public abstract void progressLoop();
|
||||
|
@ -12,12 +12,12 @@
|
||||
*
|
||||
* The Original Code is the Grendel mail/news client.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* 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): Jeff Galyan <jeffrey.galyan@sun.com>
|
||||
* Contributor(s): Jeff Galyan <jeffrey.galyan@sun.com>
|
||||
*/
|
||||
|
||||
package grendel.ui;
|
||||
@ -34,10 +34,10 @@ public class Splash extends JWindow {
|
||||
|
||||
public Splash() {
|
||||
super();
|
||||
ImageIcon image = new ImageIcon(getClass().getResource("images/GrendelSplash.jpg"));
|
||||
ImageIcon image = new ImageIcon("ui/images/GrendelSplash.jpg");
|
||||
JLabel splashLabel = new JLabel(image);
|
||||
getContentPane().add(splashLabel);
|
||||
|
||||
|
||||
Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
setLocation(screensize.width/2 - 150, screensize.height/2 - 150);
|
||||
|
||||
|
@ -46,17 +46,17 @@ public class UIFactory {
|
||||
|
||||
private UIFactory() {
|
||||
fFolderIcon =
|
||||
new ImageIcon(getClass().getResource("images/folder-small.gif"));
|
||||
new ImageIcon("ui/images/folder-small.gif");
|
||||
fNewsgroupIcon =
|
||||
new ImageIcon(getClass().getResource("images/newsgroup-small.gif"));
|
||||
new ImageIcon("ui/images/newsgroup-small.gif");
|
||||
fLocalStoreIcon =
|
||||
new ImageIcon(getClass().getResource("images/storeLocal-small.gif"));
|
||||
new ImageIcon("ui/images/storeLocal-small.gif");
|
||||
fRemoteStoreIcon =
|
||||
new ImageIcon(getClass().getResource("images/storeRemote-small.gif"));
|
||||
new ImageIcon("ui/images/storeRemote-small.gif");
|
||||
fInboxIcon =
|
||||
new ImageIcon(getClass().getResource("images/inbox-small.gif"));
|
||||
new ImageIcon("ui/images/inbox-small.gif");
|
||||
fConnectedIcon =
|
||||
new ImageIcon(getClass().getResource("images/connected-small.gif"));
|
||||
new ImageIcon("ui/images/connected-small.gif");
|
||||
}
|
||||
|
||||
public static UIFactory Instance() {
|
||||
|
@ -52,7 +52,6 @@ import javax.mail.MessagingException;
|
||||
|
||||
import grendel.prefs.base.InvisiblePrefs;
|
||||
import grendel.prefs.base.UIPrefs;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.view.ViewedMessage;
|
||||
import grendel.widgets.CollapsiblePanel;
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
@ -60,6 +59,8 @@ import grendel.widgets.Spring;
|
||||
import grendel.widgets.StatusEvent;
|
||||
import grendel.widgets.TreePath;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
/**
|
||||
* The legendary three pane UI.
|
||||
*/
|
||||
@ -183,8 +184,8 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
|
||||
layoutPanels(layout);
|
||||
|
||||
fMenu = buildMenu("menus.xml",
|
||||
Util.MergeActions(actions, Util.MergeActions(fFolders.getActions(), Util.MergeActions(fThreads.getActions(), fMessage.getActions()))));
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(Util.MergeActions(actions, Util.MergeActions(fFolders.getActions(), Util.MergeActions(fThreads.getActions(), fMessage.getActions()))));
|
||||
fMenu = builder.buildFrom("ui/menus.xml", this);
|
||||
|
||||
getRootPane().setJMenuBar(fMenu);
|
||||
|
||||
@ -205,7 +206,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
fToolBarPanelConstraints.fill = GridBagConstraints.NONE;
|
||||
fToolBarPanelConstraints.gridwidth = GridBagConstraints.REMAINDER;
|
||||
fToolBarPanelConstraints.anchor = GridBagConstraints.EAST;
|
||||
|
||||
|
||||
fToolBarPanel.add(fAnimation, fToolBarPanelConstraints);
|
||||
|
||||
fStatusBar = buildStatusBar();
|
||||
@ -225,7 +226,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
fFolders.getSize().width, fFolders.getSize().height,
|
||||
fThreads.getSize().width, fThreads.getSize().height
|
||||
);
|
||||
|
||||
|
||||
UIPrefs.GetMaster().setMultiPaneLayout(fLayout);
|
||||
UIPrefs.GetMaster().writePrefs();
|
||||
|
||||
@ -250,7 +251,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
if (fLayout.equals(layout)) {
|
||||
return; // nothing to do
|
||||
}
|
||||
|
||||
|
||||
fLayout = layout;
|
||||
remove(splitter1);
|
||||
remove(splitter2);
|
||||
@ -275,7 +276,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
threadX = tx;
|
||||
threadY = ty;
|
||||
// if the try bails, we use default
|
||||
} catch (NumberFormatException nf_ty) {
|
||||
} catch (NumberFormatException nf_ty) {
|
||||
nf_ty.printStackTrace();
|
||||
} finally {
|
||||
relayout = true;
|
||||
@ -299,7 +300,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
} else if (layout.equals(UnifiedMessageDisplayManager.SPLIT_LEFT)) {
|
||||
splitter1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
|
||||
splitter2.setOrientation(JSplitPane.VERTICAL_SPLIT);
|
||||
|
||||
|
||||
splitter2.setLeftComponent(fFolders);
|
||||
splitter2.setRightComponent(fThreads);
|
||||
|
||||
@ -321,7 +322,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
|
||||
splitter2.setLeftComponent(fFolders);
|
||||
splitter2.setRightComponent(fThreads);
|
||||
|
||||
|
||||
splitter1.setTopComponent(splitter2);
|
||||
splitter1.setBottomComponent(fMessage);
|
||||
}
|
||||
@ -345,7 +346,7 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
LayoutAction fStackedLayoutAction =
|
||||
new LayoutAction(UnifiedMessageDisplayManager.STACKED);
|
||||
|
||||
UIAction[] actions = { ActionFactory.GetExitAction(),
|
||||
Event[] actions = { ActionFactory.GetExitAction(),
|
||||
ActionFactory.GetNewMailAction(),
|
||||
ActionFactory.GetComposeMessageAction(),
|
||||
ActionFactory.GetPreferencesAction(),
|
||||
@ -473,15 +474,14 @@ class UnifiedMessageFrame extends GeneralFrame {
|
||||
// LayoutAction class
|
||||
//
|
||||
|
||||
class LayoutAction extends UIAction {
|
||||
class LayoutAction extends Event {
|
||||
ImageIcon fIcon;
|
||||
String action;
|
||||
public LayoutAction(String aAction) {
|
||||
super(aAction);
|
||||
this.setEnabled(true);
|
||||
action = aAction;
|
||||
fIcon = new ImageIcon(getClass().getResource("images/" +
|
||||
aAction + ".gif"));
|
||||
fIcon = new ImageIcon("ui/images/" + aAction + ".gif");
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent aEvent) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 9 Sep 1997.
|
||||
*
|
||||
@ -50,9 +50,10 @@ import javax.swing.JScrollPane;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import grendel.ui.ToolBarLayout;
|
||||
import grendel.ui.UIAction;
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class Util {
|
||||
static final boolean DEBUG = false;
|
||||
public static final int LEFT = 0;
|
||||
@ -108,9 +109,9 @@ public class Util {
|
||||
g.drawChars(fChars, first, length, x, y);
|
||||
}
|
||||
|
||||
static UIAction FindAction(Vector aVector, String aAction) {
|
||||
static Event FindAction(Vector aVector, String aAction) {
|
||||
for (int i = 0; i < aVector.size(); i++) {
|
||||
UIAction action = (UIAction)aVector.elementAt(i);
|
||||
Event action = (Event)aVector.elementAt(i);
|
||||
if (action.equals(aAction)) {
|
||||
return action;
|
||||
}
|
||||
@ -118,7 +119,7 @@ public class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
static public UIAction[] MergeActions(UIAction aActions1[], UIAction aActions2[]) {
|
||||
static public Event[] MergeActions(Event aActions1[], Event aActions2[]) {
|
||||
Vector resVector = new Vector();
|
||||
int i;
|
||||
if (aActions1 != null) {
|
||||
@ -133,7 +134,7 @@ public class Util {
|
||||
}
|
||||
}
|
||||
}
|
||||
UIAction res[] = new UIAction[resVector.size()];
|
||||
Event res[] = new Event[resVector.size()];
|
||||
resVector.copyInto(res);
|
||||
return res;
|
||||
}
|
||||
@ -141,7 +142,7 @@ public class Util {
|
||||
static public GrendelToolBar MergeToolBars(GrendelToolBar aBar1, GrendelToolBar aBar2) {
|
||||
GrendelToolBar res = new GrendelToolBar();
|
||||
res.setLayout(new ToolBarLayout());
|
||||
|
||||
|
||||
Component barArray1[] = aBar1.getComponents();
|
||||
Component barArray2[] = aBar2.getComponents();
|
||||
int count1 = aBar1.getComponentCount();
|
||||
@ -193,16 +194,16 @@ public class Util {
|
||||
{
|
||||
button2 = (JButton) barArray2[j];
|
||||
}
|
||||
if (button2 != null)
|
||||
if (button2 != null)
|
||||
{
|
||||
res.add(button2);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void RegisterScrollingKeys(JScrollPane aScrollPane) {
|
||||
aScrollPane.registerKeyboardAction(new ScrollAction(aScrollPane, KeyEvent.VK_UP),
|
||||
@ -277,7 +278,7 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
class ScrollAction extends UIAction {
|
||||
class ScrollAction extends Event {
|
||||
JScrollPane fScrollPane;
|
||||
int fAction;
|
||||
|
||||
|
@ -17,303 +17,83 @@
|
||||
* Copyright (C) 1999 Giao Nguyen. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Morgan Schweers <morgan@vixen.com>
|
||||
* Contributor(s):
|
||||
* Morgan Schweers <morgan@vixen.com>
|
||||
* R.J. Keller <rj.keller@beonex.com>
|
||||
*/
|
||||
|
||||
package grendel.ui;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Properties;
|
||||
|
||||
import java.awt.Container;
|
||||
import java.awt.Font;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JRadioButtonMenuItem;
|
||||
import javax.swing.ButtonGroup;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import com.sun.xml.parser.Resolver;
|
||||
import com.sun.xml.parser.Parser;
|
||||
import com.sun.xml.tree.XmlDocument;
|
||||
import com.sun.xml.tree.TreeWalker;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import grendel.widgets.MenuCtrl;
|
||||
import grendel.widgets.MenuBarCtrl;
|
||||
import grendel.widgets.Control;
|
||||
import com.trfenv.parsers.xul.XulParser;
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
/**
|
||||
* Build a menu bar from an XML data source. This builder supports:
|
||||
* <UL>
|
||||
* <LI>Text label cross referencing to a properties file.
|
||||
* <LI>Text label cross referencing to a DTD file.
|
||||
* <LI>Action lookups.
|
||||
* </UL>
|
||||
*/
|
||||
public class XMLMenuBuilder extends XMLWidgetBuilder {
|
||||
static final String id_attr = "id";
|
||||
static final String menu_tag = "menu";
|
||||
static final String label_attr = "label";
|
||||
static final String separator_attr = "separator";
|
||||
static final String menuitem_tag = "menuitem";
|
||||
static final String checkbox_attr = "checkbox";
|
||||
static final String radio_attr = "radio";
|
||||
static final String group_attr = "group";
|
||||
static final String accel_attr = "accel";
|
||||
static final String type_attr = "type";
|
||||
public class XMLMenuBuilder {
|
||||
private Event[] mListener;
|
||||
private Element root;
|
||||
private JMenuBar mMenuBar;
|
||||
|
||||
/**
|
||||
* The button group indexed by its name.
|
||||
*/
|
||||
protected Hashtable button_group;
|
||||
|
||||
Hashtable actions;
|
||||
MenuBarCtrl component;
|
||||
private Map<String, JComponent> mIDs;
|
||||
|
||||
/**
|
||||
* Build a menu builder which operates on XML formatted data
|
||||
*
|
||||
* @param ref the reference point for properties location
|
||||
* @param actionList array of UIAction objects to map to
|
||||
*
|
||||
* @param aListener The action listener that contains the events
|
||||
* for all the tags that will be parsed.
|
||||
*/
|
||||
public XMLMenuBuilder(Class ref, UIAction[] actionList) {
|
||||
button_group = new Hashtable();
|
||||
actions = new Hashtable();
|
||||
this.ref = ref;
|
||||
|
||||
if (actionList != null) {
|
||||
for (int i = 0; i < actionList.length; i++) {
|
||||
actions.put(actionList[i].getName(), actionList[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a menu builder which operates on XML formatted data
|
||||
*
|
||||
* @param frame reference point for properties location
|
||||
* @param actionList array of UIAction objects to map to
|
||||
*/
|
||||
public XMLMenuBuilder(JFrame frame, UIAction[] actionList) {
|
||||
this(frame.getClass(), actionList);
|
||||
public XMLMenuBuilder(Event[] aListener) {
|
||||
mListener = aListener;
|
||||
mIDs = new HashMap<String, JComponent>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the input stream and build a menubar from it
|
||||
*
|
||||
* @param stream the stream containing the XML data
|
||||
*Builds a JMenuBar based on the input stream data.
|
||||
*
|
||||
* @param stream The input stream to read the XML data from.
|
||||
* @param aWindow The parent window of this menubar.
|
||||
*/
|
||||
public JComponent buildFrom(InputStream stream) {
|
||||
XmlDocument doc;
|
||||
TreeWalker tree;
|
||||
Node node;
|
||||
URL linkURL;
|
||||
Element current;
|
||||
public JMenuBar buildFrom(String file, JFrame aWindow) {
|
||||
XulParser parser = new XulParser(mListener, aWindow);
|
||||
|
||||
try {
|
||||
doc = XmlDocument.createXmlDocument(stream, false);
|
||||
current = doc.getDocumentElement();
|
||||
tree = new TreeWalker(current);
|
||||
Document doc = XulParser.makeDocument(file);
|
||||
root = doc.getDocumentElement();
|
||||
|
||||
// get the link tag for this file
|
||||
node = tree.getNextElement("head").getFirstChild().getNextSibling();
|
||||
|
||||
// set the configuration contained in this node
|
||||
setConfiguration((Element)node);
|
||||
|
||||
// skip to the body
|
||||
buildFrom(tree.getNextElement("body"));
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} finally {
|
||||
return component;
|
||||
}
|
||||
}
|
||||
|
||||
public JMenu buildMenu(Element element) {
|
||||
Node node;
|
||||
MenuCtrl menu = new MenuCtrl();
|
||||
String my_id = element.getAttribute(id_attr);
|
||||
|
||||
menu.setText(getReferencedLabel(element, label_attr).trim());
|
||||
menu.setActionCommand(element.getAttribute(id_attr));
|
||||
|
||||
node = element.getFirstChild().getNextSibling();
|
||||
|
||||
while (node != null) {
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
Element current = (Element)node;
|
||||
String tag = current.getTagName();
|
||||
JComponent comp = buildComponent((Element)node);
|
||||
|
||||
menu.add(comp);
|
||||
}
|
||||
|
||||
node = node.getNextSibling();
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
public JComponent buildFrom(Element element) {
|
||||
Node node =
|
||||
element.getFirstChild().getNextSibling().getFirstChild().getNextSibling();
|
||||
component = new MenuBarCtrl();
|
||||
|
||||
while (node != null) {
|
||||
|
||||
// if it's an element, we process.
|
||||
// otherwise, it's probably a closing tag
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
JMenu menu = buildMenu((Element)node);
|
||||
component.addItemByName(menu.getActionCommand(), menu);
|
||||
}
|
||||
|
||||
node = node.getNextSibling();
|
||||
}
|
||||
|
||||
return component;
|
||||
//no, we don't support multiple menu bars. If there are multiple menubars, just take
|
||||
//the first one.
|
||||
Element menubarTag = (Element)root.getElementsByTagName("menubar").item(0);
|
||||
mMenuBar = (JMenuBar)parser.parseTag(null, menubarTag);
|
||||
mIDs = parser.getIDs();
|
||||
return mMenuBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the menubar built by this builder
|
||||
*Returns a map containing the element ID as a string and the JComponent being
|
||||
*the component that the ID connects to.
|
||||
*/
|
||||
public MenuBarCtrl getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
public void configureForOwner(JComponent component) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the component at the current XML element and add to the parent
|
||||
* @param current the current element
|
||||
*/
|
||||
protected JComponent buildComponent(Element current) {
|
||||
String tag = current.getTagName();
|
||||
JComponent comp = null;
|
||||
|
||||
// menu tag
|
||||
if (tag.equals(menu_tag)) {
|
||||
comp = buildMenu(current);
|
||||
} else if (tag.equals(menuitem_tag)) { // menuitem tag
|
||||
String type = current.getAttribute(type_attr);
|
||||
|
||||
// which type of menuitem?
|
||||
if (type.equals("")) {
|
||||
// no type ? it's a regular menuitem
|
||||
comp = buildMenuItem(current);
|
||||
} else if (type.equals(separator_attr)) { // separator
|
||||
comp = buildSeparator(current);
|
||||
} else if (type.equals(checkbox_attr)) { // checkboxes
|
||||
comp = buildCheckBoxMenuItem(current);
|
||||
} else if (type.equals(radio_attr)) { // radio
|
||||
comp = buildRadioMenuItem(current);
|
||||
}
|
||||
}
|
||||
|
||||
comp.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
return comp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a JRadioMenuItem
|
||||
* @param current the element that describes the JRadioMenuItem
|
||||
* @return the built component
|
||||
*/
|
||||
protected JRadioButtonMenuItem buildRadioMenuItem(Element current) {
|
||||
String group = current.getAttribute(group_attr);
|
||||
ButtonGroup bg;
|
||||
JRadioButtonMenuItem comp = new JRadioButtonMenuItem();
|
||||
finishComponent(comp, current);
|
||||
|
||||
// do we add to a button group?
|
||||
if (button_group.containsKey(group)) {
|
||||
bg = (ButtonGroup)button_group.get(group);
|
||||
} else {
|
||||
bg = new ButtonGroup();
|
||||
button_group.put(group, bg);
|
||||
}
|
||||
bg.add((JRadioButtonMenuItem)comp);
|
||||
|
||||
comp.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
return comp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a JCheckBoxMenuItem.
|
||||
* @param current the element that describes the JCheckBoxMenuItem
|
||||
* @return the built component
|
||||
*/
|
||||
protected JCheckBoxMenuItem buildCheckBoxMenuItem(Element current) {
|
||||
JCheckBoxMenuItem item = new JCheckBoxMenuItem();
|
||||
finishComponent(item, current);
|
||||
item.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a JSeparator.
|
||||
* @param current the element that describes the JSeparator
|
||||
* @return the built component
|
||||
*/
|
||||
protected JSeparator buildSeparator(Element current) {
|
||||
return new JSeparator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a JMenuItem.
|
||||
* @param current the element that describes the JMenuItem
|
||||
* @return the built component
|
||||
*/
|
||||
protected JMenuItem buildMenuItem(Element current) {
|
||||
JMenuItem item = new JMenuItem();
|
||||
finishComponent(item, current);
|
||||
item.setFont(new Font("Helvetica", Font.PLAIN, 12));
|
||||
return item;
|
||||
}
|
||||
|
||||
private void finishComponent(JMenuItem item, Element current) {
|
||||
String label = getReferencedLabel(current, label_attr);
|
||||
UIAction action = null;
|
||||
|
||||
if (label.length() > 0) {
|
||||
item.setText(label);
|
||||
}
|
||||
|
||||
label = current.getAttribute("action");
|
||||
if ((action = (UIAction)actions.get(label)) != null) {
|
||||
item.addActionListener(action);
|
||||
}
|
||||
|
||||
label = getReferencedLabel(current, accel_attr);
|
||||
if (label.length() > 0) {
|
||||
item.setMnemonic(label.charAt(0));
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
javax.swing.JFrame frame = new javax.swing.JFrame("Foo bar");
|
||||
XMLMenuBuilder builder = new XMLMenuBuilder(frame, new UIAction[0]);
|
||||
URL url = builder.getClass().getResource("menus.xml");
|
||||
builder.buildFrom(url.openStream());
|
||||
frame.setJMenuBar((JMenuBar)builder.getComponent());
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
public Map<String, JComponent> getElementsAndIDs()
|
||||
{
|
||||
return mIDs;
|
||||
}
|
||||
}
|
||||
|
@ -56,16 +56,9 @@ import javax.swing.JComboBox;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import com.sun.xml.parser.Resolver;
|
||||
import com.sun.xml.parser.Parser;
|
||||
import com.sun.xml.tree.XmlDocument;
|
||||
import com.sun.xml.tree.TreeWalker;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
/**
|
||||
* Build a panel from an XML data source.
|
||||
@ -84,17 +77,17 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
static final String label_tag = "label";
|
||||
static final String image_tag = "image";
|
||||
static final String layout_attr = "layout";
|
||||
|
||||
|
||||
PageUI component;
|
||||
String title;
|
||||
String id;
|
||||
String attr;
|
||||
PageModel model;
|
||||
Hashtable group = new Hashtable();
|
||||
|
||||
|
||||
/**
|
||||
* Build a menu builder which operates on XML formatted data
|
||||
*
|
||||
*
|
||||
* @param attr attribute
|
||||
* @param id the value of the attribute to have a match
|
||||
* @param model the page model for the page to be created
|
||||
@ -104,34 +97,31 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
this.id = id;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read the input stream and build a menubar from it
|
||||
*
|
||||
*
|
||||
* @param stream the stream containing the XML data
|
||||
*/
|
||||
public JComponent buildFrom(InputStream stream) {
|
||||
XmlDocument doc;
|
||||
TreeWalker tree;
|
||||
Document doc;
|
||||
Node node;
|
||||
URL linkURL;
|
||||
Element current;
|
||||
|
||||
|
||||
try {
|
||||
doc = XmlDocument.createXmlDocument(stream, false);
|
||||
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(stream);
|
||||
current = doc.getDocumentElement();
|
||||
tree = new TreeWalker(current);
|
||||
|
||||
|
||||
// get the link tag for this file
|
||||
// get into head and get the first element
|
||||
node =
|
||||
tree.getNextElement("head").getFirstChild().getNextSibling();
|
||||
|
||||
node = current.getElementsByTagName("head").item(0).getFirstChild().getNextSibling();
|
||||
|
||||
// set the configuration contained in this node
|
||||
setConfiguration((Element)node);
|
||||
|
||||
// skip to the body and find the element
|
||||
current = findTargetElement(tree.getNextElement("body"));
|
||||
|
||||
// skip to the body and find the element
|
||||
current = findTargetElement((Element)current.getElementsByTagName("body").item(0));
|
||||
|
||||
if (current != null) {
|
||||
component = (PageUI)buildFrom(current);
|
||||
@ -142,7 +132,7 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Locates the element targeted.
|
||||
* @param element the element that contains all nodes to search
|
||||
@ -150,7 +140,7 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
*/
|
||||
private Element findTargetElement(Element element) {
|
||||
Node node = element.getFirstChild().getNextSibling();
|
||||
|
||||
|
||||
while (node != null) {
|
||||
// make sure we're looking at an ELEMENT_NODE
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
@ -183,16 +173,16 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
|
||||
/**
|
||||
* Build a panel.
|
||||
* @param element the panel element
|
||||
* @param element the panel element
|
||||
* @return the panel object as a PageUI type
|
||||
*/
|
||||
public PageUI buildPanel(Element element) {
|
||||
Node node = element.getFirstChild().getNextSibling();
|
||||
|
||||
|
||||
PageUI my_component = new PageUI();
|
||||
|
||||
// every pageui in a dialog shares the same model. pageui just
|
||||
// spec the layout.
|
||||
// every pageui in a dialog shares the same model. pageui just
|
||||
// spec the layout.
|
||||
my_component.setModel(model);
|
||||
|
||||
// in the future, we'll determine what the layout manager is. for now,
|
||||
@ -212,10 +202,10 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
|
||||
return my_component;
|
||||
}
|
||||
|
||||
|
||||
private int parseGridConstant(String data) {
|
||||
int result = 1;
|
||||
|
||||
|
||||
try {
|
||||
data = data.trim();
|
||||
result = Integer.parseInt(data);
|
||||
@ -232,9 +222,9 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
|
||||
private int parseFillConstant(String fill) {
|
||||
int result = GridBagConstraints.NONE;
|
||||
|
||||
|
||||
fill = fill.trim();
|
||||
|
||||
|
||||
if (fill.equals("horizontal")) {
|
||||
result = GridBagConstraints.HORIZONTAL;
|
||||
} else if (fill.equals("vertical")) {
|
||||
@ -248,7 +238,7 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
|
||||
private float parseWeightConstant(String weight) {
|
||||
float result = 0.0f;
|
||||
|
||||
|
||||
try {
|
||||
result = Float.valueOf(weight).floatValue();
|
||||
} catch (NumberFormatException nfe) {
|
||||
@ -256,7 +246,7 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a constraint from the element's details.
|
||||
*
|
||||
@ -265,33 +255,33 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
*/
|
||||
protected GridBagConstraints buildConstraints(Element current) {
|
||||
GridBagConstraints constraints = new GridBagConstraints();
|
||||
CustomInsets inset =
|
||||
CustomInsets inset =
|
||||
new CustomInsets(current.getAttribute("insets"));
|
||||
|
||||
constraints.weightx =
|
||||
constraints.weightx =
|
||||
parseWeightConstant(current.getAttribute("weightx"));
|
||||
|
||||
constraints.weighty =
|
||||
|
||||
constraints.weighty =
|
||||
parseWeightConstant(current.getAttribute("weighty"));
|
||||
|
||||
|
||||
// fill
|
||||
constraints.fill = parseFillConstant(current.getAttribute("fill"));
|
||||
|
||||
constraints.gridwidth =
|
||||
|
||||
constraints.gridwidth =
|
||||
parseGridConstant(current.getAttribute("gridwidth"));
|
||||
|
||||
constraints.gridheight =
|
||||
|
||||
constraints.gridheight =
|
||||
parseGridConstant(current.getAttribute("gridheight"));
|
||||
|
||||
|
||||
constraints.insets = inset;
|
||||
|
||||
|
||||
return constraints;
|
||||
}
|
||||
|
||||
|
||||
protected JComponent buildComponent(Element current) {
|
||||
JComponent item = null;
|
||||
String tag = current.getTagName();
|
||||
|
||||
|
||||
if (tag.equals(input_tag)) { // input tag
|
||||
item = buildInput(current);
|
||||
} else if (tag.equals(label_tag)) {
|
||||
@ -301,18 +291,18 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
} else if (tag.equals(image_tag)) {
|
||||
item = buildImage(current);
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
protected JPasswordField buildPasswordField(Element current) {
|
||||
JPasswordField item = null;
|
||||
|
||||
|
||||
item = new JPasswordField();
|
||||
textFieldAdjustments(item, current);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
private void textFieldAdjustments(JTextField item, Element current) {
|
||||
String s = current.getAttribute("columns");
|
||||
s = s.trim();
|
||||
@ -322,23 +312,23 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
} catch (NumberFormatException nfe) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected JTextField buildTextField(Element current) {
|
||||
JTextField item = new JTextField();
|
||||
textFieldAdjustments(item, current);
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
protected JRadioButton buildRadioButton(Element current) {
|
||||
JRadioButton item = new JRadioButton();
|
||||
String label = getReferencedLabel(current, "title");
|
||||
String group_str = current.getAttribute("group");
|
||||
|
||||
|
||||
if (label.length() > 0) {
|
||||
item.setText(label);
|
||||
}
|
||||
|
||||
|
||||
// button group matters
|
||||
if (group_str.length() > 0) {
|
||||
ButtonGroup bg;
|
||||
@ -350,14 +340,14 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
}
|
||||
bg.add(item);
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
private JComponent buildInput(Element current) {
|
||||
JComponent item = null;
|
||||
String type = current.getAttribute("type");
|
||||
|
||||
|
||||
String ID = current.getAttribute("ID");
|
||||
if (type.equals("radio")) { // radio type
|
||||
item = buildRadioButton(current);
|
||||
@ -374,50 +364,50 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
} else if (type.equals("combobox")) {
|
||||
item = buildComboBox(current);
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
protected JCheckBox buildCheckBox(Element current) {
|
||||
return new JCheckBox(getReferencedLabel(current, "title"));
|
||||
}
|
||||
|
||||
|
||||
protected JButton buildButton(Element current) {
|
||||
JButton button = new JButton(getReferencedLabel(current, "title"));
|
||||
button.addActionListener(model);
|
||||
button.setActionCommand(getReferencedLabel(current, "command"));
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
protected JList buildList(Element current) {
|
||||
JList list = new JList();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
protected JComboBox buildComboBox(Element current) {
|
||||
JComboBox combobox = new JComboBox();
|
||||
return combobox;
|
||||
}
|
||||
|
||||
|
||||
protected JLabel buildLabel(Element current) {
|
||||
JLabel label = new JLabel(getReferencedLabel(current, "title"));
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
protected JLabel buildImage(Element current) {
|
||||
URL iconURL = ref.getResource(getReferencedLabel(current, "href"));
|
||||
JLabel label = new JLabel(new ImageIcon(iconURL));
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
public JPanel getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
javax.swing.JFrame frame = new javax.swing.JFrame("Foo bar");
|
||||
PageModel model = new PageModel();
|
||||
@ -426,40 +416,40 @@ public class XMLPageBuilder extends XMLWidgetBuilder {
|
||||
builder.buildFrom(url.openStream());
|
||||
JPanel panel = builder.getComponent();
|
||||
JDialog dialog = new JDialog();
|
||||
|
||||
|
||||
dialog.getContentPane().setLayout(new java.awt.GridBagLayout());
|
||||
dialog.getContentPane().add(panel, null);
|
||||
dialog.setTitle(builder.getTitle());
|
||||
dialog.pack();
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class CustomInsets extends Insets {
|
||||
CustomInsets(String inset) {
|
||||
super(0, 0, 0, 0);
|
||||
|
||||
|
||||
inset = inset.trim();
|
||||
|
||||
if (inset != null && inset.length() >= 9
|
||||
&& (inset.charAt(0) == '['
|
||||
|
||||
if (inset != null && inset.length() >= 9
|
||||
&& (inset.charAt(0) == '['
|
||||
|| inset.charAt(inset.length() - 1) == ']')) {
|
||||
inset = inset.substring(1, inset.length() - 1);
|
||||
int[] val = parseInset(inset); // guaranteed to be a length of 4
|
||||
|
||||
|
||||
top = val[0];
|
||||
left = val[1];
|
||||
bottom = val[2];
|
||||
right = val[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int[] parseInset(String inset) {
|
||||
// if all else fails, it's 0
|
||||
int[] val = { 0, 0, 0, 0 };
|
||||
StringTokenizer tok = new StringTokenizer(inset, ",");
|
||||
|
||||
|
||||
// assign the values into
|
||||
for (int i = 0; i < val.length; i++) {
|
||||
try {
|
||||
|
@ -1,136 +1,89 @@
|
||||
<?xml version="1.0"?>
|
||||
<xml>
|
||||
<head>
|
||||
<link role="stringprops" href="MenuLabels.properties"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % menuLabelsDTD SYSTEM "MenuLabels.dtd" >
|
||||
%menuLabelsDTD;
|
||||
]>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<keyset><!--
|
||||
<key modifiers="accel" key="&folderNewAccel;" oncommand="msgNew"/>
|
||||
--></keyset>
|
||||
|
||||
<menubar id="mail.multi_pane">
|
||||
<menu id="FileMenu" category="file"
|
||||
label="$multiFileLabel" accel="F">
|
||||
<menuitem id="msgNew" category="file" action="msgNew"
|
||||
label="$msgNewLabel" accel="$msgNewAccel"
|
||||
description=""/>
|
||||
<menuitem id="folderNew" category="file" action="folderNew"
|
||||
label="$folderNewLabel" accel="$folderNewAccel"
|
||||
description=""/>
|
||||
<menuitem id="msgOpen" category="file" action="msgOpen"
|
||||
label="$msgOpenLabel" accel="$msgOpenAccel"
|
||||
description=""/>
|
||||
<menuitem id="msgSaveAs" category="file" action="msgSaveAs"
|
||||
label="$msgSaveAsLabel" accel="$msgSaveAsAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="msgGetNew" category="file" action="msgGetNew"
|
||||
label="$msgGetNewLabel" accel="$msgGetNewAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="appExit" category="quit" action="appExit"
|
||||
label="$appExitLabel" accel="$appExitAccel"
|
||||
description=""/>
|
||||
|
||||
<menu id="FileMenu" label="&multiFileLabel;" accesskey="&multiFileAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="msgNew" onclick="msgNew" label="&msgNewLabel;" accesskey="&msgNewAccel;"/>
|
||||
<menuitem id="folderNew" onclick="folderNew" label="&folderNewLabel;" accesskey="&folderNewAccel;"/>
|
||||
<menuitem id="msgOpen" onclick="msgOpen" label="&msgOpenLabel;" accesskey="&msgOpenAccel;"/>
|
||||
<menuitem id="msgSaveAs" onclick="msgSaveAs" label="&msgSaveAsLabel;" accesskey="&msgSaveAsAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="msgGetNew" onclick="msgGetNew" label="&msgGetNewLabel;" accesskey="&msgGetNewAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appExit" onclick="appExit" label="&appExitLabel;" accesskey="&appExitAccel;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="EditMenu" category="edit"
|
||||
label="$multiEditLabel" accel="$multiEditAccel">
|
||||
<menuitem id="editUndo" category="edit" action="editUndo"
|
||||
label="$editUndoLabel" accel="$editUndoAccel"
|
||||
description=""/>
|
||||
<menuitem id="editCut" category="edit" action="editCut"
|
||||
label="$editCutLabel" accel="$editCutAccel"
|
||||
description=""/>
|
||||
<menuitem id="editCopy" category="edit" action="editCopy"
|
||||
label="$editCopyLabel" accel="$editCopyAccel"
|
||||
description=""/>
|
||||
<menuitem id="editPaste" category="edit" action="editPaste"
|
||||
label="$editPasteLabel" accel="$editPasteAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="folderDelete" category="edit" action="folderDelete"
|
||||
label="$folderDeleteLabel" accel="$folderDeleteAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="appSearch" category="edit" action="appSearch"
|
||||
label="$appSearchLabel" accel="$appSearchAccel"
|
||||
description=""/>
|
||||
<menuitem id="appRunFilters" category="edit" action="appRunFilters"
|
||||
label="$appRunFiltersLabel" accel="$appRunFiltersAccel"
|
||||
description=""/>
|
||||
|
||||
<menu id="EditMenu" label="&multiEditLabel;" accesskey="&multiEditAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="editUndo" onclick="editUndo" label="&editUndoLabel;" accesskey="&editUndoAccel;"/>
|
||||
<menuitem id="editCut" onclick="editCut" label="&editCutLabel;" accesskey="&editCutAccel;"/>
|
||||
<menuitem id="editCopy" onclick="editCopy" label="&editCopyLabel;" accesskey="&editCopyAccel;"/>
|
||||
<menuitem id="editPaste" onclick="editPaste" label="&editPasteLabel;" accesskey="&editPasteAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="folderDelete" onclick="folderDelete" label="&folderDeleteLabel;" accesskey="&folderDeleteAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appSearch" onclick="appSearch" label="&appSearchLabel;" accesskey="&appSearchAccel;"/>
|
||||
<menuitem id="appRunFilters" onclick="appRunFilters" label="&appRunFiltersLabel;" accesskey="&appRunFiltersAccel;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="ViewMenu" category="view"
|
||||
label="$multiViewLabel" accel="$multiViewAccel">
|
||||
<menu id="SortMenu" category="view"
|
||||
label="$viewSortLabel" accel="$viewSortAccel">
|
||||
<menuitem id="toggleThreading" category="view" action="toggleThreading"
|
||||
type="checkbox"
|
||||
label="$toggleThreadingLabel" accel="$toggleThreadingAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="sortAuthor" category="view" action="sortAuthor"
|
||||
type="radio" group="sort"
|
||||
label="$sortAuthorLabel" accel="$sortAuthorAccel"
|
||||
description=""/>
|
||||
<menuitem id="sortDate" category="view" action="sortDate"
|
||||
type="radio" group="sort"
|
||||
label="$sortDateLabel" accel="$sortDateAccel"
|
||||
description=""/>
|
||||
<menuitem id="sortNumber" category="view" action="sortNumber"
|
||||
type="radio" group="sort"
|
||||
label="$sortNumberLabel" accel="$sortNumberAccel"
|
||||
description=""/>
|
||||
<menuitem id="sortSubject" category="view" action="sortSubject"
|
||||
type="radio" group="sort"
|
||||
label="$sortSubjectLabel" accel="$sortSubjectAccel"
|
||||
description=""/>
|
||||
</menu>
|
||||
|
||||
<menu id="ViewMenu" label="&multiViewLabel;" accesskey="&multiViewAccel;">
|
||||
<menupopup>
|
||||
<menu id="SortMenu" label="&viewSortLabel;" accesskey="&viewSortAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="toggleThreading" onclick="toggleThreading" label="&toggleThreadingLabel;" accesskey="&toggleThreadingAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="sortAuthor" onclick="sortAuthor" label="&sortAuthorLabel;" accesskey="&sortAuthorAccel;"/>
|
||||
<menuitem id="sortDate" onclick="sortDate" label="&sortDateLabel;" accesskey="&sortDateAccel;"/>
|
||||
<menuitem id="sortNumber" onclick="sortNumber" label="&sortNumberLabel;" accesskey="&sortNumberAccel;"/>
|
||||
<menuitem id="sortSubject" onclick="sortSubject" label="&sortSubjectLabel;" accesskey="&sortSubjectAccel;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="MessageMenu" category="message"
|
||||
label="$multiMessageLabel" accel="$multiMessageAccel">
|
||||
<menuitem id="msgNew" category="message" action="msgNew"
|
||||
label="$msgNewLabel" accel="$msgNewAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menuitem id="msgReply" category="message" action="msgReply"
|
||||
label="$msgReplyLabel" accel="$msgReplyAccel"
|
||||
description=""/>
|
||||
<menuitem id="msgReplyAll" category="message" action="msgReplyAll"
|
||||
label="$msgReplyAllLabel" accel="$msgReplyAllAccel"
|
||||
description=""/>
|
||||
<menuitem id="fwdQuoted" category="message" action="fwdQuoted"
|
||||
label="$fwdQuotedLabel" accel="$fwdQuotedAccel"
|
||||
description=""/>
|
||||
<menuitem id="fwdInline" category="message" action="fwdInline"
|
||||
label="$fwdInlineLabel" accel="$fwdInlineAccel"
|
||||
description=""/>
|
||||
<menuitem id="fwdAttachment" category="message" action="fwdAttachment"
|
||||
label="$fwdAttachmentLabel" accel="$fwdAttachmentAccel"
|
||||
description=""/>
|
||||
<menuitem type="separator"/>
|
||||
<menu id="msgMark" category="message"
|
||||
label="$msgMarkLabel" accel="$msgMarkAccel">
|
||||
<menuitem id="markMsgRead" category="message" action="markMsgRead"
|
||||
label="$markMsgReadLabel" accel="$markMsgReadAccel"
|
||||
description=""/>
|
||||
<menuitem id="markThreadRead" category="message" action="markThreadRead"
|
||||
label="$markThreadReadLabel" accel="$markThreadReadAccel"
|
||||
description=""/>
|
||||
<menuitem id="markAllRead" category="message" action="markAllRead"
|
||||
label="$markAllReadLabel" accel="$markAllReadAccel"
|
||||
description=""/>
|
||||
</menu>
|
||||
|
||||
<menu id="MessageMenu" label="&multiMessageLabel;" accesskey="&multiMessageAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="msgNew" onclick="msgNew" label="&msgNewLabel;" accesskey="&msgNewAccel;"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="msgReply" onclick="msgReply" label="&msgReplyLabel;" accesskey="&msgReplyAccel;"/>
|
||||
<menuitem id="msgReplyAll" onclick="msgReplyAll" label="&msgReplyAllLabel;" accesskey="&msgReplyAllAccel;"/>
|
||||
<menuitem id="fwdQuoted" onclick="fwdQuoted" label="&fwdQuotedLabel;" accesskey="&fwdQuotedAccel;"/>
|
||||
<menuitem id="fwdInline" onclick="fwdInline" label="&fwdInlineLabel;" accesskey="&fwdInlineAccel;"/>
|
||||
<menuitem id="fwdAttachment" onclick="fwdAttachment" label="&fwdAttachmentLabel;" accesskey="&fwdAttachmentAccel;"/>
|
||||
<menuseparator/>
|
||||
<menu id="msgMark" label="&msgMarkLabel;" accesskey="&msgMarkAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="markMsgRead" onclick="markMsgRead" label="&markMsgReadLabel;" accesskey="&markMsgReadAccel;"/>
|
||||
<menuitem id="markThreadRead" onclick="markThreadRead" label="&markThreadReadLabel;" accesskey="&markThreadReadAccel;"/>
|
||||
<menuitem id="markAllRead" onclick="markAllRead" label="&markAllReadLabel;" accesskey="&markAllReadAccel;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="PrefsMenu" category="prefs"
|
||||
label="$multiPrefsLabel" accel="$multiPrefsAccel">
|
||||
<menuitem id="prefGeneral" category="prefs" action="prefGeneral"
|
||||
label="$prefGeneralLabel" accel="$prefGeneralAccel"
|
||||
description=""/>
|
||||
<menuitem id="prefIds" category="prefs" action="prefIds"
|
||||
label="$prefIdsLabel" accel="$prefIdsAccel"
|
||||
description=""/>
|
||||
<menuitem id="prefSrvs" category="prefs" action="prefSrvs"
|
||||
label="$prefSrvsLabel" accel="$prefSrvsAccel"
|
||||
description=""/>
|
||||
<menuitem id="prefUI" category="prefs" action="prefUI"
|
||||
label="$prefUILabel" accel="$prefUIAccel"
|
||||
description=""/>
|
||||
|
||||
<menu id="PrefsMenu" label="&multiPrefsLabel;" accesskey="&multiPrefsAccel;">
|
||||
<menupopup>
|
||||
<menuitem id="prefGeneral" onclick="prefGeneral" label="&prefGeneralLabel;" accesskey="&prefGeneralAccel;"/>
|
||||
<menuitem id="prefIds" onclick="prefIds" label="&prefIdsLabel;" accesskey="&prefIdsAccel;"/>
|
||||
<menuitem id="prefSrvs" onclick="prefSrvs" label="&prefSrvsLabel;" accesskey="&prefSrvsAccel;"/>
|
||||
<menuitem id="prefUI" onclick="prefUI" label="&prefUILabel;" accesskey="&prefUIAccel;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
</menubar>
|
||||
</body>
|
||||
</xml>
|
||||
|
||||
</window>
|
@ -1 +1 @@
|
||||
/* -*- 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): Brandon Wiley
*
* Created: Brandon Wiley
*/
package grendel.view;
import java.util.*;
public class EnumerationIterator implements Iterator
{
Enumeration enum;
*/
.nextElement();}
public void remove() {}
}
|
||||
/* -*- 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): Brandon Wiley
*
* Created: Brandon Wiley
*/
package grendel.view;
import java.util.*;
public class EnumerationIterator implements Iterator
{
Enumeration enumer;
import java.util.*;
public class EnumerationIterator implements Iterator
{
.nextElement();}
public void remove() {}
}
|
@ -94,7 +94,7 @@ class TestMessageThread implements IThreadable, ISortable {
|
||||
|
||||
if (start < (L-2) &&
|
||||
(subject.charAt(start) == 'r' || subject.charAt(start) == 'R') &&
|
||||
(subject.charAt(start+1) == 'e' || subject.charAt(start+1) == 'e')) {
|
||||
(subject.charAt(start+1) == 'e' || subject.charAt(start+1) == 'E')) {
|
||||
if (subject.charAt(start+2) == ':') {
|
||||
start += 3; // Skip over "Re:"
|
||||
has_re = true; // yes, we found it.
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Copyright (C) 1997 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Contributor(s):
|
||||
*
|
||||
* Created: Will Scullin <scullin@netscape.com>, 23 Oct 1997.
|
||||
*/
|
||||
@ -105,8 +105,8 @@ public class Animation extends Component implements Runnable
|
||||
for (int i = 0; i < iFrames; i++)
|
||||
{
|
||||
Integer arg[] = { new Integer(i) };
|
||||
String name = MessageFormat.format(template, arg);
|
||||
fGlyphs[i] = new ImageIcon(getClass().getResource(name));
|
||||
String name = MessageFormat.format(template, arg, null);
|
||||
fGlyphs[i] = new ImageIcon(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
*
|
||||
* The Original Code is the Grendel mail/news client.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Jeff Galyan
|
||||
* The Initial Developer of the Original Code is Jeff Galyan
|
||||
* <talisman@anamorphic.com>. Portions created by Jeff Galyan are
|
||||
* Copyright (C) 1997 Jeff Galyan. All
|
||||
* Rights Reserved.
|
||||
@ -35,14 +35,14 @@ import javax.swing.JToolBar;
|
||||
import javax.swing.JButton;
|
||||
|
||||
import grendel.ui.ToolBarLayout;
|
||||
import grendel.ui.UIAction;
|
||||
|
||||
import grendel.widgets.Animation;
|
||||
import grendel.widgets.Spring;
|
||||
import grendel.widgets.ToolBarButton;
|
||||
|
||||
import com.trfenv.parsers.Event;
|
||||
|
||||
public class GrendelToolBar extends JToolBar {
|
||||
|
||||
|
||||
private ToolBarLayout layout;
|
||||
|
||||
public GrendelToolBar() {
|
||||
@ -50,17 +50,19 @@ public class GrendelToolBar extends JToolBar {
|
||||
layout = new ToolBarLayout();
|
||||
setLayout(layout);
|
||||
setFloatable(false);
|
||||
|
||||
setBackground(new java.awt.Color(238,238,238));
|
||||
}
|
||||
|
||||
public Spring makeNewSpring() {
|
||||
return layout.createSpring();
|
||||
}
|
||||
|
||||
public void addButton(UIAction aActionListener,
|
||||
public void addButton(Event aActionListener,
|
||||
String aImageName,
|
||||
String aText,
|
||||
String aToolTip) {
|
||||
ToolBarButton b = new ToolBarButton();
|
||||
JButton b = new JButton();
|
||||
|
||||
b.setHorizontalTextPosition(JButton.CENTER);
|
||||
b.setVerticalTextPosition(JButton.BOTTOM);
|
||||
@ -72,9 +74,8 @@ public class GrendelToolBar extends JToolBar {
|
||||
b.setRolloverEnabled(true);
|
||||
b.setBorder(BorderFactory.createEmptyBorder());
|
||||
b.setToolTipText(aToolTip);
|
||||
|
||||
URL iconUrl = getClass().getResource("toolbar/mozilla/" + aImageName + ".gif");
|
||||
b.setIcon(new ImageIcon(iconUrl));
|
||||
|
||||
b.setIcon(new ImageIcon("widgets/toolbar/mozilla/" + aImageName + ".gif"));
|
||||
|
||||
Dimension d=b.getPreferredSize();
|
||||
double w=d.getWidth();
|
||||
|
@ -1170,8 +1170,8 @@ public class TreeTable extends JComponent implements Scrollable,
|
||||
public void updateUI() {
|
||||
super.updateUI();
|
||||
|
||||
fPlusIcon = new ImageIcon(getClass().getResource("images/plus.gif"));
|
||||
fMinusIcon = new ImageIcon(getClass().getResource("images/minus.gif"));
|
||||
fPlusIcon = new ImageIcon("widgets/images/plus.gif");
|
||||
fMinusIcon = new ImageIcon("widgets/images/minus.gif");
|
||||
|
||||
fWindowColor = UIManager.getColor("window");
|
||||
fHighlightColor = UIManager.getColor("textHighlight");
|
||||
|
Loading…
Reference in New Issue
Block a user