Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Redesign TM details page to be consistance with glossary details
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sl-eng committed Sep 6, 2012
1 parent 7a21233 commit 745f49c
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 109 deletions.
Expand Up @@ -119,7 +119,10 @@ public void focusEditor(final int currentEditorIndex)
@Override
public void execute()
{
editors.get(currentEditorIndex).setFocus();
if(editors.size() > currentEditorIndex)
{
editors.get(currentEditorIndex).setFocus();
}
}
});
}
Expand Down
Expand Up @@ -40,10 +40,6 @@ public interface Display extends WidgetDisplay

HasText getTargetComment();

HasText getProjectName();

HasText getIterationName();

HasText getDocumentName();

HasChangeHandlers getDocumentListBox();
Expand All @@ -57,6 +53,8 @@ public interface Display extends WidgetDisplay
void addDoc(String text);

HasText getLastModified();

HasText getProjectIterationName();
}

TransMemoryDetailsList tmDetails;
Expand Down Expand Up @@ -140,8 +138,7 @@ protected void selectDoc(int selected)
}
display.getSourceComment().setText(sourceComment);
display.getTargetComment().setText(targetComment);
display.getProjectName().setText(project);
display.getIterationName().setText(iter);
display.getProjectIterationName().setText(project + " / " + iter);
display.getDocumentName().setText(doc);
if (!Strings.isNullOrEmpty(lastModifiedBy))
{
Expand Down
Expand Up @@ -64,6 +64,9 @@ public interface UiMessages extends Messages

@DefaultMessage("Translation Memory")
String translationMemoryHeading();

@DefaultMessage("Translation Memory Details")
String translationMemoryDetails();

@DefaultMessage("Glossary")
String glossaryHeading();
Expand Down
Expand Up @@ -32,7 +32,7 @@
public class GlossaryDetailsView implements GlossaryDetailsPresenter.Display
{

interface GlossaryIUiBinder extends UiBinder<DialogBox, GlossaryDetailsView>
interface GlossaryDetailsIUiBinder extends UiBinder<DialogBox, GlossaryDetailsView>
{
}

Expand All @@ -43,7 +43,7 @@ interface Styles extends CssResource
String targetCommentTextArea();
}

private static GlossaryIUiBinder uiBinder = GWT.create(GlossaryIUiBinder.class);
private static GlossaryDetailsIUiBinder uiBinder = GWT.create(GlossaryDetailsIUiBinder.class);

DialogBox dialogBox;

Expand All @@ -70,7 +70,7 @@ interface Styles extends CssResource

@UiField
Styles style;

private final int VISIBLE_COMMENTS = 4;

private boolean hasGlossaryUpdateAccess;
Expand Down
Expand Up @@ -2,26 +2,11 @@
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:f="urn:import:org.zanata.webtrans.client"
xmlns:fui="urn:import:org.zanata.webtrans.client.ui"
ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
ui:generateLocales="en">
xmlns:fui="urn:import:org.zanata.webtrans.client.ui">

<ui:with field='resources' type="org.zanata.webtrans.client.resources.Resources"/>

<ui:style type="org.zanata.webtrans.client.view.GlossaryDetailsView.Styles">
.headerLabel
{
padding-right:5px;
color:#C35817;
font-weight:bold;
}

.alignTop
{
vertical-align:top;
}

.textArea
{
width:280px;
Expand All @@ -35,19 +20,6 @@
margin:0;
}

.button
{
width:70px;
margin:1px;
padding:2px;
}

.lastModifiedLabel
{
color:#C35817;
font-weight:bold;
}

.targetCommentList
{
background:#FFFFFF;
Expand Down Expand Up @@ -95,42 +67,42 @@
<g:LayoutPanel width="100%" height="100%">
<g:layer top="5px" height="22px" left="0" width="150px">
<g:HTMLPanel>
<g:InlineLabel styleName="{style.headerLabel}"><ui:msg>Entries:</ui:msg></g:InlineLabel>
<g:InlineLabel styleName="headerLabel" text="Entries:"/>
<g:ListBox ui:field='entryListBox'/>
</g:HTMLPanel>
</g:layer>

<g:layer top="5px" height="46px" left="176px" right="0">
<g:HTMLPanel>
<g:InlineLabel styleName="{style.headerLabel} {style.alignTop}"><ui:msg>Source Reference:</ui:msg></g:InlineLabel>
<g:InlineLabel styleName="headerLabel alignTop" text="Source Reference:"/>
<g:TextArea ui:field="srcRef" styleName="{style.textArea}"/>
</g:HTMLPanel>
</g:layer>

<g:layer top="70px" height="85px" left="0" right="300px">
<g:HTMLPanel>
<g:Label ui:field="sourceLabel" styleName="{style.headerLabel}"/>
<g:Label ui:field="sourceLabel" styleName="headerLabel"/>
<g:TextArea ui:field='sourceText' styleName="{style.textArea}"/>
</g:HTMLPanel>
</g:layer>

<g:layer top="70px" height="85px" left="300px" right="0">
<g:HTMLPanel>
<g:Label styleName="{style.headerLabel}"><ui:msg>Comments:</ui:msg></g:Label>
<g:Label styleName="headerLabel" text="Comments:"/>
<g:ListBox ui:field='sourceComment' styleName="{style.listBox}"/>
</g:HTMLPanel>
</g:layer>

<g:layer top="165px" height="85px" left="0" right="300px">
<g:HTMLPanel>
<g:Label ui:field="targetLabel" styleName="{style.headerLabel}"/>
<g:Label ui:field="targetLabel" styleName="headerLabel"/>
<g:TextArea ui:field='targetText' styleName="{style.textArea}"/>
</g:HTMLPanel>
</g:layer>

<g:layer top="165px" height="166px" left="300px" right="5px">
<g:HTMLPanel>
<g:Label styleName="{style.headerLabel}"><ui:msg>Comments:</ui:msg></g:Label>
<g:Label styleName="headerLabel" text="Comments:"/>
<g:ScrollPanel height="148px" styleName="{style.targetCommentList}" ui:field="targetCommentScrollTable">
<g:FlexTable ui:field="targetCommentsTable" width="100%" />
</g:ScrollPanel>
Expand All @@ -139,21 +111,21 @@

<g:layer top="255px" height="80px" left="0" right="300px">
<g:HTMLPanel>
<g:Label styleName="{style.headerLabel}"><ui:msg>New target comment:</ui:msg></g:Label>
<g:Label styleName="headerLabel" text="New target comment:"/>
<g:TextArea ui:field="newTargetComment" styleName="{style.newTargetCommentTextArea}"/>
<g:Button ui:field="addNewCommentButton" styleName="{style.targetCommentListButton}"/>
</g:HTMLPanel>
</g:layer>

<g:layer top="355px" height="15px" width="350px" left="0">
<g:Label ui:field='lastModified' styleName="{style.lastModifiedLabel}"/>
<g:Label ui:field='lastModified' styleName="lastModifiedLabel"/>
</g:layer>

<g:layer height="32px" top="348px" right="0" width="170px">
<g:HTMLPanel styleName="{style.buttonDiv}">
<g:Image ui:field="loadingIcon"/>
<g:Button ui:field='dismissButton' addStyleNames="{style.button}"/>
<g:Button ui:field='saveButton' addStyleNames="{style.button}"/>
<g:Button ui:field='dismissButton' addStyleNames="button"/>
<g:Button ui:field='saveButton' addStyleNames="button"/>
</g:HTMLPanel>
</g:layer>

Expand Down
@@ -1,6 +1,7 @@
package org.zanata.webtrans.client.view;

import org.zanata.webtrans.client.presenter.TransMemoryDetailsPresenter;
import org.zanata.webtrans.client.resources.UiMessages;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasChangeHandlers;
Expand All @@ -10,10 +11,12 @@
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class TransMemoryDetailsView implements TransMemoryDetailsPresenter.Display
{
Expand All @@ -27,30 +30,29 @@ interface TMIUiBinder extends UiBinder<DialogBox, TransMemoryDetailsView>
DialogBox dialogBox;

@UiField
TextArea sourceText;
TextArea sourceText, targetText;

@UiField
TextArea targetText;
TextArea sourceComment, targetComment;

@UiField
TextArea sourceComment;
@UiField
TextArea targetComment;
@UiField
Label projectName;
@UiField
Label iterationName;
@UiField
Label docName;
InlineLabel projectIterationName, docName;

@UiField
Label lastModified;

@UiField
Button dismissButton;

@UiField
ListBox documentListBox;

public TransMemoryDetailsView()

@Inject
public TransMemoryDetailsView(UiMessages messages)
{
dialogBox = uiBinder.createAndBindUi(this);
dialogBox.setText(messages.translationMemoryDetails());
dismissButton.setText(messages.dismiss());
}

public void hide()
Expand All @@ -70,16 +72,11 @@ public Widget asWidget()
}

@Override
public HasText getProjectName()
public HasText getProjectIterationName()
{
return projectName;
return projectIterationName;
}

@Override
public HasText getIterationName()
{
return iterationName;
}

@Override
public HasText getDocumentName()
Expand Down

0 comments on commit 745f49c

Please sign in to comment.