Skip to content

Commit

Permalink
Fix the issue - Remove Model listener from the related data set property
Browse files Browse the repository at this point in the history
pages when the pages are closed.[60467]
  • Loading branch information
xwu authored and dgao committed May 16, 2013
1 parent e80c10a commit d8ac06d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
Expand Up @@ -180,21 +180,23 @@ public boolean performOk( )
{
if ( lastSelectedDataSourceIndex != combo.getSelectionIndex( ) )
{
DataSetHandle datasetHandle = (DataSetHandle) getContainer( ).getModel( ) ;
DataSetHandle datasetHandle = (DataSetHandle) getContainer( ).getModel( );
datasetHandle.setDataSource( combo.getItem( combo.getSelectionIndex( ) ) );
( (DataSetEditor) ( getContainer( ) ) ).updateDataSetDesign( this );

if( datasetHandle instanceof OdaDataSetHandle && datasetHandle.getProperty( DataSetHandle.RESULT_SET_PROP ) != null )

if ( datasetHandle instanceof OdaDataSetHandle
&& datasetHandle.getProperty( DataSetHandle.RESULT_SET_PROP ) != null )
datasetHandle.clearProperty( DataSetHandle.RESULT_SET_PROP );
}
( (DataSetHandle) ( getContainer( ).getModel( ) ) ).removeListener( this );
}
}
catch ( SemanticException e )
{
ExceptionHandler.handle( e );
return false;
}

( (DataSetHandle) ( getContainer( ).getModel( ) ) ).removeListener( this );
return super.performOk( );
}

Expand Down
Expand Up @@ -18,7 +18,6 @@
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.report.designer.data.ui.property.AbstractDescriptionPropertyPage;
import org.eclipse.birt.report.designer.data.ui.util.ChoiceSetFactory;
import org.eclipse.birt.report.designer.data.ui.util.DataSetExceptionHandler;
import org.eclipse.birt.report.designer.data.ui.util.DataSetExpressionProvider;
import org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler;
import org.eclipse.birt.report.designer.nls.Messages;
Expand Down Expand Up @@ -370,13 +369,20 @@ public boolean canLeave( )
return true;
}

public boolean performCancel( )
{
( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );
return super.performCancel( );
}

/*
* (non-Javadoc)
*
* @see org.eclipse.birt.report.designer.ui.IPropertyPage#performOk()
*/
public boolean performOk( )
{
( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );
return canLeave( );
}

Expand Down
Expand Up @@ -1145,9 +1145,11 @@ public boolean performOk( )
&& this.getContainer( ) instanceof DataSetEditor )
{
this.modelChanged = false;
( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );
( (DataSetEditor) getContainer( ) ).updateDataSetDesign( this );
}

( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );

return super.performOk( );
}
else
Expand All @@ -1161,6 +1163,9 @@ public boolean performOk( )
} ) );
if ( confirm )
( (DataSetEditor) getContainer( ) ).updateDataSetDesign( this );

( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );

return confirm;
}
}
Expand Down Expand Up @@ -2097,7 +2102,8 @@ public void widgetSelected( SelectionEvent event )
Messages.getString( "ParameterNodeProvider.dial.title.editScalar" ), false ); //$NON-NLS-1$
isCreateMode = false;
}
handle.addListener( new ScalarParameterListener( ) );
ScalarParameterListener scalarParameterListener = new ScalarParameterListener( );
handle.addListener( scalarParameterListener );
dialog.setInput( handle );
if ( dialog.open( ) == OK )
{
Expand Down Expand Up @@ -2132,6 +2138,8 @@ public void widgetSelected( SelectionEvent event )
{
dataSetParameterHandle.setParamName( originalParamName );
}

handle.removeListener( scalarParameterListener );
}
};

Expand Down
Expand Up @@ -647,7 +647,10 @@ public boolean performOk( )
return super.performOk( );
}
else
{
disposeAll( );
return false;
}
}

/**
Expand Down Expand Up @@ -715,7 +718,6 @@ private void disposeAll( )
{
rsColumnMap = null;
columnHintMap = null;
// selectorImage.dispose( );
( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );
}

Expand Down
Expand Up @@ -308,10 +308,16 @@ public boolean performOk( )
}
if( !pageActivated )
this.setAnalysisTypeForColumn( );

( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );

return super.performOk( );
}
else
{
( (DataSetHandle) getContainer( ).getModel( ) ).removeListener( this );
return false;
}
}

/*
Expand Down
Expand Up @@ -355,6 +355,7 @@ protected Object openDialogBox( Control cellEditorWindow )
}
}
setFocus( );
handle.removeListener( this.listener );
return null;
}

Expand Down

0 comments on commit d8ac06d

Please sign in to comment.