Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

work in progress

  • Loading branch information...
aeng committed Nov 12, 2012
1 parent 30fe6b3 commit 0b296b9d9c63fc06b95d5f5b88694b3e8f743dfd
@@ -39,8 +39,6 @@
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
@@ -50,9 +48,6 @@
private static EditorOptionsUiBinder uiBinder = GWT.create(EditorOptionsUiBinder.class);
private final EnumRadioButtonGroup<NavOption> navOptionGroup;

@UiField
LayoutPanel container;

@UiField
CheckBox translatedChk, needReviewChk, untranslatedChk, enterChk, editorButtonsChk;

@@ -74,22 +69,8 @@
@UiField
Styles style;
@UiField
Label otherConfigHeader;

@UiField
CheckBox showErrorChk;
@UiField
CheckBox useCodeMirrorChk;

@UiField
PushButton saveButton;

@UiField
PushButton loadButton;

@UiField
PushButton restoreToDefaultsButton;

private Listener listener;

@Inject
@@ -103,14 +84,8 @@ public EditorOptionsView(WebTransMessages messages, NavOptionRenderer navOptionR
filterHeader.setText(messages.messageFilters());
navOptionHeader.setText(messages.navOption());
pageSizeHeader.setText(messages.pageSize());
otherConfigHeader.setText(messages.otherConfiguration());

showErrorChk.setTitle(messages.showErrorsTooltip());
useCodeMirrorChk.setTitle(messages.useCodeMirrorEditorTooltip());

saveButton.setText(messages.save());
loadButton.setText(messages.load());
restoreToDefaultsButton.setText(messages.restoreDefaults());
}

@Override
@@ -209,12 +184,6 @@ public void onEnterSaveOptionChanged(ValueChangeEvent<Boolean> event)
listener.onEnterSaveOptionChanged(enterChk.getValue());
}

@UiHandler("showErrorChk")
public void onShowErrorOptionChanged(ValueChangeEvent<Boolean> event)
{
listener.onShowErrorsOptionChanged(showErrorChk.getValue());
}

@UiHandler("useCodeMirrorChk")
public void onCodeMirrorOptionChanged(ValueChangeEvent<Boolean> event)
{
@@ -236,28 +205,10 @@ public void setOptionsState(UserConfigHolder.ConfigurationState state)

navOptionGroup.setDefaultSelected(state.getNavOption());
selectPageSize(state.getPageSize());
showErrorChk.setValue(state.isShowError());
// showErrorChk.setValue(state.isShowError());
useCodeMirrorChk.setValue(state.isUseCodeMirrorEditor());
}

@UiHandler("saveButton")
public void onSaveButtonClick( ClickEvent event )
{
listener.persistOptionChange();
}

@UiHandler("loadButton")
public void onLoadButtonClick( ClickEvent event )
{
listener.loadOptions();
}

@UiHandler("restoreToDefaultsButton")
public void onRestoreToDefaultsButtonClick( ClickEvent event )
{
listener.loadDefaultOptions();
}

private void selectPageSize(int pageSize)
{
if (pageSize == 5)
@@ -278,7 +229,7 @@ else if (pageSize ==50)
}
}

interface EditorOptionsUiBinder extends UiBinder<LayoutPanel, EditorOptionsView>
interface EditorOptionsUiBinder extends UiBinder<VerticalPanel, EditorOptionsView>
{
}

@@ -296,7 +247,5 @@ else if (pageSize ==50)
String untranslated();

String pageSizeContainer();

String editorOptsButton();
}
}
@@ -3,17 +3,20 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:f="urn:import:org.zanata.webtrans.client">

<ui:style field="style" type="org.zanata.webtrans.client.view.EditorOptionsView.Styles">
.mainPanel {
width:100%;
}

.mainPanel td {
padding-bottom:10px;
}

.mainPanel table td {
font-size: 13px;
padding: 2px;
border-radius: 5px;
padding: 1px;
color: #FFFFFF;
}

.mainPanel select {
color: #000000;
}

