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

Commit

Permalink
Some formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesEskebaek committed Sep 7, 2013
1 parent 1d548bd commit 742e677
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
Expand Up @@ -8,7 +8,7 @@
import org.zanata.webtrans.shared.rpc.NavOption;

/**
* @author Patrick Huang <ahref="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
*/
public interface EditorOptionsDisplay extends WidgetDisplay
{
Expand Down
Expand Up @@ -20,6 +20,7 @@
*/
package org.zanata.webtrans.client.view;


import org.zanata.webtrans.client.presenter.UserConfigHolder;
import org.zanata.webtrans.client.resources.UiMessages;
import org.zanata.webtrans.client.resources.WebTransMessages;
Expand Down Expand Up @@ -225,9 +226,12 @@ public void onSpellCheckChanged(ValueChangeEvent<Boolean> event)
@UiHandler({"diffModeDiff", "diffModeHighlight"})
public void onDiffModeOptionChange(ValueChangeEvent<Boolean> event)
{
if (diffModeDiff.getValue()) {
if (diffModeDiff.getValue())
{
listener.onTransMemoryDisplayModeChanged(DiffMode.NORMAL);
} else {
}
else
{
listener.onTransMemoryDisplayModeChanged(DiffMode.HIGHLIGHT);
}
}
Expand Down Expand Up @@ -269,9 +273,12 @@ public void setOptionsState(UserConfigHolder.ConfigurationState state)
showSaveApprovedWarningChk.setValue(state.isShowSaveApprovedWarning());
spellCheckChk.setValue(state.isSpellCheckEnabled());

if (state.getTransMemoryDisplayMode() == DiffMode.NORMAL) {
if (state.getTransMemoryDisplayMode() == DiffMode.NORMAL)
{
diffModeDiff.setValue(true);
} else {
}
else
{
diffModeHighlight.setValue(true);
}

Expand All @@ -283,13 +290,20 @@ public void setOptionsState(UserConfigHolder.ConfigurationState state)

private void selectPageSize(int pageSize)
{
if (pageSize == 5) {
if (pageSize == 5)
{
selectFive();
} else if (pageSize == 10) {
}
else if (pageSize == 10)
{
selectTen();
} else if (pageSize == 25) {
}
else if (pageSize == 25)
{
selectTwentyFive();
} else if (pageSize == 50) {
}
else if (pageSize ==50)
{
selectFifty();
}
}
Expand Down
Expand Up @@ -48,6 +48,7 @@

public class SourceContentsView extends Composite implements SourceContentsDisplay
{

public static final int COLUMNS = 1;
public static final int DEFAULT_ROWS = 1;
private final Grid sourcePanelContainer;
Expand Down Expand Up @@ -132,7 +133,8 @@ public void setValue(TransUnit value, boolean fireEvents)

int rowIndex = 0;
boolean useCodeMirrorEditor = configHolder.getState().isUseCodeMirrorEditor();
for (String source : value.getSources()) {
for (String source : value.getSources())
{
SourcePanel sourcePanel = new SourcePanel(transUnit.getId(), useCodeMirrorEditor);
sourcePanel.setValue(source, value.getSourceComment(), value.isPlural());
sourcePanelContainer.setWidget(rowIndex, 0, sourcePanel);
Expand All @@ -145,7 +147,8 @@ public void setValue(TransUnit value, boolean fireEvents)
@Override
public void highlightSearch(String search)
{
for (Widget sourceLabel : sourcePanelContainer) {
for (Widget sourceLabel : sourcePanelContainer)
{
((SourcePanel) sourceLabel).highlightSearch(search);
}
}
Expand All @@ -154,25 +157,30 @@ public void highlightSearch(String search)
public void setSourceSelectionHandler(ClickHandler clickHandler)
{
Preconditions.checkState(!sourcePanelList.isEmpty(), "empty source panel list. Did you forget to call setValue() before this?");
for (HasSelectableSource hasSelectableSource : sourcePanelList) {
for (HasSelectableSource hasSelectableSource : sourcePanelList)
{
hasSelectableSource.addClickHandler(clickHandler);
}
}

@Override
public void refresh()
{
for (HasSelectableSource hasSelectableSource : sourcePanelList) {
for (HasSelectableSource hasSelectableSource : sourcePanelList)
{
hasSelectableSource.refresh();
}
}

@Override
public void toggleTransUnitDetails(boolean showTransUnitDetails)
{
if (transUnitDetailsPanel.hasNoMetaInfo() && !showTransUnitDetails) {
if (transUnitDetailsPanel.hasNoMetaInfo() && !showTransUnitDetails)
{
transUnitDetailsPanel.setVisible(false);
} else {
}
else
{
transUnitDetailsPanel.setVisible(true);
}
}
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.zanata.webtrans.client.rpc.CachingDispatchAsync;

/**
* @author Patrick Huang <ahref="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
* @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
*/
@Test(groups = "unit-tests")
public class SourceContentsPresenterTest
Expand Down Expand Up @@ -66,7 +66,7 @@ public void setUp() throws Exception
verify(eventBus).addHandler(UserConfigChangeEvent.TYPE, presenter);
}

@Test
@Test
public void testShowData() throws Exception
{
// Given: 2 trans units
Expand Down

0 comments on commit 742e677

Please sign in to comment.