use of org.opencms.ui.components.CmsFileTableDialogContext in project opencms-core by alkacon.
the class CmsSourceSearchApp method getComponentForState.
/**
* @see org.opencms.ui.apps.A_CmsWorkplaceApp#getComponentForState(java.lang.String)
*/
@Override
protected Component getComponentForState(String state) {
m_rootLayout.setMainHeightFull(true);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
sp.setSizeFull();
m_searchForm = new CmsSourceSearchForm(this);
sp.setFirstComponent(m_searchForm);
VerticalLayout result = new VerticalLayout();
result.setSizeFull();
m_infoIntroLayout = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_INTRO_0);
m_infoEmptyResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_EMPTY_0);
m_resultTable = new CmsFileTable(null);
result.addComponent(m_resultTable);
result.addComponent(m_infoEmptyResult);
result.addComponent(m_infoIntroLayout);
m_resultTable.setVisible(false);
m_infoEmptyResult.setVisible(false);
m_infoIntroLayout.setVisible(true);
m_resultTable.applyWorkplaceAppSettings();
m_resultTable.setContextProvider(new I_CmsContextProvider() {
/**
* @see org.opencms.ui.apps.I_CmsContextProvider#getDialogContext()
*/
public I_CmsDialogContext getDialogContext() {
CmsFileTableDialogContext context = new CmsFileTableDialogContext(CmsProjectManagerConfiguration.APP_ID, ContextType.fileTable, m_resultTable, m_resultTable.getSelectedResources());
storeCurrentFileSelection(m_resultTable.getSelectedResources());
context.setEditableProperties(CmsFileExplorer.INLINE_EDIT_PROPERTIES);
return context;
}
});
m_resultTable.setSizeFull();
if (m_resultTableFilter == null) {
m_resultTableFilter = new TextField();
m_resultTableFilter.setIcon(FontOpenCms.FILTER);
m_resultTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
m_resultTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
m_resultTableFilter.setWidth("200px");
m_resultTableFilter.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
public void textChange(TextChangeEvent event) {
m_resultTable.filterTable(event.getText());
}
});
m_infoLayout.addComponent(m_resultTableFilter);
}
sp.setSecondComponent(result);
sp.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(state)) {
CmsSearchReplaceSettings settings = getSettingsFromState(state);
if (settings != null) {
m_currentState = state;
m_searchForm.initFormValues(settings);
search(settings, false);
}
}
return sp;
}
use of org.opencms.ui.components.CmsFileTableDialogContext in project opencms-core by alkacon.
the class CmsProjectManager method getProjectFiles.
/**
* Returns the project files table.<p>
*
* @param projectId the selected project id
*
* @return the file table
*/
protected CmsFileTable getProjectFiles(CmsUUID projectId) {
final CmsFileTable fileTable = new CmsFileTable(null);
fileTable.applyWorkplaceAppSettings();
fileTable.setContextProvider(new I_CmsContextProvider() {
/**
* @see org.opencms.ui.apps.I_CmsContextProvider#getDialogContext()
*/
public I_CmsDialogContext getDialogContext() {
CmsFileTableDialogContext context = new CmsFileTableDialogContext(CmsProjectManagerConfiguration.APP_ID, ContextType.fileTable, fileTable, fileTable.getSelectedResources());
context.setEditableProperties(CmsFileExplorer.INLINE_EDIT_PROPERTIES);
return context;
}
});
CmsObject cms = A_CmsUI.getCmsObject();
List<CmsResource> childResources;
try {
childResources = cms.readProjectView(projectId, CmsResource.STATE_KEEP);
fileTable.fillTable(cms, childResources);
} catch (CmsException e) {
CmsErrorDialog.showErrorDialog(CmsVaadinUtils.getMessageText(Messages.ERR_PROJECTS_CAN_NOT_DISPLAY_FILES_0), e);
}
return fileTable;
}
Aggregations