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

Commit

Permalink
Merge branch 'workspaceDesign' into integration/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Sep 11, 2012
2 parents daa9deb + 4bf6ccd commit b07606d
Show file tree
Hide file tree
Showing 47 changed files with 388 additions and 834 deletions.
Expand Up @@ -5,12 +5,11 @@
<ui:style type="org.zanata.webtrans.client.editor.filter.TransFilterView.Styles">
.transFilterTextBox {
margin: 0px;
font-size: 1em;
border: 2px solid lightgrey;
border-radius: 6px;
font-size: 12px;
border: 2px solid #C5C5C5;
border-radius: 3px;
outline: none;
padding-left: 4px;
width:98%;
width:388px;
}

.transFilterTextBoxEmpty {
Expand Down
Expand Up @@ -29,15 +29,11 @@
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.TransUnitId;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.Provider;
Expand All @@ -57,8 +53,9 @@ public class SourceContentsView extends Composite implements SourceContentsDispl
public SourceContentsView(Provider<TransUnitDetailsPanel> transUnitDetailsPanelProvider)
{
sourcePanelList = new ArrayList<HasSelectableSource>();
VerticalPanel root = new VerticalPanel();
root.setWidth("100%");
FlowPanel root = new FlowPanel();
root.setSize("100%", "100%");

FlowPanel container = new FlowPanel();
container.setSize("100%", "100%");

Expand All @@ -67,7 +64,6 @@ public SourceContentsView(Provider<TransUnitDetailsPanel> transUnitDetailsPanelP

container.add(sourcePanelContainer);
root.add(container);
root.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
transUnitDetailsPanel = transUnitDetailsPanelProvider.get();
root.add(transUnitDetailsPanel);

Expand Down
Expand Up @@ -30,6 +30,7 @@
import org.zanata.webtrans.client.ui.ValidationMessagePanelView;
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.TransUnitId;

import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -119,10 +120,7 @@ public void focusEditor(final int currentEditorIndex)
@Override
public void execute()
{
if(editors.size() > currentEditorIndex)
{
editors.get(currentEditorIndex).setFocus();
}
editors.get(currentEditorIndex).setFocus();
}
});
}
Expand Down
Expand Up @@ -18,6 +18,7 @@
{
display:block;
overflow-x:auto;
height:100%;
}

.button
Expand All @@ -26,17 +27,23 @@
font-size: 20px;
padding-left: 3px;
}

.button:hover
{
color:#0085CC;
}

</ui:style>

<g:HorizontalPanel width="100%" addStyleNames="{style.targetContentsCell}">
<g:cell verticalAlignment="ALIGN_TOP">
<g:FlowPanel styleName="{style.editorGridWrapper}">
<g:Grid ui:field="editorGrid" />
<fui:ValidationMessagePanelView ui:field="validationPanel" />
<fui:ValidationMessagePanelView ui:field="validationPanel" styleName="fadeElement"/>
</g:FlowPanel>
</g:cell>
<g:cell verticalAlignment="ALIGN_TOP" horizontalAlignment="ALIGN_JUSTIFY" width="30px">
<g:HTMLPanel ui:field="buttons" height="120px">
<g:HTMLPanel ui:field="buttons" height="120px" styleName="fadeElement">
<g:InlineLabel ui:field="saveIcon" title="{messages.editSaveShortcut}" styleName="icon-install {style.button}"/>
<g:InlineLabel ui:field="fuzzyIcon" title="{messages.saveAsFuzzy}" styleName="icon-flag-1 {style.button}" />
<g:InlineLabel ui:field="cancelIcon" title="{messages.editCancelShortcut}" styleName="icon-cancel-circle {style.button}" />
Expand Down
Expand Up @@ -20,6 +20,11 @@
*/
package org.zanata.webtrans.client.gin;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.Display;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;

import org.zanata.webtrans.client.Application;
import org.zanata.webtrans.client.EventProcessor;
import org.zanata.webtrans.client.editor.filter.TransFilterDisplay;
Expand All @@ -40,12 +45,11 @@
import org.zanata.webtrans.client.keys.EventWrapperImpl;
import org.zanata.webtrans.client.presenter.AppPresenter;
import org.zanata.webtrans.client.presenter.DocumentListPresenter;
import org.zanata.webtrans.client.presenter.EditorOptionsPresenter;
import org.zanata.webtrans.client.presenter.GlossaryDetailsPresenter;
import org.zanata.webtrans.client.presenter.GlossaryPresenter;
import org.zanata.webtrans.client.presenter.KeyShortcutPresenter;
import org.zanata.webtrans.client.presenter.LayoutSelectorPresenter;
import org.zanata.webtrans.client.presenter.NotificationPresenter;
import org.zanata.webtrans.client.presenter.EditorOptionsPresenter;
import org.zanata.webtrans.client.presenter.SearchResultsPresenter;
import org.zanata.webtrans.client.presenter.SideMenuPresenter;
import org.zanata.webtrans.client.presenter.SourceContentsPresenter;
Expand All @@ -68,12 +72,11 @@
import org.zanata.webtrans.client.view.AppView;
import org.zanata.webtrans.client.view.DocumentListView;
import org.zanata.webtrans.client.view.EditorOptionsDisplay;
import org.zanata.webtrans.client.view.EditorOptionsView;
import org.zanata.webtrans.client.view.GlossaryDetailsView;
import org.zanata.webtrans.client.view.GlossaryView;
import org.zanata.webtrans.client.view.KeyShortcutView;
import org.zanata.webtrans.client.view.LayoutSelectorView;
import org.zanata.webtrans.client.view.NotificationView;
import org.zanata.webtrans.client.view.EditorOptionsView;
import org.zanata.webtrans.client.view.SearchResultsView;
import org.zanata.webtrans.client.view.SideMenuView;
import org.zanata.webtrans.client.view.TransMemoryDetailsView;
Expand All @@ -87,16 +90,12 @@
import org.zanata.webtrans.client.view.WorkspaceUsersView;
import org.zanata.webtrans.shared.auth.Identity;
import org.zanata.webtrans.shared.model.UserWorkspaceContext;

import com.google.gwt.core.client.Scheduler;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.Singleton;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.Display;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;

public class WebTransClientModule extends AbstractPresenterModule
{

Expand Down Expand Up @@ -129,7 +128,6 @@ protected void configure()
bindPresenter(ValidationOptionsPresenter.class, ValidationOptionsPresenter.Display.class, ValidationOptionsView.class);
bindPresenter(NotificationPresenter.class, NotificationPresenter.Display.class, NotificationView.class);
bindPresenter(TransUnitEditPresenter.class, TransUnitEditDisplay.class, TransUnitEditView.class);
bindPresenter(LayoutSelectorPresenter.class, LayoutSelectorPresenter.Display.class, LayoutSelectorView.class);
bindPresenter(SideMenuPresenter.class, SideMenuPresenter.Display.class, SideMenuView.class);

bind(SourceContentsPresenter.class).in(Singleton.class);
Expand Down
Expand Up @@ -60,7 +60,7 @@
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.inject.Inject;

public class AppPresenter extends WidgetPresenter<AppPresenter.Display> implements HasNotificationLabel
public class AppPresenter extends WidgetPresenter<AppPresenter.Display>
{
// javac seems confused about which Display is which.
// somehow, qualifying WidgetDisplay helps!
Expand All @@ -86,14 +86,6 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg

HasClickHandlers getSearchAndReplaceButton();

HasClickHandlers getNotificationBtn();

void setNotificationText(int count, Severity severity);

void showNotificationAlert();

void cancelNotificationAlert();

HasClickHandlers getDocumentListButton();

HasClickHandlers getResizeButton();
Expand All @@ -111,8 +103,6 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg
private final DocumentListPresenter documentListPresenter;
private final TranslationPresenter translationPresenter;
private final SearchResultsPresenter searchResultsPresenter;
private final NotificationPresenter notificationPresenter;
private final LayoutSelectorPresenter layoutSelectorPresenter;
private final SideMenuPresenter sideMenuPresenter;

private final History history;
Expand All @@ -131,7 +121,7 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg
private static final String WORKSPACE_TITLE_QUERY_PARAMETER_KEY = "title";

@Inject
public AppPresenter(Display display, EventBus eventBus, final SideMenuPresenter sideMenuPresenter, final KeyShortcutPresenter keyShortcutPresenter, final TranslationPresenter translationPresenter, final DocumentListPresenter documentListPresenter, final SearchResultsPresenter searchResultsPresenter, final NotificationPresenter notificationPresenter, final LayoutSelectorPresenter layoutSelectorPresenter, final UserWorkspaceContext userWorkspaceContext, final WebTransMessages messages, final History history, final Window window, final Window.Location windowLocation)
public AppPresenter(Display display, EventBus eventBus, final SideMenuPresenter sideMenuPresenter, final KeyShortcutPresenter keyShortcutPresenter, final TranslationPresenter translationPresenter, final DocumentListPresenter documentListPresenter, final SearchResultsPresenter searchResultsPresenter, final UserWorkspaceContext userWorkspaceContext, final WebTransMessages messages, final History history, final Window window, final Window.Location windowLocation)
{
super(display, eventBus);
this.userWorkspaceContext = userWorkspaceContext;
Expand All @@ -141,33 +131,20 @@ public AppPresenter(Display display, EventBus eventBus, final SideMenuPresenter
this.documentListPresenter = documentListPresenter;
this.translationPresenter = translationPresenter;
this.searchResultsPresenter = searchResultsPresenter;
this.notificationPresenter = notificationPresenter;
this.layoutSelectorPresenter = layoutSelectorPresenter;
this.sideMenuPresenter = sideMenuPresenter;
this.window = window;
this.windowLocation = windowLocation;
}

@Override
public void setNotificationLabel(int count, Severity severity)
{
display.setNotificationText(count, severity);
}

@Override
protected void onBind()
{
keyShortcutPresenter.bind();
documentListPresenter.bind();
translationPresenter.bind();
searchResultsPresenter.bind();
notificationPresenter.bind();
layoutSelectorPresenter.bind();
sideMenuPresenter.bind();

layoutSelectorPresenter.setLayoutListener(translationPresenter);
notificationPresenter.setNotificationListener(this);

registerHandler(eventBus.addHandler(ShowSideMenuEvent.getType(), new ShowSideMenuEventHandler()
{
@Override
Expand Down Expand Up @@ -260,15 +237,6 @@ public void onValueChange(ValueChangeEvent<String> event)
}
}));

registerHandler(display.getNotificationBtn().addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
notificationPresenter.showNotification();
}
}));

display.getSearchAndReplaceButton().addClickHandler(new ClickHandler()
{
@Override
Expand Down

This file was deleted.

Expand Up @@ -5,4 +5,6 @@
public interface HasNotificationLabel
{
void setNotificationLabel(int count, Severity severity);

void showNotification();
}

This file was deleted.

0 comments on commit b07606d

Please sign in to comment.