This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rhbz844820 - work in progress - page navigation and test
- Loading branch information
Patrick Huang
committed
Aug 23, 2012
1 parent
fb4fbd6
commit 7973392
Showing
12 changed files
with
800 additions
and
68 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
30 changes: 0 additions & 30 deletions
30
zanata-war/src/main/java/org/zanata/webtrans/client/editor/table/EditorTableModel.java
This file was deleted.
Oops, something went wrong.
157 changes: 157 additions & 0 deletions
157
...-war/src/main/java/org/zanata/webtrans/client/editor/table/GetTransUnitActionContext.java
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 |
---|---|---|
@@ -0,0 +1,157 @@ | ||
/* | ||
* Copyright 2012, Red Hat, Inc. and individual contributors as indicated by the | ||
* @author tags. See the copyright.txt file in the distribution for a full | ||
* listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it under the | ||
* terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this software; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF | ||
* site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.zanata.webtrans.client.editor.table; | ||
|
||
import org.zanata.webtrans.shared.model.DocumentId; | ||
import org.zanata.webtrans.shared.model.TransUnitId; | ||
import com.google.common.base.Objects; | ||
|
||
/** | ||
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
*/ | ||
public class GetTransUnitActionContext | ||
{ | ||
//TODO make this class singleton and be used by FilterViewConfirmationPanel and TableEditorPresenter | ||
|
||
private final DocumentId documentId; | ||
private String findMessage; | ||
private int offset = 0; | ||
private int count = 10; // default page count | ||
private boolean filterTranslated; | ||
private boolean filterNeedReview; | ||
private boolean filterUntranslated; | ||
private TransUnitId targetTransUnitId; | ||
|
||
private GetTransUnitActionContext(DocumentId documentId) | ||
{ | ||
this.documentId = documentId; | ||
} | ||
|
||
public static GetTransUnitActionContext of(DocumentId documentId) | ||
{ | ||
return new GetTransUnitActionContext(documentId); | ||
} | ||
|
||
public static GetTransUnitActionContext of(DocumentId documentId, String findMessage) | ||
{ | ||
return new GetTransUnitActionContext(documentId).setFindMessage(findMessage); | ||
} | ||
|
||
public DocumentId getDocumentId() | ||
{ | ||
return documentId; | ||
} | ||
|
||
public String getFindMessage() | ||
{ | ||
return findMessage; | ||
} | ||
|
||
public GetTransUnitActionContext setFindMessage(String findMessage) | ||
{ | ||
this.findMessage = findMessage; | ||
return this; | ||
} | ||
|
||
public boolean isFilterTranslated() | ||
{ | ||
return filterTranslated; | ||
} | ||
|
||
public GetTransUnitActionContext setFilterTranslated(boolean filterTranslated) | ||
{ | ||
this.filterTranslated = filterTranslated; | ||
return this; | ||
} | ||
|
||
public boolean isFilterNeedReview() | ||
{ | ||
return filterNeedReview; | ||
} | ||
|
||
public GetTransUnitActionContext setFilterNeedReview(boolean filterNeedReview) | ||
{ | ||
this.filterNeedReview = filterNeedReview; | ||
return this; | ||
} | ||
|
||
public boolean isFilterUntranslated() | ||
{ | ||
return filterUntranslated; | ||
} | ||
|
||
public GetTransUnitActionContext setFilterUntranslated(boolean filterUntranslated) | ||
{ | ||
this.filterUntranslated = filterUntranslated; | ||
return this; | ||
} | ||
|
||
public TransUnitId getTargetTransUnitId() | ||
{ | ||
return targetTransUnitId; | ||
} | ||
|
||
public GetTransUnitActionContext setTargetTransUnitId(TransUnitId targetTransUnitId) | ||
{ | ||
this.targetTransUnitId = targetTransUnitId; | ||
return this; | ||
} | ||
|
||
public int getOffset() | ||
{ | ||
return offset; | ||
} | ||
|
||
public GetTransUnitActionContext setOffset(int offset) | ||
{ | ||
this.offset = offset; | ||
return this; | ||
} | ||
|
||
public int getCount() | ||
{ | ||
return count; | ||
} | ||
|
||
public GetTransUnitActionContext setCount(int count) | ||
{ | ||
this.count = count; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
// @formatter:off | ||
return Objects.toStringHelper(this). | ||
add("documentId", documentId). | ||
add("findMessage", findMessage). | ||
add("offset", offset). | ||
add("count", count). | ||
add("filterTranslated", filterTranslated). | ||
add("filterNeedReview", filterNeedReview). | ||
add("filterUntranslated", filterUntranslated). | ||
add("targetTransUnitId", targetTransUnitId). | ||
toString(); | ||
// @formatter:on | ||
} | ||
} |
Oops, something went wrong.