1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
Ext.namespace('Zarafa.plugins.files.data');
/**
* @class Zarafa.plugins.files.data.ComponentBox
* @singleton
*
* The global component box which holds all aliases to important components.
*/
Zarafa.plugins.files.data.ComponentBox = Ext.extend(Object, {
/**
* Get the files context.
*
* @return {Zarafa.plugins.files.FilesContext}
*/
getContext: function () {
return container.getContextByName("filescontext");
},
/**
* Get the main panel.
*
* @return {Zarafa.core.ui.MainViewport}
*/
getMainPanel: function () {
try {
return container.getContentPanel();
} catch (e) {
return container.getTabPanel().get(0).getActiveItem();
}
},
/**
* Get the preview panel.
*
* @return {Zarafa.plugins.files.ui.FilesPreviewPanel}
*/
getPreviewPanel: function () {
return this.getMainPanel().filesPreview;
},
/**
* Get the tabpanel.
*
* @return {Zarafa.core.ui.ContextContainer}
*/
getTabPanel: function () {
return container.getTabPanel();
},
/**
* Get the files viewpanel.
*
* @return {Zarafa.core.ui.SwitchViewContentContainer}
*/
getViewPanel: function () {
return this.getMainPanel().viewPanel;
},
/**
* Get the files gridpanel or iconviewpanel.
*
* @return {Zarafa.plugins.files.ui.FilesRecordGridView} or {Zarafa.plugins.files.ui.FilesRecordIconView}
*/
getItemsView: function () {
return this.getViewPanel().getActiveItem();
}
});
Zarafa.plugins.files.data.ComponentBox = new Zarafa.plugins.files.data.ComponentBox();
|