Move all of our CSS rules into our CssResource

This save us from needing to download the application's CSS
resources in a separate HTTP connection.  It also allowed us
to find and remove some unused class names.

I may have broken a few style classes here.  I plan to break
the CSS up into smaller chunks and fix any broken styles as I
go through them.

Change-Id: I81b60ff8d93be3faedf606d2f40a6f89d401909d
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-12-19 17:53:06 -08:00
parent f2d68b182d
commit f511d760db
76 changed files with 1103 additions and 764 deletions

View File

@@ -25,7 +25,6 @@
<inherits name='com.google.gerrit.Common'/> <inherits name='com.google.gerrit.Common'/>
<inherits name='com.google.gerrit.UserAgent'/> <inherits name='com.google.gerrit.UserAgent'/>
<inherits name='org.eclipse.jgit.JGit'/> <inherits name='org.eclipse.jgit.JGit'/>
<stylesheet src='gerrit.css' />
<extend-property name='locale' values='en'/> <extend-property name='locale' values='en'/>
<set-property-fallback name='locale' value='en'/> <set-property-fallback name='locale' value='en'/>

View File

@@ -35,7 +35,7 @@ public class ErrorDialog extends AutoCenterDialogBox {
body = new FlowPanel(); body = new FlowPanel();
final FlowPanel buttons = new FlowPanel(); final FlowPanel buttons = new FlowPanel();
buttons.setStyleName("gerrit-ErrorDialog-Buttons"); buttons.setStyleName(Gerrit.RESOURCES.css().errorDialogButtons());
final Button closey = new Button(); final Button closey = new Button();
closey.setText(Gerrit.C.errorDialogClose()); closey.setText(Gerrit.C.errorDialogClose());
closey.addClickHandler(new ClickHandler() { closey.addClickHandler(new ClickHandler() {
@@ -47,7 +47,7 @@ public class ErrorDialog extends AutoCenterDialogBox {
buttons.add(closey); buttons.add(closey);
final FlowPanel center = new FlowPanel(); final FlowPanel center = new FlowPanel();
center.setStyleName("gerrit-ErrorDialog"); center.setStyleName(Gerrit.RESOURCES.css().errorDialog());
center.add(body); center.add(body);
center.add(buttons); center.add(buttons);
add(center); add(center);
@@ -90,13 +90,9 @@ public class ErrorDialog extends AutoCenterDialogBox {
} }
} }
body.add(label(cn, "gerrit-ErrorDialog-ErrorType")); final Label r = new Label(cn);
r.setStyleName(Gerrit.RESOURCES.css().errorDialogErrorType());
body.add(r);
body.add(new Label(what.getMessage())); body.add(new Label(what.getMessage()));
} }
private static Label label(final String what, final String style) {
final Label r = new Label(what);
r.setStyleName(style);
return r;
}
} }

View File

