-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2c0e01
commit 0f331bd
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import com.databasepreservation.common.client.common.dialogs.DatabaseSelectDialog; | ||
import com.databasepreservation.common.client.index.filter.Filter; | ||
import com.databasepreservation.common.client.tools.FontAwesomeIconManager; | ||
import com.google.gwt.event.logical.shared.HasValueChangeHandlers; | ||
import com.google.gwt.event.logical.shared.ValueChangeEvent; | ||
import com.google.gwt.event.logical.shared.ValueChangeHandler; | ||
|
@@ -16,15 +17,17 @@ | |
* @author Alexandre Flores <[email protected]> | ||
*/ | ||
public class SearchAllButtonWrapper extends SimplePanel implements HasValueChangeHandlers<Long> { | ||
private ClientMessages messages; | ||
public Long totalSelectedDatabases; | ||
|
||
private Button button; | ||
private DatabaseSelectDialog databaseSelectDialog; | ||
|
||
public void init(Filter defaultFilter, String allFilter, ClientMessages messages, | ||
SearchPanelWithSearchAll parentSearchPanel) { | ||
this.messages = messages; | ||
this.button = new Button(); | ||
this.button.addStyleName("btn-link-info btn"); | ||
this.button.addStyleName("btn-link-info btn btn-searchall-dialog"); | ||
this.databaseSelectDialog = new DatabaseSelectDialog(defaultFilter, allFilter, messages, parentSearchPanel); | ||
this.button.addClickHandler(event -> { | ||
this.databaseSelectDialog.center(); | ||
|
@@ -44,7 +47,9 @@ public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Long> handle | |
|
||
public void setTotalSelectedDatabases(Long totalSelectedDatabases) { | ||
this.totalSelectedDatabases = totalSelectedDatabases; | ||
this.button.setHTML(SafeHtmlUtils.fromSafeConstant("Searching on " + this.totalSelectedDatabases + " databases")); | ||
this.button | ||
.setHTML(SafeHtmlUtils.fromSafeConstant(messages.manageDatabaseSearchAllSearchingOn(this.totalSelectedDatabases) | ||
+ FontAwesomeIconManager.getTag("edit"))); | ||
ValueChangeEvent.fire(this, totalSelectedDatabases); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters