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

Commit

Permalink
Browse files Browse the repository at this point in the history
rhbz723084 - add bookmark icon to each row in editor
  • Loading branch information
Patrick Huang committed Mar 14, 2013
1 parent aba0adf commit 7af3a59
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Expand Up @@ -454,7 +454,7 @@ private static String encode(String toEncode)
sb.append(nextChar);
}
}
Log.debug("Encoded: \"" + toEncode + "\" to \"" + sb + "\"");
// Log.debug("Encoded: \"" + toEncode + "\" to \"" + sb + "\"");
return sb.toString();
}

Expand Down
Expand Up @@ -5,7 +5,7 @@

<ui:style field="style" type="org.zanata.webtrans.client.ui.TransUnitDetailsPanel.Styles">
.container {
width: 100%;
width: 95%;
table-layout: fixed;
margin-left: 6px;
padding-right: 32px;
Expand Down
Expand Up @@ -23,18 +23,23 @@
import java.util.ArrayList;
import java.util.List;

import org.zanata.webtrans.client.history.History;
import org.zanata.webtrans.client.history.HistoryToken;
import org.zanata.webtrans.client.presenter.UserConfigHolder;
import org.zanata.webtrans.client.ui.HasSelectableSource;
import org.zanata.webtrans.client.ui.SourcePanel;
import org.zanata.webtrans.client.ui.TransUnitDetailsPanel;
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.TransUnitId;

import com.allen_sauer.gwt.log.client.Log;
import com.google.common.base.Preconditions;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
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.InlineLabel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.Provider;
Expand All @@ -50,11 +55,13 @@ public class SourceContentsView extends Composite implements SourceContentsDispl

private TransUnitId transUnitId;
private final UserConfigHolder configHolder;
private final History history;

@Inject
public SourceContentsView(Provider<TransUnitDetailsPanel> transUnitDetailsPanelProvider, UserConfigHolder configHolder)
public SourceContentsView(Provider<TransUnitDetailsPanel> transUnitDetailsPanelProvider, UserConfigHolder configHolder, History history)
{
this.configHolder = configHolder;
this.history = history;
sourcePanelList = new ArrayList<HasSelectableSource>();
FlowPanel root = new FlowPanel();
root.setSize("100%", "100%");
Expand All @@ -67,12 +74,33 @@ public SourceContentsView(Provider<TransUnitDetailsPanel> transUnitDetailsPanelP

container.add(sourcePanelContainer);
root.add(container);

InlineLabel bookmarkIcon = createBookmarkIcon();
root.add(bookmarkIcon);

transUnitDetailsPanel = transUnitDetailsPanelProvider.get();
root.add(transUnitDetailsPanel);

initWidget(root);
}

private InlineLabel createBookmarkIcon()
{
InlineLabel bookmarkIcon = new InlineLabel();
bookmarkIcon.setStyleName("bookmark icon-bookmark-1");
bookmarkIcon.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
HistoryToken historyToken = history.getHistoryToken();
historyToken.setTextFlowId(transUnitId.toString());
history.newItem(historyToken);
}
});
return bookmarkIcon;
}

@Override
public List<HasSelectableSource> getSourcePanelList()
{
Expand Down
Expand Up @@ -837,6 +837,13 @@ a.downloadLink
border-radius:5px;
}

.transUnitCol .bookmark
{
float: left;
margin-left: 6px;
cursor: pointer;
}

/* custom webkit scroll bar */
/* Let's get this party started */
::-webkit-scrollbar {
Expand Down

0 comments on commit 7af3a59

Please sign in to comment.