mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
wip #34 - updating the decoder editors to the new editor format
This commit is contained in:
@@ -87,6 +87,7 @@ public class DecodeConfigurationEditor extends ValidatingEditor<Channel>
|
||||
{
|
||||
remove( mCurrentEditor );
|
||||
mCurrentEditor = editor;
|
||||
mCurrentEditor.setItem( getItem() );
|
||||
add( mCurrentEditor );
|
||||
|
||||
revalidate();
|
||||
@@ -97,12 +98,12 @@ public class DecodeConfigurationEditor extends ValidatingEditor<Channel>
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
// if( mEditor != null )
|
||||
// {
|
||||
// mEditor.save();
|
||||
// }
|
||||
//
|
||||
// mChannel.setDecodeConfiguration( mEditor.getConfig() );
|
||||
if( hasItem() && mCurrentEditor != null )
|
||||
{
|
||||
mCurrentEditor.save();
|
||||
}
|
||||
|
||||
setModified( false );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,11 +120,13 @@ public class DecodeConfigurationEditor extends ValidatingEditor<Channel>
|
||||
{
|
||||
mComboDecoders.setEnabled( false );
|
||||
}
|
||||
|
||||
setModified( false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Editor<Channel> editor ) throws EditorValidationException
|
||||
public void validate( Editor<Channel> editor ) throws EditorValidationException
|
||||
{
|
||||
return mCurrentEditor.isValid( editor );
|
||||
mCurrentEditor.validate( editor );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,8 @@ public class AMDecoderEditor extends ValidatingEditor<Channel>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Editor<Channel> editor ) throws EditorValidationException
|
||||
public void validate( Editor<Channel> editor ) throws EditorValidationException
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -91,6 +91,7 @@ public class LTRNetDecoderEditor extends ValidatingEditor<Channel>
|
||||
|
||||
mComboDirection = new JComboBox<MessageDirection>();
|
||||
mComboDirection.setModel( new DefaultComboBoxModel<MessageDirection>( MessageDirection.values() ) );
|
||||
mComboDirection.setSelectedItem( MessageDirection.OSW );
|
||||
mComboDirection.setEnabled( false );
|
||||
mComboDirection.addActionListener( new ActionListener()
|
||||
{
|
||||
@@ -106,9 +107,8 @@ public class LTRNetDecoderEditor extends ValidatingEditor<Channel>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Editor<Channel> editor ) throws EditorValidationException
|
||||
public void validate( Editor<Channel> editor ) throws EditorValidationException
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ public class LTRNetDecoderEditor extends ValidatingEditor<Channel>
|
||||
|
||||
if( hasItem() )
|
||||
{
|
||||
mAFC.setEnabled( true );
|
||||
mAFCMaximumCorrection.setEnabled( true );
|
||||
mComboDirection.setEnabled( true );
|
||||
|
||||
DecodeConfiguration config = getItem().getDecodeConfiguration();
|
||||
@@ -133,6 +135,8 @@ public class LTRNetDecoderEditor extends ValidatingEditor<Channel>
|
||||
}
|
||||
else
|
||||
{
|
||||
mAFC.setEnabled( false );
|
||||
mAFCMaximumCorrection.setEnabled( false );
|
||||
mComboDirection.setEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user