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 - using celltable for display
- Loading branch information
Patrick Huang
committed
Aug 23, 2012
1 parent
6bc2dba
commit b2f4686
Showing
13 changed files
with
616 additions
and
65 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
zanata-war/src/main/java/org/zanata/webtrans/client/editor/TransUnitsDataProvider.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,47 @@ | ||
/* | ||
* 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; | ||
|
||
import java.util.ArrayList; | ||
|
||
import org.zanata.webtrans.client.presenter.TransUnitEditPresenter; | ||
import org.zanata.webtrans.shared.model.TransUnit; | ||
import org.zanata.webtrans.shared.model.TransUnitProvidesKey; | ||
import com.google.gwt.view.client.AsyncDataProvider; | ||
import com.google.gwt.view.client.HasData; | ||
import com.google.gwt.view.client.ListDataProvider; | ||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
|
||
/** | ||
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
*/ | ||
@Singleton | ||
public class TransUnitsDataProvider extends ListDataProvider<TransUnit> | ||
{ | ||
|
||
@Inject | ||
public TransUnitsDataProvider() | ||
{ | ||
super(TransUnitProvidesKey.KEY_PROVIDER); | ||
} | ||
} |
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
88 changes: 88 additions & 0 deletions
88
zanata-war/src/main/java/org/zanata/webtrans/client/presenter/TransUnitEditPresenter.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,88 @@ | ||
/* | ||
* 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.presenter; | ||
|
||
import org.zanata.webtrans.client.editor.TransUnitsDataProvider; | ||
import org.zanata.webtrans.client.editor.table.GetTransUnitActionContext; | ||
import org.zanata.webtrans.client.editor.table.PageNavigation; | ||
import org.zanata.webtrans.client.events.DocumentSelectionEvent; | ||
import org.zanata.webtrans.client.events.DocumentSelectionHandler; | ||
import org.zanata.webtrans.client.view.TransUnitEditDisplay; | ||
import org.zanata.webtrans.client.view.TransUnitListDisplay; | ||
import org.zanata.webtrans.shared.model.TransUnit; | ||
import com.google.gwt.view.client.AsyncDataProvider; | ||
import com.google.inject.Inject; | ||
|
||
import net.customware.gwt.presenter.client.EventBus; | ||
import net.customware.gwt.presenter.client.widget.WidgetPresenter; | ||
|
||
/** | ||
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
*/ | ||
public class TransUnitEditPresenter extends WidgetPresenter<TransUnitEditDisplay> implements DocumentSelectionHandler | ||
{ | ||
|
||
private final TransUnitEditDisplay display; | ||
private final EventBus eventBus; | ||
private final PageNavigation pageNavigation; | ||
private final TransUnitListDisplay transUnitListDisplay; | ||
private final AsyncDataProvider<TransUnit> dataProvider; | ||
|
||
@Inject | ||
public TransUnitEditPresenter(TransUnitEditDisplay display, EventBus eventBus, PageNavigation pageNavigation, TransUnitListDisplay transUnitListDisplay) | ||
{ | ||
super(display, eventBus); | ||
this.display = display; | ||
this.eventBus = eventBus; | ||
this.pageNavigation = pageNavigation; | ||
this.transUnitListDisplay = transUnitListDisplay; | ||
display.setDisplayTable(transUnitListDisplay); | ||
dataProvider = new TransUnitsDataProvider(); | ||
dataProvider.addDataDisplay(transUnitListDisplay); | ||
} | ||
|
||
@Override | ||
protected void onBind() | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
protected void onUnbind() | ||
{ | ||
} | ||
|
||
@Override | ||
protected void onRevealDisplay() | ||
{ | ||
} | ||
|
||
@Override | ||
public void onDocumentSelected(DocumentSelectionEvent event) | ||
{ | ||
GetTransUnitActionContext context = GetTransUnitActionContext.of(event.getDocumentId()).setCount(10); | ||
pageNavigation.init(context); | ||
|
||
dataProvider.updateRowCount(pageNavigation.getTotalCount(), true); | ||
} | ||
|
||
} |
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
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: 30 additions & 0 deletions
30
zanata-war/src/main/java/org/zanata/webtrans/client/view/TransUnitEditDisplay.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,30 @@ | ||
/* | ||
* 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.view; | ||
|
||
import net.customware.gwt.presenter.client.widget.WidgetDisplay; | ||
|
||
public interface TransUnitEditDisplay extends WidgetDisplay | ||
{ | ||
void setDisplayTable(TransUnitListDisplay displayTable); | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
zanata-war/src/main/java/org/zanata/webtrans/client/view/TransUnitEditView.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,60 @@ | ||
/* | ||
* 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.view; | ||
|
||
import com.google.gwt.core.client.GWT; | ||
import com.google.gwt.uibinder.client.UiBinder; | ||
import com.google.gwt.uibinder.client.UiField; | ||
import com.google.gwt.user.client.ui.Composite; | ||
import com.google.gwt.user.client.ui.VerticalPanel; | ||
import com.google.gwt.user.client.ui.Widget; | ||
|
||
/** | ||
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
*/ | ||
public class TransUnitEditView extends Composite implements TransUnitEditDisplay | ||
{ | ||
interface TransUnitTableViewUiBinder extends UiBinder<VerticalPanel, TransUnitEditView> | ||
{ | ||
} | ||
|
||
private static TransUnitTableViewUiBinder uiBinder = GWT.create(TransUnitTableViewUiBinder.class); | ||
|
||
private VerticalPanel rootPanel; | ||
|
||
public TransUnitEditView() | ||
{ | ||
rootPanel = uiBinder.createAndBindUi(this); | ||
} | ||
|
||
@Override | ||
public void setDisplayTable(TransUnitListDisplay displayTable) | ||
{ | ||
rootPanel.add(displayTable); | ||
} | ||
|
||
@Override | ||
public Widget asWidget() | ||
{ | ||
return rootPanel; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
zanata-war/src/main/java/org/zanata/webtrans/client/view/TransUnitEditView.ui.xml
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,6 @@ | ||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' | ||
xmlns:g='urn:import:com.google.gwt.user.client.ui'> | ||
<g:VerticalPanel> | ||
|
||
</g:VerticalPanel> | ||
</ui:UiBinder> |
33 changes: 33 additions & 0 deletions
33
zanata-war/src/main/java/org/zanata/webtrans/client/view/TransUnitListDisplay.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,33 @@ | ||
/* | ||
* 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.view; | ||
|
||
import org.zanata.webtrans.shared.model.TransUnit; | ||
import com.google.gwt.user.client.ui.IsWidget; | ||
import com.google.gwt.view.client.HasData; | ||
import com.google.inject.ImplementedBy; | ||
|
||
@ImplementedBy(TransUnitListTable.class) | ||
public interface TransUnitListDisplay extends HasData<TransUnit>, IsWidget | ||
{ | ||
void setHighlightString(String highlightString); | ||
} |
Oops, something went wrong.