Skip to content
Snippets Groups Projects
Commit 1edd29aa authored by buczekp's avatar buczekp
Browse files

[LMS-2177] minor: added clear button to history widget

SVN: 20636
parent 8cbb5297
No related branches found
No related tags found
No related merge requests found
...@@ -146,7 +146,7 @@ public abstract class Dict ...@@ -146,7 +146,7 @@ public abstract class Dict
public static final String BUTTON_EXPORT_TABLE = "button_exportTable"; public static final String BUTTON_EXPORT_TABLE = "button_exportTable";
public static final String BUTTON_LOGIN_LABEL = "login_buttonLabel"; public static final String BUTTON_LOGIN_LABEL = "login_buttonLabel";
public static final String BUTTON_LOGOUT_LABEL = "logout_buttonLabel"; public static final String BUTTON_LOGOUT_LABEL = "logout_buttonLabel";
public static final String BUTTON_HOME_LABEL = "home_buttonLabel"; public static final String BUTTON_HOME_LABEL = "home_buttonLabel";
...@@ -172,7 +172,7 @@ public abstract class Dict ...@@ -172,7 +172,7 @@ public abstract class Dict
public static final String LOGIN_BUTTON_LABEL = "login_buttonLabel"; public static final String LOGIN_BUTTON_LABEL = "login_buttonLabel";
public static final String LOGIN_FAILED = "login_failed"; public static final String LOGIN_FAILED = "login_failed";
// //
// AbstractAsyncCallback // AbstractAsyncCallback
// //
...@@ -1092,5 +1092,7 @@ public abstract class Dict ...@@ -1092,5 +1092,7 @@ public abstract class Dict
public static final String LAST_VISITS = "last_visits"; public static final String LAST_VISITS = "last_visits";
public static final String CLEAR = "clear";
// ----- end generic ------------------ // ----- end generic ------------------
} }
...@@ -84,19 +84,22 @@ public class HistoryWidget extends ContentPanel ...@@ -84,19 +84,22 @@ public class HistoryWidget extends ContentPanel
setLayout(new FitLayout()); setLayout(new FitLayout());
setHeaderVisible(true); setHeaderVisible(true);
setHeading(viewContext.getMessage(Dict.LAST_VISITS)); setHeading(viewContext.getMessage(Dict.LAST_VISITS));
final Button clearButton = new Button("Clear", new SelectionListener<ButtonEvent>()
{ final TreeStore<ModelData> store = createStore(viewContext);
@Override final Button clearButton =
public void componentSelected(ButtonEvent ce) new Button(viewContext.getMessage(Dict.CLEAR), new SelectionListener<ButtonEvent>()
{ {
List<EntityVisit> visits = viewContext.getDisplaySettingsManager().getVisits(); @Override
visits.clear(); public void componentSelected(ButtonEvent ce)
// TODO 2011-31-03, Piotr Buczek: refresh the widget {
} List<EntityVisit> visits =
}); viewContext.getDisplaySettingsManager().getVisits();
visits.clear();
store.removeAll();
}
});
getHeader().addTool(clearButton); getHeader().addTool(clearButton);
TreeStore<ModelData> store = createStore(viewContext);
ColumnModel columnModel = createColumnModel(viewContext); ColumnModel columnModel = createColumnModel(viewContext);
final TreeGrid<ModelData> treeGrid = new TreeGrid<ModelData>(store, columnModel); final TreeGrid<ModelData> treeGrid = new TreeGrid<ModelData>(store, columnModel);
......
...@@ -753,6 +753,7 @@ warning_no_script_message: "No script provided", ...@@ -753,6 +753,7 @@ warning_no_script_message: "No script provided",
// History Widget // History Widget
// //
last_visits: "Last Visited Places", last_visits: "Last Visited Places",
clear: "Clear",
// LAST LINE: KEEP IT AT THE END // LAST LINE: KEEP IT AT THE END
lastline: "" // we need a line without a comma lastline: "" // we need a line without a comma
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment