NCBI C++ ToolKit
|
Search Toolkit Book for CQualTableLoadManager
CTableFileLoadManager. More...
#include <gui/packages/pkg_sequence_edit/qual_table_load_manager.hpp>
Classes | |
class | CColumnIdPage |
class | CDelimitersPage |
Public Member Functions | |
CQualTableLoadManager () | |
CQualTableLoadManager. More... | |
void | SetTopLevelEntry (CSeq_entry_Handle seq_entry) |
bool | ShouldMakeMailReport () |
CAttribTableColumnIdPanel * | x_GetColumnIdPanel () |
IFileLoadPanelClient interface implementation | |
virtual string | GetLabel () const |
virtual wxString | GetFormatWildcard () const |
return file wildcard for the format (example - "*.txt;*.tab" ) More... | |
virtual string | GetFileLoaderId () const |
IUILoadManager interface implementation | |
virtual void | SetServiceLocator (IServiceLocator *srv_locator) |
Sets / unsets Service Locator. More... | |
virtual void | SetParentWindow (wxWindow *parent) |
virtual const IUIObject & | GetDescriptor () const |
Returns the object describing this tool (UI meta data). More... | |
virtual void | InitUI () |
Initializes the Manager before using it in UI. More... | |
virtual void | CleanUI () |
CleanUI() is called after the host finished using the manager. More... | |
virtual wxPanel * | GetCurrentPanel () |
Return the panel corresponding to the current state of Tool Manager. More... | |
virtual bool | CanDo (EAction action) |
Indicates whether given transition is possible in the current state. More... | |
virtual bool | IsFinalState () |
True if Tool Manager has reached its final state, i.e. More... | |
virtual bool | IsCompletedState () |
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred and validated. More... | |
virtual bool | DoTransition (EAction action) |
Performs transition if possible and returns true, otherwise the function shall warn the user about the problem preventing the transition (such as insufficient or invalid input) and return false. More... | |
virtual IAppTask * | GetTask () |
Once parameters are gathered and validated this function is called to produce the final Task object that will be executed to do the actual computational work. More... | |
virtual IExecuteUnit * | GetExecuteUnit () |
virtual bool | SingleFileLoader () const |
returns true if loader can handle only one file More... | |
virtual IWizardPage * | GetFirstPage () |
Returns first options page (if any) of the tool to be shown in wizard dialog. More... | |
virtual void | SetPrevPage (IWizardPage *prevPage) |
Sets a wizard page which should show before the first page of the tool. More... | |
virtual wxString | GetFormatWildcard () |
virtual bool | ValidateFilenames (const vector< wxString > &filenames) |
checks given filenames and returns true if the manager can handle them, otherwise - shows an error message More... | |
virtual void | SetFilenames (const vector< wxString > &filenames) |
initilize the manager with the given filenames More... | |
virtual void | GetFilenames (vector< wxString > &filenames) const |
get actual filenames that will be opened More... | |
virtual bool | IsInitialState () |
return true if the current state of the loader UI is the first valid state (first step in a wizard-like sequence) More... | |
virtual bool | RecognizeFormat (const wxString &filename) |
return true if the given file format is supported by this manager More... | |
virtual bool | RecognizeFormat (CFormatGuess::EFormat fmt) |
return true if the given file format is supported by this manager More... | |
IExtension interface implementation | |
virtual string | GetExtensionIdentifier () const |
returns the unique human-readable identifier for the extension the id should use lowercase letters separated by underscores - "like_this" More... | |
virtual string | GetExtensionLabel () const |
returns a displayable label for this extension ( please capitalize the key words - "My Extension" ) More... | |
IRegSettings interface implementation | |
virtual void | SetRegistryPath (const string &path) |
virtual void | LoadSettings () |
virtual void | SaveSettings () const |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
![]() | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
![]() | |
virtual bool | CanGuessFormat () const |
returns true if loader's format can be guessed More... | |
![]() | |
virtual wxPanel * | GetMaxPanel () |
Return the panel that occupies max size on display, to calculate dialog window size. More... | |
virtual IUIToolManager * | GetAlternateToolManager () |
If a transition fails, it may make sense to switch to a different tool manger When a tool manager identifies a more appropriate manager for a task, it returns it here, otherwise NULL. More... | |
virtual IWizardPage * | GetOptionsPage () |
Returns page for tool options (long wizard path via "Options" button) More... | |
virtual void | SetNextPage (IWizardPage *) |
Sets a wizard page which should show after the last page of the tool. More... | |
virtual void | RestoreDefaults () |
Restores the default options for the current panel. More... | |
virtual void | ResetState () |
virtual bool | UsesSingleOMScope () |
virtual | ~IUIToolManager () |
![]() | |
virtual | ~IFileLoadPanelClient () |
![]() | |
virtual | ~IToolWizard () |
virtual IWizardPage * | GetOptionsPage () |
Returns page for tool options (long wizard path via "Options" button) More... | |
virtual void | SetNextPage (IWizardPage *) |
Sets a wizard page which should show after the last page of the tool. More... | |
![]() | |
virtual | ~IExtension () |
![]() | |
virtual | ~IRegSettings () |
Static Public Member Functions | |
static string | Id () |
static string | Label () |
![]() | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
![]() | |
static void | EnableDebugDump (bool on) |
Protected Member Functions | |
CAttribTableDelimitersPanel * | x_GetDelimitersPanel () |
void | x_ConvertToSeqAnnot () |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Attributes | |
CUIObject | m_Descr |
IServiceLocator * | m_SrvLocator |
wxWindow * | m_ParentWindow |
string | m_RegPath |
vector< wxString > | m_FileNames |
CRef< CTableImportDataSource > | m_ImportedTableData |
Data is loaded initially into this table for delimiter processing. More... | |
CRef< CTableAnnotDataSource > | m_AnnotTableData |
After delimiters and column types are identified, table is copied to this table for saving as asn and data (feature) transforms. More... | |
CAttribTableDelimitersPanel * | m_TableDelimitersPanel |
CAttribTableColumnIdPanel * | m_TableColumnIdPanel |
CSeq_entry_Handle | m_TopSeqEntry |
CQualTableLoadManager::CDelimitersPage | m_DelimitersPage |
CQualTableLoadManager::CColumnIdPage | m_ColumnIdPage |
IWizardPage * | m_CurrentPage |
Additional Inherited Members | |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
![]() | |
enum | EAction { eBack = 0 , eNext , eSkip } |
![]() | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
CQualTableLoadManager - a Load Manager for Sequin qualifier table files. This class implements IFileFormatLoaderManager interface in order to work with generic Format LoadManager.
Definition at line 64 of file qual_table_load_manager.hpp.
CQualTableLoadManager::CQualTableLoadManager | ( | ) |
Definition at line 117 of file qual_table_load_manager.cpp.
References m_Descr, and CUIObject::SetLogEvent().
Indicates whether given transition is possible in the current state.
Implements IUIToolManager.
Definition at line 268 of file qual_table_load_manager.cpp.
References _ASSERT, IUIToolManager::eBack, IUIToolManager::eNext, IsInitialState(), and m_CurrentPage.
|
virtual |
CleanUI() is called after the host finished using the manager.
This function shall free resources associated with the session and reset internal state.
Implements IUIToolManager.
Definition at line 174 of file qual_table_load_manager.cpp.
References m_CurrentPage, m_DelimitersPage, m_TableColumnIdPanel, m_TableDelimitersPanel, and NULL.
Performs transition if possible and returns true, otherwise the function shall warn the user about the problem preventing the transition (such as insufficient or invalid input) and return false.
Typically this function would take user input from the current panel, validate the input and go to the next state creating new UI panel if needed.
Implements IUIToolManager.
Definition at line 297 of file qual_table_load_manager.cpp.
References _ASSERT, IWizardPage::CanLeavePage(), IUIToolManager::eBack, IUIToolManager::eNext, IWizardPage::GetNextPage(), IWizardPage::GetPrevPage(), m_ColumnIdPage, and m_CurrentPage.
|
virtual |
Return the panel corresponding to the current state of Tool Manager.
Implements IUIToolManager.
Definition at line 182 of file qual_table_load_manager.cpp.
References IWizardPage::GetPanel(), and m_CurrentPage.
Returns the object describing this tool (UI meta data).
Implements IUIToolManager.
Definition at line 162 of file qual_table_load_manager.cpp.
References m_Descr.
|
virtual |
Reimplemented from IFileLoadPanelClient.
Definition at line 330 of file qual_table_load_manager.cpp.
References m_AnnotTableData, and m_FileNames.
|
virtual |
returns the unique human-readable identifier for the extension the id should use lowercase letters separated by underscores - "like_this"
Implements IExtension.
Definition at line 381 of file qual_table_load_manager.cpp.
|
virtual |
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
Implements IExtension.
Definition at line 388 of file qual_table_load_manager.cpp.
|
inlinevirtual |
Implements IFileFormatLoaderManager.
Definition at line 81 of file qual_table_load_manager.hpp.
References Id().
|
virtual |
get actual filenames that will be opened
Implements IFileFormatLoaderManager.
Definition at line 358 of file qual_table_load_manager.cpp.
References filenames, and m_FileNames.
|
inlinevirtual |
Returns first options page (if any) of the tool to be shown in wizard dialog.
Reimplemented from IToolWizard.
Definition at line 99 of file qual_table_load_manager.hpp.
References m_DelimitersPage.
|
virtual |
IFileFormatLoaderManager - additional members
Implements IFileFormatLoaderManager.
Definition at line 335 of file qual_table_load_manager.cpp.
References CFileExtensions::GetDialogFilter(), and CFileExtensions::kAllFiles.
|
virtual |
return file wildcard for the format (example - "*.txt;*.tab" )
Implements IFileLoadPanelClient.
Definition at line 141 of file qual_table_load_manager.cpp.
References CFileExtensions::GetDialogFilter(), and CFileExtensions::kAllFiles.
|
virtual |
Implements IFileLoadPanelClient.
Definition at line 136 of file qual_table_load_manager.cpp.
References CUIObject::GetLabel(), and m_Descr.
|
virtual |
Once parameters are gathered and validated this function is called to produce the final Task object that will be executed to do the actual computational work.
Implements IUIToolManager.
Definition at line 325 of file qual_table_load_manager.cpp.
Definition at line 127 of file qual_table_load_manager.hpp.
Referenced by GetFileLoaderId().
|
virtual |
Initializes the Manager before using it in UI.
This function shall reset Internal state of the tool.
Implements IUIToolManager.
Definition at line 168 of file qual_table_load_manager.cpp.
References m_CurrentPage, and m_DelimitersPage.
|
virtual |
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred and validated.
Typically this is the last state after Final state. This state does not have an associated UI panel. When manager reaches the “Completed” state the framework hides the dialog and calls GetTask() function.
Implements IUIToolManager.
Definition at line 291 of file qual_table_load_manager.cpp.
References m_CurrentPage.
|
virtual |
True if Tool Manager has reached its final state, i.e.
the last page (panel) in the sequence is displayed and "Finish" button is shown. The framework calls this function to decide whether “Finish” or “Next” button needs to be shown.
Implements IUIToolManager.
Definition at line 285 of file qual_table_load_manager.cpp.
References IWizardPage::GetNextPage(), and m_CurrentPage.
|
virtual |
return true if the current state of the loader UI is the first valid state (first step in a wizard-like sequence)
Implements IFileFormatLoaderManager.
Definition at line 363 of file qual_table_load_manager.cpp.
References m_CurrentPage, and m_DelimitersPage.
Referenced by CanDo().
Definition at line 128 of file qual_table_load_manager.hpp.
|
virtual |
Implements IRegSettings.
Definition at line 213 of file qual_table_load_manager.cpp.
|
virtual |
return true if the given file format is supported by this manager
Implements IFileFormatLoaderManager.
Definition at line 376 of file qual_table_load_manager.cpp.
References CFormatGuess::eTable.
return true if the given file format is supported by this manager
Implements IFileFormatLoaderManager.
Definition at line 369 of file qual_table_load_manager.cpp.
References CFileExtensions::kTable, and CFileExtensions::RecognizeExtension().
|
virtual |
Implements IRegSettings.
Definition at line 208 of file qual_table_load_manager.cpp.
|
virtual |
initilize the manager with the given filenames
Implements IFileFormatLoaderManager.
Definition at line 353 of file qual_table_load_manager.cpp.
References filenames, and m_FileNames.
Referenced by CSequenceEditingEventHandler::TableReaderClipboard(), and CEditingBtnsPanel::TableReaderFromClipboard().
|
virtual |
Implements IToolWizard.
Definition at line 156 of file qual_table_load_manager.cpp.
References m_ParentWindow.
|
inlinevirtual |
Sets a wizard page which should show before the first page of the tool.
Reimplemented from IToolWizard.
Definition at line 100 of file qual_table_load_manager.hpp.
References m_DelimitersPage, and CWizardPage::SetPrevPage().
Implements IRegSettings.
Definition at line 203 of file qual_table_load_manager.cpp.
References m_RegPath.
|
virtual |
Sets / unsets Service Locator.
Tool Manager can use the locator to obtain the services necessary services.
Implements IUIToolManager.
Definition at line 151 of file qual_table_load_manager.cpp.
References m_SrvLocator.
Referenced by COrganismInfoPanel::OnImportSrcTable(), CEditingBtnsPanel::TableReader(), CSequenceEditingEventHandler::TableReader(), CSequenceEditingEventHandler::TableReaderClipboard(), and CEditingBtnsPanel::TableReaderFromClipboard().
|
inline |
Definition at line 74 of file qual_table_load_manager.hpp.
References m_TopSeqEntry.
Referenced by COrganismInfoPanel::OnImportSrcTable(), CEditingBtnsPanel::TableReader(), CSequenceEditingEventHandler::TableReader(), CSequenceEditingEventHandler::TableReaderClipboard(), and CEditingBtnsPanel::TableReaderFromClipboard().
bool CQualTableLoadManager::ShouldMakeMailReport | ( | ) |
Definition at line 395 of file qual_table_load_manager.cpp.
References CAttribTableColumnIdPanel::ShouldMakeMailReport(), and x_GetColumnIdPanel().
|
inlinevirtual |
returns true if loader can handle only one file
Reimplemented from IFileFormatLoaderManager.
Definition at line 98 of file qual_table_load_manager.hpp.
checks given filenames and returns true if the manager can handle them, otherwise - shows an error message
Implements IFileFormatLoaderManager.
Definition at line 341 of file qual_table_load_manager.cpp.
References filenames, CAttribTableDelimitersPanel::PreviewData(), CAttribTableDelimitersPanel::SetPreviewFileName(), and x_GetDelimitersPanel().
|
protected |
Definition at line 187 of file qual_table_load_manager.cpp.
References CTableImportDataSource::ConvertToSeqAnnot(), CTableAnnotDataSource::GetContainer(), GUI_AsyncExec(), Info(), LOG_POST, m_AnnotTableData, m_ImportedTableData, CRef< C, Locker >::Reset(), and wxT.
CAttribTableColumnIdPanel * CQualTableLoadManager::x_GetColumnIdPanel | ( | ) |
Definition at line 238 of file qual_table_load_manager.cpp.
References CSeq_entry_Handle::GetScope(), IServiceLocator::GetServiceByType(), CGBDocument::GetUndoManager(), kColumnIdTag, CAttribTableColumnIdPanel::LoadSettings(), m_FileNames, m_ImportedTableData, m_ParentWindow, m_RegPath, m_SrvLocator, m_TableColumnIdPanel, m_TopSeqEntry, NULL, CAttribTableColumnIdPanel::SetCommandProcessor(), CAttribTableColumnIdPanel::SetFileNames(), CAttribTableColumnIdPanel::SetImportDataSource(), CAttribTableColumnIdPanel::SetRegistryPath(), and CAttribTableColumnIdPanel::SetTopLevelEntry().
Referenced by COrganismInfoPanel::OnImportSrcTable(), ShouldMakeMailReport(), CEditingBtnsPanel::TableReader(), CSequenceEditingEventHandler::TableReader(), CSequenceEditingEventHandler::TableReaderClipboard(), and CEditingBtnsPanel::TableReaderFromClipboard().
|
protected |
Definition at line 217 of file qual_table_load_manager.cpp.
References kDelimitersTag, CAttribTableDelimitersPanel::LoadSettings(), m_FileNames, m_ImportedTableData, m_ParentWindow, m_RegPath, m_TableDelimitersPanel, NULL, CAttribTableDelimitersPanel::PreviewData(), CAttribTableDelimitersPanel::SetImportDataSource(), CAttribTableDelimitersPanel::SetLoadManager(), CAttribTableDelimitersPanel::SetPreviewFileName(), and CAttribTableDelimitersPanel::SetRegistryPath().
Referenced by CQualTableLoadManager::CDelimitersPage::GetPanel(), and ValidateFilenames().
|
protected |
After delimiters and column types are identified, table is copied to this table for saving as asn and data (feature) transforms.
Definition at line 149 of file qual_table_load_manager.hpp.
Referenced by GetExecuteUnit(), and x_ConvertToSeqAnnot().
|
protected |
Referenced by DoTransition().
|
protected |
Definition at line 181 of file qual_table_load_manager.hpp.
Referenced by CanDo(), CleanUI(), DoTransition(), GetCurrentPanel(), InitUI(), IsCompletedState(), IsFinalState(), and IsInitialState().
|
protected |
Referenced by CleanUI(), GetFirstPage(), InitUI(), IsInitialState(), and SetPrevPage().
|
protected |
Definition at line 134 of file qual_table_load_manager.hpp.
Referenced by CQualTableLoadManager(), GetDescriptor(), and GetLabel().
|
protected |
Definition at line 138 of file qual_table_load_manager.hpp.
Referenced by GetExecuteUnit(), GetFilenames(), SetFilenames(), x_GetColumnIdPanel(), and x_GetDelimitersPanel().
|
protected |
Data is loaded initially into this table for delimiter processing.
Definition at line 145 of file qual_table_load_manager.hpp.
Referenced by x_ConvertToSeqAnnot(), x_GetColumnIdPanel(), and x_GetDelimitersPanel().
|
protected |
Definition at line 136 of file qual_table_load_manager.hpp.
Referenced by SetParentWindow(), x_GetColumnIdPanel(), and x_GetDelimitersPanel().
|
protected |
Definition at line 137 of file qual_table_load_manager.hpp.
Referenced by SetRegistryPath(), x_GetColumnIdPanel(), and x_GetDelimitersPanel().
|
protected |
Definition at line 135 of file qual_table_load_manager.hpp.
Referenced by SetServiceLocator(), and x_GetColumnIdPanel().
|
protected |
Definition at line 152 of file qual_table_load_manager.hpp.
Referenced by CleanUI(), and x_GetColumnIdPanel().
|
protected |
Definition at line 151 of file qual_table_load_manager.hpp.
Referenced by CleanUI(), and x_GetDelimitersPanel().
|
protected |
Definition at line 154 of file qual_table_load_manager.hpp.
Referenced by SetTopLevelEntry(), and x_GetColumnIdPanel().