Merge topic 'user-dashboards'

* changes:
  Allow users to sort 'My' menu items of preference screen
  Allow admins to configure the default 'My' menus for all users
  Allow users to configure the 'My' menu from the preferences screen
  Use REST API for loading/saving general account preferences
  Extend REST API for user preferences to set My menu items
  Add All-Users project to store meta data for all users
This commit is contained in:
Shawn Pearce
2014-03-26 05:05:09 +00:00
committed by Gerrit Code Review
31 changed files with 947 additions and 55 deletions

View File

@@ -116,4 +116,9 @@ public interface GerritConstants extends Constants {
String projectAccessProposeForReviewHint();
String userCannotVoteToolTip();
String stringListPanelAdd();
String stringListPanelDelete();
String stringListPanelUp();
String stringListPanelDown();
}

View File

@@ -99,3 +99,8 @@ projectAccessError = You don't have permissions to modify the access rights for
projectAccessProposeForReviewHint = You may propose these modifications to the project owners by clicking on 'Save for Review'.
userCannotVoteToolTip = User cannot vote in this category
stringListPanelAdd = Add
stringListPanelDelete = Delete
stringListPanelUp = Up
stringListPanelDown = Down

View File

@@ -28,6 +28,12 @@ public interface GerritResources extends ClientBundle {
@Source("arrowRight.gif")
public ImageResource arrowRight();
@Source("arrowUp.png")
public ImageResource arrowUp();
@Source("arrowDown.png")
public ImageResource arrowDown();
@Source("editText.png")
public ImageResource edit();
@@ -69,4 +75,7 @@ public interface GerritResources extends ClientBundle {
@Source("warning.png")
public ImageResource warning();
@Source("listAdd.png")
public ImageResource listAdd();
}

View File

@@ -0,0 +1,276 @@
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.client;
import com.google.gerrit.client.ui.NavigationTable;
import com.google.gerrit.client.ui.OnEditEnabler;
import com.google.gerrit.client.ui.SmallHeading;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ImageResourceRenderer;
import com.google.gwtexpui.globalkey.client.NpTextBox;
import java.util.ArrayList;
import java.util.List;
public class StringListPanel extends FlowPanel {
private final StringListTable t;
private final Button deleteButton;
private final HorizontalPanel titlePanel;
private Image info;
private FocusWidget widget;
public StringListPanel(String title, List<String> fieldNames, FocusWidget w,
boolean autoSort) {
widget = w;
titlePanel = new HorizontalPanel();
SmallHeading titleLabel = new SmallHeading(title);
titlePanel.add(titleLabel);
add(titlePanel);
t = new StringListTable(fieldNames, autoSort);
add(t);
deleteButton = new Button(Gerrit.C.stringListPanelDelete());
deleteButton.setEnabled(false);
add(deleteButton);
deleteButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
widget.setEnabled(true);
t.deleteChecked();
}
});
}
public void display(List<List<String>> values) {
t.display(values);
}
public void setInfo(String msg) {
if (info == null) {
info = new Image(Gerrit.RESOURCES.info());
titlePanel.add(info);
}
info.setTitle(msg);
}
public List<List<String>> getValues() {
return t.getValues();
}
private class StringListTable extends NavigationTable<List<String>> {
private final List<NpTextBox> inputs;
private final boolean autoSort;
StringListTable(List<String> names, boolean autoSort) {
this.autoSort = autoSort;
Button addButton =
new Button(new ImageResourceRenderer().render(Gerrit.RESOURCES.listAdd()));
addButton.setTitle(Gerrit.C.stringListPanelAdd());
OnEditEnabler e = new OnEditEnabler(addButton);
inputs = new ArrayList<>();
FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().iconHeader());
for (int i = 0; i < names.size(); i++) {
fmt.addStyleName(0, i + 1, Gerrit.RESOURCES.css().dataHeader());
table.setText(0, i + 1, names.get(i));
NpTextBox input = new NpTextBox();
input.setVisibleLength(35);
input.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
widget.setEnabled(true);
add();
}
}
});
inputs.add(input);
fmt.addStyleName(1, i + 1, Gerrit.RESOURCES.css().dataHeader());
table.setWidget(1, i + 1, input);
e.listenTo(input);
}
addButton.setEnabled(false);
addButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
widget.setEnabled(true);
add();
}
});
table.setWidget(1, 0, addButton);
if (!autoSort) {
fmt.addStyleName(0, names.size() + 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, names.size() + 2, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(1, names.size() + 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(1, names.size() + 2, Gerrit.RESOURCES.css().iconHeader());
}
}
void display(List<List<String>> values) {
for (int row = 2; row < table.getRowCount(); row++) {
table.removeRow(row--);
}
int row = 2;
for (List<String> v : values) {
populate(row, v, row == values.size() + 1);
row++;
}
}
List<List<String>> getValues() {
List<List<String>> values = new ArrayList<>();
for (int row = 2; row < table.getRowCount(); row++) {
values.add(getValues(row));
}
return values;
}
List<String> getValues(int row) {
List<String> v = new ArrayList<>();
for (int i = 0; i < inputs.size(); i++) {
v.add(table.getText(row, i + 1));
}
return v;
}
private void populate(final int row, List<String> values, boolean last) {
FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().iconCell());
CheckBox checkBox = new CheckBox();
checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
enableDelete();
}
});
table.setWidget(row, 0, checkBox);
for (int i = 0; i < values.size(); i++) {
fmt.addStyleName(row, i + 1, Gerrit.RESOURCES.css().dataCell());
table.setText(row, i + 1, values.get(i));
}
if (!autoSort) {
fmt.addStyleName(row, values.size() + 1, Gerrit.RESOURCES.css().iconCell());
if (!last) {
Image down = new Image(Gerrit.RESOURCES.arrowDown());
down.setTitle(Gerrit.C.stringListPanelDown());
down.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
List<String> value = getValues(row);
List<String> nextValue = getValues(row + 1);
populate(row, nextValue, false);
populate(row + 1, value, row + 1 == table.getRowCount() - 1);
widget.setEnabled(true);
}
});
table.setWidget(row, values.size() + 1, down);
}
if (row > 2) {
Image up = new Image(Gerrit.RESOURCES.arrowUp());
up.setTitle(Gerrit.C.stringListPanelUp());
up.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
List<String> previousValue = getValues(row - 1);
List<String> value = getValues(row);
populate(row - 1, value, false);
populate(row, previousValue, row == table.getRowCount() - 1);
widget.setEnabled(true);
}
});
table.setWidget(row, values.size() + 2, up);
}
}
}
void add() {
List<String> values = new ArrayList<>();
for (NpTextBox input : inputs) {
String v = input.getValue().trim();
if (!v.isEmpty()) {
input.setValue("");
values.add(v);
}
}
t.insert(values);
}
void insert(List<String> v) {
int insertPos = table.getRowCount();
if (autoSort) {
for (int row = 1; row < table.getRowCount(); row++) {
int compareResult = v.get(0).compareTo(table.getText(row, 1));
if (compareResult < 0) {
insertPos = row;
break;
} else if (compareResult == 0) {
return;
}
}
}
table.insertRow(insertPos);
populate(insertPos, v, insertPos == table.getRowCount() - 1);
}
void enableDelete() {
for (int row = 2; row < table.getRowCount(); row++) {
if (((CheckBox) table.getWidget(row, 0)).getValue()) {
deleteButton.setEnabled(true);
return;
}
}
deleteButton.setEnabled(false);
}
void deleteChecked() {
deleteButton.setEnabled(false);
for (int row = 2; row < table.getRowCount(); row++) {
if (((CheckBox) table.getWidget(row, 0)).getValue()) {
table.removeRow(row--);
}
}
}
@Override
protected void onOpenRow(int row) {
}
@Override
protected Object getRowItemKey(List<String> item) {
return item.get(0);
}
}
}