@@ -20,8 +20,8 @@ import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.LinkMenuBar; import com.google.gerrit.client.ui.LinkMenuBar;
import com.google.gerrit.client.ui.LinkMenuItem; import com.google.gerrit.client.ui.LinkMenuItem;
import com.google.gerrit.client.ui.Screen; import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.common.Version;
import com.google.gerrit.common.PageLinks; import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.Version;
import com.google.gerrit.common.auth.SignInMode; import com.google.gerrit.common.auth.SignInMode;
import com.google.gerrit.common.data.GerritConfig; import com.google.gerrit.common.data.GerritConfig;
import com.google.gerrit.common.data.HostPageData; import com.google.gerrit.common.data.HostPageData;
@@ -156,31 +156,41 @@ public class Gerrit implements EntryPoint {
public void onModuleLoad() { public void onModuleLoad() {
UserAgent.assertNotInIFrame(); UserAgent.assertNotInIFrame();
RESOURCES.gwt_override().ensureInjected();
RESOURCES.css().ensureInjected(); RESOURCES.css().ensureInjected();
final RootPanel gTopMenu = RootPanel.get("gerrit_topmenu");
final RootPanel gStarting = RootPanel.get("gerrit_startinggerrit");
final RootPanel gBody = RootPanel.get("gerrit_body");
final RootPanel gBottomMenu = RootPanel.get("gerrit_btmmenu");
gTopMenu.setStyleName(RESOURCES.css().gerritTopMenu());
gBody.setStyleName(RESOURCES.css().gerritBody());
initHostname(); initHostname();
Window.setTitle(M.windowTitle1(myHost)); Window.setTitle(M.windowTitle1(myHost));
initHistoryHooks(); initHistoryHooks();
populateBottomMenu(); populateBottomMenu(gBottomMenu);
final RootPanel menuArea = RootPanel.get("gerrit_topmenu");
final Grid menuLine = new Grid(1, 3); final Grid menuLine = new Grid(1, 3);
menuLeft = new TabPanel(); menuLeft = new TabPanel();
menuRight = new LinkMenuBar(); menuRight = new LinkMenuBar();
searchPanel = new SearchPanel(); searchPanel = new SearchPanel();
menuLeft.setStyleName("gerrit-topmenu-menuLeft"); menuLeft.setStyleName(RESOURCES.css().topmenuMenuLeft());
menuLine.setStyleName("gerrit-topmenu"); menuLine.setStyleName(RESOURCES.css().topmenu());
menuArea.add(menuLine); gTopMenu.add(menuLine);
final FlowPanel menuRightPanel = new FlowPanel(); final FlowPanel menuRightPanel = new FlowPanel();
menuRightPanel.setStyleName("gerrit-topmenu-menuRight"); menuRightPanel.setStyleName(RESOURCES.css().topmenuMenuRight());
menuRightPanel.add(menuRight); menuRightPanel.add(menuRight);
menuRightPanel.add(searchPanel); menuRightPanel.add(searchPanel);
menuLine.setWidget(0, 0, menuLeft); menuLine.setWidget(0, 0, menuLeft);
menuLine.setWidget(0, 1, new FlowPanel()); menuLine.setWidget(0, 1, new FlowPanel());
menuLine.setWidget(0, 2, menuRightPanel); menuLine.setWidget(0, 2, menuRightPanel);
final CellFormatter fmt = menuLine.getCellFormatter(); final CellFormatter fmt = menuLine.getCellFormatter();
fmt.setStyleName(0, 0, "gerrit-topmenu-TDmenu"); fmt.setStyleName(0, 0, RESOURCES.css().topmenuTDmenu());
fmt.setStyleName(0, 1, "gerrit-topmenu-TDglue"); fmt.setStyleName(0, 1, RESOURCES.css().topmenuTDglue());
fmt.setStyleName(0, 2, "gerrit-topmenu-TDmenu"); fmt.setStyleName(0, 2, RESOURCES.css().topmenuTDmenu());
siteHeader = RootPanel.get("gerrit_header"); siteHeader = RootPanel.get("gerrit_header");
siteFooter = RootPanel.get("gerrit_footer"); siteFooter = RootPanel.get("gerrit_footer");
@@ -192,9 +202,9 @@ public class Gerrit implements EntryPoint {
view.onShowView(); view.onShowView();
} }
}; };
RootPanel.get("gerrit_body").add(body); gBody.add(body);
final RpcStatus rpcStatus = new RpcStatus(menuArea); final RpcStatus rpcStatus = new RpcStatus(gTopMenu);
JsonUtil.addRpcStartHandler(rpcStatus); JsonUtil.addRpcStartHandler(rpcStatus);
JsonUtil.addRpcCompleteHandler(rpcStatus); JsonUtil.addRpcCompleteHandler(rpcStatus);
JsonUtil.setDefaultXsrfManager(new XsrfManager() { JsonUtil.setDefaultXsrfManager(new XsrfManager() {
@@ -217,7 +227,7 @@ public class Gerrit implements EntryPoint {
myAccount = result.userAccount; myAccount = result.userAccount;
applyUserPreferences(); applyUserPreferences();
} }
onModuleLoad2(); onModuleLoad2(gStarting);
} }
}); });
} }
@@ -262,16 +272,14 @@ public class Gerrit implements EntryPoint {
} }
} }
private static void populateBottomMenu() { private static void populateBottomMenu(final RootPanel btmmenu) {
final RootPanel btmmenu = RootPanel.get("gerrit_btmmenu");
final Label keyHelp = new Label(C.keyHelp()); final Label keyHelp = new Label(C.keyHelp());
keyHelp.setStyleName("gerrit-keyhelp"); keyHelp.setStyleName(RESOURCES.css().keyhelp());
btmmenu.add(keyHelp); btmmenu.add(keyHelp);
final String vs = getVersion(); final String vs = getVersion();
final HTML version = new HTML(M.poweredBy(vs)); final HTML version = new HTML(M.poweredBy(vs));
version.setStyleName("gerrit-version"); version.setStyleName(RESOURCES.css().version());
btmmenu.add(version); btmmenu.add(version);
} }
@@ -288,13 +296,11 @@ public class Gerrit implements EntryPoint {
return myVersion; return myVersion;
} }
private void onModuleLoad2() { private void onModuleLoad2(final RootPanel starting) {
refreshMenuBar(); refreshMenuBar();
final RootPanel sg = RootPanel.get("gerrit_startinggerrit"); starting.getElement().getParentElement().removeChild(starting.getElement());
sg.getElement().getParentElement().removeChild(sg.getElement()); RootPanel.detachNow(starting);
RootPanel.detachNow(sg);
History.addValueChangeHandler(new HistoryHandler()); History.addValueChangeHandler(new HistoryHandler());
JumpKeys.register(body); JumpKeys.register(body);
@@ -397,13 +403,13 @@ public class Gerrit implements EntryPoint {
private static void whoAmI() { private static void whoAmI() {
final String name = FormatUtil.nameEmail(getUserAccount()); final String name = FormatUtil.nameEmail(getUserAccount());
final InlineLabel l = new InlineLabel(name); final InlineLabel l = new InlineLabel(name);
l.setStyleName("gerrit-MenuBarUserName"); l.setStyleName(RESOURCES.css().menuBarUserName());
menuRight.add(l); menuRight.add(l);
} }
private static Anchor anchor(final String text, final String to) { private static Anchor anchor(final String text, final String to) {
final Anchor a = new Anchor(text, to); final Anchor a = new Anchor(text, to);
a.setStyleName("gerrit-MenuItem"); a.setStyleName(RESOURCES.css().menuItem());
Accessibility.setRole(a.getElement(), Accessibility.ROLE_MENUITEM); Accessibility.setRole(a.getElement(), Accessibility.ROLE_MENUITEM);
return a; return a;
} }

View File

@@ -0,0 +1,171 @@
// Copyright (C) 2009 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.gwt.resources.client.CssResource;
public interface GerritCss extends CssResource {
String greenCheckClass();
String abandonChangeDialog();
String abandonMessage();
String accountContactOnFile();
String accountContactPrivacyDetails();
String accountDashboard();
String accountInfoBlock();
String accountName();
String activeRow();
String addReviewer();
String addSshKeyPanel();
String approvalCategoryList();
String approvalTable();
String approvalhint();
String approvalrole();
String approvalscore();
String blockHeader();
String bottomheader();
String cAPPROVAL();
String cID();
String cLastUpdate();
String cPROJECT();
String cSUBJECT();
String changeComments();
String changeInfoBlock();
String changeScreen();
String changeScreenDescription();
String changeScreenStarIcon();
String changeTable();
String changeTablePrevNextLinks();
String changeTypeCell();
String changeid();
String closedstate();
String command();
String commentCell();
String commentEditorPanel();
String commentHolder();
String commentPanel();
String commentPanelAuthorCell();
String commentPanelButtons();
String commentPanelContent();
String commentPanelDateCell();
String commentPanelHeader();
String commentPanelLast();
String commentPanelMessage();
String commentPanelSummary();
String commentPanelSummaryCell();
String complexHeader();
String content();
String contributorAgreementAlreadySubmitted();
String contributorAgreementButton();
String contributorAgreementLegal();
String contributorAgreementShortDescription();
String coverMessage();
String dataCell();
String dataHeader();
String diffLinkCell();
String diffText();
String diffTextCONTEXT();
String diffTextDELETE();
String diffTextFileHeader();
String diffTextHunkHeader();
String diffTextINSERT();
String diffTextNoLF();
String drafts();
String emptySection();
String errorDialog();
String errorDialogButtons();
String errorDialogErrorType();
String fileColumnHeader();
String fileLine();
String fileLineCONTEXT();
String fileLineDELETE();
String fileLineINSERT();
String fileLineNone();
String filePathCell();
String gerritTopMenu();
String gerritBody();
String groupName();
String header();
String hyperlink();
String iconCell();
String iconHeader();
String identityUntrustedExternalId();
String infoBlock();
String infoTable();
String inputFieldTypeHint();
String keyhelp();
String leftMostCell();
String leftmost();
String lineHeader();
String lineNumber();
String linkMenuBar();
String linkMenuItemNotLast();
String menuBarUserName();
String menuItem();
String missingApproval();
String missingApprovalList();
String needsReview();
String negscore();
String noLineLineNumber();
String patchBrowserPopup();
String patchBrowserPopupBody();
String patchComments();
String patchContentTable();
String patchHistoryTable();
String patchNoDifference();
String patchScreenDisplayControls();
String patchSetActions();
String patchSetInfoBlock();
String patchSetLink();
String patchSetRevision();
String patchSetUserIdentity();
String permalink();
String posscore();
String projectAdminApprovalCategoryRangeLine();
String projectAdminApprovalCategoryValue();
String publishCommentsScreen();
String registerScreenExplain();
String registerScreenNextLinks();
String registerScreenSection();
String rightmost();
String rpcStatus();
String rpcStatusLoading();
String rpcStatusPanel();
String screen();
String screenHeader();
String searchPanel();
String sectionHeader();
String sideBySideScreenLinkTable();
String sideBySideScreenSideBySideTable();
String skipLine();
String smallHeading();
String sourceFilePath();
String sshHostKeyPanel();
String sshHostKeyPanelFingerprintData();
String sshHostKeyPanelHeading();
String sshHostKeyPanelKnownHostEntry();
String sshKeyPanelEncodedKey();
String sshKeyPanelInvalid();
String sshPanelUsername();
String topmenu();
String topmenuMenuLeft();
String topmenuMenuRight();
String topmenuTDglue();
String topmenuTDmenu();
String topmost();
String useridentity();
String version();
String visualtab();
String whitespaceerror();
}

View File

@@ -15,11 +15,15 @@
package com.google.gerrit.client; package com.google.gerrit.client;
import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource; import com.google.gwt.resources.client.ImageResource;
public interface GerritResources extends ClientBundle { public interface GerritResources extends ClientBundle {
@Source("gerrit2.css") @Source("gerrit.css")
GerritCssResource css(); GerritCss css();
@Source("gwt_override.css")
CssResource gwt_override();
@Source("arrowRight.gif") @Source("arrowRight.gif")
public ImageResource arrowRight(); public ImageResource arrowRight();

View File

@@ -28,7 +28,7 @@ public class NotSignedInDialog extends AutoCenterDialogBox {
setText(Gerrit.C.notSignedInTitle()); setText(Gerrit.C.notSignedInTitle());
final FlowPanel buttons = new FlowPanel(); final FlowPanel buttons = new FlowPanel();
buttons.setStyleName("gerrit-ErrorDialog-Buttons"); buttons.setStyleName(Gerrit.RESOURCES.css().errorDialogButtons());
final Button signin = new Button(); final Button signin = new Button();
signin.setText(Gerrit.C.menuSignIn()); signin.setText(Gerrit.C.menuSignIn());
@@ -52,7 +52,7 @@ public class NotSignedInDialog extends AutoCenterDialogBox {
buttons.add(close); buttons.add(close);
final FlowPanel center = new FlowPanel(); final FlowPanel center = new FlowPanel();
center.setStyleName("gerrit-ErrorDialog"); center.setStyleName(Gerrit.RESOURCES.css().errorDialog());
center.add(new HTML(Gerrit.C.notSignedInBody())); center.add(new HTML(Gerrit.C.notSignedInBody()));
center.add(buttons); center.add(buttons);
add(center); add(center);

View File

@@ -41,12 +41,12 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
RpcStatus(final Panel p) { RpcStatus(final Panel p) {
final FlowPanel r = new FlowPanel(); final FlowPanel r = new FlowPanel();
r.setStyleName("gerrit-RpcStatusPanel"); r.setStyleName(Gerrit.RESOURCES.css().rpcStatusPanel());
p.add(r); p.add(r);
loading = new InlineLabel(); loading = new InlineLabel();
loading.setText(Gerrit.C.rpcStatusLoading()); loading.setText(Gerrit.C.rpcStatusLoading());
loading.setStyleName("gerrit-RpcStatus"); loading.setStyleName(Gerrit.RESOURCES.css().rpcStatus());
loading.addStyleDependentName("Loading"); loading.addStyleDependentName("Loading");
loading.setVisible(false); loading.setVisible(false);
r.add(loading); r.add(loading);

View File

@@ -41,18 +41,18 @@ class SearchPanel extends Composite {
SearchPanel() { SearchPanel() {
final FlowPanel body = new FlowPanel(); final FlowPanel body = new FlowPanel();
initWidget(body); initWidget(body);
setStyleName("gerrit-SearchPanel"); setStyleName(Gerrit.RESOURCES.css().searchPanel());
searchBox = new NpTextBox(); searchBox = new NpTextBox();
searchBox.setVisibleLength(46); searchBox.setVisibleLength(46);
searchBox.setText(Gerrit.C.searchHint()); searchBox.setText(Gerrit.C.searchHint());
searchBox.addStyleName("gerrit-InputFieldTypeHint"); searchBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
searchBox.addFocusHandler(new FocusHandler() { searchBox.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(FocusEvent event) { public void onFocus(FocusEvent event) {
if (Gerrit.C.searchHint().equals(searchBox.getText())) { if (Gerrit.C.searchHint().equals(searchBox.getText())) {
searchBox.setText(""); searchBox.setText("");
searchBox.removeStyleName("gerrit-InputFieldTypeHint"); searchBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -61,7 +61,7 @@ class SearchPanel extends Composite {
public void onBlur(BlurEvent event) { public void onBlur(BlurEvent event) {
if ("".equals(searchBox.getText())) { if ("".equals(searchBox.getText())) {
searchBox.setText(Gerrit.C.searchHint()); searchBox.setText(Gerrit.C.searchHint());
searchBox.addStyleName("gerrit-InputFieldTypeHint"); searchBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -95,10 +95,10 @@ class SearchPanel extends Composite {
void setText(final String query) { void setText(final String query) {
if (query == null || query.equals("")) { if (query == null || query.equals("")) {
searchBox.setText(Gerrit.C.searchHint()); searchBox.setText(Gerrit.C.searchHint());
searchBox.addStyleName("gerrit-InputFieldTypeHint"); searchBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} else { } else {
searchBox.setText(query); searchBox.setText(query);
searchBox.removeStyleName("gerrit-InputFieldTypeHint"); searchBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }

View File

@@ -67,8 +67,8 @@ public class AccountSettings extends AccountScreen {
} }
info = new Grid(4, 2); info = new Grid(4, 2);
info.setStyleName("gerrit-InfoBlock"); info.setStyleName(Gerrit.RESOURCES.css().infoBlock());
info.addStyleName("gerrit-AccountInfoBlock"); info.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
add(info); add(info);
infoRow(0, Util.C.fullName()); infoRow(0, Util.C.fullName());
@@ -77,9 +77,9 @@ public class AccountSettings extends AccountScreen {
infoRow(3, Util.C.accountId()); infoRow(3, Util.C.accountId());
final CellFormatter fmt = info.getCellFormatter(); final CellFormatter fmt = info.getCellFormatter();
fmt.addStyleName(0, 0, "topmost"); fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, "topmost"); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(3, 0, "bottomheader"); fmt.addStyleName(3, 0, Gerrit.RESOURCES.css().bottomheader());
tabTokens = new ArrayList<String>(); tabTokens = new ArrayList<String>();
tabs = new TabPanel(); tabs = new TabPanel();
@@ -156,7 +156,7 @@ public class AccountSettings extends AccountScreen {
private void infoRow(final int row, final String name) { private void infoRow(final int row, final String name) {
info.setText(row, labelIdx, name); info.setText(row, labelIdx, name);
info.getCellFormatter().addStyleName(row, 0, "header"); info.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
} }
void display(final Account account) { void display(final Account account) {

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.client.account; package com.google.gerrit.client.account;
import com.google.gerrit.client.FormatUtil; import com.google.gerrit.client.FormatUtil;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.FancyFlexTable; import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gerrit.common.PageLinks; import com.google.gerrit.common.PageLinks;
@@ -64,7 +65,7 @@ class AgreementPanel extends Composite {
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
for (int c = 1; c <= 4; c++) { for (int c = 1; c <= 4; c++) {
fmt.addStyleName(0, c, S_DATA_HEADER); fmt.addStyleName(0, c, Gerrit.RESOURCES.css().dataHeader());
} }
} }
@@ -129,9 +130,9 @@ class AgreementPanel extends Composite {
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
for (int c = 1; c <= 4; c++) { for (int c = 1; c <= 4; c++) {
fmt.addStyleName(row, c, S_DATA_CELL); fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
} }
fmt.addStyleName(row, 4, "C_LAST_UPDATE"); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().cLastUpdate());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -55,14 +55,14 @@ class ContactPanelFull extends ContactPanelShort {
faxTxt.setMaxLength(30); faxTxt.setMaxLength(30);
final Grid infoSecure = new Grid(4, 2); final Grid infoSecure = new Grid(4, 2);
infoSecure.setStyleName("gerrit-InfoBlock"); infoSecure.setStyleName(Gerrit.RESOURCES.css().infoBlock());
infoSecure.addStyleName("gerrit-AccountInfoBlock"); infoSecure.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
final HTML privhtml = new HTML(Util.C.contactPrivacyDetailsHtml()); final HTML privhtml = new HTML(Util.C.contactPrivacyDetailsHtml());
privhtml.setStyleName("gerrit-AccountContactPrivacyDetails"); privhtml.setStyleName(Gerrit.RESOURCES.css().accountContactPrivacyDetails());
hasContact = new Label(); hasContact = new Label();
hasContact.setStyleName("gerrit-AccountContactOnFile"); hasContact.setStyleName(Gerrit.RESOURCES.css().accountContactOnFile());
hasContact.setVisible(false); hasContact.setVisible(false);
if (Gerrit.getConfig().isUseContactInfo()) { if (Gerrit.getConfig().isUseContactInfo()) {
@@ -76,9 +76,9 @@ class ContactPanelFull extends ContactPanelShort {
row(infoSecure, 2, Util.C.contactFieldPhone(), phoneTxt); row(infoSecure, 2, Util.C.contactFieldPhone(), phoneTxt);
row(infoSecure, 3, Util.C.contactFieldFax(), faxTxt); row(infoSecure, 3, Util.C.contactFieldFax(), faxTxt);
infoSecure.getCellFormatter().addStyleName(0, 0, "topmost"); infoSecure.getCellFormatter().addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
infoSecure.getCellFormatter().addStyleName(0, 1, "topmost"); infoSecure.getCellFormatter().addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
infoSecure.getCellFormatter().addStyleName(3, 0, "bottomheader"); infoSecure.getCellFormatter().addStyleName(3, 0, Gerrit.RESOURCES.css().bottomheader());
final TextSaveButtonListener sbl = new TextSaveButtonListener(save); final TextSaveButtonListener sbl = new TextSaveButtonListener(save);
addressTxt.addKeyPressHandler(sbl); addressTxt.addKeyPressHandler(sbl);

View File

@@ -81,8 +81,8 @@ class ContactPanelShort extends Composite {
emailPick = new ListBox(); emailPick = new ListBox();
final Grid infoPlainText = new Grid(2, 2); final Grid infoPlainText = new Grid(2, 2);
infoPlainText.setStyleName("gerrit-InfoBlock"); infoPlainText.setStyleName(Gerrit.RESOURCES.css().infoBlock());
infoPlainText.addStyleName("gerrit-AccountInfoBlock"); infoPlainText.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
body.add(infoPlainText); body.add(infoPlainText);
@@ -103,9 +103,9 @@ class ContactPanelShort extends Composite {
row(infoPlainText, 0, Util.C.contactFieldFullName(), nameTxt); row(infoPlainText, 0, Util.C.contactFieldFullName(), nameTxt);
row(infoPlainText, 1, Util.C.contactFieldEmail(), emailLine); row(infoPlainText, 1, Util.C.contactFieldEmail(), emailLine);
infoPlainText.getCellFormatter().addStyleName(0, 0, "topmost"); infoPlainText.getCellFormatter().addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
infoPlainText.getCellFormatter().addStyleName(0, 1, "topmost"); infoPlainText.getCellFormatter().addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
infoPlainText.getCellFormatter().addStyleName(1, 0, "bottomheader"); infoPlainText.getCellFormatter().addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
save = new Button(Util.C.buttonSaveChanges()); save = new Button(Util.C.buttonSaveChanges());
save.setEnabled(false); save.setEnabled(false);
@@ -233,7 +233,7 @@ class ContactPanelShort extends Composite {
final Widget field) { final Widget field) {
info.setText(row, labelIdx, name); info.setText(row, labelIdx, name);
info.setWidget(row, fieldIdx, field); info.setWidget(row, fieldIdx, field);
info.getCellFormatter().addStyleName(row, 0, "header"); info.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
} }
protected void display(final Account userAccount) { protected void display(final Account userAccount) {

View File

@@ -97,11 +97,11 @@ class ExternalIdPanel extends Composite {
table.setText(0, 5, Util.C.webIdIdentity()); table.setText(0, 5, Util.C.webIdIdentity());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 4, S_DATA_HEADER); fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 5, S_DATA_HEADER); fmt.addStyleName(0, 5, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -195,7 +195,7 @@ class ExternalIdPanel extends Composite {
table.setText(row, 3, ""); table.setText(row, 3, "");
} else { } else {
table.setText(row, 3, Util.C.untrustedProvider()); table.setText(row, 3, Util.C.untrustedProvider());
fmt.addStyleName(row, 3, "gerrit-Identity-UntrustedExternalId"); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().identityUntrustedExternalId());
} }
if (k.getEmailAddress() != null && k.getEmailAddress().length() > 0) { if (k.getEmailAddress() != null && k.getEmailAddress().length() > 0) {
table.setText(row, 4, k.getEmailAddress()); table.setText(row, 4, k.getEmailAddress());
@@ -204,12 +204,12 @@ class ExternalIdPanel extends Composite {
} }
table.setText(row, 5, describe(k)); table.setText(row, 5, describe(k));
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, S_DATA_CELL); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, "C_LAST_UPDATE"); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().cLastUpdate());
fmt.addStyleName(row, 4, S_DATA_CELL); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 5, S_DATA_CELL); fmt.addStyleName(row, 5, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -117,7 +117,7 @@ public class NewAgreementScreen extends AccountScreen {
.add(new SmallHeading(Util.C.newAgreementReviewLegalHeading())); .add(new SmallHeading(Util.C.newAgreementReviewLegalHeading()));
agreementHtml = new HTML(); agreementHtml = new HTML();
agreementHtml.setStyleName("gerrit-ContributorAgreement-Legal"); agreementHtml.setStyleName(Gerrit.RESOURCES.css().contributorAgreementLegal());
agreementGroup.add(agreementHtml); agreementGroup.add(agreementHtml);
formBody.add(agreementGroup); formBody.add(agreementGroup);
@@ -175,13 +175,13 @@ public class NewAgreementScreen extends AccountScreen {
for (final ContributorAgreement cla : available) { for (final ContributorAgreement cla : available) {
final RadioButton r = new RadioButton("cla_id", cla.getShortName()); final RadioButton r = new RadioButton("cla_id", cla.getShortName());
r.addStyleName("gerrit-ContributorAgreement-Button"); r.addStyleName(Gerrit.RESOURCES.css().contributorAgreementButton());
radios.add(r); radios.add(r);
if (mySigned.contains(cla.getId())) { if (mySigned.contains(cla.getId())) {
r.setEnabled(false); r.setEnabled(false);
final Label l = new Label(Util.C.newAgreementAlreadySubmitted()); final Label l = new Label(Util.C.newAgreementAlreadySubmitted());
l.setStyleName("gerrit-ContributorAgreement-AlreadySubmitted"); l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementAlreadySubmitted());
radios.add(l); radios.add(l);
} else { } else {
r.addClickHandler(new ClickHandler() { r.addClickHandler(new ClickHandler() {
@@ -195,7 +195,7 @@ public class NewAgreementScreen extends AccountScreen {
if (cla.getShortDescription() != null if (cla.getShortDescription() != null
&& !cla.getShortDescription().equals("")) { && !cla.getShortDescription().equals("")) {
final Label l = new Label(cla.getShortDescription()); final Label l = new Label(cla.getShortDescription());
l.setStyleName("gerrit-ContributorAgreement-ShortDescription"); l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementShortDescription());
radios.add(l); radios.add(l);
} }
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.account; package com.google.gerrit.client.account;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.FancyFlexTable; import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gerrit.client.ui.ProjectLink; import com.google.gerrit.client.ui.ProjectLink;
@@ -52,19 +53,18 @@ class ProjectWatchPanel extends Composite {
{ {
final FlowPanel fp = new FlowPanel(); final FlowPanel fp = new FlowPanel();
fp.setStyleName("gerrit-ProjectWatchPanel-AddPanel");
final NpTextBox box = new NpTextBox(); final NpTextBox box = new NpTextBox();
nameTxt = new SuggestBox(new ProjectNameSuggestOracle(), box); nameTxt = new SuggestBox(new ProjectNameSuggestOracle(), box);
box.setVisibleLength(50); box.setVisibleLength(50);
box.setText(Util.C.defaultProjectName()); box.setText(Util.C.defaultProjectName());
box.addStyleName("gerrit-InputFieldTypeHint"); box.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
box.addFocusHandler(new FocusHandler() { box.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(FocusEvent event) { public void onFocus(FocusEvent event) {
if (Util.C.defaultProjectName().equals(box.getText())) { if (Util.C.defaultProjectName().equals(box.getText())) {
box.setText(""); box.setText("");
box.removeStyleName("gerrit-InputFieldTypeHint"); box.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -73,7 +73,7 @@ class ProjectWatchPanel extends Composite {
public void onBlur(BlurEvent event) { public void onBlur(BlurEvent event) {
if ("".equals(box.getText())) { if ("".equals(box.getText())) {
box.setText(Util.C.defaultProjectName()); box.setText(Util.C.defaultProjectName());
box.addStyleName("gerrit-InputFieldTypeHint"); box.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -152,9 +152,9 @@ class ProjectWatchPanel extends Composite {
table.setText(0, 3, Util.C.watchedProjectColumnEmailNotifications()); table.setText(0, 3, Util.C.watchedProjectColumnEmailNotifications());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.setRowSpan(0, 0, 2); fmt.setRowSpan(0, 0, 2);
fmt.setRowSpan(0, 1, 2); fmt.setRowSpan(0, 1, 2);
fmt.setRowSpan(0, 2, 2); fmt.setRowSpan(0, 2, 2);
@@ -164,9 +164,9 @@ class ProjectWatchPanel extends Composite {
table.setText(1, 0, Util.C.watchedProjectColumnNewChanges()); table.setText(1, 0, Util.C.watchedProjectColumnNewChanges());
table.setText(1, 1, Util.C.watchedProjectColumnAllComments()); table.setText(1, 1, Util.C.watchedProjectColumnAllComments());
table.setText(1, 2, Util.C.watchedProjectColumnSubmittedChanges()); table.setText(1, 2, Util.C.watchedProjectColumnSubmittedChanges());
fmt.addStyleName(1, 0, S_DATA_HEADER); fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(1, 1, S_DATA_HEADER); fmt.addStyleName(1, 1, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(1, 2, S_DATA_HEADER); fmt.addStyleName(1, 2, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -301,11 +301,11 @@ class ProjectWatchPanel extends Composite {
} }
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, S_DATA_CELL); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, S_DATA_CELL); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 5, S_DATA_CELL); fmt.addStyleName(row, 5, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -45,10 +45,10 @@ public class RegisterScreen extends AccountScreen {
final FlowPanel formBody = new FlowPanel(); final FlowPanel formBody = new FlowPanel();
final FlowPanel contactGroup = new FlowPanel(); final FlowPanel contactGroup = new FlowPanel();
contactGroup.setStyleName("gerrit-RegisterScreen-Section"); contactGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
contactGroup.add(new SmallHeading(Util.C.welcomeReviewContact())); contactGroup.add(new SmallHeading(Util.C.welcomeReviewContact()));
final HTML whereFrom = new HTML(Util.C.welcomeContactFrom()); final HTML whereFrom = new HTML(Util.C.welcomeContactFrom());
whereFrom.setStyleName("gerrit-RegisterScreen-Explain"); whereFrom.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
contactGroup.add(whereFrom); contactGroup.add(whereFrom);
contactGroup.add(new ContactPanelShort() { contactGroup.add(new ContactPanelShort() {
@Override @Override
@@ -66,10 +66,10 @@ public class RegisterScreen extends AccountScreen {
formBody.add(contactGroup); formBody.add(contactGroup);
final FlowPanel sshKeyGroup = new FlowPanel(); final FlowPanel sshKeyGroup = new FlowPanel();
sshKeyGroup.setStyleName("gerrit-RegisterScreen-Section"); sshKeyGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
sshKeyGroup.add(new SmallHeading(Util.C.welcomeSshKeyHeading())); sshKeyGroup.add(new SmallHeading(Util.C.welcomeSshKeyHeading()));
final HTML whySshKey = new HTML(Util.C.welcomeSshKeyText()); final HTML whySshKey = new HTML(Util.C.welcomeSshKeyText());
whySshKey.setStyleName("gerrit-RegisterScreen-Explain"); whySshKey.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
sshKeyGroup.add(whySshKey); sshKeyGroup.add(whySshKey);
sshKeyGroup.add(new SshPanel() { sshKeyGroup.add(new SshPanel() {
{ {
@@ -79,13 +79,13 @@ public class RegisterScreen extends AccountScreen {
formBody.add(sshKeyGroup); formBody.add(sshKeyGroup);
final FlowPanel choices = new FlowPanel(); final FlowPanel choices = new FlowPanel();
choices.setStyleName("gerrit-RegisterScreen-NextLinks"); choices.setStyleName(Gerrit.RESOURCES.css().registerScreenNextLinks());
if (Gerrit.getConfig().isUseContributorAgreements()) { if (Gerrit.getConfig().isUseContributorAgreements()) {
final FlowPanel agreementGroup = new FlowPanel(); final FlowPanel agreementGroup = new FlowPanel();
agreementGroup.setStyleName("gerrit-RegisterScreen-Section"); agreementGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
agreementGroup.add(new SmallHeading(Util.C.welcomeAgreementHeading())); agreementGroup.add(new SmallHeading(Util.C.welcomeAgreementHeading()));
final HTML whyAgreement = new HTML(Util.C.welcomeAgreementText()); final HTML whyAgreement = new HTML(Util.C.welcomeAgreementText());
whyAgreement.setStyleName("gerrit-RegisterScreen-Explain"); whyAgreement.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
agreementGroup.add(whyAgreement); agreementGroup.add(whyAgreement);
choices.add(new InlineHyperlink(Util.C.newAgreement(), choices.add(new InlineHyperlink(Util.C.newAgreement(),

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.account; package com.google.gerrit.client.account;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.ui.SmallHeading; import com.google.gerrit.client.ui.SmallHeading;
import com.google.gerrit.common.data.SshHostKey; import com.google.gerrit.common.data.SshHostKey;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
@@ -25,25 +26,25 @@ import com.google.gwtexpui.clippy.client.CopyableLabel;
class SshHostKeyPanel extends Composite { class SshHostKeyPanel extends Composite {
SshHostKeyPanel(final SshHostKey info) { SshHostKeyPanel(final SshHostKey info) {
final FlowPanel body = new FlowPanel(); final FlowPanel body = new FlowPanel();
body.setStyleName("gerrit-SshHostKeyPanel"); body.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanel());
body.add(new SmallHeading(Util.C.sshHostKeyTitle())); body.add(new SmallHeading(Util.C.sshHostKeyTitle()));
{ {
final Label fpLbl = new Label(Util.C.sshHostKeyFingerprint()); final Label fpLbl = new Label(Util.C.sshHostKeyFingerprint());
fpLbl.setStyleName("gerrit-SshHostKeyPanel-Heading"); fpLbl.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelHeading());
body.add(fpLbl); body.add(fpLbl);
final Label fpVal = new Label(info.getFingerprint()); final Label fpVal = new Label(info.getFingerprint());
fpVal.setStyleName("gerrit-SshHostKeyPanel-FingerprintData"); fpVal.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelFingerprintData());
body.add(fpVal); body.add(fpVal);
} }
{ {
final HTML hdr = new HTML(Util.C.sshHostKeyKnownHostEntry()); final HTML hdr = new HTML(Util.C.sshHostKeyKnownHostEntry());
hdr.setStyleName("gerrit-SshHostKeyPanel-Heading"); hdr.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelHeading());
body.add(hdr); body.add(hdr);
final CopyableLabel lbl; final CopyableLabel lbl;
lbl = new CopyableLabel(info.getHostIdent() + " " + info.getHostKey()); lbl = new CopyableLabel(info.getHostIdent() + " " + info.getHostKey());
lbl.setPreviewText(SshPanel.elide(lbl.getText(), 80)); lbl.setPreviewText(SshPanel.elide(lbl.getText(), 80));
lbl.addStyleName("gerrit-SshHostKeyPanel-KnownHostEntry"); lbl.addStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelKnownHostEntry());
body.add(lbl); body.add(lbl);
} }
initWidget(body); initWidget(body);

View File

@@ -99,7 +99,7 @@ class SshPanel extends Composite {
userNameTxt.setText(Gerrit.getUserAccount().getSshUserName()); userNameTxt.setText(Gerrit.getUserAccount().getSshUserName());
} }
userNameTxt.addKeyPressHandler(new SshUserNameValidator()); userNameTxt.addKeyPressHandler(new SshUserNameValidator());
userNameTxt.addStyleName("gerrit-SshPanel-username"); userNameTxt.addStyleName(Gerrit.RESOURCES.css().sshPanelUsername());
userNameTxt.setVisibleLength(16); userNameTxt.setVisibleLength(16);
userNameTxt.setReadOnly(!canEditSshUserName()); userNameTxt.setReadOnly(!canEditSshUserName());
@@ -115,8 +115,8 @@ class SshPanel extends Composite {
new TextSaveButtonListener(userNameTxt, changeUserName); new TextSaveButtonListener(userNameTxt, changeUserName);
final Grid userInfo = new Grid(1, 2); final Grid userInfo = new Grid(1, 2);
userInfo.setStyleName("gerrit-InfoBlock"); userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
userInfo.addStyleName("gerrit-AccountInfoBlock"); userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
body.add(userInfo); body.add(userInfo);
final FlowPanel userNameRow = new FlowPanel(); final FlowPanel userNameRow = new FlowPanel();
@@ -124,10 +124,10 @@ class SshPanel extends Composite {
userNameRow.add(changeUserName); userNameRow.add(changeUserName);
row(userInfo, 0, Util.C.sshUserName(), userNameRow); row(userInfo, 0, Util.C.sshUserName(), userNameRow);
userInfo.getCellFormatter().addStyleName(0, 0, "topmost"); userInfo.getCellFormatter().addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
userInfo.getCellFormatter().addStyleName(0, 0, "topmost"); userInfo.getCellFormatter().addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
userInfo.getCellFormatter().addStyleName(0, 1, "topmost"); userInfo.getCellFormatter().addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
userInfo.getCellFormatter().addStyleName(0, 0, "bottomheader"); userInfo.getCellFormatter().addStyleName(0, 0, Gerrit.RESOURCES.css().bottomheader());
showAddKeyBlock = new Button(Util.C.buttonShowAddSshKey()); showAddKeyBlock = new Button(Util.C.buttonShowAddSshKey());
showAddKeyBlock.addClickHandler(new ClickHandler() { showAddKeyBlock.addClickHandler(new ClickHandler() {
@@ -155,7 +155,7 @@ class SshPanel extends Composite {
addKeyBlock = new VerticalPanel(); addKeyBlock = new VerticalPanel();
addKeyBlock.setVisible(false); addKeyBlock.setVisible(false);
addKeyBlock.setStyleName("gerrit-AddSshKeyPanel"); addKeyBlock.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
addKeyBlock.add(new SmallHeading(Util.C.addSshKeyPanelHeader())); addKeyBlock.add(new SmallHeading(Util.C.addSshKeyPanelHeader()));
addKeyBlock.add(new HTML(Util.C.addSshKeyHelp())); addKeyBlock.add(new HTML(Util.C.addSshKeyHelp()));
@@ -225,7 +225,7 @@ class SshPanel extends Composite {
final Widget field) { final Widget field) {
info.setText(row, labelIdx, name); info.setText(row, labelIdx, name);
info.setWidget(row, fieldIdx, field); info.setWidget(row, fieldIdx, field);
info.getCellFormatter().addStyleName(row, 0, "header"); info.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
} }
void setKeyTableVisible(final boolean on) { void setKeyTableVisible(final boolean on) {
@@ -490,8 +490,6 @@ class SshPanel extends Composite {
} }
private class SshKeyTable extends FancyFlexTable<AccountSshKey> { private class SshKeyTable extends FancyFlexTable<AccountSshKey> {
private static final String S_INVALID = "gerrit-SshKeyPanel-Invalid";
SshKeyTable() { SshKeyTable() {
table.setWidth(""); table.setWidth("");
table.setText(0, 3, Util.C.sshKeyAlgorithm()); table.setText(0, 3, Util.C.sshKeyAlgorithm());
@@ -501,13 +499,13 @@ class SshPanel extends Composite {
table.setText(0, 7, Util.C.sshKeyStored()); table.setText(0, 7, Util.C.sshKeyStored());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 4, S_DATA_HEADER); fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 5, S_DATA_HEADER); fmt.addStyleName(0, 5, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 6, S_DATA_HEADER); fmt.addStyleName(0, 6, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 7, S_DATA_HEADER); fmt.addStyleName(0, 7, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -555,10 +553,10 @@ class SshPanel extends Composite {
table.setWidget(row, 1, new CheckBox()); table.setWidget(row, 1, new CheckBox());
if (k.isValid()) { if (k.isValid()) {
table.setText(row, 2, ""); table.setText(row, 2, "");
fmt.removeStyleName(row, 2, S_INVALID); fmt.removeStyleName(row, 2, Gerrit.RESOURCES.css().sshKeyPanelInvalid());
} else { } else {
table.setText(row, 2, Util.C.sshKeyInvalid()); table.setText(row, 2, Util.C.sshKeyInvalid());
fmt.addStyleName(row, 2, S_INVALID); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().sshKeyPanelInvalid());
} }
table.setText(row, 3, k.getAlgorithm()); table.setText(row, 3, k.getAlgorithm());
table.setText(row, 4, elide(k.getEncodedKey(), 40)); table.setText(row, 4, elide(k.getEncodedKey(), 40));
@@ -566,14 +564,14 @@ class SshPanel extends Composite {
table.setText(row, 6, FormatUtil.mediumFormat(k.getLastUsedOn())); table.setText(row, 6, FormatUtil.mediumFormat(k.getLastUsedOn()));
table.setText(row, 7, FormatUtil.mediumFormat(k.getStoredOn())); table.setText(row, 7, FormatUtil.mediumFormat(k.getStoredOn()));
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_ICON_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 4, "gerrit-SshKeyPanel-EncodedKey"); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().sshKeyPanelEncodedKey());
for (int c = 3; c <= 7; c++) { for (int c = 3; c <= 7; c++) {
fmt.addStyleName(row, c, S_DATA_CELL); fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
} }
fmt.addStyleName(row, 6, "C_LAST_UPDATE"); fmt.addStyleName(row, 6, Gerrit.RESOURCES.css().cLastUpdate());
fmt.addStyleName(row, 7, "C_LAST_UPDATE"); fmt.addStyleName(row, 7, Gerrit.RESOURCES.css().cLastUpdate());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -278,7 +278,7 @@ public class AccountGroupScreen extends AccountScreen {
}); });
externalMatches = new Grid(); externalMatches = new Grid();
externalMatches.setStyleName("gerrit-InfoTable"); externalMatches.setStyleName(Gerrit.RESOURCES.css().infoTable());
externalMatches.setVisible(false); externalMatches.setVisible(false);
final FlowPanel searchLine = new FlowPanel(); final FlowPanel searchLine = new FlowPanel();
@@ -352,7 +352,7 @@ public class AccountGroupScreen extends AccountScreen {
if (result.isEmpty()) { if (result.isEmpty()) {
externalMatches.resize(1, 1); externalMatches.resize(1, 1);
externalMatches.setText(0, 0, Util.C.errorNoMatchingGroups()); externalMatches.setText(0, 0, Util.C.errorNoMatchingGroups());
fmt.setStyleName(0, 0, "header"); fmt.setStyleName(0, 0, Gerrit.RESOURCES.css().header());
return; return;
} }
@@ -360,8 +360,8 @@ public class AccountGroupScreen extends AccountScreen {
externalMatches.setText(0, 0, Util.C.columnGroupName()); externalMatches.setText(0, 0, Util.C.columnGroupName());
externalMatches.setText(0, 1, ""); externalMatches.setText(0, 1, "");
fmt.setStyleName(0, 0, "header"); fmt.setStyleName(0, 0, Gerrit.RESOURCES.css().header());
fmt.setStyleName(0, 1, "header"); fmt.setStyleName(0, 1, Gerrit.RESOURCES.css().header());
for (int row = 0; row < result.size(); row++) { for (int row = 0; row < result.size(); row++) {
final AccountGroup.ExternalNameKey key = result.get(row); final AccountGroup.ExternalNameKey key = result.get(row);
@@ -374,7 +374,7 @@ public class AccountGroupScreen extends AccountScreen {
}); });
externalMatches.setText(1 + row, 0, key.get()); externalMatches.setText(1 + row, 0, key.get());
externalMatches.setWidget(1 + row, 1, b); externalMatches.setWidget(1 + row, 1, b);
fmt.setStyleName(1 + row, 1, "rightmost"); fmt.setStyleName(1 + row, 1, Gerrit.RESOURCES.css().rightmost());
} }
externalMatches.setVisible(true); externalMatches.setVisible(true);
@@ -467,9 +467,9 @@ public class AccountGroupScreen extends AccountScreen {
table.setText(0, 3, Util.C.columnEmailAddress()); table.setText(0, 3, Util.C.columnEmailAddress());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -524,9 +524,9 @@ public class AccountGroupScreen extends AccountScreen {
table.setText(row, 3, accounts.get(accountId).getPreferredEmail()); table.setText(row, 3, accounts.get(accountId).getPreferredEmail());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, S_DATA_CELL); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.admin; package com.google.gerrit.client.admin;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.HistoryHandler; import com.google.gerrit.client.HistoryHandler;
import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.ScreenLoadCallback; import com.google.gerrit.client.rpc.ScreenLoadCallback;
@@ -58,7 +59,7 @@ public class GroupListScreen extends AccountScreen {
add(groups); add(groups);
final VerticalPanel fp = new VerticalPanel(); final VerticalPanel fp = new VerticalPanel();
fp.setStyleName("gerrit-AddSshKeyPanel"); fp.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
fp.add(new SmallHeading(Util.C.headingCreateGroup())); fp.add(new SmallHeading(Util.C.headingCreateGroup()));
addTxt = new NpTextBox(); addTxt = new NpTextBox();

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.admin; package com.google.gerrit.client.admin;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.HistoryHandler; import com.google.gerrit.client.HistoryHandler;
import com.google.gerrit.client.ui.NavigationTable; import com.google.gerrit.client.ui.NavigationTable;
import com.google.gerrit.reviewdb.AccountGroup; import com.google.gerrit.reviewdb.AccountGroup;
@@ -59,8 +60,8 @@ public class GroupTable extends NavigationTable<AccountGroup> {
}); });
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_DATA_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
} }
@Override @Override
@@ -95,9 +96,9 @@ public class GroupTable extends NavigationTable<AccountGroup> {
table.setText(row, 2, k.getDescription()); table.setText(row, 2, k.getDescription());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_DATA_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 1, "GroupName"); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().groupName());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -83,20 +83,20 @@ public class ProjectBranchesPanel extends Composite {
private void initBranches(final Panel body) { private void initBranches(final Panel body) {
final FlowPanel addPanel = new FlowPanel(); final FlowPanel addPanel = new FlowPanel();
addPanel.setStyleName("gerrit-AddSshKeyPanel"); addPanel.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
final Grid addGrid = new Grid(2, 2); final Grid addGrid = new Grid(2, 2);
nameTxtBox = new NpTextBox(); nameTxtBox = new NpTextBox();
nameTxtBox.setVisibleLength(50); nameTxtBox.setVisibleLength(50);
nameTxtBox.setText(Util.C.defaultBranchName()); nameTxtBox.setText(Util.C.defaultBranchName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
nameTxtBox.addFocusHandler(new FocusHandler() { nameTxtBox.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(FocusEvent event) { public void onFocus(FocusEvent event) {
if (Util.C.defaultBranchName().equals(nameTxtBox.getText())) { if (Util.C.defaultBranchName().equals(nameTxtBox.getText())) {
nameTxtBox.setText(""); nameTxtBox.setText("");
nameTxtBox.removeStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -105,7 +105,7 @@ public class ProjectBranchesPanel extends Composite {
public void onBlur(BlurEvent event) { public void onBlur(BlurEvent event) {
if ("".equals(nameTxtBox.getText())) { if ("".equals(nameTxtBox.getText())) {
nameTxtBox.setText(Util.C.defaultBranchName()); nameTxtBox.setText(Util.C.defaultBranchName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -115,13 +115,13 @@ public class ProjectBranchesPanel extends Composite {
irevTxtBox = new NpTextBox(); irevTxtBox = new NpTextBox();
irevTxtBox.setVisibleLength(50); irevTxtBox.setVisibleLength(50);
irevTxtBox.setText(Util.C.defaultRevisionSpec()); irevTxtBox.setText(Util.C.defaultRevisionSpec());
irevTxtBox.addStyleName("gerrit-InputFieldTypeHint"); irevTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
irevTxtBox.addFocusHandler(new FocusHandler() { irevTxtBox.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(FocusEvent event) { public void onFocus(FocusEvent event) {
if (Util.C.defaultRevisionSpec().equals(irevTxtBox.getText())) { if (Util.C.defaultRevisionSpec().equals(irevTxtBox.getText())) {
irevTxtBox.setText(""); irevTxtBox.setText("");
irevTxtBox.removeStyleName("gerrit-InputFieldTypeHint"); irevTxtBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -130,7 +130,7 @@ public class ProjectBranchesPanel extends Composite {
public void onBlur(BlurEvent event) { public void onBlur(BlurEvent event) {
if ("".equals(irevTxtBox.getText())) { if ("".equals(irevTxtBox.getText())) {
irevTxtBox.setText(Util.C.defaultRevisionSpec()); irevTxtBox.setText(Util.C.defaultRevisionSpec());
irevTxtBox.addStyleName("gerrit-InputFieldTypeHint"); irevTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -215,10 +215,10 @@ public class ProjectBranchesPanel extends Composite {
table.setText(0, 3, Util.C.columnBranchRevision()); table.setText(0, 3, Util.C.columnBranchRevision());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 4, S_DATA_HEADER); fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -277,10 +277,10 @@ public class ProjectBranchesPanel extends Composite {
} }
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, S_DATA_CELL); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, S_DATA_CELL); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.admin; package com.google.gerrit.client.admin;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.HistoryHandler; import com.google.gerrit.client.HistoryHandler;
import com.google.gerrit.client.rpc.ScreenLoadCallback; import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.AccountScreen; import com.google.gerrit.client.ui.AccountScreen;
@@ -56,7 +57,7 @@ public class ProjectListScreen extends AccountScreen {
add(projects); add(projects);
final VerticalPanel fp = new VerticalPanel(); final VerticalPanel fp = new VerticalPanel();
fp.setStyleName("gerrit-AddSshKeyPanel"); fp.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
fp.add(new SmallHeading(Util.C.headingCreateGroup())); fp.add(new SmallHeading(Util.C.headingCreateGroup()));
} }
@@ -89,8 +90,8 @@ public class ProjectListScreen extends AccountScreen {
}); });
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_DATA_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
} }
@Override @Override
@@ -124,9 +125,9 @@ public class ProjectListScreen extends AccountScreen {
table.setText(row, 2, k.getDescription()); table.setText(row, 2, k.getDescription());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_DATA_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 1, "C_PROJECT"); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().cPROJECT());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
setRowItem(row, k); setRowItem(row, k);
} }

View File

@@ -100,7 +100,7 @@ public class ProjectRightsPanel extends Composite {
private void initRights(final Panel body) { private void initRights(final Panel body) {
final FlowPanel addPanel = new FlowPanel(); final FlowPanel addPanel = new FlowPanel();
addPanel.setStyleName("gerrit-AddSshKeyPanel"); addPanel.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
final Grid addGrid = new Grid(4, 2); final Grid addGrid = new Grid(4, 2);
@@ -145,13 +145,13 @@ public class ProjectRightsPanel extends Composite {
nameTxt = new SuggestBox(new AccountGroupSuggestOracle(), nameTxtBox); nameTxt = new SuggestBox(new AccountGroupSuggestOracle(), nameTxtBox);
nameTxtBox.setVisibleLength(50); nameTxtBox.setVisibleLength(50);
nameTxtBox.setText(Util.C.defaultAccountGroupName()); nameTxtBox.setText(Util.C.defaultAccountGroupName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
nameTxtBox.addFocusHandler(new FocusHandler() { nameTxtBox.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(FocusEvent event) { public void onFocus(FocusEvent event) {
if (Util.C.defaultAccountGroupName().equals(nameTxtBox.getText())) { if (Util.C.defaultAccountGroupName().equals(nameTxtBox.getText())) {
nameTxtBox.setText(""); nameTxtBox.setText("");
nameTxtBox.removeStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -160,7 +160,7 @@ public class ProjectRightsPanel extends Composite {
public void onBlur(BlurEvent event) { public void onBlur(BlurEvent event) {
if ("".equals(nameTxtBox.getText())) { if ("".equals(nameTxtBox.getText())) {
nameTxtBox.setText(Util.C.defaultAccountGroupName()); nameTxtBox.setText(Util.C.defaultAccountGroupName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -323,10 +323,10 @@ public class ProjectRightsPanel extends Composite {
table.setText(0, 4, Util.C.columnRightRange()); table.setText(0, 4, Util.C.columnRightRange());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, 1, S_ICON_HEADER); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, 2, S_DATA_HEADER); fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, S_DATA_HEADER); fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 4, S_DATA_HEADER); fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
} }
void deleteChecked() { void deleteChecked() {
@@ -409,11 +409,11 @@ public class ProjectRightsPanel extends Composite {
} }
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, S_ICON_CELL); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, S_DATA_CELL); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, S_DATA_CELL); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, S_DATA_CELL); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, "gerrit-ProjectAdmin-ApprovalCategoryRangeLine"); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().projectAdminApprovalCategoryRangeLine());
setRowItem(row, k); setRowItem(row, k);
} }
@@ -421,7 +421,7 @@ public class ProjectRightsPanel extends Composite {
private void formatValue(final SafeHtmlBuilder m, final short v, private void formatValue(final SafeHtmlBuilder m, final short v,
final ApprovalCategoryValue e) { final ApprovalCategoryValue e) {
m.openSpan(); m.openSpan();
m.setStyleName("gerrit-ProjectAdmin-ApprovalCategoryValue"); m.setStyleName(Gerrit.RESOURCES.css().projectAdminApprovalCategoryValue());
if (v == 0) { if (v == 0) {
m.append(' '); m.append(' ');
} else if (v > 0) { } else if (v > 0) {

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.client.auth.openid;
import com.google.gwt.i18n.client.Constants; import com.google.gwt.i18n.client.Constants;
public interface LoginConstants extends Constants { public interface OpenIdConstants extends Constants {
String buttonSignIn(); String buttonSignIn();
String buttonRegister(); String buttonRegister();
String buttonLinkId(); String buttonLinkId();

View File

@@ -9,7 +9,7 @@ nameGoogle = Google Account
nameYahoo = Yahoo! ID nameYahoo = Yahoo! ID
whatIsOpenIDHtml = \ whatIsOpenIDHtml = \
<h2 class="gerrit-SmallHeading" style="margin-top: 25px;">What is OpenID?</h2>\ <h2 class="smallHeading" style="margin-top: 25px;">What is OpenID?</h2>\
<p>OpenID provides secure single-sign-on, without \ <p>OpenID provides secure single-sign-on, without \
revealing your passwords to this website.</p>\ revealing your passwords to this website.</p>\
<p>There are many OpenID providers available. You may already \ <p>There are many OpenID providers available. You may already \

View File

@@ -0,0 +1,26 @@
// Copyright (C) 2009 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.auth.openid;
import com.google.gwt.resources.client.CssResource;
interface OpenIdCss extends CssResource {
String loginForm();
String logo();
String loginLine();
String identifier();
String directLink();
String error();
}

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.client.auth.openid;
import com.google.gwt.i18n.client.Messages; import com.google.gwt.i18n.client.Messages;
public interface LoginMessages extends Messages { public interface OpenIdMessages extends Messages {
String signInAt(String hostname); String signInAt(String hostname);
String registerAt(String hostname); String registerAt(String hostname);
String linkAt(String hostname); String linkAt(String hostname);

View File

@@ -14,16 +14,26 @@
package com.google.gerrit.client.auth.openid; package com.google.gerrit.client.auth.openid;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.DataResource;
import com.google.gwt.resources.client.ImageResource; import com.google.gwt.resources.client.ImageResource;
public interface LoginResources extends ClientBundle { interface OpenIdResources extends ClientBundle {
static final OpenIdResources I = GWT.create(OpenIdResources.class);
@Source("openid.css")
OpenIdCss css();
@Source("identifierBackground.gif")
DataResource identifierBackground();
@Source("openidLogo.png") @Source("openidLogo.png")
public ImageResource openidLogo(); ImageResource openidLogo();
@Source("iconGoogle.gif") @Source("iconGoogle.gif")
public ImageResource iconGoogle(); ImageResource iconGoogle();
@Source("iconYahoo.gif") @Source("iconYahoo.gif")
public ImageResource iconYahoo(); ImageResource iconYahoo();
} }

View File

@@ -20,7 +20,6 @@ import com.google.gerrit.client.ui.SmallHeading;
import com.google.gerrit.common.auth.SignInMode; import com.google.gerrit.common.auth.SignInMode;
import com.google.gerrit.common.auth.openid.DiscoveryResult; import com.google.gerrit.common.auth.openid.DiscoveryResult;
import com.google.gerrit.common.auth.openid.OpenIdUrls; import com.google.gerrit.common.auth.openid.OpenIdUrls;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.FormElement; import com.google.gwt.dom.client.FormElement;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
@@ -50,7 +49,10 @@ import java.util.Map;
public class OpenIdSignInDialog extends SignInDialog implements public class OpenIdSignInDialog extends SignInDialog implements
FormPanel.SubmitHandler { FormPanel.SubmitHandler {
private final LoginResources icons; static {
OpenIdResources.I.css().ensureInjected();
}
private final FlowPanel panelWidget; private final FlowPanel panelWidget;
private final FormPanel form; private final FormPanel form;
private final FlowPanel formBody; private final FlowPanel formBody;
@@ -69,10 +71,8 @@ public class OpenIdSignInDialog extends SignInDialog implements
final String initialErrorMsg) { final String initialErrorMsg) {
super(requestedMode); super(requestedMode);
icons = GWT.create(LoginResources.class);
formBody = new FlowPanel(); formBody = new FlowPanel();
formBody.setStyleName("gerrit-OpenID-loginform"); formBody.setStyleName(OpenIdResources.I.css().loginForm());
form = new FormPanel(); form = new FormPanel();
form.setMethod(FormPanel.METHOD_GET); form.setMethod(FormPanel.METHOD_GET);
@@ -94,8 +94,8 @@ public class OpenIdSignInDialog extends SignInDialog implements
createErrorBox(); createErrorBox();
createIdentBox(); createIdentBox();
link(OpenIdUrls.URL_GOOGLE, OpenIdUtil.C.nameGoogle(), icons.iconGoogle()); link(OpenIdUrls.URL_GOOGLE, OpenIdUtil.C.nameGoogle(), OpenIdResources.I.iconGoogle());
link(OpenIdUrls.URL_YAHOO, OpenIdUtil.C.nameYahoo(), icons.iconYahoo()); link(OpenIdUrls.URL_YAHOO, OpenIdUtil.C.nameYahoo(), OpenIdResources.I.iconYahoo());
if (initialErrorMsg != null) { if (initialErrorMsg != null) {
showError(initialErrorMsg); showError(initialErrorMsg);
@@ -117,8 +117,8 @@ public class OpenIdSignInDialog extends SignInDialog implements
private void createHeaderLogo() { private void createHeaderLogo() {
final FlowPanel headerLogo = new FlowPanel(); final FlowPanel headerLogo = new FlowPanel();
headerLogo.setStyleName("gerrit-OpenID-logobox"); headerLogo.setStyleName(OpenIdResources.I.css().logo());
headerLogo.add(new Image(icons.openidLogo())); headerLogo.add(new Image(OpenIdResources.I.openidLogo()));
formBody.add(headerLogo); formBody.add(headerLogo);
} }
@@ -145,7 +145,7 @@ public class OpenIdSignInDialog extends SignInDialog implements
private void createErrorBox() { private void createErrorBox() {
errorLine = new FlowPanel(); errorLine = new FlowPanel();
DOM.setStyleAttribute(errorLine.getElement(), "visibility", "hidden"); DOM.setStyleAttribute(errorLine.getElement(), "visibility", "hidden");
errorLine.setStyleName("gerrit-OpenID-errorline"); errorLine.setStyleName(OpenIdResources.I.css().error());
errorMsg = new InlineLabel(); errorMsg = new InlineLabel();
errorLine.add(errorMsg); errorLine.add(errorMsg);
@@ -163,14 +163,14 @@ public class OpenIdSignInDialog extends SignInDialog implements
private void createIdentBox() { private void createIdentBox() {
final FlowPanel group = new FlowPanel(); final FlowPanel group = new FlowPanel();
group.setStyleName("gerrit-OpenID-loginline"); group.setStyleName(OpenIdResources.I.css().loginLine());
final FlowPanel line1 = new FlowPanel(); final FlowPanel line1 = new FlowPanel();
group.add(line1); group.add(line1);
providerId = new NpTextBox(); providerId = new NpTextBox();
providerId.setVisibleLength(60); providerId.setVisibleLength(60);
providerId.setStyleName("gerrit-OpenID-openid_identifier"); providerId.setStyleName(OpenIdResources.I.css().identifier());
providerId.setTabIndex(0); providerId.setTabIndex(0);
providerId.addKeyPressHandler(new KeyPressHandler() { providerId.addKeyPressHandler(new KeyPressHandler() {
@Override @Override
@@ -233,7 +233,7 @@ public class OpenIdSignInDialog extends SignInDialog implements
}; };
final FlowPanel line = new FlowPanel(); final FlowPanel line = new FlowPanel();
line.addStyleName("gerrit-OpenID-directlink"); line.addStyleName(OpenIdResources.I.css().directLink());
final Image img = new Image(icon); final Image img = new Image(icon);
img.addClickHandler(i); img.addClickHandler(i);

View File

@@ -19,13 +19,13 @@ import com.google.gwt.core.client.GWT;
import com.google.gwtjsonrpc.client.JsonUtil; import com.google.gwtjsonrpc.client.JsonUtil;
public class OpenIdUtil { public class OpenIdUtil {
public static final LoginConstants C; public static final OpenIdConstants C;
public static final LoginMessages M; public static final OpenIdMessages M;
public static final OpenIdService SVC; public static final OpenIdService SVC;
static { static {
C = GWT.create(LoginConstants.class); C = GWT.create(OpenIdConstants.class);
M = GWT.create(LoginMessages.class); M = GWT.create(OpenIdMessages.class);
SVC = GWT.create(OpenIdService.class); SVC = GWT.create(OpenIdService.class);
JsonUtil.bind(SVC, "rpc/OpenIdService"); JsonUtil.bind(SVC, "rpc/OpenIdService");
} }

View File

@@ -0,0 +1,66 @@
/* Copyright (C) 2009 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.
*/
@url identifierBackground identifierBackground;
.loginForm {
margin-left: 10px;
margin-right: 10px;
}
.logo {
width: 98%;
text-align: right;
}
.loginLine {
margin-bottom: 10px;
}
.loginLine div {
white-space: nowrap;
}
.identifier {
background: #ffffff identifierBackground no-repeat scroll 5px 50%;
padding-left: 25px;
border: 1px solid #999999;
margin-right: 5px;
}
.directLink {
vertical-align: middle;
margin-right: 5px;
color: blue;
cursor: pointer;
}
.directLink:hover {
text-decoration: underline;
}
.directLink img {
margin-right: 3px;
border: 0 none;
}
.error {
padding-top: 5px;
padding-bottom: 5px;
}
.error span {
padding-top: 4px;
padding-bottom: 4px;
padding-left: 10px;
padding-right: 10px;
background: #fff1a8;
}

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.client.auth.userpass;
import com.google.gwt.i18n.client.Constants; import com.google.gwt.i18n.client.Constants;
public interface LoginConstants extends Constants { public interface UserPassConstants extends Constants {
String buttonSignIn(); String buttonSignIn();
String username(); String username();
String password(); String password();

View File

@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.client; package com.google.gerrit.client.auth.userpass;
import com.google.gwt.resources.client.CssResource; import com.google.gwt.resources.client.CssResource;
public interface GerritCssResource extends CssResource { public interface UserPassCss extends CssResource {
String greenCheckClass(); String loginForm();
String error();
} }

View File

@@ -16,6 +16,6 @@ package com.google.gerrit.client.auth.userpass;
import com.google.gwt.i18n.client.Messages; import com.google.gwt.i18n.client.Messages;
public interface LoginMessages extends Messages { public interface UserPassMessages extends Messages {
String signInAt(String hostname); String signInAt(String hostname);
} }

View File

@@ -0,0 +1,25 @@
// Copyright (C) 2009 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.auth.userpass;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
interface UserPassResources extends ClientBundle {
static final UserPassResources I = GWT.create(UserPassResources.class);
@Source("userpass.css")
UserPassCss css();
}

View File

@@ -41,6 +41,10 @@ import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.NpTextBox; import com.google.gwtexpui.globalkey.client.NpTextBox;
public class UserPassSignInDialog extends SignInDialog { public class UserPassSignInDialog extends SignInDialog {
static {
UserPassResources.I.css().ensureInjected();
}
private final FlowPanel formBody; private final FlowPanel formBody;
private FlowPanel errorLine; private FlowPanel errorLine;
@@ -55,7 +59,7 @@ public class UserPassSignInDialog extends SignInDialog {
super(SignInMode.SIGN_IN); super(SignInMode.SIGN_IN);
formBody = new FlowPanel(); formBody = new FlowPanel();
formBody.setStyleName("gerrit-OpenID-loginform"); formBody.setStyleName(UserPassResources.I.css().loginForm());
add(formBody); add(formBody);
createHeaderText(); createHeaderText();
@@ -88,7 +92,7 @@ public class UserPassSignInDialog extends SignInDialog {
private void createErrorBox() { private void createErrorBox() {
errorLine = new FlowPanel(); errorLine = new FlowPanel();
DOM.setStyleAttribute(errorLine.getElement(), "visibility", "hidden"); DOM.setStyleAttribute(errorLine.getElement(), "visibility", "hidden");
errorLine.setStyleName("gerrit-OpenID-errorline"); errorLine.setStyleName(UserPassResources.I.css().error());
errorMsg = new InlineLabel(); errorMsg = new InlineLabel();
errorLine.add(errorMsg); errorLine.add(errorMsg);
@@ -132,7 +136,7 @@ public class UserPassSignInDialog extends SignInDialog {
}); });
final FlowPanel buttons = new FlowPanel(); final FlowPanel buttons = new FlowPanel();
buttons.setStyleName("gerrit-ErrorDialog-Buttons"); buttons.setStyleName(Gerrit.RESOURCES.css().errorDialogButtons());
login = new Button(); login = new Button();
login.setText(Util.C.buttonSignIn()); login.setText(Util.C.buttonSignIn());

View File

@@ -19,8 +19,8 @@ import com.google.gwt.core.client.GWT;
import com.google.gwtjsonrpc.client.JsonUtil; import com.google.gwtjsonrpc.client.JsonUtil;
public class Util { public class Util {
public static final LoginConstants C = GWT.create(LoginConstants.class); public static final UserPassConstants C = GWT.create(UserPassConstants.class);
public static final LoginMessages M = GWT.create(LoginMessages.class); public static final UserPassMessages M = GWT.create(UserPassMessages.class);
public static final UserPassAuthService SVC; public static final UserPassAuthService SVC;
static { static {

View File

@@ -13,6 +13,20 @@
* limitations under the License. * limitations under the License.
*/ */
@sprite .greenCheckClass { .loginForm {
gwt-image: "greenCheck"; margin-left: 10px;
margin-right: 10px;
}
.error {
padding-top: 5px;
padding-bottom: 5px;
}
.error span {
padding-top: 4px;
padding-bottom: 4px;
padding-left: 10px;
padding-right: 10px;
background: #fff1a8;
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.changes; package com.google.gerrit.client.changes;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.SmallHeading; import com.google.gerrit.client.ui.SmallHeading;
import com.google.gerrit.common.data.ChangeDetail; import com.google.gerrit.common.data.ChangeDetail;
@@ -39,7 +40,7 @@ public class AbandonChangeDialog extends AutoCenterDialogBox {
super(/* auto hide */true, /* modal */true); super(/* auto hide */true, /* modal */true);
psid = psi; psid = psi;
addStyleName("gerrit-AbandonChangeDialog"); addStyleName(Gerrit.RESOURCES.css().abandonChangeDialog());
setText(Util.C.abandonChangeTitle()); setText(Util.C.abandonChangeTitle());
panel = new FlowPanel(); panel = new FlowPanel();
@@ -48,7 +49,7 @@ public class AbandonChangeDialog extends AutoCenterDialogBox {
panel.add(new SmallHeading(Util.C.headingAbandonMessage())); panel.add(new SmallHeading(Util.C.headingAbandonMessage()));
final FlowPanel mwrap = new FlowPanel(); final FlowPanel mwrap = new FlowPanel();
mwrap.setStyleName("gerrit-AbandonMessage"); mwrap.setStyleName(Gerrit.RESOURCES.css().abandonMessage());
panel.add(mwrap); panel.add(mwrap);
message = new NpTextArea(); message = new NpTextArea();
@@ -58,7 +59,6 @@ public class AbandonChangeDialog extends AutoCenterDialogBox {
mwrap.add(message); mwrap.add(message);
final FlowPanel buttonPanel = new FlowPanel(); final FlowPanel buttonPanel = new FlowPanel();
buttonPanel.setStyleName("gerrit-CommentEditor-Buttons");
panel.add(buttonPanel); panel.add(buttonPanel);
sendButton = new Button(Util.C.buttonAbandonChangeSend()); sendButton = new Button(Util.C.buttonAbandonChangeSend());

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.client.changes; package com.google.gerrit.client.changes;
import com.google.gerrit.client.FormatUtil; import com.google.gerrit.client.FormatUtil;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.ChangeTable.ApprovalViewType; import com.google.gerrit.client.changes.ChangeTable.ApprovalViewType;
import com.google.gerrit.client.rpc.ScreenLoadCallback; import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.Screen; import com.google.gerrit.client.ui.Screen;
@@ -39,7 +40,7 @@ public class AccountDashboardScreen extends Screen {
protected void onInitUI() { protected void onInitUI() {
super.onInitUI(); super.onInitUI();
table = new ChangeTable(true); table = new ChangeTable(true);
table.addStyleName("gerrit-AccountDashboard"); table.addStyleName(Gerrit.RESOURCES.css().accountDashboard());
byOwner = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null); byOwner = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null);
forReview = new ChangeTable.Section("", ApprovalViewType.USER, ownerId); forReview = new ChangeTable.Section("", ApprovalViewType.USER, ownerId);
closed = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null); closed = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null);

View File

@@ -85,7 +85,7 @@ public abstract class AllSingleListScreen extends Screen {
add(table); add(table);
final HorizontalPanel buttons = new HorizontalPanel(); final HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName("gerrit-ChangeTable-PrevNextLinks"); buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks());
buttons.add(prev); buttons.add(prev);
buttons.add(next); buttons.add(next);
add(buttons); add(buttons);

View File

@@ -62,7 +62,7 @@ public class ApprovalTable extends Composite {
public ApprovalTable() { public ApprovalTable() {
types = Gerrit.getConfig().getApprovalTypes().getApprovalTypes(); types = Gerrit.getConfig().getApprovalTypes().getApprovalTypes();
table = new Grid(1, 3 + types.size()); table = new Grid(1, 3 + types.size());
table.addStyleName("gerrit-InfoTable"); table.addStyleName(Gerrit.RESOURCES.css().infoTable());
displayHeader(); displayHeader();
missing = new Widget() { missing = new Widget() {
@@ -70,10 +70,10 @@ public class ApprovalTable extends Composite {
setElement(DOM.createElement("ul")); setElement(DOM.createElement("ul"));
} }
}; };
missing.setStyleName("gerrit-MissingApprovalList"); missing.setStyleName(Gerrit.RESOURCES.css().missingApprovalList());
addReviewer = new FlowPanel(); addReviewer = new FlowPanel();
addReviewer.setStyleName("gerrit-AddReviewer"); addReviewer.setStyleName(Gerrit.RESOURCES.css().addReviewer());
addMemberBox = new AddMemberBox(); addMemberBox = new AddMemberBox();
addMemberBox.setAddButtonText(Util.C.approvalTableAddReviewer()); addMemberBox.setAddButtonText(Util.C.approvalTableAddReviewer());
addMemberBox.addClickHandler(new ClickHandler() { addMemberBox.addClickHandler(new ClickHandler() {
@@ -91,7 +91,7 @@ public class ApprovalTable extends Composite {
fp.add(addReviewer); fp.add(addReviewer);
initWidget(fp); initWidget(fp);
setStyleName("gerrit-ApprovalTable"); setStyleName(Gerrit.RESOURCES.css().approvalTable());
} }
private void displayHeader() { private void displayHeader() {
@@ -107,22 +107,21 @@ public class ApprovalTable extends Composite {
private void header(final int col, final String title) { private void header(final int col, final String title) {
table.setText(0, col, title); table.setText(0, col, title);
table.getCellFormatter().addStyleName(0, col, "header"); table.getCellFormatter().addStyleName(0, col, Gerrit.RESOURCES.css().header());
} }
private void applyEdgeStyles(final int row) { private void applyEdgeStyles(final int row) {
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(row, 0, "leftmost"); fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().leftmost());
fmt.addStyleName(row, 0, "reviewer"); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().approvalrole());
fmt.addStyleName(row, 1, "approvalrole"); fmt.addStyleName(row, 1 + types.size(), Gerrit.RESOURCES.css().rightmost());
fmt.addStyleName(row, 1 + types.size(), "rightmost"); fmt.addStyleName(row, 2 + types.size(), Gerrit.RESOURCES.css().approvalhint());
fmt.addStyleName(row, 2 + types.size(), "approvalhint");
} }
private void applyScoreStyles(final int row) { private void applyScoreStyles(final int row) {
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
for (int col = 0; col < types.size(); col++) { for (int col = 0; col < types.size(); col++) {
fmt.addStyleName(row, 2 + col, "approvalscore"); fmt.addStyleName(row, 2 + col, Gerrit.RESOURCES.css().approvalscore());
} }
} }
@@ -167,7 +166,7 @@ public class ApprovalTable extends Composite {
for (final ApprovalType at : types) { for (final ApprovalType at : types) {
if (need.contains(at.getCategory().getId())) { if (need.contains(at.getCategory().getId())) {
final Element li = DOM.createElement("li"); final Element li = DOM.createElement("li");
li.setClassName("gerrit-MissingApproval"); li.setClassName(Gerrit.RESOURCES.css().missingApproval());
DOM.setInnerText(li, Util.M.needApproval(at.getCategory().getName(), DOM.setInnerText(li, Util.M.needApproval(at.getCategory().getName(),
at.getMax().formatValue(), at.getMax().getName())); at.getMax().formatValue(), at.getMax().getName()));
DOM.appendChild(missingList, li); DOM.appendChild(missingList, li);
@@ -268,11 +267,11 @@ public class ApprovalTable extends Composite {
String vstr = String.valueOf(ca.getValue()); String vstr = String.valueOf(ca.getValue());
if (ca.getValue() > 0) { if (ca.getValue() > 0) {
vstr = "+" + vstr; vstr = "+" + vstr;
fmt.removeStyleName(row, col, "negscore"); fmt.removeStyleName(row, col, Gerrit.RESOURCES.css().negscore());
fmt.addStyleName(row, col, "posscore"); fmt.addStyleName(row, col, Gerrit.RESOURCES.css().posscore());
} else { } else {
fmt.addStyleName(row, col, "negscore"); fmt.addStyleName(row, col, Gerrit.RESOURCES.css().negscore());
fmt.removeStyleName(row, col, "posscore"); fmt.removeStyleName(row, col, Gerrit.RESOURCES.css().posscore());
} }
table.setText(row, col, vstr); table.setText(row, col, vstr);
} }

View File

@@ -31,7 +31,7 @@ public class ChangeDescriptionBlock extends Composite {
public ChangeDescriptionBlock() { public ChangeDescriptionBlock() {
infoBlock = new ChangeInfoBlock(); infoBlock = new ChangeInfoBlock();
description = new HTML(); description = new HTML();
description.setStyleName("gerrit-ChangeScreen-Description"); description.setStyleName(Gerrit.RESOURCES.css().changeScreenDescription());
final HorizontalPanel hp = new HorizontalPanel(); final HorizontalPanel hp = new HorizontalPanel();
hp.add(infoBlock); hp.add(infoBlock);

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.client.changes;
import static com.google.gerrit.client.FormatUtil.mediumFormat; import static com.google.gerrit.client.FormatUtil.mediumFormat;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.ui.AccountDashboardLink; import com.google.gerrit.client.ui.AccountDashboardLink;
import com.google.gerrit.client.ui.ChangeLink; import com.google.gerrit.client.ui.ChangeLink;
import com.google.gerrit.client.ui.ProjectLink; import com.google.gerrit.client.ui.ProjectLink;
@@ -43,8 +44,8 @@ public class ChangeInfoBlock extends Composite {
public ChangeInfoBlock() { public ChangeInfoBlock() {
table = new Grid(R_CNT, 2); table = new Grid(R_CNT, 2);
table.setStyleName("gerrit-InfoBlock"); table.setStyleName(Gerrit.RESOURCES.css().infoBlock());
table.addStyleName("gerrit-ChangeInfoBlock"); table.addStyleName(Gerrit.RESOURCES.css().changeInfoBlock());
initRow(R_CHANGE_ID, "Change-Id: "); initRow(R_CHANGE_ID, "Change-Id: ");
initRow(R_OWNER, Util.C.changeInfoBlockOwner()); initRow(R_OWNER, Util.C.changeInfoBlockOwner());
@@ -55,19 +56,19 @@ public class ChangeInfoBlock extends Composite {
initRow(R_STATUS, Util.C.changeInfoBlockStatus()); initRow(R_STATUS, Util.C.changeInfoBlockStatus());
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(0, 0, "topmost"); fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, "topmost"); fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(R_CHANGE_ID, 1, "changeid"); fmt.addStyleName(R_CHANGE_ID, 1, Gerrit.RESOURCES.css().changeid());
fmt.addStyleName(R_CNT - 2, 0, "bottomheader"); fmt.addStyleName(R_CNT - 2, 0, Gerrit.RESOURCES.css().bottomheader());
fmt.addStyleName(R_PERMALINK, 0, "permalink"); fmt.addStyleName(R_PERMALINK, 0, Gerrit.RESOURCES.css().permalink());
fmt.addStyleName(R_PERMALINK, 1, "permalink"); fmt.addStyleName(R_PERMALINK, 1, Gerrit.RESOURCES.css().permalink());
initWidget(table); initWidget(table);
} }
private void initRow(final int row, final String name) { private void initRow(final int row, final String name) {
table.setText(row, 0, name); table.setText(row, 0, name);
table.getCellFormatter().addStyleName(row, 0, "header"); table.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
} }
public void display(final Change chg, final AccountInfoCache acc) { public void display(final Change chg, final AccountInfoCache acc) {
@@ -81,9 +82,9 @@ public class ChangeInfoBlock extends Composite {
table.setText(R_STATUS, 1, Util.toLongString(chg.getStatus())); table.setText(R_STATUS, 1, Util.toLongString(chg.getStatus()));
if (chg.getStatus().isClosed()) { if (chg.getStatus().isClosed()) {
table.getCellFormatter().addStyleName(R_STATUS, 1, "closedstate"); table.getCellFormatter().addStyleName(R_STATUS, 1, Gerrit.RESOURCES.css().closedstate());
} else { } else {
table.getCellFormatter().removeStyleName(R_STATUS, 1, "closedstate"); table.getCellFormatter().removeStyleName(R_STATUS, 1, Gerrit.RESOURCES.css().closedstate());
} }
final FlowPanel fp = new FlowPanel(); final FlowPanel fp = new FlowPanel();

View File

@@ -142,7 +142,7 @@ public class ChangeScreen extends Screen {
@Override @Override
protected void onInitUI() { protected void onInitUI() {
super.onInitUI(); super.onInitUI();
addStyleName("gerrit-ChangeScreen"); addStyleName(Gerrit.RESOURCES.css().changeScreen());
keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation()); keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation());
keysAction = new KeyCommandSet(Gerrit.C.sectionActions()); keysAction = new KeyCommandSet(Gerrit.C.sectionActions());
@@ -154,7 +154,7 @@ public class ChangeScreen extends Screen {
.keyPublishComments())); .keyPublishComments()));
starChange = new Image(Gerrit.RESOURCES.starOpen()); starChange = new Image(Gerrit.RESOURCES.starOpen());
starChange.setStyleName("gerrit-ChangeScreen-StarIcon"); starChange.setStyleName(Gerrit.RESOURCES.css().changeScreenStarIcon());
starChange.setVisible(Gerrit.isSignedIn()); starChange.setVisible(Gerrit.isSignedIn());
starChange.addClickHandler(new ClickHandler() { starChange.addClickHandler(new ClickHandler() {
@Override @Override
@@ -186,7 +186,7 @@ public class ChangeScreen extends Screen {
add(patchSetPanels); add(patchSetPanels);
comments = new FlowPanel(); comments = new FlowPanel();
comments.setStyleName("gerrit-ChangeComments"); comments.setStyleName(Gerrit.RESOURCES.css().changeComments());
add(comments); add(comments);
} }
@@ -257,13 +257,13 @@ public class ChangeScreen extends Screen {
panel.setContent(psp); panel.setContent(psp);
final InlineLabel revtxt = new InlineLabel(ps.getRevision().get() + " "); final InlineLabel revtxt = new InlineLabel(ps.getRevision().get() + " ");
revtxt.addStyleName("gerrit-PatchSetRevision"); revtxt.addStyleName(Gerrit.RESOURCES.css().patchSetRevision());
panel.getHeader().add(revtxt); panel.getHeader().add(revtxt);
if (gw != null) { if (gw != null) {
final Anchor revlink = final Anchor revlink =
new Anchor("(gitweb)", false, gw.toRevision(detail.getChange() new Anchor("(gitweb)", false, gw.toRevision(detail.getChange()
.getProject(), ps)); .getProject(), ps));
revlink.addStyleName("gerrit-PatchSetLink"); revlink.addStyleName(Gerrit.RESOURCES.css().patchSetLink());
panel.getHeader().add(revlink); panel.getHeader().add(revlink);
} }
@@ -282,7 +282,7 @@ public class ChangeScreen extends Screen {
comments.clear(); comments.clear();
final Label hdr = new Label(Util.C.changeScreenComments()); final Label hdr = new Label(Util.C.changeScreenComments());
hdr.setStyleName("gerrit-BlockHeader"); hdr.setStyleName(Gerrit.RESOURCES.css().blockHeader());
comments.add(hdr); comments.add(hdr);
final AccountInfoCache accts = detail.getAccounts(); final AccountInfoCache accts = detail.getAccounts();
@@ -318,7 +318,7 @@ public class ChangeScreen extends Screen {
new CommentPanel(author, msg.getWrittenOn(), msg.getMessage()); new CommentPanel(author, msg.getWrittenOn(), msg.getMessage());
cp.setRecent(isRecent); cp.setRecent(isRecent);
if (i == msgList.size() - 1) { if (i == msgList.size() - 1) {
cp.addStyleName("gerrit-CommentPanel-Last"); cp.addStyleName(Gerrit.RESOURCES.css().commentPanelLast());
cp.setOpen(true); cp.setOpen(true);
} }
comments.add(cp); comments.add(cp);

View File

@@ -60,15 +60,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
public class ChangeTable extends NavigationTable<ChangeInfo> { public class ChangeTable extends NavigationTable<ChangeInfo> {
private static final String S_C_ID = "C_ID";
private static final String S_C_SUBJECT = "C_SUBJECT";
private static final String S_C_PROJECT = "C_PROJECT";
private static final String S_C_LAST_UPDATE = "C_LAST_UPDATE";
private static final String S_C_APPROVAL = "C_APPROVAL";
private static final String S_SECTION_HEADER = "SectionHeader";
private static final String S_EMPTY_SECTION = "EmptySection";
private static final String S_NEEDS_REVIEW = "NeedsReview";
private static final int C_STAR = 1; private static final int C_STAR = 1;
private static final int C_ID = 2; private static final int C_ID = 2;
private static final int C_SUBJECT = 3; private static final int C_SUBJECT = 3;
@@ -127,10 +118,10 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
} }
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, C_STAR, S_ICON_HEADER); fmt.addStyleName(0, C_STAR, Gerrit.RESOURCES.css().iconHeader());
fmt.addStyleName(0, C_ID, S_C_ID); fmt.addStyleName(0, C_ID, Gerrit.RESOURCES.css().cID());
for (int i = C_ID; i < columns; i++) { for (int i = C_ID; i < columns; i++) {
fmt.addStyleName(0, i, S_DATA_HEADER); fmt.addStyleName(0, i, Gerrit.RESOURCES.css().dataHeader());
} }
table.addClickHandler(new ClickHandler() { table.addClickHandler(new ClickHandler() {
@@ -190,7 +181,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
table.setText(row, 0, Util.C.changeTableNone()); table.setText(row, 0, Util.C.changeTableNone());
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.setColSpan(row, 0, columns); fmt.setColSpan(row, 0, columns);
fmt.setStyleName(row, 0, S_EMPTY_SECTION); fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
} }
private void insertChangeRow(final int row) { private void insertChangeRow(final int row) {
@@ -202,17 +193,17 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
protected void applyDataRowStyle(final int row) { protected void applyDataRowStyle(final int row) {
super.applyDataRowStyle(row); super.applyDataRowStyle(row);
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(row, C_STAR, S_ICON_CELL); fmt.addStyleName(row, C_STAR, Gerrit.RESOURCES.css().iconCell());
for (int i = C_ID; i < columns; i++) { for (int i = C_ID; i < columns; i++) {
fmt.addStyleName(row, i, S_DATA_CELL); fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
} }
fmt.addStyleName(row, C_ID, S_C_ID); fmt.addStyleName(row, C_ID, Gerrit.RESOURCES.css().cID());
fmt.addStyleName(row, C_SUBJECT, S_C_SUBJECT); fmt.addStyleName(row, C_SUBJECT, Gerrit.RESOURCES.css().cSUBJECT());
fmt.addStyleName(row, C_PROJECT, S_C_PROJECT); fmt.addStyleName(row, C_PROJECT, Gerrit.RESOURCES.css().cPROJECT());
fmt.addStyleName(row, C_BRANCH, S_C_PROJECT); fmt.addStyleName(row, C_BRANCH, Gerrit.RESOURCES.css().cPROJECT());
fmt.addStyleName(row, C_LAST_UPDATE, S_C_LAST_UPDATE); fmt.addStyleName(row, C_LAST_UPDATE, Gerrit.RESOURCES.css().cLastUpdate());
for (int i = BASE_COLUMNS; i < columns; i++) { for (int i = BASE_COLUMNS; i < columns; i++) {
fmt.addStyleName(row, i, S_C_APPROVAL); fmt.addStyleName(row, i, Gerrit.RESOURCES.css().cAPPROVAL());
} }
} }
@@ -233,8 +224,8 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
} }
table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c)); table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c));
table.setWidget(row, C_OWNER, link(c.getOwner())); table.setWidget(row, C_OWNER, link(c.getOwner()));
table.setWidget(row, C_PROJECT, table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c
new ProjectLink(c.getProject().getKey(), c.getStatus())); .getStatus()));
table.setText(row, C_BRANCH, c.getBranch()); table.setText(row, C_BRANCH, c.getBranch());
table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn())); table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn()));
setRowItem(row, c); setRowItem(row, c);
@@ -268,7 +259,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
table.setText(s.titleRow, 0, s.titleText); table.setText(s.titleRow, 0, s.titleText);
final FlexCellFormatter fmt = table.getFlexCellFormatter(); final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.setColSpan(s.titleRow, 0, columns); fmt.setColSpan(s.titleRow, 0, columns);
fmt.addStyleName(s.titleRow, 0, S_SECTION_HEADER); fmt.addStyleName(s.titleRow, 0, Gerrit.RESOURCES.css().sectionHeader());
} else { } else {
s.titleRow = -1; s.titleRow = -1;
} }
@@ -319,8 +310,8 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
for (final ApprovalType type : approvalTypes) { for (final ApprovalType type : approvalTypes) {
final PatchSetApproval ca = approvals.get(type.getCategory().getId()); final PatchSetApproval ca = approvals.get(type.getCategory().getId());
fmt.removeStyleName(row, col, "negscore"); fmt.removeStyleName(row, col, Gerrit.RESOURCES.css().negscore());
fmt.removeStyleName(row, col, "posscore"); fmt.removeStyleName(row, col, Gerrit.RESOURCES.css().posscore());
if (ca == null || ca.getValue() == 0) { if (ca == null || ca.getValue() == 0) {
table.clearCell(row, col); table.clearCell(row, col);
@@ -338,9 +329,9 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
String vstr = String.valueOf(ca.getValue()); String vstr = String.valueOf(ca.getValue());
if (ca.getValue() > 0) { if (ca.getValue() > 0) {
vstr = "+" + vstr; vstr = "+" + vstr;
fmt.addStyleName(row, col, "posscore"); fmt.addStyleName(row, col, Gerrit.RESOURCES.css().posscore());
} else { } else {
fmt.addStyleName(row, col, "negscore"); fmt.addStyleName(row, col, Gerrit.RESOURCES.css().negscore());
} }
table.setText(row, col, vstr); table.setText(row, col, vstr);
} }
@@ -359,7 +350,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
} }
final Element tr = DOM.getParent(fmt.getElement(row, 0)); final Element tr = DOM.getParent(fmt.getElement(row, 0));
UIObject.setStyleName(tr, S_NEEDS_REVIEW, !haveReview UIObject.setStyleName(tr, Gerrit.RESOURCES.css().needsReview(), !haveReview
&& highlightUnreviewed); && highlightUnreviewed);
} }

View File

@@ -78,20 +78,20 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
*/ */
public void ensureLoaded(final PatchSetDetail detail) { public void ensureLoaded(final PatchSetDetail detail) {
infoTable = new Grid(R_CNT, 2); infoTable = new Grid(R_CNT, 2);
infoTable.setStyleName("gerrit-InfoBlock"); infoTable.setStyleName(Gerrit.RESOURCES.css().infoBlock());
infoTable.addStyleName("gerrit-PatchSetInfoBlock"); infoTable.addStyleName(Gerrit.RESOURCES.css().patchSetInfoBlock());
initRow(R_AUTHOR, Util.C.patchSetInfoAuthor()); initRow(R_AUTHOR, Util.C.patchSetInfoAuthor());
initRow(R_COMMITTER, Util.C.patchSetInfoCommitter()); initRow(R_COMMITTER, Util.C.patchSetInfoCommitter());
initRow(R_DOWNLOAD, Util.C.patchSetInfoDownload()); initRow(R_DOWNLOAD, Util.C.patchSetInfoDownload());
final CellFormatter itfmt = infoTable.getCellFormatter(); final CellFormatter itfmt = infoTable.getCellFormatter();
itfmt.addStyleName(0, 0, "topmost"); itfmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
itfmt.addStyleName(0, 1, "topmost"); itfmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
itfmt.addStyleName(R_CNT - 1, 0, "bottomheader"); itfmt.addStyleName(R_CNT - 1, 0, Gerrit.RESOURCES.css().bottomheader());
itfmt.addStyleName(R_AUTHOR, 1, "useridentity"); itfmt.addStyleName(R_AUTHOR, 1, Gerrit.RESOURCES.css().useridentity());
itfmt.addStyleName(R_COMMITTER, 1, "useridentity"); itfmt.addStyleName(R_COMMITTER, 1, Gerrit.RESOURCES.css().useridentity());
itfmt.addStyleName(R_DOWNLOAD, 1, "command"); itfmt.addStyleName(R_DOWNLOAD, 1, Gerrit.RESOURCES.css().command());
final PatchSetInfo info = detail.getInfo(); final PatchSetInfo info = detail.getInfo();
displayUserIdentity(R_AUTHOR, info.getAuthor()); displayUserIdentity(R_AUTHOR, info.getAuthor());
@@ -106,7 +106,7 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
body.add(infoTable); body.add(infoTable);
actionsPanel = new FlowPanel(); actionsPanel = new FlowPanel();
actionsPanel.setStyleName("gerrit-PatchSetActions"); actionsPanel.setStyleName(Gerrit.RESOURCES.css().patchSetActions());
body.add(actionsPanel); body.add(actionsPanel);
if (Gerrit.isSignedIn()) { if (Gerrit.isSignedIn()) {
populateCommentAction(); populateCommentAction();
@@ -188,14 +188,14 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
} }
final FlowPanel fp = new FlowPanel(); final FlowPanel fp = new FlowPanel();
fp.setStyleName("gerrit-PatchSetUserIdentity"); fp.setStyleName(Gerrit.RESOURCES.css().patchSetUserIdentity());
if (who.getName() != null) { if (who.getName() != null) {
final Account.Id aId = who.getAccount(); final Account.Id aId = who.getAccount();
if (aId != null) { if (aId != null) {
fp.add(new AccountDashboardLink(who.getName(), aId)); fp.add(new AccountDashboardLink(who.getName(), aId));
} else { } else {
final InlineLabel lbl = new InlineLabel(who.getName()); final InlineLabel lbl = new InlineLabel(who.getName());
lbl.setStyleName("gerrit-AccountName"); lbl.setStyleName(Gerrit.RESOURCES.css().accountName());
fp.add(lbl); fp.add(lbl);
} }
} }
@@ -287,7 +287,7 @@ class PatchSetPanel extends Composite implements OpenHandler<DisclosurePanel> {
private void initRow(final int row, final String name) { private void initRow(final int row, final String name) {
infoTable.setText(row, 0, name); infoTable.setText(row, 0, name);
infoTable.getCellFormatter().addStyleName(row, 0, "header"); infoTable.getCellFormatter().addStyleName(row, 0, Gerrit.RESOURCES.css().header());
} }
private void onSubmitResult(final ChangeDetail result) { private void onSubmitResult(final ChangeDetail result) {

View File

@@ -256,7 +256,7 @@ public class PatchTable extends Composite {
text = Util.M.otherFrom(patch.getSourceFileName()); text = Util.M.otherFrom(patch.getSourceFileName());
} }
final Label line = new Label(text); final Label line = new Label(text);
line.setStyleName("SourceFilePath"); line.setStyleName(Gerrit.RESOURCES.css().sourceFilePath());
final FlowPanel cell = new FlowPanel(); final FlowPanel cell = new FlowPanel();
cell.add(nameCol); cell.add(nameCol);
cell.add(line); cell.add(line);
@@ -283,32 +283,32 @@ public class PatchTable extends Composite {
// Cursor // Cursor
m.openTd(); m.openTd();
m.addStyleName(S_ICON_HEADER); m.addStyleName(Gerrit.RESOURCES.css().iconHeader());
m.addStyleName("LeftMostCell"); m.addStyleName(Gerrit.RESOURCES.css().leftMostCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
// Mode // Mode
m.openTd(); m.openTd();
m.setStyleName(S_ICON_HEADER); m.setStyleName(Gerrit.RESOURCES.css().iconHeader());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
// "File path" // "File path"
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.append(Util.C.patchTableColumnName()); m.append(Util.C.patchTableColumnName());
m.closeTd(); m.closeTd();
// "Comments" // "Comments"
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.append(Util.C.patchTableColumnComments()); m.append(Util.C.patchTableColumnComments());
m.closeTd(); m.closeTd();
// "Diff" // "Diff"
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.setAttribute("colspan", 3); m.setAttribute("colspan", 3);
m.append(Util.C.patchTableColumnDiff()); m.append(Util.C.patchTableColumnDiff());
m.closeTd(); m.closeTd();
@@ -316,7 +316,7 @@ public class PatchTable extends Composite {
// "Reviewed" // "Reviewed"
if (Gerrit.isSignedIn()) { if (Gerrit.isSignedIn()) {
m.openTd(); m.openTd();
m.setStyleName(S_ICON_HEADER); m.setStyleName(Gerrit.RESOURCES.css().iconHeader());
m.append(Util.C.reviewed()); m.append(Util.C.reviewed());
m.closeTd(); m.closeTd();
} }
@@ -328,24 +328,24 @@ public class PatchTable extends Composite {
m.openTr(); m.openTr();
m.openTd(); m.openTd();
m.addStyleName(S_ICON_CELL); m.addStyleName(Gerrit.RESOURCES.css().iconCell());
m.addStyleName("LeftMostCell"); m.addStyleName(Gerrit.RESOURCES.css().leftMostCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName("ChangeTypeCell"); m.setStyleName(Gerrit.RESOURCES.css().changeTypeCell());
m.append(p.getChangeType().getCode()); m.append(p.getChangeType().getCode());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName(S_DATA_CELL); m.addStyleName(Gerrit.RESOURCES.css().dataCell());
m.addStyleName("FilePathCell"); m.addStyleName(Gerrit.RESOURCES.css().filePathCell());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName(S_DATA_CELL); m.addStyleName(Gerrit.RESOURCES.css().dataCell());
m.addStyleName("CommentCell"); m.addStyleName(Gerrit.RESOURCES.css().commentCell());
appendCommentCount(m, p); appendCommentCount(m, p);
m.closeTd(); m.closeTd();
@@ -398,7 +398,7 @@ public class PatchTable extends Composite {
// Green check mark if the user is logged in and they reviewed that file // Green check mark if the user is logged in and they reviewed that file
if (Gerrit.isSignedIn()) { if (Gerrit.isSignedIn()) {
m.openTd(); m.openTd();
m.setStyleName(S_DATA_CELL); m.setStyleName(Gerrit.RESOURCES.css().dataCell());
if (p.isReviewedByCurrentUser()) { if (p.isReviewedByCurrentUser()) {
m.openDiv(); m.openDiv();
m.setStyleName(Gerrit.RESOURCES.css().greenCheckClass()); m.setStyleName(Gerrit.RESOURCES.css().greenCheckClass());
@@ -419,7 +419,7 @@ public class PatchTable extends Composite {
m.append(", "); m.append(", ");
} }
m.openSpan(); m.openSpan();
m.setStyleName("Drafts"); m.setStyleName(Gerrit.RESOURCES.css().drafts());
m.append(Util.M.patchTableDrafts(p.getDraftCount())); m.append(Util.M.patchTableDrafts(p.getDraftCount()));
m.closeSpan(); m.closeSpan();
} }
@@ -427,8 +427,8 @@ public class PatchTable extends Composite {
private void openlink(final SafeHtmlBuilder m, final int colspan) { private void openlink(final SafeHtmlBuilder m, final int colspan) {
m.openTd(); m.openTd();
m.addStyleName(S_DATA_CELL); m.addStyleName(Gerrit.RESOURCES.css().dataCell());
m.addStyleName("DiffLinkCell"); m.addStyleName(Gerrit.RESOURCES.css().diffLinkCell());
m.setAttribute("colspan", colspan); m.setAttribute("colspan", colspan);
} }
@@ -439,8 +439,8 @@ public class PatchTable extends Composite {
private void emptycell(final SafeHtmlBuilder m, final int colspan) { private void emptycell(final SafeHtmlBuilder m, final int colspan) {
m.openTd(); m.openTd();
m.addStyleName(S_DATA_CELL); m.addStyleName(Gerrit.RESOURCES.css().dataCell());
m.addStyleName("DiffLinkCell"); m.addStyleName(Gerrit.RESOURCES.css().diffLinkCell());
m.setAttribute("colspan", colspan); m.setAttribute("colspan", colspan);
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();

View File

@@ -76,7 +76,7 @@ public class PublishCommentScreen extends AccountScreen implements ClickHandler
@Override @Override
protected void onInitUI() { protected void onInitUI() {
super.onInitUI(); super.onInitUI();
addStyleName("gerrit-PublishCommentsScreen"); addStyleName(Gerrit.RESOURCES.css().publishCommentsScreen());
approvalButtons = new ArrayList<ValueRadioButton>(); approvalButtons = new ArrayList<ValueRadioButton>();
descBlock = new ChangeDescriptionBlock(); descBlock = new ChangeDescriptionBlock();
@@ -101,7 +101,6 @@ public class PublishCommentScreen extends AccountScreen implements ClickHandler
body.add(draftsPanel); body.add(draftsPanel);
final FlowPanel buttonRow = new FlowPanel(); final FlowPanel buttonRow = new FlowPanel();
buttonRow.setStyleName("gerrit-CommentEditor-Buttons");
body.add(buttonRow); body.add(buttonRow);
send = new Button(Util.C.buttonPublishCommentsSend()); send = new Button(Util.C.buttonPublishCommentsSend());
@@ -152,7 +151,7 @@ public class PublishCommentScreen extends AccountScreen implements ClickHandler
body.add(new SmallHeading(Util.C.headingCoverMessage())); body.add(new SmallHeading(Util.C.headingCoverMessage()));
final VerticalPanel mwrap = new VerticalPanel(); final VerticalPanel mwrap = new VerticalPanel();
mwrap.setStyleName("gerrit-CoverMessage"); mwrap.setStyleName(Gerrit.RESOURCES.css().coverMessage());
body.add(mwrap); body.add(mwrap);
message = new NpTextArea(); message = new NpTextArea();
@@ -176,7 +175,7 @@ public class PublishCommentScreen extends AccountScreen implements ClickHandler
body.add(new SmallHeading(ct.getCategory().getName() + ":")); body.add(new SmallHeading(ct.getCategory().getName() + ":"));
final VerticalPanel vp = new VerticalPanel(); final VerticalPanel vp = new VerticalPanel();
vp.setStyleName("gerrit-ApprovalCategoryList"); vp.setStyleName(Gerrit.RESOURCES.css().approvalCategoryList());
final List<ApprovalCategoryValue> lst = final List<ApprovalCategoryValue> lst =
new ArrayList<ApprovalCategoryValue>(ct.getValues()); new ArrayList<ApprovalCategoryValue>(ct.getValues());
Collections.reverse(lst); Collections.reverse(lst);
@@ -233,7 +232,7 @@ public class PublishCommentScreen extends AccountScreen implements ClickHandler
final String fn = patchKey.get(); final String fn = patchKey.get();
if (!fn.equals(priorFile)) { if (!fn.equals(priorFile)) {
panel = new FlowPanel(); panel = new FlowPanel();
panel.addStyleName("gerrit-PatchComments"); panel.addStyleName(Gerrit.RESOURCES.css().patchComments());
draftsPanel.add(panel); draftsPanel.add(panel);
// Parent table can be null here since we are not showing any // Parent table can be null here since we are not showing any
// next/previous links // next/previous links

View File

@@ -35,7 +35,6 @@ class SubmitFailureDialog extends AutoCenterDialogBox {
body.add(msgText); body.add(msgText);
final FlowPanel buttonPanel = new FlowPanel(); final FlowPanel buttonPanel = new FlowPanel();
buttonPanel.setStyleName("gerrit-CommentEditor-Buttons");
Button close = new Button(Util.C.buttonClose()); Button close = new Button(Util.C.buttonClose());
close.addClickHandler(new ClickHandler() { close.addClickHandler(new ClickHandler() {
@Override @Override

View File

@@ -0,0 +1,62 @@
/* Copyright (C) 2009 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.
*/
@external .gwt-Button;
@external .gwt-TabBar;
@external .gwt-TabBarFirst;
@external .gwt-TabBarItem;
@external .gwt-TabBarItem-selected;
@external .gwt-TabBarRest;
@external .gwt-TabPanel;
@external .gwt-TabPanelBottom;
.gwt-Button {
white-space: nowrap;
}
.gwt-TabBar {
border-bottom: 1px solid black;
}
.gwt-TabBar .gwt-TabBarFirst {
display: none;
}
.gwt-TabBar .gwt-TabBarItem {
margin: 0px;
background: #d4e9a9;
padding-top: 0.5em;
padding-bottom: 1px;
padding-left: 1em;
padding-right: 1em;
border-right: 1px solid black;
}
.gwt-TabBar .gwt-TabBarItem-selected {
background: #ffffcc;
}
.gwt-TabBar .gwt-TabBarRest {
background: #d4e9a9;
padding-top: 0.5em;
padding-bottom: 1px;
}
.gwt-TabBar .gwt-TabPanelBottom {
background: #d4e9a9;
border-top: 1px solid black;
border-left: none;
border-right: none;
border-bottom: none;
padding: 1px;
}
.gwt-TabPanel .gwt-TabPanelBottom {
border: none;
}

View File

@@ -90,7 +90,7 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
keysComment = null; keysComment = null;
} }
table.setStyleName("gerrit-PatchContentTable"); table.setStyleName(Gerrit.RESOURCES.css().patchContentTable());
} }
void notifyDraftDelta(final int delta) { void notifyDraftDelta(final int delta) {
@@ -397,7 +397,7 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
protected void insertRow(final int row) { protected void insertRow(final int row) {
table.insertRow(row); table.insertRow(row);
table.getCellFormatter().setStyleName(row, 0, S_ICON_CELL); table.getCellFormatter().setStyleName(row, 0, Gerrit.RESOURCES.css().iconCell());
} }
@Override @Override
@@ -476,7 +476,7 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
private void styleCommentRow(final int row) { private void styleCommentRow(final int row) {
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
final Element iconCell = fmt.getElement(row, 0); final Element iconCell = fmt.getElement(row, 0);
UIObject.setStyleName(DOM.getParent(iconCell), "CommentHolder", true); UIObject.setStyleName(DOM.getParent(iconCell), Gerrit.RESOURCES.css().commentHolder(), true);
} }
protected static class CommentList { protected static class CommentList {

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.patches; package com.google.gerrit.client.patches;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.CommentPanel; import com.google.gerrit.client.ui.CommentPanel;
import com.google.gerrit.reviewdb.PatchLineComment; import com.google.gerrit.reviewdb.PatchLineComment;
@@ -65,7 +66,7 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
public CommentEditorPanel(final PatchLineComment plc) { public CommentEditorPanel(final PatchLineComment plc) {
comment = plc; comment = plc;
addStyleName("gerrit-CommentEditorPanel"); addStyleName(Gerrit.RESOURCES.css().commentEditorPanel());
setAuthorNameText(PatchUtil.C.draft()); setAuthorNameText(PatchUtil.C.draft());
setMessageText(plc.getMessage()); setMessageText(plc.getMessage());
addDoubleClickHandler(this); addDoubleClickHandler(this);

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.patches; package com.google.gerrit.client.patches;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.Util; import com.google.gerrit.client.changes.Util;
import com.google.gerrit.client.ui.FancyFlexTable; import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gerrit.reviewdb.Patch; import com.google.gerrit.reviewdb.Patch;
@@ -35,9 +36,9 @@ class HistoryTable extends FancyFlexTable<Patch> {
final List<HistoryRadio> all = new ArrayList<HistoryRadio>(); final List<HistoryRadio> all = new ArrayList<HistoryRadio>();
HistoryTable(final PatchScreen parent) { HistoryTable(final PatchScreen parent) {
setStyleName("gerrit-PatchHistoryTable"); setStyleName(Gerrit.RESOURCES.css().patchHistoryTable());
screen = parent; screen = parent;
table.addStyleName("gerrit-ChangeTable"); table.addStyleName(Gerrit.RESOURCES.css().changeTable());
} }
void onClick(final HistoryRadio b) { void onClick(final HistoryRadio b) {
@@ -116,28 +117,28 @@ class HistoryTable extends FancyFlexTable<Patch> {
m.openTr(); m.openTr();
m.openTd(); m.openTd();
m.addStyleName(S_ICON_HEADER); m.addStyleName(Gerrit.RESOURCES.css().iconHeader());
m.addStyleName("LeftMostCell"); m.addStyleName(Gerrit.RESOURCES.css().leftMostCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.append(PatchUtil.C.patchHeaderOld()); m.append(PatchUtil.C.patchHeaderOld());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.append(PatchUtil.C.patchHeaderNew()); m.append(PatchUtil.C.patchHeaderNew());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_HEADER); m.setStyleName(Gerrit.RESOURCES.css().dataHeader());
m.append(Util.C.patchTableColumnComments()); m.append(Util.C.patchTableColumnComments());
m.closeTd(); m.closeTd();
@@ -148,13 +149,13 @@ class HistoryTable extends FancyFlexTable<Patch> {
m.openTr(); m.openTr();
m.openTd(); m.openTd();
m.addStyleName(S_ICON_CELL); m.addStyleName(Gerrit.RESOURCES.css().iconCell());
m.addStyleName("LeftMostCell"); m.addStyleName(Gerrit.RESOURCES.css().leftMostCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_CELL); m.setStyleName(Gerrit.RESOURCES.css().dataCell());
m.setAttribute("align", "right"); m.setAttribute("align", "right");
if (k != null) { if (k != null) {
final PatchSet.Id psId = k.getKey().getParentKey(); final PatchSet.Id psId = k.getKey().getParentKey();
@@ -165,17 +166,17 @@ class HistoryTable extends FancyFlexTable<Patch> {
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_CELL); m.setStyleName(Gerrit.RESOURCES.css().dataCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_CELL); m.setStyleName(Gerrit.RESOURCES.css().dataCell());
m.nbsp(); m.nbsp();
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName(S_DATA_CELL); m.setStyleName(Gerrit.RESOURCES.css().dataCell());
if (k != null && k.getCommentCount() > 0) { if (k != null && k.getCommentCount() > 0) {
m.append(Util.M.patchTableComments(k.getCommentCount())); m.append(Util.M.patchTableComments(k.getCommentCount()));
} else { } else {

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.patches; package com.google.gerrit.client.patches;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.PatchTable; import com.google.gerrit.client.changes.PatchTable;
import com.google.gerrit.client.changes.Util; import com.google.gerrit.client.changes.Util;
import com.google.gerrit.reviewdb.Patch; import com.google.gerrit.reviewdb.Patch;
@@ -44,12 +45,12 @@ class PatchBrowserPopup extends PluginSafeDialogBox implements
sp = new ScrollPanel(fileList); sp = new ScrollPanel(fileList);
final FlowPanel body = new FlowPanel(); final FlowPanel body = new FlowPanel();
body.setStyleName("gerrit-PatchBrowserPopup-Body"); body.setStyleName(Gerrit.RESOURCES.css().patchBrowserPopupBody());
body.add(sp); body.add(sp);
setText(Util.M.patchSetHeader(callerKey.getParentKey().get())); setText(Util.M.patchSetHeader(callerKey.getParentKey().get()));
setWidget(body); setWidget(body);
addStyleName("gerrit-PatchBrowserPopup"); addStyleName(Gerrit.RESOURCES.css().patchBrowserPopup());
} }
@Override @Override

View File

@@ -218,7 +218,7 @@ public abstract class PatchScreen extends Screen {
initDisplayControls(); initDisplayControls();
noDifference = new Label(PatchUtil.C.noDifference()); noDifference = new Label(PatchUtil.C.noDifference());
noDifference.setStyleName("gerrit-PatchNoDifference"); noDifference.setStyleName(Gerrit.RESOURCES.css().patchNoDifference());
noDifference.setVisible(false); noDifference.setVisible(false);
contentTable = createContentTable(); contentTable = createContentTable();
@@ -226,7 +226,7 @@ public abstract class PatchScreen extends Screen {
add(createNextPrevLinks()); add(createNextPrevLinks());
contentPanel = new FlowPanel(); contentPanel = new FlowPanel();
contentPanel.setStyleName("gerrit-SideBySideScreen-SideBySideTable"); contentPanel.setStyleName(Gerrit.RESOURCES.css().sideBySideScreenSideBySideTable());
contentPanel.add(noDifference); contentPanel.add(noDifference);
contentPanel.add(contentTable); contentPanel.add(contentTable);
add(contentPanel); add(contentPanel);
@@ -256,7 +256,7 @@ public abstract class PatchScreen extends Screen {
private void initDisplayControls() { private void initDisplayControls() {
final Grid displayControls = new Grid(0, 5); final Grid displayControls = new Grid(0, 5);
displayControls.setStyleName("gerrit-PatchScreen-DisplayControls"); displayControls.setStyleName(Gerrit.RESOURCES.css().patchScreenDisplayControls());
add(displayControls); add(displayControls);
createIgnoreWhitespace(displayControls, 0, 0); createIgnoreWhitespace(displayControls, 0, 0);
@@ -353,7 +353,7 @@ public abstract class PatchScreen extends Screen {
private Widget createNextPrevLinks() { private Widget createNextPrevLinks() {
final Grid table = new Grid(1, 3); final Grid table = new Grid(1, 3);
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
table.setStyleName("gerrit-SideBySideScreen-LinkTable"); table.setStyleName(Gerrit.RESOURCES.css().sideBySideScreenLinkTable());
fmt.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); fmt.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
fmt.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER); fmt.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT); fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);

View File

@@ -19,6 +19,7 @@ import static com.google.gerrit.client.patches.PatchLine.Type.DELETE;
import static com.google.gerrit.client.patches.PatchLine.Type.INSERT; import static com.google.gerrit.client.patches.PatchLine.Type.INSERT;
import static com.google.gerrit.client.patches.PatchLine.Type.REPLACE; import static com.google.gerrit.client.patches.PatchLine.Type.REPLACE;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.common.data.CommentDetail; import com.google.gerrit.common.data.CommentDetail;
import com.google.gerrit.common.data.EditList; import com.google.gerrit.common.data.EditList;
import com.google.gerrit.common.data.PatchScript; import com.google.gerrit.common.data.PatchScript;
@@ -177,10 +178,10 @@ public class SideBySideTable extends AbstractPatchContentTable {
protected void insertRow(final int row) { protected void insertRow(final int row) {
super.insertRow(row); super.insertRow(row);
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(row, COL_A - 1, "LineNumber"); fmt.addStyleName(row, COL_A - 1, Gerrit.RESOURCES.css().lineNumber());
fmt.addStyleName(row, COL_A, "DiffText"); fmt.addStyleName(row, COL_A, Gerrit.RESOURCES.css().diffText());
fmt.addStyleName(row, COL_B - 1, "LineNumber"); fmt.addStyleName(row, COL_B - 1, Gerrit.RESOURCES.css().lineNumber());
fmt.addStyleName(row, COL_B, "DiffText"); fmt.addStyleName(row, COL_B, Gerrit.RESOURCES.css().diffText());
} }
private int finish(final Iterator<PatchLineComment> i, int row, final int col) { private int finish(final Iterator<PatchLineComment> i, int row, final int col) {
@@ -197,28 +198,28 @@ public class SideBySideTable extends AbstractPatchContentTable {
m.openTr(); m.openTr();
m.openTd(); m.openTd();
m.addStyleName(S_ICON_CELL); m.addStyleName(Gerrit.RESOURCES.css().iconCell());
m.addStyleName("FileColumnHeader"); m.addStyleName(Gerrit.RESOURCES.css().fileColumnHeader());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName("FileColumnHeader"); m.addStyleName(Gerrit.RESOURCES.css().fileColumnHeader());
m.addStyleName("LineNumber"); m.addStyleName(Gerrit.RESOURCES.css().lineNumber());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName("FileColumnHeader"); m.setStyleName(Gerrit.RESOURCES.css().fileColumnHeader());
m.setAttribute("width", "50%"); m.setAttribute("width", "50%");
m.append(PatchUtil.C.patchHeaderOld()); m.append(PatchUtil.C.patchHeaderOld());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName("FileColumnHeader"); m.addStyleName(Gerrit.RESOURCES.css().fileColumnHeader());
m.addStyleName("LineNumber"); m.addStyleName(Gerrit.RESOURCES.css().lineNumber());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName("FileColumnHeader"); m.setStyleName(Gerrit.RESOURCES.css().fileColumnHeader());
m.setAttribute("width", "50%"); m.setAttribute("width", "50%");
m.append(PatchUtil.C.patchHeaderNew()); m.append(PatchUtil.C.patchHeaderNew());
m.closeTd(); m.closeTd();
@@ -230,11 +231,11 @@ public class SideBySideTable extends AbstractPatchContentTable {
m.openTr(); m.openTr();
m.openTd(); m.openTd();
m.setStyleName(S_ICON_CELL); m.setStyleName(Gerrit.RESOURCES.css().iconCell());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.setStyleName("SkipLine"); m.setStyleName(Gerrit.RESOURCES.css().skipLine());
m.setAttribute("colspan", 4); m.setAttribute("colspan", 4);
m.append(PatchUtil.M.patchSkipRegion(skipCnt)); m.append(PatchUtil.M.patchSkipRegion(skipCnt));
m.closeTd(); m.closeTd();
@@ -246,7 +247,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
m.setAttribute("valign", "top"); m.setAttribute("valign", "top");
m.openTd(); m.openTd();
m.setStyleName(S_ICON_CELL); m.setStyleName(Gerrit.RESOURCES.css().iconCell());
m.closeTd(); m.closeTd();
} }
@@ -262,25 +263,35 @@ public class SideBySideTable extends AbstractPatchContentTable {
final int lineNumberMinusOne, final PatchLine.Type type, final int lineNumberMinusOne, final PatchLine.Type type,
final SafeHtml lineHtml) { final SafeHtml lineHtml) {
m.openTd(); m.openTd();
m.setStyleName("LineNumber"); m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
m.append(lineNumberMinusOne + 1); m.append(lineNumberMinusOne + 1);
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName("FileLine"); m.addStyleName(Gerrit.RESOURCES.css().fileLine());
m.addStyleName("FileLine-" + type.name()); switch(type){
case CONTEXT:
m.addStyleName(Gerrit.RESOURCES.css().fileLineCONTEXT());
break;
case DELETE:
m.addStyleName(Gerrit.RESOURCES.css().fileLineDELETE());
break;
case INSERT:
m.addStyleName(Gerrit.RESOURCES.css().fileLineINSERT());
break;
}
m.append(lineHtml); m.append(lineHtml);
m.closeTd(); m.closeTd();
} }
private void appendLineNone(final SafeHtmlBuilder m) { private void appendLineNone(final SafeHtmlBuilder m) {
m.openTd(); m.openTd();
m.setStyleName("LineNumber"); m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
m.closeTd(); m.closeTd();
m.openTd(); m.openTd();
m.addStyleName("FileLine"); m.addStyleName(Gerrit.RESOURCES.css().fileLine());
m.addStyleName("FileLineNone"); m.addStyleName(Gerrit.RESOURCES.css().fileLineNone());
m.closeTd(); m.closeTd();
} }

View File

@@ -18,6 +18,7 @@ import static com.google.gerrit.client.patches.PatchLine.Type.CONTEXT;
import static com.google.gerrit.client.patches.PatchLine.Type.DELETE; import static com.google.gerrit.client.patches.PatchLine.Type.DELETE;
import static com.google.gerrit.client.patches.PatchLine.Type.INSERT; import static com.google.gerrit.client.patches.PatchLine.Type.INSERT;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.common.data.CommentDetail; import com.google.gerrit.common.data.CommentDetail;
import com.google.gerrit.common.data.EditList; import com.google.gerrit.common.data.EditList;
import com.google.gerrit.common.data.PatchScript; import com.google.gerrit.common.data.PatchScript;
@@ -227,9 +228,9 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
protected void insertRow(final int row) { protected void insertRow(final int row) {
super.insertRow(row); super.insertRow(row);
final CellFormatter fmt = table.getCellFormatter(); final CellFormatter fmt = table.getCellFormatter();
fmt.addStyleName(row, PC - 2, "LineNumber"); fmt.addStyleName(row, PC - 2, Gerrit.RESOURCES.css().lineNumber());
fmt.addStyleName(row, PC - 1, "LineNumber"); fmt.addStyleName(row, PC - 1, Gerrit.RESOURCES.css().lineNumber());
fmt.addStyleName(row, PC, "DiffText"); fmt.addStyleName(row, PC, Gerrit.RESOURCES.css().diffText());
} }
private int insert(final List<PatchLineComment> in, int row) { private int insert(final List<PatchLineComment> in, int row) {
@@ -248,8 +249,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
padLineNumber(m); padLineNumber(m);
m.openTd(); m.openTd();
m.addStyleName("DiffText"); m.addStyleName(Gerrit.RESOURCES.css().diffText());
m.addStyleName("DiffText-FILE_HEADER"); m.addStyleName(Gerrit.RESOURCES.css().diffTextFileHeader());
m.append(line); m.append(line);
m.closeTd(); m.closeTd();
closeLine(m); closeLine(m);
@@ -261,8 +262,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
padLineNumber(m); padLineNumber(m);
m.openTd(); m.openTd();
m.addStyleName("DiffText"); m.addStyleName(Gerrit.RESOURCES.css().diffText());
m.addStyleName("DiffText-HUNK_HEADER"); m.addStyleName(Gerrit.RESOURCES.css().diffTextHunkHeader());
m.append("@@ -"); m.append("@@ -");
appendRange(m, hunk.getCurA() + 1, hunk.getEndA() - hunk.getCurA()); appendRange(m, hunk.getCurA() + 1, hunk.getEndA() - hunk.getCurA());
m.append(" +"); m.append(" +");
@@ -298,19 +299,21 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
final PrettyFormatter fmtA, final PrettyFormatter fmtB) { final PrettyFormatter fmtA, final PrettyFormatter fmtB) {
final String text = src.get(i); final String text = src.get(i);
m.openTd(); m.openTd();
m.addStyleName("DiffText"); m.addStyleName(Gerrit.RESOURCES.css().diffText());
m.addStyleName("DiffText-" + type.name());
switch (type) { switch (type) {
case CONTEXT: case CONTEXT:
m.addStyleName(Gerrit.RESOURCES.css().diffTextCONTEXT());
m.nbsp(); m.nbsp();
m.append(fmtA.format(text)); m.append(fmtA.format(text));
fmtB.update(text); fmtB.update(text);
break; break;
case DELETE: case DELETE:
m.addStyleName(Gerrit.RESOURCES.css().diffTextDELETE());
m.append("-"); m.append("-");
m.append(fmtA.format(text)); m.append(fmtA.format(text));
break; break;
case INSERT: case INSERT:
m.addStyleName(Gerrit.RESOURCES.css().diffTextINSERT());
m.append("+"); m.append("+");
m.append(fmtB.format(text)); m.append(fmtB.format(text));
break; break;
@@ -323,8 +326,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
padLineNumber(m); padLineNumber(m);
padLineNumber(m); padLineNumber(m);
m.openTd(); m.openTd();
m.addStyleName("DiffText"); m.addStyleName(Gerrit.RESOURCES.css().diffText());
m.addStyleName("DiffText-NO_LF"); m.addStyleName(Gerrit.RESOURCES.css().diffTextNoLF());
m.append("\\ No newline at end of file"); m.append("\\ No newline at end of file");
m.closeTd(); m.closeTd();
closeLine(m); closeLine(m);
@@ -334,7 +337,7 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
m.openTr(); m.openTr();
m.setAttribute("valign", "top"); m.setAttribute("valign", "top");
m.openTd(); m.openTd();
m.setStyleName(S_ICON_CELL); m.setStyleName(Gerrit.RESOURCES.css().iconCell());
m.closeTd(); m.closeTd();
} }
@@ -344,13 +347,13 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
private void padLineNumber(final SafeHtmlBuilder m) { private void padLineNumber(final SafeHtmlBuilder m) {
m.openTd(); m.openTd();
m.setStyleName("LineNumber"); m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
m.closeTd(); m.closeTd();
} }
private void appendLineNumber(final SafeHtmlBuilder m, final int idx) { private void appendLineNumber(final SafeHtmlBuilder m, final int idx) {
m.openTd(); m.openTd();
m.setStyleName("LineNumber"); m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
m.append(idx + 1); m.append(idx + 1);
m.closeTd(); m.closeTd();
} }

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.FormatUtil; import com.google.gerrit.client.FormatUtil;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.AccountDashboardScreen; import com.google.gerrit.client.changes.AccountDashboardScreen;
import com.google.gerrit.common.PageLinks; import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.data.AccountInfo; import com.google.gerrit.common.data.AccountInfo;
@@ -43,7 +44,7 @@ public class AccountDashboardLink extends DirectScreenLink {
public AccountDashboardLink(final String text, final Account.Id ai) { public AccountDashboardLink(final String text, final Account.Id ai) {
super(text, PageLinks.toAccountDashboard(ai)); super(text, PageLinks.toAccountDashboard(ai));
addStyleName("gerrit-AccountName"); addStyleName(Gerrit.RESOURCES.css().accountName());
accountId = ai; accountId = ai;
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.admin.Util; import com.google.gerrit.client.admin.Util;
import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.BlurHandler;
@@ -40,13 +41,13 @@ public class AddMemberBox extends Composite {
nameTxtBox.setVisibleLength(50); nameTxtBox.setVisibleLength(50);
nameTxtBox.setText(Util.C.defaultAccountName()); nameTxtBox.setText(Util.C.defaultAccountName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
nameTxtBox.addFocusHandler(new FocusHandler() { nameTxtBox.addFocusHandler(new FocusHandler() {
@Override @Override
public void onFocus(final FocusEvent event) { public void onFocus(final FocusEvent event) {
if (Util.C.defaultAccountName().equals(nameTxtBox.getText())) { if (Util.C.defaultAccountName().equals(nameTxtBox.getText())) {
nameTxtBox.setText(""); nameTxtBox.setText("");
nameTxtBox.removeStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.removeStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
@@ -55,12 +56,11 @@ public class AddMemberBox extends Composite {
public void onBlur(final BlurEvent event) { public void onBlur(final BlurEvent event) {
if ("".equals(nameTxtBox.getText())) { if ("".equals(nameTxtBox.getText())) {
nameTxtBox.setText(Util.C.defaultAccountName()); nameTxtBox.setText(Util.C.defaultAccountName());
nameTxtBox.addStyleName("gerrit-InputFieldTypeHint"); nameTxtBox.addStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint());
} }
} }
}); });
addPanel.setStyleName("gerrit-ProjectWatchPanel-AddPanel");
addPanel.add(nameTxt); addPanel.add(nameTxt);
addPanel.add(addMember); addPanel.add(addMember);

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
@@ -25,7 +26,7 @@ public class CommandMenuItem extends Anchor implements ClickHandler {
public CommandMenuItem(final String text, final Command cmd) { public CommandMenuItem(final String text, final Command cmd) {
super(text); super(text);
setStyleName("gerrit-MenuItem"); setStyleName(Gerrit.RESOURCES.css().menuItem());
Accessibility.setRole(getElement(), Accessibility.ROLE_MENUITEM); Accessibility.setRole(getElement(), Accessibility.ROLE_MENUITEM);
addClickHandler(this); addClickHandler(this);
command = cmd; command = cmd;

View File

@@ -61,13 +61,13 @@ public class CommentPanel extends Composite implements HasDoubleClickHandlers {
protected CommentPanel() { protected CommentPanel() {
final FlowPanel body = new FlowPanel(); final FlowPanel body = new FlowPanel();
initWidget(body); initWidget(body);
setStyleName("gerrit-CommentPanel"); setStyleName(Gerrit.RESOURCES.css().commentPanel());
messageSummary = new InlineLabel(); messageSummary = new InlineLabel();
messageSummary.setStyleName("gerrit-CommentPanel-Summary"); messageSummary.setStyleName(Gerrit.RESOURCES.css().commentPanelSummary());
header = new FlexTable(); header = new FlexTable();
header.setStyleName("gerrit-CommentPanel-Header"); header.setStyleName(Gerrit.RESOURCES.css().commentPanelHeader());
header.addClickHandler(new ClickHandler() { header.addClickHandler(new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
@@ -78,19 +78,19 @@ public class CommentPanel extends Composite implements HasDoubleClickHandlers {
header.setWidget(0, 1, messageSummary); header.setWidget(0, 1, messageSummary);
header.setText(0, 2, ""); header.setText(0, 2, "");
final CellFormatter fmt = header.getCellFormatter(); final CellFormatter fmt = header.getCellFormatter();
fmt.setStyleName(0, 0, "gerrit-CommentPanel-AuthorCell"); fmt.setStyleName(0, 0, Gerrit.RESOURCES.css().commentPanelAuthorCell());
fmt.setStyleName(0, 1, "gerrit-CommentPanel-SummaryCell"); fmt.setStyleName(0, 1, Gerrit.RESOURCES.css().commentPanelSummaryCell());
fmt.setStyleName(0, 2, "gerrit-CommentPanel-DateCell"); fmt.setStyleName(0, 2, Gerrit.RESOURCES.css().commentPanelDateCell());
fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT); fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
body.add(header); body.add(header);
content = new FlowPanel(); content = new FlowPanel();
content.setStyleName("gerrit-CommentPanel-Content"); content.setStyleName(Gerrit.RESOURCES.css().commentPanelContent());
content.setVisible(false); content.setVisible(false);
body.add(content); body.add(content);
messageText = new DoubleClickHTML(); messageText = new DoubleClickHTML();
messageText.setStyleName("gerrit-CommentPanel-Message"); messageText.setStyleName(Gerrit.RESOURCES.css().commentPanelMessage());
content.add(messageText); content.add(messageText);
} }
@@ -134,7 +134,7 @@ public class CommentPanel extends Composite implements HasDoubleClickHandlers {
protected Panel getButtonPanel() { protected Panel getButtonPanel() {
if (buttons == null) { if (buttons == null) {
buttons = new FlowPanel(); buttons = new FlowPanel();
buttons.setStyleName("gerrit-CommentPanel-Buttons"); buttons.setStyleName(Gerrit.RESOURCES.css().commentPanelButtons());
content.add(buttons); content.add(buttons);
} }
return buttons; return buttons;

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.event.logical.shared.HasCloseHandlers; import com.google.gwt.event.logical.shared.HasCloseHandlers;
import com.google.gwt.event.logical.shared.HasOpenHandlers; import com.google.gwt.event.logical.shared.HasOpenHandlers;
@@ -54,7 +55,7 @@ public class ComplexDisclosurePanel extends Composite implements
{ {
setElement(DOM.createTD()); setElement(DOM.createTD());
DOM.setInnerHTML(getElement(), "&nbsp;"); DOM.setInnerHTML(getElement(), "&nbsp;");
addStyleName("complexHeader"); addStyleName(Gerrit.RESOURCES.css().complexHeader());
} }
@Override @Override

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DOM;
@@ -30,26 +31,18 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
private static final FancyFlexTableImpl impl = private static final FancyFlexTableImpl impl =
GWT.create(FancyFlexTableImpl.class); GWT.create(FancyFlexTableImpl.class);
protected static final String MY_STYLE = "gerrit-ChangeTable";
protected static final String S_ICON_HEADER = "IconHeader";
protected static final String S_DATA_HEADER = "DataHeader";
protected static final String S_ICON_CELL = "IconCell";
protected static final String S_DATA_CELL = "DataCell";
protected static final String S_LEFT_MOST_CELL = "LeftMostCell";
protected static final String S_ACTIVE_ROW = "ActiveRow";
protected static final int C_ARROW = 0; protected static final int C_ARROW = 0;
protected final MyFlexTable table; protected final MyFlexTable table;
protected FancyFlexTable() { protected FancyFlexTable() {
table = createFlexTable(); table = createFlexTable();
table.addStyleName(MY_STYLE); table.addStyleName(Gerrit.RESOURCES.css().changeTable());
table.setWidth("100%"); table.setWidth("100%");
initWidget(table); initWidget(table);
table.setText(0, C_ARROW, ""); table.setText(0, C_ARROW, "");
table.getCellFormatter().addStyleName(0, C_ARROW, S_ICON_HEADER); table.getCellFormatter().addStyleName(0, C_ARROW, Gerrit.RESOURCES.css().iconHeader());
} }
protected MyFlexTable createFlexTable() { protected MyFlexTable createFlexTable() {
@@ -113,8 +106,8 @@ public abstract class FancyFlexTable<RowItem> extends Composite {
} }
protected void applyDataRowStyle(final int newRow) { protected void applyDataRowStyle(final int newRow) {
table.getCellFormatter().addStyleName(newRow, C_ARROW, S_ICON_CELL); table.getCellFormatter().addStyleName(newRow, C_ARROW, Gerrit.RESOURCES.css().iconCell());
table.getCellFormatter().addStyleName(newRow, C_ARROW, S_LEFT_MOST_CELL); table.getCellFormatter().addStyleName(newRow, C_ARROW, Gerrit.RESOURCES.css().leftMostCell());
} }
/** /**

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Accessibility; import com.google.gwt.user.client.ui.Accessibility;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
@@ -26,7 +27,7 @@ public class LinkMenuBar extends Composite {
public LinkMenuBar() { public LinkMenuBar() {
body = new FlowPanel(); body = new FlowPanel();
initWidget(body); initWidget(body);
setStyleName("gerrit-LinkMenuBar"); setStyleName(Gerrit.RESOURCES.css().linkMenuBar());
Accessibility.setRole(getElement(), Accessibility.ROLE_MENUBAR); Accessibility.setRole(getElement(), Accessibility.ROLE_MENUBAR);
} }
@@ -49,9 +50,8 @@ public class LinkMenuBar extends Composite {
public void add(final Widget i) { public void add(final Widget i) {
if (body.getWidgetCount() > 0) { if (body.getWidgetCount() > 0) {
final Widget p = body.getWidget(body.getWidgetCount() - 1); final Widget p = body.getWidget(body.getWidgetCount() - 1);
p.addStyleName("gerrit-LinkMenuItem-NotLast"); p.addStyleName(Gerrit.RESOURCES.css().linkMenuItemNotLast());
} }
i.addStyleName("gerrit-LinkMenuItem");
body.add(i); body.add(i);
} }
} }

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.AnchorElement; import com.google.gwt.dom.client.AnchorElement;
import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DOM;
@@ -27,7 +28,7 @@ public class LinkMenuItem extends InlineHyperlink {
public LinkMenuItem(final String text, final String targetHistoryToken) { public LinkMenuItem(final String text, final String targetHistoryToken) {
super(text, targetHistoryToken); super(text, targetHistoryToken);
setStyleName("gerrit-MenuItem"); setStyleName(Gerrit.RESOURCES.css().menuItem());
Accessibility.setRole(getElement(), Accessibility.ROLE_MENUITEM); Accessibility.setRole(getElement(), Accessibility.ROLE_MENUITEM);
} }

View File

@@ -137,12 +137,12 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
final boolean clear = 0 <= currentRow && currentRow < table.getRowCount(); final boolean clear = 0 <= currentRow && currentRow < table.getRowCount();
if (clear) { if (clear) {
final Element tr = DOM.getParent(fmt.getElement(currentRow, C_ARROW)); final Element tr = DOM.getParent(fmt.getElement(currentRow, C_ARROW));
UIObject.setStyleName(tr, S_ACTIVE_ROW, false); UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), false);
} }
if (newRow >= 0) { if (newRow >= 0) {
table.setWidget(newRow, C_ARROW, pointer); table.setWidget(newRow, C_ARROW, pointer);
final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW)); final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
UIObject.setStyleName(tr, S_ACTIVE_ROW, true); UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);
if (scroll) { if (scroll) {
scrollIntoView(tr); scrollIntoView(tr);
} }

View File

@@ -31,7 +31,7 @@ public abstract class Screen extends View {
protected Screen() { protected Screen() {
initWidget(new FlowPanel()); initWidget(new FlowPanel());
setStyleName("gerrit-Screen"); setStyleName(Gerrit.RESOURCES.css().screen());
} }
@Override @Override
@@ -50,7 +50,7 @@ public abstract class Screen extends View {
me.add(header = new FlowPanel()); me.add(header = new FlowPanel());
me.add(body = new FlowPanel()); me.add(body = new FlowPanel());
header.setStyleName("gerrit-ScreenHeader"); header.setStyleName(Gerrit.RESOURCES.css().screenHeader());
header.add(headerText = new InlineLabel()); header.add(headerText = new InlineLabel());
} }

View File

@@ -14,11 +14,12 @@
package com.google.gerrit.client.ui; package com.google.gerrit.client.ui;
import com.google.gerrit.client.Gerrit;
import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Label;
public class SmallHeading extends Label { public class SmallHeading extends Label {
public SmallHeading() { public SmallHeading() {
setStyleName("gerrit-SmallHeading"); setStyleName(Gerrit.RESOURCES.css().smallHeading());
} }
public SmallHeading(final String text) { public SmallHeading(final String text) {

View File

@@ -46,9 +46,9 @@
</noscript> </noscript>
</div> </div>
<div id="gerrit_body"></div> <div id="gerrit_body"></div>
<div id="gerrit_pagefooter"> <div style="clear: both; margin-top: 15px; padding-top: 2px; margin-bottom: 15px;">
<div id="gerrit_footer"></div> <div id="gerrit_footer"></div>
<div id="gerrit_btmmenu"></div> <div id="gerrit_btmmenu" style="clear: both;"></div>
</div> </div>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
</body> </body>