X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.suite.ui%2Fsrc%2Forg%2Fargeo%2Fsuite%2Fui%2FRecentItems.java;h=66f2dc5b05e1d169fb17c11c5163458ca05b5c04;hb=41e9998f7f1c87c747c57f60c6bec65fa20757a6;hp=5c6fa0de79a754a11cde4d08ee8c74ddd008f038;hpb=306805ed46d62207c966c254c013a00ca10acee4;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java index 5c6fa0d..66f2dc5 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java @@ -15,10 +15,9 @@ import javax.jcr.observation.EventListener; import javax.jcr.query.Query; import javax.jcr.query.QueryResult; -import org.argeo.cms.ui.CmsTheme; +import org.argeo.api.cms.CmsTheme; +import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.ui.CmsUiProvider; -import org.argeo.cms.ui.CmsView; -import org.argeo.cms.ui.util.CmsUiUtils; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.entity.EntityType; import org.argeo.jcr.Jcr; @@ -56,17 +55,17 @@ public class RecentItems implements CmsUiProvider { private final static int SEARCH_TEXT_DELAY = 800; private final static int SEARCH_DEFAULT_LIMIT = 100; - public static enum Property { - entityTypes; - } - private CmsTheme theme; private String entityType; + static enum Property { + entityTypes; + } + @Override public Control createUi(Composite parent, Node context) throws RepositoryException { - theme = CmsTheme.getCmsTheme(parent); + theme = CmsSwtUtils.getCmsTheme(parent); parent.setLayout(new GridLayout()); // parent.setLayout(CmsUiUtils.noSpaceGridLayout()); parent.setLayout(new GridLayout()); @@ -89,11 +88,11 @@ public class RecentItems implements CmsUiProvider { return null; SingleEntityViewer entityViewer = new SingleEntityViewer(parent, SWT.NONE, context.getSession()); entityViewer.createUi(); - entityViewer.getViewer().getTable().setLayoutData(CmsUiUtils.fillAll()); + entityViewer.getViewer().getTable().setLayoutData(CmsSwtUtils.fillAll()); Composite bottom = new Composite(parent, SWT.NONE); - bottom.setLayoutData(CmsUiUtils.fillWidth()); - bottom.setLayout(CmsUiUtils.noSpaceGridLayout()); + bottom.setLayoutData(CmsSwtUtils.fillWidth()); + bottom.setLayout(CmsSwtUtils.noSpaceGridLayout()); ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE); bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false)); ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT); @@ -108,7 +107,7 @@ public class RecentItems implements CmsUiProvider { public void doubleClick(DoubleClickEvent event) { Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement(); if (node != null) - CmsView.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(), + CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(), SuiteEvent.eventProperties(node)); } @@ -117,7 +116,7 @@ public class RecentItems implements CmsUiProvider { public void selectionChanged(SelectionChangedEvent event) { Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement(); if (node != null) { - CmsView.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(), + CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(), SuiteEvent.eventProperties(node)); deleteItem.setEnabled(true); } else {