View File

@@ -39,6 +39,10 @@ public interface AccountConstants extends Constants {
String buttonSaveChanges();
String showRelativeDateInChangeTable();
String showSizeBarInChangeTable();
String myMenu();
String myMenuInfo();
String myMenuName();
String myMenuUrl();
String changeScreenOldUi();
String changeScreenNewUi();

View File

@@ -19,6 +19,10 @@ contextWholeFile = Whole File
buttonSaveChanges = Save Changes
showRelativeDateInChangeTable = Show Relative Dates In Changes Table
showSizeBarInChangeTable = Show Change Sizes As Colored Bars In Changes Table
myMenu = My Menu
myMenuInfo = Menu Items for the 'My' top level menu.
myMenuName = Name
myMenuUrl = URL
changeScreenOldUi = Old Screen
changeScreenNewUi = New Screen

View File

@@ -19,10 +19,12 @@ import static com.google.gerrit.reviewdb.client.AccountGeneralPreferences.PAGESI
import com.google.gerrit.client.Dispatcher;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.StringListPanel;
import com.google.gerrit.client.extensions.TopMenuItem;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.Natives;
import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.OnEditEnabler;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.CommentVisibilityStrategy;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -34,9 +36,11 @@ import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwtjsonrpc.common.VoidResult;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
public class MyPreferencesScreen extends SettingsScreen {
private CheckBox showSiteHeader;
@@ -52,6 +56,7 @@ public class MyPreferencesScreen extends SettingsScreen {
private ListBox commentVisibilityStrategy;
private ListBox changeScreen;
private ListBox diffView;
private StringListPanel myMenus;
private Button save;
@Override
@@ -202,6 +207,13 @@ public class MyPreferencesScreen extends SettingsScreen {
doSave();
}
});
myMenus = new StringListPanel(Util.C.myMenu(),
Arrays.asList(Util.C.myMenuName(), Util.C.myMenuUrl()),
save, false);
myMenus.setInfo(Util.C.myMenuInfo());
add(myMenus);
add(save);
final OnEditEnabler e = new OnEditEnabler(save);
@@ -223,9 +235,11 @@ public class MyPreferencesScreen extends SettingsScreen {
@Override
protected void onLoad() {
super.onLoad();
Util.ACCOUNT_SVC.myAccount(new ScreenLoadCallback<Account>(this) {
public void preDisplay(final Account result) {
display(result.getGeneralPreferences());
AccountApi.self().view("preferences")
.get(new ScreenLoadCallback<Preferences>(this) {
@Override
public void preDisplay(Preferences prefs) {
display(prefs);
}
});
}
@@ -246,28 +260,34 @@ public class MyPreferencesScreen extends SettingsScreen {
diffView.setEnabled(on);
}
private void display(final AccountGeneralPreferences p) {
showSiteHeader.setValue(p.isShowSiteHeader());
useFlashClipboard.setValue(p.isUseFlashClipboard());
copySelfOnEmails.setValue(p.isCopySelfOnEmails());
reversePatchSetOrder.setValue(p.isReversePatchSetOrder());
showUsernameInReviewCategory.setValue(p.isShowUsernameInReviewCategory());
setListBox(maximumPageSize, DEFAULT_PAGESIZE, p.getMaximumPageSize());
private void display(Preferences p) {
showSiteHeader.setValue(p.showSiteHeader());
useFlashClipboard.setValue(p.useFlashClipboard());
copySelfOnEmails.setValue(p.copySelfOnEmail());
reversePatchSetOrder.setValue(p.reversePatchSetOrder());
showUsernameInReviewCategory.setValue(p.showUsernameInReviewCategory());
setListBox(maximumPageSize, DEFAULT_PAGESIZE, p.changesPerPage());
setListBox(dateFormat, AccountGeneralPreferences.DateFormat.STD, //
p.getDateFormat());
p.dateFormat());
setListBox(timeFormat, AccountGeneralPreferences.TimeFormat.HHMM_12, //
p.getTimeFormat());
relativeDateInChangeTable.setValue(p.isRelativeDateInChangeTable());
sizeBarInChangeTable.setValue(p.isSizeBarInChangeTable());
p.timeFormat());
relativeDateInChangeTable.setValue(p.relativeDateInChangeTable());
sizeBarInChangeTable.setValue(p.sizeBarInChangeTable());
setListBox(commentVisibilityStrategy,
AccountGeneralPreferences.CommentVisibilityStrategy.EXPAND_RECENT,
p.getCommentVisibilityStrategy());
p.commentVisibilityStrategy());
setListBox(changeScreen,
null,
p.getChangeScreen());
p.changeScreen());
setListBox(diffView,
AccountGeneralPreferences.DiffView.SIDE_BY_SIDE,
p.getDiffView());
p.diffView());
List<List<String>> values = new ArrayList<>();
for (TopMenuItem item : Natives.asList(p.my())) {
values.add(Arrays.asList(item.getName(), item.getUrl()));
}
myMenus.display(values);
}
private void setListBox(final ListBox f, final short defaultValue,
@@ -350,22 +370,30 @@ public class MyPreferencesScreen extends SettingsScreen {
enable(false);
save.setEnabled(false);
Util.ACCOUNT_SVC.changePreferences(p, new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
Gerrit.getUserAccount().setGeneralPreferences(p);
Gerrit.applyUserPreferences();
Dispatcher.changeScreen2 = false;
enable(true);
}
List<TopMenuItem> items = new ArrayList<>();
for (List<String> v : myMenus.getValues()) {
items.add(TopMenuItem.create(v.get(0), v.get(1)));
}
@Override
public void onFailure(final Throwable caught) {
enable(true);
save.setEnabled(true);
super.onFailure(caught);
}
});
AccountApi.self().view("preferences")
.post(Preferences.create(p, items), new GerritCallback<Preferences>() {
@Override
public void onSuccess(Preferences prefs) {
Gerrit.getUserAccount().setGeneralPreferences(p);
Gerrit.applyUserPreferences();
Dispatcher.changeScreen2 = false;
enable(true);
display(prefs);
Gerrit.refreshMenuBar();
}
@Override
public void onFailure(Throwable caught) {
enable(true);
save.setEnabled(true);
super.onFailure(caught);
}
});
}
private static String getLabel(AccountGeneralPreferences.ChangeScreen ui) {

View File

@@ -15,12 +15,197 @@
package com.google.gerrit.client.account;
import com.google.gerrit.client.extensions.TopMenuItem;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.CommentVisibilityStrategy;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DateFormat;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DiffView;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadCommand;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.TimeFormat;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
public class Preferences extends JavaScriptObject {
import java.util.List;
public final native JsArray<TopMenuItem> my() /*-{ return this.my; }-*/;
public class Preferences extends JavaScriptObject {
public static Preferences create(AccountGeneralPreferences in, List<TopMenuItem> myMenus) {
Preferences p = createObject().cast();
if (in == null) {
in = AccountGeneralPreferences.createDefault();
}
p.changesPerPage(in.getMaximumPageSize());
p.showSiteHeader(in.isShowSiteHeader());
p.useFlashClipboard(in.isUseFlashClipboard());
p.downloadScheme(in.getDownloadUrl());
p.downloadCommand(in.getDownloadCommand());
p.copySelfOnEmail(in.isCopySelfOnEmails());
p.dateFormat(in.getDateFormat());
p.timeFormat(in.getTimeFormat());
p.reversePatchSetOrder(in.isReversePatchSetOrder());
p.showUsernameInReviewCategory(in.isShowUsernameInReviewCategory());
p.relativeDateInChangeTable(in.isRelativeDateInChangeTable());
p.sizeBarInChangeTable(in.isSizeBarInChangeTable());
p.commentVisibilityStrategy(in.getCommentVisibilityStrategy());
p.diffView(in.getDiffView());
p.changeScreen(in.getChangeScreen());
p.setMyMenus(myMenus);
return p;
}
public final short changesPerPage() {
return get("changes_per_page", AccountGeneralPreferences.DEFAULT_PAGESIZE);
}
private final native short get(String n, int d)
/*-{ return this.hasOwnProperty(n) ? this[n] : d }-*/;
public final native boolean showSiteHeader()
/*-{ return this.show_site_header || false }-*/;
public final native boolean useFlashClipboard()
/*-{ return this.use_flash_clipboard || false }-*/;
public final DownloadScheme downloadScheme() {
String s = downloadSchemeRaw();
return s != null ? DownloadScheme.valueOf(s) : null;
}
private final native String downloadSchemeRaw()
/*-{ return this.download_scheme }-*/;
public final DownloadCommand downloadCommand() {
String s = downloadCommandRaw();
return s != null ? DownloadCommand.valueOf(s) : null;
}
private final native String downloadCommandRaw()
/*-{ return this.download_command }-*/;
public final native boolean copySelfOnEmail()
/*-{ return this.copy_self_on_email || false }-*/;
public final DateFormat dateFormat() {
String s = dateFormatRaw();
return s != null ? DateFormat.valueOf(s) : null;
}
private final native String dateFormatRaw()
/*-{ return this.date_format }-*/;
public final TimeFormat timeFormat() {
String s = timeFormatRaw();
return s != null ? TimeFormat.valueOf(s) : null;
}
private final native String timeFormatRaw()
/*-{ return this.time_format }-*/;
public final native boolean reversePatchSetOrder()
/*-{ return this.reverse_patch_set_order || false }-*/;
public final native boolean showUsernameInReviewCategory()
/*-{ return this.show_username_in_review_category || false }-*/;
public final native boolean relativeDateInChangeTable()
/*-{ return this.relative_date_in_change_table || false }-*/;
public final native boolean sizeBarInChangeTable()
/*-{ return this.size_bar_in_change_table || false }-*/;
public final CommentVisibilityStrategy commentVisibilityStrategy() {
String s = commentVisibilityStrategyRaw();
return s != null ? CommentVisibilityStrategy.valueOf(s) : null;
}
private final native String commentVisibilityStrategyRaw()
/*-{ return this.comment_visibility_strategy }-*/;
public final DiffView diffView() {
String s = diffViewRaw();
return s != null ? DiffView.valueOf(s) : null;
}
private final native String diffViewRaw()
/*-{ return this.diff_view }-*/;
public final ChangeScreen changeScreen() {
String s = changeScreenRaw();
return s != null ? ChangeScreen.valueOf(s) : null;
}
private final native String changeScreenRaw()
/*-{ return this.change_screen }-*/;
public final native JsArray<TopMenuItem> my()
/*-{ return this.my; }-*/;
public final native void changesPerPage(short n)
/*-{ this.changes_per_page = n }-*/;
public final native void showSiteHeader(boolean s)
/*-{ this.show_site_header = s }-*/;
public final native void useFlashClipboard(boolean u)
/*-{ this.use_flash_clipboard = u }-*/;
public final void downloadScheme(DownloadScheme d) {
downloadSchemeRaw(d != null ? d.toString() : null);
}
private final native void downloadSchemeRaw(String d)
/*-{ this.download_scheme = d }-*/;
public final void downloadCommand(DownloadCommand d) {
downloadCommandRaw(d != null ? d.toString() : null);
}
public final native void downloadCommandRaw(String d)
/*-{ this.download_command = d }-*/;
public final native void copySelfOnEmail(boolean c)
/*-{ this.copy_self_on_email = c }-*/;
public final void dateFormat(DateFormat f) {
dateFormatRaw(f != null ? f.toString() : null);
}
private final native void dateFormatRaw(String f)
/*-{ this.date_format = f }-*/;
public final void timeFormat(TimeFormat f) {
timeFormatRaw(f != null ? f.toString() : null);
}
private final native void timeFormatRaw(String f)
/*-{ this.time_format = f }-*/;
public final native void reversePatchSetOrder(boolean r)
/*-{ this.reverse_patch_set_order = r }-*/;
public final native void showUsernameInReviewCategory(boolean s)
/*-{ this.show_username_in_review_category = s }-*/;
public final native void relativeDateInChangeTable(boolean d)
/*-{ this.relative_date_in_change_table = d }-*/;
public final native void sizeBarInChangeTable(boolean s)
/*-{ this.size_bar_in_change_table = s }-*/;
public final void commentVisibilityStrategy(CommentVisibilityStrategy s) {
commentVisibilityStrategyRaw(s != null ? s.toString() : null);
}
private final native void commentVisibilityStrategyRaw(String s)
/*-{ this.comment_visibility_strategy = s }-*/;
public final void diffView(DiffView d) {
diffViewRaw(d != null ? d.toString() : null);
}
private final native void diffViewRaw(String d)
/*-{ this.diff_view = d }-*/;
public final void changeScreen(ChangeScreen s) {
changeScreenRaw(s != null ? s.toString() : null);
}
private final native void changeScreenRaw(String s)
/*-{ this.change_screen = s }-*/;
final void setMyMenus(List<TopMenuItem> myMenus) {
initMy();
for (TopMenuItem n : myMenus) {
addMy(n);
}
}
final native void initMy() /*-{ this.my = []; }-*/;
final native void addMy(TopMenuItem m) /*-{ this.my.push(m); }-*/;
protected Preferences() {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -17,11 +17,21 @@ package com.google.gerrit.client.extensions;
import com.google.gwt.core.client.JavaScriptObject;
public class TopMenuItem extends JavaScriptObject {
public static TopMenuItem create(String name, String url) {
TopMenuItem i = createObject().cast();
i.name(name);
i.url(url);
return i;
}
public final native String getName() /*-{ return this.name; }-*/;
public final native String getUrl() /*-{ return this.url; }-*/;
public final native String getTarget() /*-{ return this.target; }-*/;
public final native String getId() /*-{ return this.id; }-*/;
public final native void name(String n) /*-{ this.name = n }-*/;
public final native void url(String u) /*-{ this.url = u }-*/;
protected TopMenuItem() {
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B