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

Commit

Permalink
Move Save button above Cancel, modify tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Aug 1, 2011
1 parent 08eecf6 commit 386e2a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
Expand Up @@ -46,6 +46,7 @@
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class InlineTargetCellEditor implements CellEditor<TransUnit>
Expand Down Expand Up @@ -125,7 +126,7 @@ public void onClick(ClickEvent event)
private TransUnit cellValue;

private EditorTextArea textArea;
private HorizontalPanel operationsPanel;
private VerticalPanel operationsPanel;

private boolean isFocused = false;
// private boolean allowFuzzyOverride = false;
Expand Down Expand Up @@ -279,8 +280,8 @@ else if (!event.isAltKeyDown() && !event.isControlKeyDown())

layoutTable.add(textArea);

operationsPanel = new HorizontalPanel();
operationsPanel.setWidth("100%");
operationsPanel = new VerticalPanel();
operationsPanel.setHeight("100%");
operationsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
operationsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

Expand All @@ -292,21 +293,6 @@ else if (!event.isAltKeyDown() && !event.isControlKeyDown())
// stateImage = new Image(resources.newUnit());
// operationsPanel.add(stateImage);

// Add content widget
// toggleFuzzy = new CheckBox(messages.fuzzy());
// operationsPanel.add(toggleFuzzy);

// PushButton cloneButton = new PushButton(new Image(), cloneHandler);
// cloneButton.setText(messages.editClone());
// cloneButton.setTitle(messages.editCloneShortcut());
// operationsPanel.add(cloneButton);

// PushButton cloneAndSaveButton = new PushButton(new Image(),
// cloneAndSaveHandler);
// cloneAndSaveButton.setText(messages.editCloneAndSave());
// cloneAndSaveButton.setTitle(messages.editCloneAndSaveShortcut());
// operationsPanel.add(cloneAndSaveButton);

// PushButton doesn't allow to have images and text at the same time
TableResources images = GWT.create(TableResources.class);
Image cancelButton = new Image(images.cellEditorCancel());
Expand All @@ -315,14 +301,14 @@ else if (!event.isAltKeyDown() && !event.isControlKeyDown())
cancelButton.setTitle(messages.editCancelShortcut());
cancelButton.addClickHandler(cancelHandler);

operationsPanel.add(cancelButton);

Image saveButton = new Image(images.cellEditorAccept());
// saveButton.setText(messages.editSave());
saveButton.setStyleName("gwt-Button");
saveButton.setTitle(messages.editSaveShortcut());
saveButton.addClickHandler(acceptHandler);

operationsPanel.add(saveButton);
operationsPanel.add(cancelButton);
layoutTable.add(operationsPanel);
}

Expand Down
Expand Up @@ -56,16 +56,10 @@ public interface NavigationMessages extends Messages
@DefaultMessage("Alt+PageUp")
String prevFuzzyOrUntranslatedShortcut();

@DefaultMessage("Save")
String editSave();

@DefaultMessage("Ctrl+Enter")
@DefaultMessage("Save (Ctrl+Enter)")
String editSaveShortcut();

@DefaultMessage("Cancel")
String editCancel();

@DefaultMessage("Esc")
@DefaultMessage("Cancel (Esc)")
String editCancelShortcut();

// @DefaultMessage("Copy")
Expand Down

0 comments on commit 386e2a1

Please sign in to comment.