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

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Nov 12, 2012
1 parent 30fe6b3 commit 0b296b9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 170 deletions.
Expand Up @@ -39,8 +39,6 @@
import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.InlineLabel; import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label; 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.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject; import com.google.inject.Inject;
Expand All @@ -50,9 +48,6 @@ public class EditorOptionsView extends Composite implements EditorOptionsDisplay
private static EditorOptionsUiBinder uiBinder = GWT.create(EditorOptionsUiBinder.class); private static EditorOptionsUiBinder uiBinder = GWT.create(EditorOptionsUiBinder.class);
private final EnumRadioButtonGroup<NavOption> navOptionGroup; private final EnumRadioButtonGroup<NavOption> navOptionGroup;


@UiField
LayoutPanel container;

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


Expand All @@ -74,22 +69,8 @@ public class EditorOptionsView extends Composite implements EditorOptionsDisplay
@UiField @UiField
Styles style; Styles style;
@UiField @UiField
Label otherConfigHeader;

@UiField
CheckBox showErrorChk;
@UiField
CheckBox useCodeMirrorChk; CheckBox useCodeMirrorChk;


@UiField
PushButton saveButton;

@UiField
PushButton loadButton;

@UiField
PushButton restoreToDefaultsButton;

private Listener listener; private Listener listener;


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


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

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


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


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

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


navOptionGroup.setDefaultSelected(state.getNavOption()); navOptionGroup.setDefaultSelected(state.getNavOption());
selectPageSize(state.getPageSize()); selectPageSize(state.getPageSize());
showErrorChk.setValue(state.isShowError()); // showErrorChk.setValue(state.isShowError());
useCodeMirrorChk.setValue(state.isUseCodeMirrorEditor()); 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) private void selectPageSize(int pageSize)
{ {
if (pageSize == 5) if (pageSize == 5)
Expand All @@ -278,7 +229,7 @@ else if (pageSize ==50)
} }
} }


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


Expand All @@ -296,7 +247,5 @@ interface Styles extends CssResource
String untranslated(); String untranslated();


String pageSizeContainer(); String pageSizeContainer();

String editorOptsButton();
} }
} }
Expand Up @@ -3,17 +3,20 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:f="urn:import:org.zanata.webtrans.client"> 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"> <ui:style field="style" type="org.zanata.webtrans.client.view.EditorOptionsView.Styles">
.mainPanel {
width:100%;
}

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

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


.mainPanel select {
color: #000000;
}

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


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

</ui:style> </ui:style>


<g:LayoutPanel> <g:VerticalPanel styleName="{style.mainPanel}">
<g:layer top="0px" bottom="0" left="0" right="0"> <g:cell>
<g:LayoutPanel ui:field="container" styleName="{style.mainPanel}"> <g:VerticalPanel width="100%">
<g:layer top="5px" height="100px" left="5px" right="5px"> <g:Label ui:field="editorOptionHeader" styleName="sideMenuHeader"/>
<g:VerticalPanel width="100%"> <g:CheckBox ui:field="editorButtonsChk"><ui:msg>Editor Buttons</ui:msg></g:CheckBox>
<g:Label ui:field="editorOptionHeader" styleName="sideMenuHeader"/> <g:CheckBox ui:field="enterChk"><ui:msg>'Enter' key saves immediately</ui:msg></g:CheckBox>
<g:CheckBox ui:field="editorButtonsChk"><ui:msg>Editor Buttons</ui:msg></g:CheckBox> <g:CheckBox ui:field="useCodeMirrorChk" ><ui:msg>Use CodeMirror Editor</ui:msg></g:CheckBox>
<g:CheckBox ui:field="enterChk"><ui:msg>'Enter' key saves immediately</ui:msg></g:CheckBox> </g:VerticalPanel>
<g:CheckBox ui:field="useCodeMirrorChk" ><ui:msg>Use CodeMirror Editor</ui:msg></g:CheckBox> </g:cell>
</g:VerticalPanel>
</g:layer> <g:cell>
<g:layer top="110px" height="100px" left="5px" right="5px"> <g:VerticalPanel width="100%">
<g:VerticalPanel width="100%"> <g:Label ui:field="filterHeader" styleName="sideMenuHeader"/>
<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="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="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:CheckBox ui:field="untranslatedChk" styleName="{style.untranslated}"><ui:msg>Untranslated</ui:msg></g:CheckBox> </g:VerticalPanel>
</g:VerticalPanel> </g:cell>
</g:layer>
<g:layer top="220px" height="100px" left="5px" right="5px"> <g:cell>
<g:VerticalPanel width="100%"> <g:VerticalPanel width="100%">
<g:Label ui:field="navOptionHeader" styleName="sideMenuHeader"/> <g:Label ui:field="navOptionHeader" styleName="sideMenuHeader"/>
<g:VerticalPanel ui:field="optionsContainer" /> <g:VerticalPanel ui:field="optionsContainer" />
</g:VerticalPanel> </g:VerticalPanel>
</g:layer> </g:cell>
<g:layer top="330px" height="70px" left="5px" right="5px">
<g:VerticalPanel width="100%"> <g:cell>
<g:Label ui:field="pageSizeHeader" styleName="sideMenuHeader"/> <g:VerticalPanel width="100%">
<g:HTMLPanel styleName="{style.pageSizeContainer}"> <g:Label ui:field="pageSizeHeader" styleName="sideMenuHeader"/>
<g:InlineLabel ui:field="five" >5</g:InlineLabel> <g:HTMLPanel styleName="{style.pageSizeContainer}">
<g:InlineLabel ui:field="ten" >10</g:InlineLabel> <g:InlineLabel ui:field="five" >5</g:InlineLabel>
<g:InlineLabel ui:field="twentyFive" >25</g:InlineLabel> <g:InlineLabel ui:field="ten" >10</g:InlineLabel>
<g:InlineLabel ui:field="fifty" >50</g:InlineLabel> <g:InlineLabel ui:field="twentyFive" >25</g:InlineLabel>
</g:HTMLPanel> <g:InlineLabel ui:field="fifty" >50</g:InlineLabel>
</g:VerticalPanel> </g:HTMLPanel>
</g:layer> </g:VerticalPanel>
<g:layer top="410px" height="100px" left="5px" right="5px"> </g:cell>
<g:VerticalPanel width="100%">
<g:Label ui:field="otherConfigHeader" styleName="sideMenuHeader"/> </g:VerticalPanel>
<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>


</ui:UiBinder> </ui:UiBinder>
Expand Up @@ -31,8 +31,8 @@
import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite; 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.Label;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.PushButton; import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
Expand All @@ -47,7 +47,7 @@ interface OptionsUiBinder extends UiBinder<VerticalPanel, OptionsView>
} }


@UiField @UiField
LayoutPanel optionsContainer; HTMLPanel optionsContainer;


@UiField @UiField
Label advancedUserConfig; Label advancedUserConfig;
Expand Down
Expand Up @@ -2,52 +2,11 @@
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <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: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"> <ui:style field="style">
.mainPanel table td { .mainPanel {
font-size: 13px; width:100%;
padding: 2px; height:100%;
border-radius: 5px; padding: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;
} }


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


</ui:style> </ui:style>


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


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

0 comments on commit 0b296b9

Please sign in to comment.