[kune-commits] r811 - in trunk/src/main/java/org/ourproject/kune:
platf/client/app workspace/client/search
workspace/client/ui/newtmp/sitebar/sitelogo
workspace/client/ui/newtmp/skel
vjrj
vjrj at ourproject.org
Mon Jul 21 04:46:14 CEST 2008
Author: vjrj
Date: 2008-07-21 04:46:08 +0200 (Mon, 21 Jul 2008)
New Revision: 811
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
Log:
SiteSearcher fixes
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -65,8 +65,6 @@
// Temporary new ws
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- ws.mask();
-
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -31,7 +31,6 @@
import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.data.FieldDef;
import com.gwtext.client.data.Record;
-import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StringFieldDef;
import com.gwtext.client.widgets.Button;
@@ -42,15 +41,14 @@
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.GridView;
import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
import com.gwtext.client.widgets.layout.BorderLayoutData;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -60,8 +58,7 @@
private final Window dialog;
private final SiteSearcherPresenter presenter;
private Store groupStore;
- private ComboBox searchCombo;
- private Store historyStore;
+ private TextField searchField;
private Store contentStore;
private GridPanel groupsGrid;
private GridPanel contentGrid;
@@ -76,8 +73,8 @@
dialog = createDialog();
}
- public String getComboTextToSearch() {
- return searchCombo.getValue();
+ public String getTextToSearch() {
+ return searchField.getValueAsString();
}
public void hide() {
@@ -85,7 +82,7 @@
}
public void search(final String text, final SiteSearcherType type) {
- searchCombo.setValue(text);
+ searchField.setValue(text);
switch (type) {
case group_user:
query(groupStore, groupsGrid, text);
@@ -177,12 +174,6 @@
dialog.setCloseAction(Window.HIDE);
- dialog.addListener(new WindowListenerAdapter() {
- public void onCollapse(final Panel panel) {
- // dialog.hide();
- }
- });
-
return dialog;
}
@@ -197,56 +188,26 @@
form.setWidth(330);
form.setHideLabels(true);
- historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+ searchField = new TextField();
+ searchField.setWidth(300);
+ searchField.addListener(new FieldListenerAdapter() {
- searchCombo = new ComboBox();
- searchCombo.setStore(historyStore);
- searchCombo.setDisplayField("term");
- searchCombo.setTypeAhead(false);
- searchCombo.setLoadingText(i18n.t("Searching..."));
- searchCombo.setWidth(300);
- searchCombo.setPageSize(10);
- searchCombo.setMode(ComboBox.LOCAL);
- searchCombo.setMinChars(1);
- searchCombo.setValueField("term");
- searchCombo.setForceSelection(false);
- searchCombo.setEditable(true);
- historyStore.load();
- searchCombo.addListener(new ComboBoxListenerAdapter() {
- public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- presenter.doSearch(getComboTextToSearch());
- historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
- searchCombo.setStore(historyStore);
- historyStore.load();
- }
- });
- searchCombo.addListener(new FieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- // Maybe we use...
- }
-
public void onSpecialKey(final Field field, final EventObject e) {
switch (e.getKey()) {
case KeyboardListener.KEY_ENTER:
- Log.debug("Enter pressed");
- Log.debug("field: " + field.getValueAsString());
- Log.debug("field2: " + getComboTextToSearch());
presenter.doSearch(field.getValueAsString());
- historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
- historyStore.load();
- searchCombo.setStore(historyStore);
break;
}
e.stopEvent();
}
});
- form.add(searchCombo);
+ form.add(searchField);
final Button searchBtn = new Button(i18n.tWithNT("Search", "used in button"));
searchBtn.addListener(new ButtonListenerAdapter() {
public void onClick(final Button button, final EventObject e) {
- presenter.doSearch(getComboTextToSearch());
+ presenter.doSearch(getTextToSearch());
}
});
hp.add(form);
@@ -291,12 +252,13 @@
final String gridName = type == SiteSearcherType.group_user ? "group-search" : "content-search";
final GridPanel grid = new GridPanel(gridName, 474, 250, store, columnModel);
+
createPagingToolbar(store, grid);
grid.setHideColumnHeader(true);
- // final GridView view = new GridView();
- // view.setForceFit(true);
- // // view.setEnableRowBody(true);
- // grid.setView(view);
+ final GridView view = new GridView();
+ view.setForceFit(true);
+ view.setEmptyText(i18n.t("No results"));
+ grid.setView(view);
grid.addListener(new PanelListenerAdapter() {
public void onRender(final Component component) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -26,8 +26,6 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.allen_sauer.gwt.log.client.Log;
-
public class SiteSearcherPresenter extends AbstractPresenter implements SiteSearcher {
private SiteSearcherView view;
@@ -44,12 +42,11 @@
}
public void doSearch(final SiteSearcherType typeOfSearch) {
- doSearchOfType(view.getComboTextToSearch(), typeOfSearch);
+ doSearchOfType(view.getTextToSearch(), typeOfSearch);
}
public void doSearch(final String text) {
searchHistory.put(text, null);
- Log.debug("Search History: " + searchHistory.toString());
Site.hideProgress();
view.search(text, currentSearch);
view.show();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -23,7 +23,7 @@
public interface SiteSearcherView extends View {
- String getComboTextToSearch();
+ String getTextToSearch();
void hide();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -12,7 +12,6 @@
public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
siteLogoImg = new Image();
final SiteBar siteBar = ws.getSiteBar();
- siteBar.addSpacer();
siteBar.add(siteLogoImg);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-21 02:05:26 UTC (rev 810)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-21 02:46:08 UTC (rev 811)
@@ -21,6 +21,8 @@
private final ExtElement extRootBody;
public WorkspaceSkeleton() {
+ extRootBody = new ExtElement(RootPanel.getBodyElement());
+ mask();
QuickTips.init(); // extgwt tips
final QuickTip quickTipInstance = QuickTips.getQuickTip();
quickTipInstance.setDismissDelay(8000);
@@ -36,7 +38,6 @@
mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
container.add(mainPanel.getPanel());
- extRootBody = new ExtElement(RootPanel.getBodyElement());
}
public Panel getEntityMainHeader() {
More information about the kune-commits
mailing list