notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2968 - development/main/depot/prefs/src/main/net/dpml/depot/prefs
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2968 - development/main/depot/prefs/src/main/net/dpml/depot/prefs
- Date: Mon, 04 Jul 2005 19:41:21 -0400
Author: mcconnell AT dpml.net
Date: Mon Jul 4 19:41:21 2005
New Revision: 2968
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheDirectoryPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
Log:
Updates to get prefs building properly.
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheDirectoryPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheDirectoryPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheDirectoryPanel.java
Mon Jul 4 19:41:21 2005
@@ -40,7 +40,7 @@
import net.dpml.transit.Transit;
import net.dpml.transit.model.CacheModel;
import net.dpml.transit.model.CacheListener;
-import net.dpml.transit.model.FileChangeEvent;
+import net.dpml.transit.model.CacheDirectoryChangeEvent;
import net.dpml.transit.model.CacheEvent;
/**
@@ -65,7 +65,7 @@
private JButton m_ok;
private JButton m_revert;
- private File m_target;
+ private String m_target;
private final CacheModel m_manager;
@@ -83,11 +83,10 @@
m_propertyChangeSupport = new PropertyChangeSupport( this );
- File cache = getCurrentCacheFile();
- String filename = cache.getCanonicalPath();
+ String cache = getCurrentCachePath();
JLabel label =
IconHelper.createImageIconJLabel(
- getClass().getClassLoader(), CACHE_ICON_SRC, "Filename",
"Directory: " + filename );
+ getClass().getClassLoader(), CACHE_ICON_SRC, "Filename",
"Directory: " + cache );
label.setBorder( new EmptyBorder( 0, 5, 0, 0 ) );
m_label = label;
@@ -154,11 +153,10 @@
* Notify the listener of a change to the cache directory.
* @param event the cache directory change event
*/
- public void cacheDirectoryChanged( FileChangeEvent event )
+ public void cacheDirectoryChanged( CacheDirectoryChangeEvent event )
{
- File cache = getCurrentCacheFile();
- String path = convertToPath( cache );
- String text = "Directory: " + path;
+ String cache = getCurrentCachePath();
+ String text = "Directory: " + cache;
m_label.setText( text );
}
@@ -193,7 +191,7 @@
*/
public void propertyChange( PropertyChangeEvent event )
{
- File cache = getCurrentCacheFile();
+ String cache = getCurrentCachePath();
boolean flag = ( false == cache.equals( m_target ) );
m_ok.setEnabled( flag );
m_revert.setEnabled( flag );
@@ -224,13 +222,12 @@
{
if( null != m_target )
{
- File file = getCurrentCacheFile();
- if( false == file.equals( m_target ) )
+ String path = getCurrentCachePath();
+ if( false == path.equals( m_target ) )
{
- String path = convertToPath( m_target );
try
{
- m_manager.setCacheDirectory( new File( path ) );
+ m_manager.setCacheDirectoryPath( path );
}
catch( RemoteException e )
{
@@ -254,9 +251,9 @@
public void actionPerformed( ActionEvent event )
{
- File old = m_target;
- m_target = getCurrentCacheFile();
- String text = "Directory: " + convertToPath( m_target );
+ String old = m_target;
+ m_target = getCurrentCachePath();
+ String text = "Directory: " + m_target;
m_label.setText( text );
PropertyChangeEvent e =
new PropertyChangeEvent(
@@ -274,7 +271,8 @@
public void actionPerformed( ActionEvent event )
{
- File file = getCurrentCacheFile();
+ String path = getCurrentCachePath();
+ /*
JFileChooser chooser = new JFileChooser();
chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
chooser.setCurrentDirectory( file );
@@ -289,9 +287,11 @@
this, "location", file, m_target );
m_propertyChangeSupport.firePropertyChange( e );
}
+ */
}
}
+ /*
private String convertToPath( File file )
{
try
@@ -303,17 +303,18 @@
return file.toString();
}
}
+ */
- private File getCurrentCacheFile()
+ private String getCurrentCachePath()
{
try
{
- return m_manager.getCacheDirectory();
+ return m_manager.getCacheDirectoryPath();
}
catch( RemoteException e )
{
final String error =
- "Unexpected remote exception while reading cache directory
value.";
+ "Unexpected remote exception while reading cache directory
path value.";
throw new RuntimeException( error, e );
}
}
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicPanel.java
Mon Jul 4 19:41:21 2005
@@ -122,7 +122,10 @@
JPanel panel = new JPanel();
panel.setLayout( new BorderLayout() );
- panel.add( label, BorderLayout.CENTER );
+ if( null != label )
+ {
+ panel.add( label, BorderLayout.CENTER );
+ }
panel.setBorder(
new CompoundBorder(
new TitledBorder(
@@ -148,7 +151,10 @@
JPanel panel = new JPanel();
panel.setLayout( new BorderLayout() );
- panel.add( label, BorderLayout.WEST );
+ if( null != label )
+ {
+ panel.add( label, BorderLayout.WEST );
+ }
panel.setBorder(
new CompoundBorder(
new TitledBorder(
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
Mon Jul 4 19:41:21 2005
@@ -58,7 +58,7 @@
/**
* The default dialog height.
*/
- private static final int DEFAULT_DIALOG_HEIGHT = 600;
+ private static final int DEFAULT_DIALOG_HEIGHT = 700;
/**
* Empty boarder offset.
- svn commit: r2968 - development/main/depot/prefs/src/main/net/dpml/depot/prefs, mcconnell, 07/04/2005
Archive powered by MHonArc 2.6.24.