wip #34 - reformatting the channel configuration editors.

This commit is contained in:
denny
2016-03-20 19:35:45 -04:00
parent f32c520cab
commit d93f497b33
32 changed files with 1415 additions and 1472 deletions

View File

@@ -0,0 +1,25 @@
package gui.editor;
public class EditorValidationException extends Exception
{
private static final long serialVersionUID = 1L;
private Editor<?> mEditor;
private String mReason;
public EditorValidationException( Editor<?> editor, String reason )
{
mEditor = editor;
mReason = reason;
}
public Editor<?> getEditor()
{
return mEditor;
}
public String getReason()
{
return mReason;
}
}

View File

@@ -0,0 +1,37 @@
package gui.editor;
import javax.swing.JLabel;
import net.miginfocom.swing.MigLayout;
public class EmptyValidatingEditor<T> extends ValidatingEditor<T>
{
private static final long serialVersionUID = 1L;
public EmptyValidatingEditor( String descriptor )
{
setLayout( new MigLayout( "insets 0 0 0 0", "[center]", "[grow]" ) );
add( new JLabel( "Please select " + descriptor ), "wrap" );
}
public EmptyValidatingEditor()
{
this( "an item" );
}
@Override
public void save()
{
}
@Override
public void reset()
{
}
@Override
public boolean isValid( Editor<T> editor ) throws EditorValidationException
{
return true;
}
}

View File

@@ -0,0 +1,15 @@
package gui.editor;
/**
* Editor class that allows other editors to be validated for configuration with this editor
*/
public abstract class ValidatingEditor<T> extends Editor<T>
{
private static final long serialVersionUID = 1L;
/**
* Indicates if the editor argument is valid according to the settings of this editor
*/
public abstract boolean isValid( Editor<T> editor ) throws EditorValidationException;
}