You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2006/12/18 18:15:08 UTC
svn commit: r488345 [12/12] - in /directory/sandbox/pamarcelot/ldapstudio:
ldapstudio-browser-core/ ldapstudio-browser-core/META-INF/
ldapstudio-browser-core/about_files/ ldapstudio-browser-core/lib/
ldapstudio-browser-core/src/ ldapstudio-browser-core...
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionGrammar.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionGrammar.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionGrammar.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionGrammar.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
package org.apache.directory.ldapstudio.browser.model;
-
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.HashMap;
@@ -31,15 +30,13 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-
/**
- * This class represent the Connection Grammar used to parsed the XML
+ * This class represent the Connection Grammar used to parsed the XML
* representation of a connection.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class ConnectionGrammar extends AbstractGrammar
-{
+public class ConnectionGrammar extends AbstractGrammar {
/** The initial state */
public static int GRAMMAR_START = 0;
@@ -51,496 +48,441 @@
// States for Connection tag
public static int CONNECTION_START = 2;
+
public static int CONNECTION_END = 3;
// States for Name tag
public static int NAME_START = 4;
+
public static int NAME_END = 5;
// States for Host tag
public static int HOST_START = 6;
+
public static int HOST_END = 7;
// States for Port tag
public static int PORT_START = 8;
+
public static int PORT_END = 9;
// States for BaseDN tag
public static int BASEDN_START = 10;
+
public static int BASEDN_END = 11;
// States for AnonymousBind tag
public static int ANONYMOUSBIND_START = 12;
+
public static int ANONYMOUSBIND_END = 13;
// States for UserDN tag
public static int USERDN_START = 14;
+
public static int USERDN_END = 15;
// States for appendBaseDNtoUserDNWithBaseDN tag
public static int APPENDBASEDNTOUSERDN_START = 18;
+
public static int APPENDBASEDNTOUSERDN_END = 19;
// States for Password tag
public static int PASSWORD_START = 16;
- public static int PASSWORD_END = 17;
+ public static int PASSWORD_END = 17;
/**
- * Default constructor
- */
+ * Default constructor
+ */
@SuppressWarnings("unchecked")
- public ConnectionGrammar()
- {
- // Create the transitions table
- super.transitions = ( HashMap<Tag, GrammarTransition>[] ) Array.newInstance( HashMap.class, 20 );
-
- // Initilization of the HashMaps
- super.transitions[GRAMMAR_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[CONNECTIONS_LOOP] = new HashMap<Tag, GrammarTransition>();
- super.transitions[CONNECTION_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[CONNECTION_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[NAME_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[NAME_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[HOST_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[HOST_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[PORT_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[PORT_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[BASEDN_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[BASEDN_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[ANONYMOUSBIND_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[ANONYMOUSBIND_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[USERDN_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[USERDN_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[APPENDBASEDNTOUSERDN_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[APPENDBASEDNTOUSERDN_END] = new HashMap<Tag, GrammarTransition>();
- super.transitions[PASSWORD_START] = new HashMap<Tag, GrammarTransition>();
- super.transitions[PASSWORD_END] = new HashMap<Tag, GrammarTransition>();
-
- // State: [GRAMMAR_START] - Tag: <connections>
- super.transitions[GRAMMAR_START].put( new Tag( "connections", Tag.START ), new GrammarTransition(
- GRAMMAR_START, CONNECTIONS_LOOP, null ) );
-
- // State: [CONNECTIONS_LOOP] - Tag: <connection>
- super.transitions[CONNECTIONS_LOOP].put( new Tag( "connection", Tag.START ), new GrammarTransition(
- CONNECTIONS_LOOP, CONNECTION_START, createConnection ) );
-
- // State: [CONNECTION_START] - Tag: <name>
- super.transitions[CONNECTION_START].put( new Tag( "name", Tag.START ), new GrammarTransition( CONNECTION_START,
- NAME_START, addName ) );
-
- // State: [NAME_START] - Tag: </name>
- super.transitions[NAME_START].put( new Tag( "name", Tag.END ), new GrammarTransition( NAME_START, NAME_END,
- null ) );
-
- // State: [NAME_END] - Tag: <host>
- super.transitions[NAME_END].put( new Tag( "host", Tag.START ), new GrammarTransition( NAME_END, HOST_START,
- addHost ) );
-
- // State: [HOST_START] - Tag: </host>
- super.transitions[HOST_START].put( new Tag( "host", Tag.END ), new GrammarTransition( HOST_START, HOST_END,
- null ) );
-
- // State: [HOST_END] - Tag: <port>
- super.transitions[HOST_END].put( new Tag( "port", Tag.START ), new GrammarTransition( HOST_END, PORT_START,
- addPort ) );
-
- // State: [PORT_START] - Tag: </port>
- super.transitions[PORT_START].put( new Tag( "port", Tag.END ), new GrammarTransition( PORT_START, PORT_END,
- null ) );
-
- // State: [PORT_END] - Tag: <baseDN>
- super.transitions[PORT_END].put( new Tag( "baseDN", Tag.START ), new GrammarTransition( PORT_END, BASEDN_START,
- addBaseDN ) );
-
- // State: [BASEDN_START] - Tag: </baseDN>
- super.transitions[BASEDN_START].put( new Tag( "baseDN", Tag.END ), new GrammarTransition( BASEDN_START,
- BASEDN_END, null ) );
-
- // State: [BASEDN_END] - Tag: <anonymousBind>
- super.transitions[BASEDN_END].put( new Tag( "anonymousBind", Tag.START ), new GrammarTransition( BASEDN_END,
- ANONYMOUSBIND_START, addAnonymousBind ) );
-
- // State: [ANONYMOUSBIND_START] - Tag: </anonymousBind>
- super.transitions[ANONYMOUSBIND_START].put( new Tag( "anonymousBind", Tag.END ), new GrammarTransition(
- ANONYMOUSBIND_START, ANONYMOUSBIND_END, null ) );
-
- // State: [ANONYMOUSBIND_END] - Tag: <userDN>
- super.transitions[ANONYMOUSBIND_END].put( new Tag( "userDN", Tag.START ), new GrammarTransition(
- ANONYMOUSBIND_END, USERDN_START, addUserDN ) );
-
- // State: [USERDN_START] - Tag: </userDN>
- super.transitions[USERDN_START].put( new Tag( "userDN", Tag.END ), new GrammarTransition( USERDN_START,
- USERDN_END, null ) );
-
- // State: [USERDN_END] - Tag: <appendBaseDNtoUserDNWithBaseDN>
- super.transitions[USERDN_END].put( new Tag( "appendBaseDNtoUserDNWithBaseDN", Tag.START ),
- new GrammarTransition( USERDN_END, APPENDBASEDNTOUSERDN_START, appendBaseDNtoUserDNWithBaseDN ) );
-
- // State: [PREFIXUSERDNWITHBASEDN_START] - Tag: </appendBaseDNtoUserDNWithBaseDN>
- super.transitions[APPENDBASEDNTOUSERDN_START].put( new Tag( "appendBaseDNtoUserDNWithBaseDN", Tag.END ),
- new GrammarTransition( APPENDBASEDNTOUSERDN_START, APPENDBASEDNTOUSERDN_END, null ) );
-
- // State: [PREFIXUSERDNWITHBASEDN_END] - Tag: <password>
- super.transitions[APPENDBASEDNTOUSERDN_END].put( new Tag( "password", Tag.START ), new GrammarTransition(
- APPENDBASEDNTOUSERDN_END, PASSWORD_START, addPassword ) );
-
- // State: [PASSWORD_START] - Tag: </password>
- super.transitions[PASSWORD_START].put( new Tag( "password", Tag.END ), new GrammarTransition( PASSWORD_START,
- PASSWORD_END, null ) );
-
- // State: [PASSWORD_END] - Tag: </connection>
- super.transitions[PASSWORD_END].put( new Tag( "connection", Tag.END ), new GrammarTransition( PASSWORD_END,
- CONNECTIONS_LOOP, null ) );
-
- // State: [CONNECTIONS_LOOP] - Tag: </connections>
- super.transitions[CONNECTIONS_LOOP].put( new Tag( "connections", Tag.END ), new GrammarTransition(
- CONNECTIONS_LOOP, GRAMMAR_END, null ) );
+ public ConnectionGrammar() {
+ // Create the transitions table
+ super.transitions = (HashMap<Tag, GrammarTransition>[]) Array
+ .newInstance(HashMap.class, 20);
+
+ // Initilization of the HashMaps
+ super.transitions[GRAMMAR_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[CONNECTIONS_LOOP] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[CONNECTION_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[CONNECTION_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[NAME_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[NAME_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[HOST_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[HOST_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[PORT_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[PORT_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[BASEDN_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[BASEDN_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[ANONYMOUSBIND_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[ANONYMOUSBIND_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[USERDN_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[USERDN_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[APPENDBASEDNTOUSERDN_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[APPENDBASEDNTOUSERDN_END] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[PASSWORD_START] = new HashMap<Tag, GrammarTransition>();
+ super.transitions[PASSWORD_END] = new HashMap<Tag, GrammarTransition>();
+
+ // State: [GRAMMAR_START] - Tag: <connections>
+ super.transitions[GRAMMAR_START].put(new Tag("connections", Tag.START),
+ new GrammarTransition(GRAMMAR_START, CONNECTIONS_LOOP, null));
+
+ // State: [CONNECTIONS_LOOP] - Tag: <connection>
+ super.transitions[CONNECTIONS_LOOP].put(
+ new Tag("connection", Tag.START), new GrammarTransition(
+ CONNECTIONS_LOOP, CONNECTION_START, createConnection));
+
+ // State: [CONNECTION_START] - Tag: <name>
+ super.transitions[CONNECTION_START].put(new Tag("name", Tag.START),
+ new GrammarTransition(CONNECTION_START, NAME_START, addName));
+
+ // State: [NAME_START] - Tag: </name>
+ super.transitions[NAME_START].put(new Tag("name", Tag.END),
+ new GrammarTransition(NAME_START, NAME_END, null));
+
+ // State: [NAME_END] - Tag: <host>
+ super.transitions[NAME_END].put(new Tag("host", Tag.START),
+ new GrammarTransition(NAME_END, HOST_START, addHost));
+
+ // State: [HOST_START] - Tag: </host>
+ super.transitions[HOST_START].put(new Tag("host", Tag.END),
+ new GrammarTransition(HOST_START, HOST_END, null));
+
+ // State: [HOST_END] - Tag: <port>
+ super.transitions[HOST_END].put(new Tag("port", Tag.START),
+ new GrammarTransition(HOST_END, PORT_START, addPort));
+
+ // State: [PORT_START] - Tag: </port>
+ super.transitions[PORT_START].put(new Tag("port", Tag.END),
+ new GrammarTransition(PORT_START, PORT_END, null));
+
+ // State: [PORT_END] - Tag: <baseDN>
+ super.transitions[PORT_END].put(new Tag("baseDN", Tag.START),
+ new GrammarTransition(PORT_END, BASEDN_START, addBaseDN));
+
+ // State: [BASEDN_START] - Tag: </baseDN>
+ super.transitions[BASEDN_START].put(new Tag("baseDN", Tag.END),
+ new GrammarTransition(BASEDN_START, BASEDN_END, null));
+
+ // State: [BASEDN_END] - Tag: <anonymousBind>
+ super.transitions[BASEDN_END].put(new Tag("anonymousBind", Tag.START),
+ new GrammarTransition(BASEDN_END, ANONYMOUSBIND_START,
+ addAnonymousBind));
+
+ // State: [ANONYMOUSBIND_START] - Tag: </anonymousBind>
+ super.transitions[ANONYMOUSBIND_START].put(new Tag("anonymousBind",
+ Tag.END), new GrammarTransition(ANONYMOUSBIND_START,
+ ANONYMOUSBIND_END, null));
+
+ // State: [ANONYMOUSBIND_END] - Tag: <userDN>
+ super.transitions[ANONYMOUSBIND_END].put(new Tag("userDN", Tag.START),
+ new GrammarTransition(ANONYMOUSBIND_END, USERDN_START,
+ addUserDN));
+
+ // State: [USERDN_START] - Tag: </userDN>
+ super.transitions[USERDN_START].put(new Tag("userDN", Tag.END),
+ new GrammarTransition(USERDN_START, USERDN_END, null));
+
+ // State: [USERDN_END] - Tag: <appendBaseDNtoUserDNWithBaseDN>
+ super.transitions[USERDN_END].put(new Tag(
+ "appendBaseDNtoUserDNWithBaseDN", Tag.START),
+ new GrammarTransition(USERDN_END, APPENDBASEDNTOUSERDN_START,
+ appendBaseDNtoUserDNWithBaseDN));
+
+ // State: [PREFIXUSERDNWITHBASEDN_START] - Tag:
+ // </appendBaseDNtoUserDNWithBaseDN>
+ super.transitions[APPENDBASEDNTOUSERDN_START].put(new Tag(
+ "appendBaseDNtoUserDNWithBaseDN", Tag.END),
+ new GrammarTransition(APPENDBASEDNTOUSERDN_START,
+ APPENDBASEDNTOUSERDN_END, null));
+
+ // State: [PREFIXUSERDNWITHBASEDN_END] - Tag: <password>
+ super.transitions[APPENDBASEDNTOUSERDN_END].put(new Tag("password",
+ Tag.START), new GrammarTransition(APPENDBASEDNTOUSERDN_END,
+ PASSWORD_START, addPassword));
+
+ // State: [PASSWORD_START] - Tag: </password>
+ super.transitions[PASSWORD_START].put(new Tag("password", Tag.END),
+ new GrammarTransition(PASSWORD_START, PASSWORD_END, null));
+
+ // State: [PASSWORD_END] - Tag: </connection>
+ super.transitions[PASSWORD_END].put(new Tag("connection", Tag.END),
+ new GrammarTransition(PASSWORD_END, CONNECTIONS_LOOP, null));
+
+ // State: [CONNECTIONS_LOOP] - Tag: </connections>
+ super.transitions[CONNECTIONS_LOOP].put(
+ new Tag("connections", Tag.END), new GrammarTransition(
+ CONNECTIONS_LOOP, GRAMMAR_END, null));
}
/**
- * GrammarAction that create a Connection
- */
- private final GrammarAction createConnection = new GrammarAction( "Create Connection" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- container.addConnection( new Connection() );
- }
+ * GrammarAction that create a Connection
+ */
+ private final GrammarAction createConnection = new GrammarAction(
+ "Create Connection") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ container.addConnection(new Connection());
+ }
};
/**
- * GrammarAction that adds a Name to a Connection
- */
- private final GrammarAction addName = new GrammarAction( "Add Name" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "null" ) )
- {
- connection.setName( null );
- }
- else
- {
- connection.setName( xpp.getText() );
- }
- }
- }
+ * GrammarAction that adds a Name to a Connection
+ */
+ private final GrammarAction addName = new GrammarAction("Add Name") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("null")) {
+ connection.setName(null);
+ } else {
+ connection.setName(xpp.getText());
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a Host to a Connection
- */
- private final GrammarAction addHost = new GrammarAction( "Add Host" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "null" ) )
- {
- connection.setHost( null );
- }
- else
- {
- connection.setHost( xpp.getText() );
- }
- }
- }
+ * GrammarAction that adds a Host to a Connection
+ */
+ private final GrammarAction addHost = new GrammarAction("Add Host") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("null")) {
+ connection.setHost(null);
+ } else {
+ connection.setHost(xpp.getText());
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a Port to a Connection
- */
- private final GrammarAction addPort = new GrammarAction( "Add Port" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "0" ) )
- {
- connection.setPort( 0 );
- }
- else
- {
- connection.setPort( Integer.parseInt( xpp.getText() ) );
- }
- }
- }
+ * GrammarAction that adds a Port to a Connection
+ */
+ private final GrammarAction addPort = new GrammarAction("Add Port") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("0")) {
+ connection.setPort(0);
+ } else {
+ connection.setPort(Integer.parseInt(xpp.getText()));
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a BaseDN to a Connection
- */
- private final GrammarAction addBaseDN = new GrammarAction( "Add BaseDN" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "null" ) )
- {
- connection.setBaseDN( LdapDN.EMPTY_LDAPDN );
- }
- else
- {
- try
- {
- connection.setBaseDN( new LdapDN( xpp.getText() ) );
- }
- catch ( InvalidNameException e )
- {
- throw new XmlPullParserException( "An error has ocurred. " + e.getMessage(), xpp, null );
- }
- }
- }
- }
+ * GrammarAction that adds a BaseDN to a Connection
+ */
+ private final GrammarAction addBaseDN = new GrammarAction("Add BaseDN") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("null")) {
+ connection.setBaseDN(LdapDN.EMPTY_LDAPDN);
+ } else {
+ try {
+ connection.setBaseDN(new LdapDN(xpp.getText()));
+ } catch (InvalidNameException e) {
+ throw new XmlPullParserException(
+ "An error has ocurred. " + e.getMessage(), xpp,
+ null);
+ }
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a AnonymousBind to a Connection
- */
- private final GrammarAction addAnonymousBind = new GrammarAction( "Add AnonymousBind" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "false" ) )
- {
- connection.setAnonymousBind( false );
- }
- else if ( xpp.getText().equals( "true" ) )
- {
- connection.setAnonymousBind( true );
- }
- else
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- }
- }
+ * GrammarAction that adds a AnonymousBind to a Connection
+ */
+ private final GrammarAction addAnonymousBind = new GrammarAction(
+ "Add AnonymousBind") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("false")) {
+ connection.setAnonymousBind(false);
+ } else if (xpp.getText().equals("true")) {
+ connection.setAnonymousBind(true);
+ } else {
+ throw new XmlPullParserException("An error has ocurred.",
+ xpp, null);
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a UserDN to a Connection
- */
- private final GrammarAction addUserDN = new GrammarAction( "Add UserDN" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "null" ) )
- {
- connection.setUserDN( LdapDN.EMPTY_LDAPDN );
- }
- else
- {
- try
- {
- connection.setUserDN( new LdapDN( xpp.getText() ) );
- }
- catch ( InvalidNameException e )
- {
- throw new XmlPullParserException( "An error has ocurred. " + e.getMessage(), xpp, null );
- }
- }
- }
- }
+ * GrammarAction that adds a UserDN to a Connection
+ */
+ private final GrammarAction addUserDN = new GrammarAction("Add UserDN") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("null")) {
+ connection.setUserDN(LdapDN.EMPTY_LDAPDN);
+ } else {
+ try {
+ connection.setUserDN(new LdapDN(xpp.getText()));
+ } catch (InvalidNameException e) {
+ throw new XmlPullParserException(
+ "An error has ocurred. " + e.getMessage(), xpp,
+ null);
+ }
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a appendBaseDNtoUserDNWithBaseDN to a Connection
- */
+ * GrammarAction that adds a appendBaseDNtoUserDNWithBaseDN to a
+ * Connection
+ */
private final GrammarAction appendBaseDNtoUserDNWithBaseDN = new GrammarAction(
- "Add appendBaseDNtoUserDNWithBaseDN" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "false" ) )
- {
- connection.setAppendBaseDNtoUserDNWithBaseDN( false );
- }
- else if ( xpp.getText().equals( "true" ) )
- {
- connection.setAppendBaseDNtoUserDNWithBaseDN( true );
- }
- else
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- }
- }
+ "Add appendBaseDNtoUserDNWithBaseDN") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("false")) {
+ connection.setAppendBaseDNtoUserDNWithBaseDN(false);
+ } else if (xpp.getText().equals("true")) {
+ connection.setAppendBaseDNtoUserDNWithBaseDN(true);
+ } else {
+ throw new XmlPullParserException("An error has ocurred.",
+ xpp, null);
+ }
+ }
+ }
};
/**
- * GrammarAction that adds a Password to a Connection
- */
- private final GrammarAction addPassword = new GrammarAction( "Add Password" )
- {
- public void action( ConnectionParserContainer container ) throws XmlPullParserException
- {
- Connection connection = container.getCurrentConnection();
-
- XmlPullParser xpp = container.getParser();
-
- int eventType = 0;
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( e.getMessage(), xpp, null );
- }
-
- if ( eventType != XmlPullParser.TEXT )
- {
- throw new XmlPullParserException( "An error has ocurred.", xpp, null );
- }
- else
- {
- if ( xpp.getText().equals( "null" ) )
- {
- connection.setPassword( null );
- }
- else
- {
- connection.setPassword( xpp.getText() );
- }
- }
- }
+ * GrammarAction that adds a Password to a Connection
+ */
+ private final GrammarAction addPassword = new GrammarAction("Add Password") {
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException {
+ Connection connection = container.getCurrentConnection();
+
+ XmlPullParser xpp = container.getParser();
+
+ int eventType = 0;
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(e.getMessage(), xpp, null);
+ }
+
+ if (eventType != XmlPullParser.TEXT) {
+ throw new XmlPullParserException("An error has ocurred.", xpp,
+ null);
+ } else {
+ if (xpp.getText().equals("null")) {
+ connection.setPassword(null);
+ } else {
+ connection.setPassword(xpp.getText());
+ }
+ }
+ }
};
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionListener.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionListener.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionListener.java Mon Dec 18 09:15:00 2006
@@ -20,19 +20,19 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
- * Interface that has to be implemented by each Class that wants to listen on changes
- * on a Connection
+ * Interface that has to be implemented by each Class that wants to listen on
+ * changes on a Connection
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public interface ConnectionListener
-{
+public interface ConnectionListener {
/**
- * This method is called if the Connection have been modified
- * @param connection the Connection
- */
- public void connectionChanged( Connection connection );
+ * This method is called if the Connection have been modified
+ *
+ * @param connection
+ * the Connection
+ */
+ public void connectionChanged(Connection connection);
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParser.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParser.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParser.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParser.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
package org.apache.directory.ldapstudio.browser.model;
-
import java.io.IOException;
import java.io.StringReader;
import java.util.List;
@@ -29,106 +28,85 @@
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
-
/**
* This class is a Connection Parser
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class ConnectionParser
-{
+public class ConnectionParser {
private ConnectionParserContainer container;
-
/**
- * Default constructor
- * @throws XmlPullParserException
- */
- public ConnectionParser() throws XmlPullParserException
- {
- this.container = new ConnectionParserContainer();
+ * Default constructor
+ *
+ * @throws XmlPullParserException
+ */
+ public ConnectionParser() throws XmlPullParserException {
+ this.container = new ConnectionParserContainer();
- XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
+ XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
- XmlPullParser xpp = factory.newPullParser();
+ XmlPullParser xpp = factory.newPullParser();
- container.setParser( xpp );
+ container.setParser(xpp);
}
+ public void parse(String str) throws XmlPullParserException {
+ XmlPullParser xpp = container.getParser();
- public void parse( String str ) throws XmlPullParserException
- {
- XmlPullParser xpp = container.getParser();
-
- xpp.setInput( new StringReader( str ) );
-
- container.setState( ConnectionGrammar.GRAMMAR_START );
-
- int eventType = xpp.getEventType();
- do
- {
- if ( eventType == XmlPullParser.START_DOCUMENT )
- {
- container.setState( ConnectionGrammar.GRAMMAR_START );
- }
- else if ( eventType == XmlPullParser.END_DOCUMENT )
- {
- container.setState( ConnectionGrammar.GRAMMAR_END );
- }
- else if ( eventType == XmlPullParser.START_TAG )
- {
- processTag( Tag.START );
- }
- else if ( eventType == XmlPullParser.END_TAG )
- {
- processTag( Tag.END );
- }
- try
- {
- eventType = xpp.next();
- }
- catch ( IOException e )
- {
- throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
- null );
- }
- }
- while ( container.getState() != ConnectionGrammar.GRAMMAR_END );
- }
+ xpp.setInput(new StringReader(str));
+ container.setState(ConnectionGrammar.GRAMMAR_START);
- private void processTag( int tagType ) throws XmlPullParserException
- {
- XmlPullParser xpp = container.getParser();
-
- String tagName = xpp.getName().toLowerCase();
-
- GrammarTransition transition = container.getTransition( container.getState(), new Tag( tagName, tagType ) );
-
- if ( transition != null )
- {
- container.setState( transition.getNextState() );
-
- if ( transition.hasAction() )
- {
- transition.getAction().action( container );
- }
- }
- else
- {
- throw new XmlPullParserException( "The tag " + new Tag( tagName, tagType )
- + " can't be found at this position", xpp, null );
- }
+ int eventType = xpp.getEventType();
+ do {
+ if (eventType == XmlPullParser.START_DOCUMENT) {
+ container.setState(ConnectionGrammar.GRAMMAR_START);
+ } else if (eventType == XmlPullParser.END_DOCUMENT) {
+ container.setState(ConnectionGrammar.GRAMMAR_END);
+ } else if (eventType == XmlPullParser.START_TAG) {
+ processTag(Tag.START);
+ } else if (eventType == XmlPullParser.END_TAG) {
+ processTag(Tag.END);
+ }
+ try {
+ eventType = xpp.next();
+ } catch (IOException e) {
+ throw new XmlPullParserException(
+ "An IOException ocurred during parsing : "
+ + e.getMessage(), xpp, null);
+ }
+ } while (container.getState() != ConnectionGrammar.GRAMMAR_END);
}
+ private void processTag(int tagType) throws XmlPullParserException {
+ XmlPullParser xpp = container.getParser();
+
+ String tagName = xpp.getName().toLowerCase();
+
+ GrammarTransition transition = container.getTransition(container
+ .getState(), new Tag(tagName, tagType));
+
+ if (transition != null) {
+ container.setState(transition.getNextState());
+
+ if (transition.hasAction()) {
+ transition.getAction().action(container);
+ }
+ } else {
+ throw new XmlPullParserException("The tag "
+ + new Tag(tagName, tagType)
+ + " can't be found at this position", xpp, null);
+ }
+ }
/**
- * Gets a List of the parsed Connections
- * @return a List of the parsed Connections
- */
- public List<Connection> getConnections()
- {
- return container.getConnections();
+ * Gets a List of the parsed Connections
+ *
+ * @return a List of the parsed Connections
+ */
+ public List<Connection> getConnections() {
+ return container.getConnections();
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParserContainer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParserContainer.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParserContainer.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionParserContainer.java Mon Dec 18 09:15:00 2006
@@ -20,20 +20,17 @@
package org.apache.directory.ldapstudio.browser.model;
-
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
-
/**
* This container is used for parsing connections
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class ConnectionParserContainer
-{
+public class ConnectionParserContainer {
/** The current state of the decoding */
private int state;
@@ -49,126 +46,109 @@
private ConnectionGrammar grammar;
-
- public ConnectionParserContainer()
- {
- grammar = new ConnectionGrammar();
- connections = new ArrayList<Connection>();
+ public ConnectionParserContainer() {
+ grammar = new ConnectionGrammar();
+ connections = new ArrayList<Connection>();
}
-
/**
- * Get the parser
- *
- * @return Returns the parser
- */
- public XmlPullParser getParser()
- {
- return parser;
+ * Get the parser
+ *
+ * @return Returns the parser
+ */
+ public XmlPullParser getParser() {
+ return parser;
}
-
/**
- * Set the parser
- *
- * @param state
- * The parser
- */
- public void setParser( XmlPullParser parser )
- {
- this.parser = parser;
+ * Set the parser
+ *
+ * @param state
+ * The parser
+ */
+ public void setParser(XmlPullParser parser) {
+ this.parser = parser;
}
-
/**
- * Get the current grammar state
- *
- * @return Returns the current grammar state
- */
- public int getState()
- {
- return state;
+ * Get the current grammar state
+ *
+ * @return Returns the current grammar state
+ */
+ public int getState() {
+ return state;
}
-
/**
- * Set the new current state
- *
- * @param state
- * The new state
- */
- public void setState( int state )
- {
- this.state = state;
+ * Set the new current state
+ *
+ * @param state
+ * The new state
+ */
+ public void setState(int state) {
+ this.state = state;
}
-
/**
- * Get the transition
- *
- * @return Returns the transition from the previous state to the new state
- */
- public int getTransition()
- {
- return transition;
+ * Get the transition
+ *
+ * @return Returns the transition from the previous state to the new
+ * state
+ */
+ public int getTransition() {
+ return transition;
}
-
/**
- * Update the transition from a state to another
- *
- * @param transition
- * The transition to set
- */
- public void setTransition( int transition )
- {
- this.transition = transition;
+ * Update the transition from a state to another
+ *
+ * @param transition
+ * The transition to set
+ */
+ public void setTransition(int transition) {
+ this.transition = transition;
}
-
/**
- * Get the connections
- *
- * @return Returns the parsed connections
- */
- public List<Connection> getConnections()
- {
- return this.connections;
+ * Get the connections
+ *
+ * @return Returns the parsed connections
+ */
+ public List<Connection> getConnections() {
+ return this.connections;
}
-
/**
- * Get the transition associated with the state and tag
- *
- * @param state
- * The current state
- * @param tag
- * The current tag
- * @return A valid transition if any, or null.
- */
- public GrammarTransition getTransition( int state, Tag tag )
- {
- return grammar.getTransition( state, tag );
+ * Get the transition associated with the state and tag
+ *
+ * @param state
+ * The current state
+ * @param tag
+ * The current tag
+ * @return A valid transition if any, or null.
+ */
+ public GrammarTransition getTransition(int state, Tag tag) {
+ return grammar.getTransition(state, tag);
}
-
/**
- * Returns the current Connection
- * @return A Connection
- */
- public Connection getCurrentConnection()
- {
- return connections.get( connections.size() - 1 );
+ * Returns the current Connection
+ *
+ * @return A Connection
+ */
+ public Connection getCurrentConnection() {
+ return connections.get(connections.size() - 1);
}
-
/**
- * Adds a connection to the Connection List
- * @param connection The Connection to add
- * @return true (as per the general contract of the Collection.add method).
- */
- public boolean addConnection( Connection connection )
- {
- return connections.add( connection );
+ * Adds a connection to the Connection List
+ *
+ * @param connection
+ * The Connection to add
+ * @return true (as per the general contract of the Collection.add
+ * method).
+ */
+ public boolean addConnection(Connection connection) {
+ return connections.add(connection);
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connections.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connections.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connections.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Connections.java Mon Dec 18 09:15:00 2006
@@ -20,7 +20,6 @@
package org.apache.directory.ldapstudio.browser.model;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -32,279 +31,262 @@
import org.eclipse.ui.PlatformUI;
import org.xmlpull.v1.XmlPullParserException;
-
/**
* This class represent the Connections class used to store all the connections
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class Connections implements ConnectionListener
-{
+public class Connections implements ConnectionListener {
/**
- * The Preferences identifier for storing the Connections
- */
+ * The Preferences identifier for storing the Connections
+ */
private static final String CONNECTIONS_PREFS = "connections_prefs";
/**
- * The Connections List
- */
+ * The Connections List
+ */
private List<Connection> connections;
/**
- * The Listeners List
- */
+ * The Listeners List
+ */
private List<ConnectionsListener> listeners;
/**
- * The instance (used to access Connections as a Singleton)
- */
+ * The instance (used to access Connections as a Singleton)
+ */
private static Connections instance;
// Static thread-safe singleton initializer
- static
- {
- instance = new Connections();
+ static {
+ instance = new Connections();
}
-
/**
- * Private constructor
- */
- private Connections()
- {
- connections = new ArrayList<Connection>();
- listeners = new ArrayList<ConnectionsListener>();
+ * Private constructor
+ */
+ private Connections() {
+ connections = new ArrayList<Connection>();
+ listeners = new ArrayList<ConnectionsListener>();
- loadConnections();
+ loadConnections();
}
-
/**
- * Loads the Connections
- */
- private void loadConnections()
- {
- Preferences store = Activator.getDefault().getPluginPreferences();
+ * Loads the Connections
+ */
+ private void loadConnections() {
+ Preferences store = Activator.getDefault().getPluginPreferences();
- String connectionsAsXml = store.getString( CONNECTIONS_PREFS );
+ String connectionsAsXml = store.getString(CONNECTIONS_PREFS);
- try
- {
- ConnectionParser parser = new ConnectionParser();
+ try {
+ ConnectionParser parser = new ConnectionParser();
- parser.parse( connectionsAsXml );
+ parser.parse(connectionsAsXml);
- connections = parser.getConnections();
+ connections = parser.getConnections();
- // Registering this class as a listener for modification on any Connection.
- for ( Connection connection : connections )
- {
- connection.addListener( this );
- }
- }
- catch ( XmlPullParserException e )
- {
- MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error",
- "An error ocurred while recovering the connections." );
- }
+ // Registering this class as a listener for modification on any
+ // Connection.
+ for (Connection connection : connections) {
+ connection.addListener(this);
+ }
+ } catch (XmlPullParserException e) {
+ MessageDialog.openError(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), "Error",
+ "An error ocurred while recovering the connections.");
+ }
}
-
/**
- * Stores the Connections
- */
- private void storeConnections()
- {
- Preferences store = Activator.getDefault().getPluginPreferences();
+ * Stores the Connections
+ */
+ private void storeConnections() {
+ Preferences store = Activator.getDefault().getPluginPreferences();
- StringBuffer sb = new StringBuffer();
+ StringBuffer sb = new StringBuffer();
- // Constructing the XML String representing all the Connections
- sb.append( "<connections>" );
- for ( int i = 0; i < connections.size(); i++ )
- {
- sb.append( connections.get( i ).toXml() );
- }
- sb.append( "</connections>" );
+ // Constructing the XML String representing all the Connections
+ sb.append("<connections>");
+ for (int i = 0; i < connections.size(); i++) {
+ sb.append(connections.get(i).toXml());
+ }
+ sb.append("</connections>");
- store.setValue( CONNECTIONS_PREFS, sb.toString() );
+ store.setValue(CONNECTIONS_PREFS, sb.toString());
}
-
/**
- * Use this method to get the singleton instance of the controller
- * @return
- */
- public static Connections getInstance()
- {
- return instance;
+ * Use this method to get the singleton instance of the controller
+ *
+ * @return
+ */
+ public static Connections getInstance() {
+ return instance;
}
-
/**
- * Adds a Connection
- * @param connection the Connection to add
- * @return true (as per the general contract of Collection.add).
- */
- public boolean addConnection( Connection connection )
- {
- if ( connection != null )
- {
- boolean bool = connections.add( connection );
+ * Adds a Connection
+ *
+ * @param connection
+ * the Connection to add
+ * @return true (as per the general contract of Collection.add).
+ */
+ public boolean addConnection(Connection connection) {
+ if (connection != null) {
+ boolean bool = connections.add(connection);
- connection.addListener( this );
+ connection.addListener(this);
- // Notifying the listeners
- notifyChanged( new ConnectionsEvent( ConnectionsEventType.ADD, connection ) );
+ // Notifying the listeners
+ notifyChanged(new ConnectionsEvent(ConnectionsEventType.ADD,
+ connection));
- // Saving the Connections
- storeConnections();
+ // Saving the Connections
+ storeConnections();
- return bool;
- }
- return false;
+ return bool;
+ }
+ return false;
}
-
/**
- * Removes a Connection
- * @param connection the Connection to remove
- * @return true if the list contained the specified element.
- */
- public boolean removeConnection( Connection connection )
- {
- if ( connection != null )
- {
- boolean bool = connections.remove( connection );
+ * Removes a Connection
+ *
+ * @param connection
+ * the Connection to remove
+ * @return true if the list contained the specified element.
+ */
+ public boolean removeConnection(Connection connection) {
+ if (connection != null) {
+ boolean bool = connections.remove(connection);
- connection.removeListener( this );
+ connection.removeListener(this);
- // Notifying the listeners
- notifyChanged( new ConnectionsEvent( ConnectionsEventType.REMOVE, connection ) );
+ // Notifying the listeners
+ notifyChanged(new ConnectionsEvent(ConnectionsEventType.REMOVE,
+ connection));
- // Saving the Connections
- storeConnections();
+ // Saving the Connections
+ storeConnections();
- return bool;
- }
- return false;
+ return bool;
+ }
+ return false;
}
-
/**
- * Notifies all the listeners that the Connections have changed
- * @param event the associated event
- */
- private void notifyChanged( ConnectionsEvent event )
- {
- for ( ConnectionsListener listener : listeners )
- {
- listener.connectionsChanged( this, event );
- }
+ * Notifies all the listeners that the Connections have changed
+ *
+ * @param event
+ * the associated event
+ */
+ private void notifyChanged(ConnectionsEvent event) {
+ for (ConnectionsListener listener : listeners) {
+ listener.connectionsChanged(this, event);
+ }
}
-
/**
- * Return the Connection at the specified position in the list
- * @param index index of element to return
- * @return the element at the specified position in this list
- * @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index >= size())
- */
- public Connection getConnection( int index ) throws IndexOutOfBoundsException
- {
- return connections.get( index );
+ * Return the Connection at the specified position in the list
+ *
+ * @param index
+ * index of element to return
+ * @return the element at the specified position in this list
+ * @throws IndexOutOfBoundsException
+ * if the index is out of range (index < 0 || index >=
+ * size())
+ */
+ public Connection getConnection(int index) throws IndexOutOfBoundsException {
+ return connections.get(index);
}
-
/**
- * Returns the number of elements in this list. If this list contains
- * more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE
- * @return the number of elements in this list
- */
- public int size()
- {
- return connections.size();
+ * Returns the number of elements in this list. If this list contains
+ * more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE
+ *
+ * @return the number of elements in this list
+ */
+ public int size() {
+ return connections.size();
}
-
/**
- * Adds a listener for the Connections modifications
- * @param listener the listener to add
- * @return true (as per the general contract of Collection.add).
- */
- public boolean addListener( ConnectionsListener listener )
- {
- return listeners.add( listener );
+ * Adds a listener for the Connections modifications
+ *
+ * @param listener
+ * the listener to add
+ * @return true (as per the general contract of Collection.add).
+ */
+ public boolean addListener(ConnectionsListener listener) {
+ return listeners.add(listener);
}
-
/**
- * Removes a listener for the Connections modifications
- * @param listener the listener to remove
- * @return true if the list contained the specified element.
- */
- public boolean removeListener( ConnectionsListener listener )
- {
- return listeners.remove( listener );
+ * Removes a listener for the Connections modifications
+ *
+ * @param listener
+ * the listener to remove
+ * @return true if the list contained the specified element.
+ */
+ public boolean removeListener(ConnectionsListener listener) {
+ return listeners.remove(listener);
}
-
/**
- * Sorts the connections into ascending order, according to the
- * natural ordering.
- */
- public void sort()
- {
- Collections.sort( connections );
+ * Sorts the connections into ascending order, according to the natural
+ * ordering.
+ */
+ public void sort() {
+ Collections.sort(connections);
}
-
/**
- * Verifies if the name is already used by a connection
- * @param name the name
- * @param excludeName a name to exclude from the verification
- * @return true if the name is available, false if a connection
- * already has a same name
- */
- public boolean isConnectionNameAvailable( String name, String excludeName )
- {
- for ( int i = 0; i < size(); i++ )
- {
- if ( name.equals( getConnection( i ).getName() ) )
- {
- if ( !name.equals( excludeName ) )
- {
- return false;
- }
- }
- }
- return true;
+ * Verifies if the name is already used by a connection
+ *
+ * @param name
+ * the name
+ * @param excludeName
+ * a name to exclude from the verification
+ * @return true if the name is available, false if a connection already
+ * has a same name
+ */
+ public boolean isConnectionNameAvailable(String name, String excludeName) {
+ for (int i = 0; i < size(); i++) {
+ if (name.equals(getConnection(i).getName())) {
+ if (!name.equals(excludeName)) {
+ return false;
+ }
+ }
+ }
+ return true;
}
-
/**
- * Verifies if the name is already used by a connection
- * @param name the name
- * @return true if the name is available, false if a connection
- * already has a same name
- */
- public boolean isConnectionNameAvailable( String name )
- {
- return isConnectionNameAvailable( name, null );
+ * Verifies if the name is already used by a connection
+ *
+ * @param name
+ * the name
+ * @return true if the name is available, false if a connection already
+ * has a same name
+ */
+ public boolean isConnectionNameAvailable(String name) {
+ return isConnectionNameAvailable(name, null);
}
-
/**
- * This method is called if the Connection have been modified
- * @param connection the Connection
- */
- public void connectionChanged( Connection connection )
- {
- // Notifying the listeners
- notifyChanged( new ConnectionsEvent( ConnectionsEventType.UPDATE, connection ) );
+ * This method is called if the Connection have been modified
+ *
+ * @param connection
+ * the Connection
+ */
+ public void connectionChanged(Connection connection) {
+ // Notifying the listeners
+ notifyChanged(new ConnectionsEvent(ConnectionsEventType.UPDATE,
+ connection));
- // Saving the Connections
- storeConnections();
+ // Saving the Connections
+ storeConnections();
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsEvent.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsEvent.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsEvent.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsEvent.java Mon Dec 18 09:15:00 2006
@@ -20,51 +20,43 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
- * This class is used to represent the events related to
- * modifications on the Connections Class, such as :
- * - "Add",
- * - "Update" or
- * - "Remove"
- * of a Connection
+ * This class is used to represent the events related to modifications on the
+ * Connections Class, such as : - "Add", - "Update" or - "Remove" of a
+ * Connection
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class ConnectionsEvent
-{
+public class ConnectionsEvent {
/**
- * This enum represents the different types of a ConnectionEvent
- */
- public enum ConnectionsEventType
- {
- ADD, UPDATE, REMOVE
+ * This enum represents the different types of a ConnectionEvent
+ */
+ public enum ConnectionsEventType {
+ ADD, UPDATE, REMOVE
};
private ConnectionsEventType type;
- private Connection connection;
+ private Connection connection;
/**
- * Default constructor
- * @param type the type of the event
- * @param connection the connection associated with the event
- */
- public ConnectionsEvent( ConnectionsEventType type, Connection connection )
- {
- this.type = type;
- this.connection = connection;
+ * Default constructor
+ *
+ * @param type
+ * the type of the event
+ * @param connection
+ * the connection associated with the event
+ */
+ public ConnectionsEvent(ConnectionsEventType type, Connection connection) {
+ this.type = type;
+ this.connection = connection;
}
-
- public Connection getConnection()
- {
- return connection;
+ public Connection getConnection() {
+ return connection;
}
-
- public ConnectionsEventType getType()
- {
- return type;
+ public ConnectionsEventType getType() {
+ return type;
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsListener.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsListener.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/ConnectionsListener.java Mon Dec 18 09:15:00 2006
@@ -20,19 +20,21 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
- * Interface that has to be implemented by each Class that wants to listen on changes
- * on Connections
+ * Interface that has to be implemented by each Class that wants to listen on
+ * changes on Connections
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public interface ConnectionsListener
-{
+public interface ConnectionsListener {
/**
- * This method is called if the Connections have changed
- * @param connections the Connections
- * @param event the event associated
- */
- public void connectionsChanged( Connections connections, ConnectionsEvent event );
+ * This method is called if the Connections have changed
+ *
+ * @param connections
+ * the Connections
+ * @param event
+ * the event associated
+ */
+ public void connectionsChanged(Connections connections,
+ ConnectionsEvent event);
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarAction.java Mon Dec 18 09:15:00 2006
@@ -20,47 +20,41 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
* A top level grammar class that store meta informations about the actions.
* Those informations are not mandatory, but they can be usefull for debugging.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public abstract class GrammarAction implements IAction
-{
+public abstract class GrammarAction implements IAction {
// ~ Instance fields
// ----------------------------------------------------------------------------
/** The action's name */
protected String name;
-
// ~ Constructors
// -------------------------------------------------------------------------------
/**
- * Creates a new GrammarAction object.
- *
- * @param name
- * The name of the create daction
- */
- public GrammarAction( String name )
- {
- this.name = name;
+ * Creates a new GrammarAction object.
+ *
+ * @param name
+ * The name of the create daction
+ */
+ public GrammarAction(String name) {
+ this.name = name;
}
-
// ~ Methods
// ------------------------------------------------------------------------------------
/**
- * Print the action's name
- *
- * @return The action's name
- */
- public String toString()
- {
- return name;
+ * Print the action's name
+ *
+ * @return The action's name
+ */
+ public String toString() {
+ return name;
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarTransition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarTransition.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarTransition.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/GrammarTransition.java Mon Dec 18 09:15:00 2006
@@ -20,15 +20,13 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
* Define a transition between two states of a grammar. It stores the next
* state, and the action to execute while transiting.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class GrammarTransition
-{
+public class GrammarTransition {
// ~ Instance fields
// ----------------------------------------------------------------------------
@@ -41,57 +39,50 @@
/** The current state */
private int currentState;
-
// ~ Constructors
// -------------------------------------------------------------------------------
/**
- * Creates a new GrammarTransition object.
- *
- * @param currentState
- * The current transition
- * @param nextState
- * The target state
- * @param action
- * The action to execute. It could be null.
- */
- public GrammarTransition( int currentState, int nextState, GrammarAction action )
- {
- this.currentState = currentState;
- this.nextState = nextState;
- this.action = action;
+ * Creates a new GrammarTransition object.
+ *
+ * @param currentState
+ * The current transition
+ * @param nextState
+ * The target state
+ * @param action
+ * The action to execute. It could be null.
+ */
+ public GrammarTransition(int currentState, int nextState,
+ GrammarAction action) {
+ this.currentState = currentState;
+ this.nextState = nextState;
+ this.action = action;
}
-
// ~ Methods
// ------------------------------------------------------------------------------------
/**
- * @return Returns the target state.
- */
- public int getNextState()
- {
- return nextState;
+ * @return Returns the target state.
+ */
+ public int getNextState() {
+ return nextState;
}
-
/**
- * Tells if the transition has an associated action.
- *
- * @return <code>true</code> if an action has been asociated to the
- * transition
- */
- public boolean hasAction()
- {
- return action != null;
+ * Tells if the transition has an associated action.
+ *
+ * @return <code>true</code> if an action has been asociated to the
+ * transition
+ */
+ public boolean hasAction() {
+ return action != null;
}
-
/**
- * @return Returns the action associated with the transition
- */
- public GrammarAction getAction()
- {
- return action;
+ * @return Returns the action associated with the transition
+ */
+ public GrammarAction getAction() {
+ return action;
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IAction.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IAction.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IAction.java Mon Dec 18 09:15:00 2006
@@ -20,28 +20,26 @@
package org.apache.directory.ldapstudio.browser.model;
-
import org.xmlpull.v1.XmlPullParserException;
-
/**
* IAction interface just contains the method 'action' which must be implemented
* in all the implementong classes.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public interface IAction
-{
+public interface IAction {
// ~ Methods
// ------------------------------------------------------------------------------------
/**
- * The action to be executed.
- *
- * @param container
- * The container which stores the current data
- * @throws DecoderException
- * Thrown if something went wrong.
- */
- public void action( ConnectionParserContainer container ) throws XmlPullParserException;
+ * The action to be executed.
+ *
+ * @param container
+ * The container which stores the current data
+ * @throws DecoderException
+ * Thrown if something went wrong.
+ */
+ public void action(ConnectionParserContainer container)
+ throws XmlPullParserException;
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IGrammar.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IGrammar.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IGrammar.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/IGrammar.java Mon Dec 18 09:15:00 2006
@@ -20,40 +20,38 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
* The interface which expose common behavior of a Gramar implementer.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public interface IGrammar
-{
+public interface IGrammar {
// ~ Methods
// ------------------------------------------------------------------------------------
/**
- * This method, when called, execute an action on the current data stored in
- * the container.
- *
- * @param asn1Container
- * Store the data being processed.
- * @throws DecoderException
- * Thrown when an unrecoverable error occurs.
- */
- //void executeAction( ConnectionParserContainer container ) throws Exception;
+ * This method, when called, execute an action on the current data
+ * stored in the container.
+ *
+ * @param asn1Container
+ * Store the data being processed.
+ * @throws DecoderException
+ * Thrown when an unrecoverable error occurs.
+ */
+ // void executeAction( ConnectionParserContainer container ) throws
+ // Exception;
/**
- * Get the grammar name
- *
- * @return Return the grammar's name
- */
+ * Get the grammar name
+ *
+ * @return Return the grammar's name
+ */
String getName();
-
/**
- * Set the grammar's name
- *
- * @param name
- * The grammar name
- */
- void setName( String name );
+ * Set the grammar's name
+ *
+ * @param name
+ * The grammar name
+ */
+ void setName(String name);
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Tag.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Tag.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Tag.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/model/Tag.java Mon Dec 18 09:15:00 2006
@@ -20,90 +20,68 @@
package org.apache.directory.ldapstudio.browser.model;
-
/**
- * This class represent a XML Tag which consists of :
- * - a name
- * - a type (START, END)
- *
+ * This class represent a XML Tag which consists of : - a name - a type (START,
+ * END)
+ *
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class Tag
-{
+public class Tag {
private String name;
+
private int type;
public static int START = 0;
- public static int END = 1;
+ public static int END = 1;
- public Tag( String name, int type )
- {
- setName( name );
- setType( type );
+ public Tag(String name, int type) {
+ setName(name);
+ setType(type);
}
-
- public String getName()
- {
- return name;
+ public String getName() {
+ return name;
}
-
- public void setName( String name )
- {
- this.name = name.toLowerCase();
+ public void setName(String name) {
+ this.name = name.toLowerCase();
}
-
- public int getType()
- {
- return type;
+ public int getType() {
+ return type;
}
-
- public void setType( int type )
- {
- this.type = type;
+ public void setType(int type) {
+ this.type = type;
}
-
@Override
- public boolean equals( Object obj )
- {
- if ( obj instanceof Tag )
- {
- Tag tag = ( Tag ) obj;
- return ( ( this.name.equals( tag.getName() ) ) && ( this.type == tag.getType() ) );
-
- }
- else
- {
- return false;
- }
+ public boolean equals(Object obj) {
+ if (obj instanceof Tag) {
+ Tag tag = (Tag) obj;
+ return ((this.name.equals(tag.getName())) && (this.type == tag
+ .getType()));
+
+ } else {
+ return false;
+ }
}
-
@Override
- public int hashCode()
- {
+ public int hashCode() {
- return name.hashCode() + type << 24;
+ return name.hashCode() + type << 24;
}
-
@Override
- public String toString()
- {
- if ( name != null )
- {
- return "<" + ( ( type == Tag.END ) ? "/" : "" ) + name + ">";
- }
- else
- {
- return "Unknown tag";
- }
+ public String toString() {
+ if (name != null) {
+ return "<" + ((type == Tag.END) ? "/" : "") + name + ">";
+ } else {
+ return "Unknown tag";
+ }
}
}
Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java?view=diff&rev=488345&r1=488344&r2=488345
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java (original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-ldapbrowser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java Mon Dec 18 09:15:00 2006
@@ -20,29 +20,42 @@
package org.apache.directory.ldapstudio.browser.view;
-
/**
* This class is used to define path for images
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class ImageKeys
-{
+public class ImageKeys {
// Images for Views
public static final String CONNECTION = "resources/icons/connection.gif"; //$NON-NLS-1$
+
public static final String CONNECTION_DELETE = "resources/icons/connection_delete.gif"; //$NON-NLS-1$
+
public static final String CONNECTION_EDIT = "resources/icons/connection_edit.gif"; //$NON-NLS-1$
+
public static final String CONNECTION_NEW = "resources/icons/connection_new.gif"; //$NON-NLS-1$
+
public static final String CONNECTION_RUNNING = "resources/icons/connection_running.gif"; //$NON-NLS-1$
+
public static final String ENTRY = "resources/icons/entry.gif"; //$NON-NLS-1$
+
public static final String ENTRY_NEW = "resources/icons/entry_new.gif"; //$NON-NLS-1$
+
public static final String ENTRY_DELETE = "resources/icons/entry_delete.gif"; //$NON-NLS-1$
+
public static final String ATTRIBUTE_NEW = "resources/icons/attribute_new.gif"; //$NON-NLS-1$
+
public static final String ATTRIBUTE_DELETE = "resources/icons/attribute_delete.gif"; //$NON-NLS-1$
+
public static final String ATTRIBUTE_EDIT = "resources/icons/attribute_edit.gif"; //$NON-NLS-1$
+
public static final String FOLDER_ENTRY = "resources/icons/folder_entry.gif"; //$NON-NLS-1$
+
public static final String WIZARD_CONNECTION = "resources/icons/wizard_connection.gif"; //$NON-NLS-1$
+
public static final String WIZARD_ATTRIBUTE = "resources/icons/wizard_attribute.gif"; //$NON-NLS-1$
+
public static final String REFRESH = "resources/icons/refresh.gif"; //$NON-NLS-1$
+
public static final String CONNECTION_ERROR = "resources/icons/connection_error.gif"; //$NON-NLS-1$
}