.translated {
border-left: 3px solid #099B09;
margin-left: 5px;
@@ -50,66 +53,47 @@
margin-right: 3px;
}

.editorOptsButton {
float: right;
color: #000000;
margin-right: 3px;
border-radius: 3px;
}

</ui:style>

<g:LayoutPanel>
<g:layer top="0px" bottom="0" left="0" right="0">
<g:LayoutPanel ui:field="container" styleName="{style.mainPanel}">
<g:layer top="5px" height="100px" left="5px" right="5px">
<g:VerticalPanel width="100%">
<g:Label ui:field="editorOptionHeader" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="editorButtonsChk"><ui:msg>Editor Buttons</ui:msg></g:CheckBox>
<g:CheckBox ui:field="enterChk"><ui:msg>'Enter' key saves immediately</ui:msg></g:CheckBox>
<g:CheckBox ui:field="useCodeMirrorChk" ><ui:msg>Use CodeMirror Editor</ui:msg></g:CheckBox>
</g:VerticalPanel>
</g:layer>
<g:layer top="110px" height="100px" left="5px" right="5px">
<g:VerticalPanel width="100%">
<g:Label ui:field="filterHeader" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="translatedChk" styleName="{style.translated}"><ui:msg>Translated</ui:msg></g:CheckBox>
<g:CheckBox ui:field="needReviewChk" styleName="{style.needReview}"><ui:msg>Need Review</ui:msg></g:CheckBox>
<g:CheckBox ui:field="untranslatedChk" styleName="{style.untranslated}"><ui:msg>Untranslated</ui:msg></g:CheckBox>
</g:VerticalPanel>
</g:layer>
<g:layer top="220px" height="100px" left="5px" right="5px">
<g:VerticalPanel width="100%">
<g:Label ui:field="navOptionHeader" styleName="sideMenuHeader"/>
<g:VerticalPanel ui:field="optionsContainer" />
</g:VerticalPanel>
</g:layer>
<g:layer top="330px" height="70px" left="5px" right="5px">
<g:VerticalPanel width="100%">
<g:Label ui:field="pageSizeHeader" styleName="sideMenuHeader"/>
<g:HTMLPanel styleName="{style.pageSizeContainer}">
<g:InlineLabel ui:field="five" >5</g:InlineLabel>
<g:InlineLabel ui:field="ten" >10</g:InlineLabel>
<g:InlineLabel ui:field="twentyFive" >25</g:InlineLabel>
<g:InlineLabel ui:field="fifty" >50</g:InlineLabel>
</g:HTMLPanel>
</g:VerticalPanel>
</g:layer>
<g:layer top="410px" height="100px" left="5px" right="5px">
<g:VerticalPanel width="100%">
<g:Label ui:field="otherConfigHeader" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="showErrorChk"><ui:msg>Show System Errors</ui:msg></g:CheckBox>
</g:VerticalPanel>
</g:layer>
<g:layer bottom="2px" height="24px">
<g:HTMLPanel>
<g:PushButton ui:field="saveButton" addStyleNames="{style.editorOptsButton}"/>
<g:PushButton ui:field="loadButton" addStyleNames="{style.editorOptsButton}" title=""/>
<g:PushButton ui:field="restoreToDefaultsButton" addStyleNames="{style.editorOptsButton}"/>
</g:HTMLPanel>
</g:layer>
</g:LayoutPanel>
</g:layer>
</g:LayoutPanel>
<g:VerticalPanel styleName="{style.mainPanel}">
<g:cell>
<g:VerticalPanel width="100%">
<g:Label ui:field="editorOptionHeader" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="editorButtonsChk"><ui:msg>Editor Buttons</ui:msg></g:CheckBox>
<g:CheckBox ui:field="enterChk"><ui:msg>'Enter' key saves immediately</ui:msg></g:CheckBox>
<g:CheckBox ui:field="useCodeMirrorChk" ><ui:msg>Use CodeMirror Editor</ui:msg></g:CheckBox>
</g:VerticalPanel>
</g:cell>

