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

Commit

Permalink
add image and tooltip to 'copy src to target button', change css styl…
Browse files Browse the repository at this point in the history
…e of middle column and make it horizontalalignment center
  • Loading branch information
jamesni committed Jul 27, 2011
1 parent e364782 commit 274e471
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,22 @@ public interface NavigationMessages extends Messages
@DefaultMessage("Esc")
String editCancelShortcut();

@DefaultMessage("Copy")
String editClone();
// @DefaultMessage("Copy")
// String editClone();

// @DefaultMessage("Ctrl+Home")
@DefaultMessage("Clone")
String editCloneShortcut();
// @DefaultMessage("Ctrl+Home")
// @DefaultMessage("Clone")
// String editCloneShortcut();

@DefaultMessage("Clone & Save")
String editCloneAndSave();
// @DefaultMessage("Clone & Save")
// String editCloneAndSave();

// @DefaultMessage("Ctrl+End")
@DefaultMessage("Clone & Save")
String editCloneAndSaveShortcut();
// @DefaultMessage("Ctrl+End")
// @DefaultMessage("Clone & Save")
// String editCloneAndSaveShortcut();

@DefaultMessage("Copy message from source language")
String copySourcetoTarget();

@DefaultMessage("{0} ({1})")
String actionToolTip(String actionName, String shortcut);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.zanata.webtrans.shared.model.TransUnit;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
Expand All @@ -38,11 +39,13 @@
import com.google.gwt.gen2.table.client.ColumnDefinition;
import com.google.gwt.gen2.table.client.DefaultTableDefinition;
import com.google.gwt.gen2.table.client.RowRenderer;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ImageBundle;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Image;

public class TableEditorTableDefinition extends DefaultTableDefinition<TransUnit>
{
Expand All @@ -55,6 +58,12 @@ public class TableEditorTableDefinition extends DefaultTableDefinition<TransUnit
private CheckBox toggleFuzzy;
private EventBus eventBus;

public static interface OperationsColumnImages extends ImageBundle
{
@Resource("org/zanata/webtrans/images/crystal_project/16x16/actions/2rightarrow.png")
AbstractImagePrototype copySrcButton();
}

private final RowRenderer<TransUnit> rowRenderer = new RowRenderer<TransUnit>()
{
@Override
Expand Down Expand Up @@ -164,8 +173,9 @@ public void setCellValue(TransUnit rowValue, TransUnit cellValue)
@Override
public void renderRowValue(final TransUnit rowValue, ColumnDefinition<TransUnit, TransUnit> columnDef, AbstractCellView<TransUnit> view)
{
// view.setStyleName("TableEditorCell TableEditorCell-Source");
view.setStyleName("TableEditorCell TableEditorCell-Middle");
VerticalPanel operationsPanel = new VerticalPanel();
operationsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
toggleFuzzy = new CheckBox(messages.fuzzy());
if (rowValue.getStatus() == ContentState.NeedReview)
toggleFuzzy.setValue(true);
Expand All @@ -186,9 +196,11 @@ public void onValueChange(ValueChangeEvent<Boolean> event)
}

});
PushButton copyButton = new PushButton(new Image());
copyButton.setText(messages.editClone());
copyButton.setTitle(messages.editCloneShortcut());
OperationsColumnImages images = GWT.<OperationsColumnImages> create(OperationsColumnImages.class);
Image copyButton = images.copySrcButton().createImage();
copyButton.setStyleName("gwt-Button");
//copyButton.setText(messages.editClone());
copyButton.setTitle(messages.copySourcetoTarget());
copyButton.addClickHandler(new ClickHandler()
{

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ td.TableEditorCell-Source {

}

td.TableEditorCell-Middle {

}

td.TableEditorCell-Target {

}
Expand All @@ -273,6 +277,10 @@ tr.TableEditorRow.highlighted td.TableEditorCell-Source {

}

tr.TableEditorRow.highlighted td.TableEditorCell-Middle {

}

tr.TableEditorRow.highlighted td.TableEditorCell-Target {
cursor: hand;
}
Expand Down Expand Up @@ -301,7 +309,7 @@ tr.TableEditorRow.content-filter-nomatch {
}

tr.TableEditorRow.selected td {
background: #C3D9FF;

}

.TableEditorContent,.TableEditorContent-Edit {
Expand Down

0 comments on commit 274e471

Please sign in to comment.