<g:cell>
<g:VerticalPanel width="100%">
<g:Label ui:field="filterHeader" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="translatedChk" styleName="{style.translated}"><ui:msg>Translated</ui:msg></g:CheckBox>
<g:CheckBox ui:field="needReviewChk" styleName="{style.needReview}"><ui:msg>Need Review</ui:msg></g:CheckBox>
<g:CheckBox ui:field="untranslatedChk" styleName="{style.untranslated}"><ui:msg>Untranslated</ui:msg></g:CheckBox>
</g:VerticalPanel>
</g:cell>

<g:cell>
<g:VerticalPanel width="100%">
<g:Label ui:field="navOptionHeader" styleName="sideMenuHeader"/>
<g:VerticalPanel ui:field="optionsContainer" />
</g:VerticalPanel>
</g:cell>

<g:cell>
<g:VerticalPanel width="100%">
<g:Label ui:field="pageSizeHeader" styleName="sideMenuHeader"/>
<g:HTMLPanel styleName="{style.pageSizeContainer}">
<g:InlineLabel ui:field="five" >5</g:InlineLabel>
<g:InlineLabel ui:field="ten" >10</g:InlineLabel>
<g:InlineLabel ui:field="twentyFive" >25</g:InlineLabel>
<g:InlineLabel ui:field="fifty" >50</g:InlineLabel>
</g:HTMLPanel>
</g:VerticalPanel>
</g:cell>

</g:VerticalPanel>


</ui:UiBinder>
@@ -31,8 +31,8 @@
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -47,7 +47,7 @@
}

@UiField
LayoutPanel optionsContainer;
HTMLPanel optionsContainer;

@UiField
Label advancedUserConfig;
@@ -2,52 +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">

<ui:style field="style" type="org.zanata.webtrans.client.view.EditorOptionsView.Styles">
.mainPanel table td {
font-size: 13px;
padding: 2px;
border-radius: 5px;
color: #FFFFFF;
}

.mainPanel select {
color: #000000;
}

.translated {
border-left: 3px solid #099B09;
margin-left: 5px;
}

.needReview {
border-left: 3px solid #ffc000;
margin-left: 5px;
}

.untranslated {
border-left: 3px solid #e5e5e5;
margin-left: 5px;
}

.selectedPageSize {
background-color: #B62918;
}

.pageSizeContainer {
margin-left: 8px;
margin-top: 8px;
}

.pageSizeContainer span {
padding: 3px;
border: 1px solid #808080;
cursor: pointer;
display: block;
height: 15px;
width: 15px;
text-align: center;
float: left;
margin-right: 3px;
<ui:style field="style">
.mainPanel {
width:100%;
height:100%;
padding:5px;
}

.editorOptsButton {
@@ -59,18 +18,18 @@

</ui:style>

<g:VerticalPanel height="100%" width="100%">
<g:VerticalPanel height="100%" width="100%" styleName="{style.mainPanel}">
<g:cell>
<g:LayoutPanel ui:field="optionsContainer"/>
<g:HTMLPanel ui:field="optionsContainer"/>
</g:cell>

<g:cell verticalAlignment="ALIGN_BOTTOM">
<g:cell verticalAlignment="ALIGN_TOP" height="50px">
<g:HTMLPanel>
<g:Label ui:field="advancedUserConfig" styleName="sideMenuHeader"/>
<g:CheckBox ui:field="showErrorChk"><ui:msg>Show System Errors</ui:msg></g:CheckBox>
</g:HTMLPanel>
</g:cell>
<g:cell verticalAlignment="ALIGN_BOTTOM">
<g:cell verticalAlignment="ALIGN_BOTTOM" height="30px">
<g:HTMLPanel>
<g:PushButton ui:field="saveButton" addStyleNames="{style.editorOptsButton}"/>
<g:PushButton ui:field="loadButton" addStyleNames="{style.editorOptsButton}" title=""/>

0 comments on commit 0b296b9

Please sign in to comment.
You can’t perform that action at this time.