<resource file="${basedir}/resources/book_16x16.png" />\r
<resource file="${basedir}/resources/bug_16x16.png" />\r
<resource file="${basedir}/resources/blank.png" />\r
+ <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />\r
\r
<class name="com.gitblit.client.GitblitClientLauncher" />\r
<classfilter>\r
downloadListener = listener;\r
downloadFromApache(MavenObject.GSON, BuildType.RUNTIME);\r
downloadFromApache(MavenObject.JSCH, BuildType.RUNTIME);\r
+ downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);\r
+ downloadFromApache(MavenObject.SLF4JNOP, BuildType.RUNTIME);\r
\r
downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);\r
}\r
"46a386136c901748e6a3af67ebde6c22bc6b4524",\r
"e223571d77769cdafde59040da235842f3326453");\r
\r
+ public static final MavenObject SLF4JNOP = new MavenObject("SLF4J NOP", "org/slf4j",\r
+ "slf4j-nop", "1.6.1", 4800, 4100, 32300,\r
+ "70249094d4e5653b6bdfea46f3a1a4165c1e1993",\r
+ "4a8e77f7bf6897a3c3b7fc3acb4c862dfb905baa",\r
+ "24b2b46f9025f2db53b5b32143f7832538fa3178");\r
+\r
public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j",\r
"slf4j-log4j12", "1.6.1", 9800, 9500, 52400,\r
"bd245d6746cdd4e6203e976e21d597a46f115802",\r
package com.gitblit.client;\r
\r
import java.awt.BorderLayout;\r
+import java.awt.Component;\r
import java.awt.Dimension;\r
import java.awt.FlowLayout;\r
import java.awt.Font;\r
import javax.swing.JComponent;\r
import javax.swing.JDialog;\r
import javax.swing.JLabel;\r
+import javax.swing.JList;\r
import javax.swing.JOptionPane;\r
import javax.swing.JPanel;\r
import javax.swing.JTextField;\r
+import javax.swing.ListCellRenderer;\r
\r
import com.gitblit.Constants.AccessRestrictionType;\r
import com.gitblit.Constants.FederationStrategy;\r
import com.gitblit.models.UserModel;\r
import com.gitblit.utils.StringUtils;\r
\r
+/**\r
+ * Dialog to create/edit a repository.\r
+ * \r
+ * @author James Moger\r
+ */\r
public class EditRepositoryDialog extends JDialog {\r
\r
private static final long serialVersionUID = 1L;\r
\r
public EditRepositoryDialog(List<UserModel> allusers) {\r
this(new RepositoryModel(), allusers);\r
- setTitle("Create Repository");\r
+ setTitle(Translation.get("gb.newRepository"));\r
}\r
\r
public EditRepositoryDialog(RepositoryModel aRepository, List<UserModel> allUsers) {\r
this.repository = new RepositoryModel();\r
initialize(aRepository, allUsers);\r
setModal(true);\r
- setTitle("Edit Repository: " + aRepository.name);\r
+ setTitle(Translation.get("gb.edit") + ": " + aRepository.name);\r
setIconImage(new ImageIcon(getClass().getResource("/gitblt-favicon.png")).getImage());\r
}\r
\r
owner.setSelectedItem(currentOwner);\r
}\r
\r
- useTickets = new JCheckBox("distributed Ticgit issues", anRepository.useTickets);\r
- useDocs = new JCheckBox("enumerates Markdown documentation in repository",\r
- anRepository.useDocs);\r
- showRemoteBranches = new JCheckBox("show remote branches", anRepository.showRemoteBranches);\r
- showReadme = new JCheckBox("show a \"readme\" Markdown file on the summary page",\r
+ useTickets = new JCheckBox(Translation.get("gb.useTicketsDescription"),\r
+ anRepository.useTickets);\r
+ useDocs = new JCheckBox(Translation.get("gb.useDocsDescription"), anRepository.useDocs);\r
+ showRemoteBranches = new JCheckBox(Translation.get("gb.showRemoteBranchesDescription"),\r
+ anRepository.showRemoteBranches);\r
+ showReadme = new JCheckBox(Translation.get("gb.showReadmeDescription"),\r
anRepository.showReadme);\r
- isFrozen = new JCheckBox("deny push operations", anRepository.isFrozen);\r
+ isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"), anRepository.isFrozen);\r
\r
accessRestriction = new JComboBox(AccessRestrictionType.values());\r
+ accessRestriction.setRenderer(new AccessRestrictionRenderer());\r
accessRestriction.setSelectedItem(anRepository.accessRestriction);\r
\r
federationStrategy = new JComboBox(FederationStrategy.values());\r
+ federationStrategy.setRenderer(new FederationStrategyRenderer());\r
federationStrategy.setSelectedItem(anRepository.federationStrategy);\r
\r
JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));\r
- fieldsPanel.add(newFieldPanel("name", nameField));\r
- fieldsPanel.add(newFieldPanel("description", descriptionField));\r
- fieldsPanel.add(newFieldPanel("owner", owner));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.name"), nameField));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.description"), descriptionField));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.owner"), owner));\r
\r
- fieldsPanel.add(newFieldPanel("enable tickets", useTickets));\r
- fieldsPanel.add(newFieldPanel("enable docs", useDocs));\r
- fieldsPanel.add(newFieldPanel("show remote branches", showRemoteBranches));\r
- fieldsPanel.add(newFieldPanel("show readme", showReadme));\r
- fieldsPanel.add(newFieldPanel("is frozen", isFrozen));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.enableTickets"), useTickets));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.enableDocs"), useDocs));\r
+ fieldsPanel\r
+ .add(newFieldPanel(Translation.get("gb.showRemoteBranches"), showRemoteBranches));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.showReadme"), showReadme));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen));\r
\r
usersPalette = new JPalette<String>();\r
JPanel accessPanel = new JPanel(new BorderLayout(5, 5));\r
- accessPanel.add(newFieldPanel("access restriction", accessRestriction), BorderLayout.NORTH);\r
- accessPanel.add(newFieldPanel("permitted users", usersPalette), BorderLayout.CENTER);\r
+ accessPanel.add(newFieldPanel(Translation.get("gb.accessRestriction"), accessRestriction),\r
+ BorderLayout.NORTH);\r
+ accessPanel.add(newFieldPanel(Translation.get("gb.permittedUsers"), usersPalette),\r
+ BorderLayout.CENTER);\r
\r
setsPalette = new JPalette<String>();\r
JPanel federationPanel = new JPanel(new BorderLayout(5, 5));\r
- federationPanel.add(newFieldPanel("federation strategy", federationStrategy),\r
+ federationPanel.add(\r
+ newFieldPanel(Translation.get("gb.federationStrategy"), federationStrategy),\r
BorderLayout.NORTH);\r
- federationPanel.add(newFieldPanel("federation sets", setsPalette), BorderLayout.CENTER);\r
+ federationPanel.add(newFieldPanel(Translation.get("gb.federationSets"), setsPalette),\r
+ BorderLayout.CENTER);\r
\r
JPanel panel = new JPanel(new BorderLayout(5, 5));\r
panel.add(fieldsPanel, BorderLayout.NORTH);\r
panel.add(accessPanel, BorderLayout.CENTER);\r
panel.add(federationPanel, BorderLayout.SOUTH);\r
\r
- JButton createButton = new JButton("Save");\r
+ JButton createButton = new JButton(Translation.get("gb.save"));\r
createButton.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
if (validateFields()) {\r
}\r
});\r
\r
- JButton cancelButton = new JButton("Cancel");\r
+ JButton cancelButton = new JButton(Translation.get("gb.cancel"));\r
cancelButton.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
canceled = true;\r
}\r
\r
private void showValidationError(String message) {\r
- JOptionPane.showMessageDialog(EditRepositoryDialog.this, message, "Validation Error",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(EditRepositoryDialog.this, message,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
\r
public void setUsers(List<String> all, List<String> selected) {\r
}\r
return repository;\r
}\r
+\r
+ /**\r
+ * ListCellRenderer to display descriptive text about the access\r
+ * restriction.\r
+ * \r
+ */\r
+ private class AccessRestrictionRenderer extends JLabel implements ListCellRenderer {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ @Override\r
+ public Component getListCellRendererComponent(JList list, Object value, int index,\r
+ boolean isSelected, boolean cellHasFocus) {\r
+ if (value instanceof AccessRestrictionType) {\r
+ AccessRestrictionType restriction = (AccessRestrictionType) value;\r
+ switch (restriction) {\r
+ case NONE:\r
+ setText(Translation.get("gb.notRestricted"));\r
+ break;\r
+ case PUSH:\r
+ setText(Translation.get("gb.pushRestricted"));\r
+ break;\r
+ case CLONE:\r
+ setText(Translation.get("gb.cloneRestricted"));\r
+ break;\r
+ case VIEW:\r
+ setText(Translation.get("gb.viewRestricted"));\r
+ break;\r
+ }\r
+ } else {\r
+ setText(value.toString());\r
+ }\r
+ return this;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * ListCellRenderer to display descriptive text about the federation\r
+ * strategy.\r
+ */\r
+ private class FederationStrategyRenderer extends JLabel implements ListCellRenderer {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ @Override\r
+ public Component getListCellRendererComponent(JList list, Object value, int index,\r
+ boolean isSelected, boolean cellHasFocus) {\r
+ if (value instanceof FederationStrategy) {\r
+ FederationStrategy strategy = (FederationStrategy) value;\r
+ switch (strategy) {\r
+ case EXCLUDE:\r
+ setText(Translation.get("gb.excludeFromFederation"));\r
+ break;\r
+ case FEDERATE_THIS:\r
+ setText(Translation.get("gb.federateThis"));\r
+ break;\r
+ case FEDERATE_ORIGIN:\r
+ setText(Translation.get("gb.federateOrigin"));\r
+ break;\r
+ }\r
+ } else {\r
+ setText(value.toString());\r
+ }\r
+ return this;\r
+ }\r
+ }\r
}\r
\r
public EditUserDialog(IStoredSettings settings) {\r
this(new UserModel(""), settings);\r
- setTitle("Create User");\r
+ setTitle(Translation.get("gb.newUser"));\r
}\r
\r
public EditUserDialog(UserModel anUser, IStoredSettings settings) {\r
this.settings = settings;\r
initialize(anUser);\r
setModal(true);\r
- setTitle("Edit User: " + anUser.username);\r
+ setTitle(Translation.get("gb.edit") + ": " + anUser.username);\r
setIconImage(new ImageIcon(getClass().getResource("/gitblt-favicon.png")).getImage());\r
}\r
\r
passwordField = new JPasswordField(anUser.password == null ? "" : anUser.password, 25);\r
confirmPasswordField = new JPasswordField(anUser.password == null ? "" : anUser.password,\r
25);\r
- canAdminCheckbox = new JCheckBox("can administer Gitblit server", anUser.canAdmin);\r
+ canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), anUser.canAdmin);\r
notFederatedCheckbox = new JCheckBox(\r
- "block federated Gitblit instances from pulling this account",\r
+ Translation.get("gb.excludeFromFederationDescription"),\r
anUser.excludeFromFederation);\r
\r
JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));\r
- fieldsPanel.add(newFieldPanel("username", usernameField));\r
- fieldsPanel.add(newFieldPanel("password", passwordField));\r
- fieldsPanel.add(newFieldPanel("confirm password", confirmPasswordField));\r
- fieldsPanel.add(newFieldPanel("can admin", canAdminCheckbox));\r
- fieldsPanel.add(newFieldPanel("exclude from federation", notFederatedCheckbox));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.username"), usernameField));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.password"), passwordField));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.confirmPassword"), confirmPasswordField));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.canAdmin"), canAdminCheckbox));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.excludeFromFederation"),\r
+ notFederatedCheckbox));\r
\r
repositoryPalette = new JPalette<String>();\r
JPanel panel = new JPanel(new BorderLayout());\r
panel.add(fieldsPanel, BorderLayout.NORTH);\r
- panel.add(newFieldPanel("restricted repositories", repositoryPalette), BorderLayout.CENTER);\r
+ panel.add(newFieldPanel(Translation.get("gb.restrictedRepositories"), repositoryPalette),\r
+ BorderLayout.CENTER);\r
\r
- JButton createButton = new JButton("Save");\r
+ JButton createButton = new JButton(Translation.get("gb.save"));\r
createButton.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
if (validateFields()) {\r
}\r
});\r
\r
- JButton cancelButton = new JButton("Cancel");\r
+ JButton cancelButton = new JButton(Translation.get("gb.cancel"));\r
cancelButton.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
canceled = true;\r
}\r
\r
// TODO verify username uniqueness on create\r
- \r
+\r
// if (isCreate) {\r
// UserModel model = GitBlit.self().getUserModel(username);\r
// if (model != null) {\r
}\r
\r
private void showValidationError(String message) {\r
- JOptionPane.showMessageDialog(EditUserDialog.this, message, "Validation Error",\r
+ JOptionPane.showMessageDialog(EditUserDialog.this, message, Translation.get("gb.error"),\r
JOptionPane.ERROR_MESSAGE);\r
}\r
\r
import java.awt.BorderLayout;\r
import java.awt.Dimension;\r
import java.awt.EventQueue;\r
+import java.awt.Font;\r
import java.awt.GridLayout;\r
import java.awt.event.ActionEvent;\r
import java.awt.event.ActionListener;\r
\r
private JMenuBar setupMenu() {\r
JMenuBar menuBar = new JMenuBar();\r
- JMenu serversMenu = new JMenu("Servers");\r
+ JMenu serversMenu = new JMenu(Translation.get("gb.servers"));\r
menuBar.add(serversMenu);\r
- recentMenu = new JMenu("Recent");\r
+ recentMenu = new JMenu(Translation.get("gb.recent"));\r
serversMenu.add(recentMenu);\r
- JMenuItem login = new JMenuItem("Login...");\r
+ JMenuItem login = new JMenuItem(Translation.get("gb.login") + "...");\r
login.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_DOWN_MASK, false));\r
login.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
\r
private JPanel newLabelPanel(String text, JTextField field) {\r
JLabel label = new JLabel(text);\r
+ label.setFont(label.getFont().deriveFont(Font.BOLD));\r
label.setPreferredSize(new Dimension(75, 10));\r
JPanel jpanel = new JPanel(new BorderLayout());\r
jpanel.add(label, BorderLayout.WEST);\r
JPasswordField passwordField = new JPasswordField(new String(reg.password));\r
\r
JPanel panel = new JPanel(new GridLayout(0, 1, 5, 5));\r
- panel.add(newLabelPanel("name", nameField));\r
- panel.add(newLabelPanel("url", urlField));\r
- panel.add(newLabelPanel("account", accountField));\r
- panel.add(newLabelPanel("password", passwordField));\r
+ panel.add(newLabelPanel(Translation.get("gb.name"), nameField));\r
+ panel.add(newLabelPanel(Translation.get("gb.url"), urlField));\r
+ panel.add(newLabelPanel(Translation.get("gb.username"), accountField));\r
+ panel.add(newLabelPanel(Translation.get("gb.password"), passwordField));\r
\r
- int result = JOptionPane.showConfirmDialog(GitblitClient.this, panel, "Login",\r
- JOptionPane.OK_CANCEL_OPTION);\r
+ int result = JOptionPane.showConfirmDialog(GitblitClient.this, panel,\r
+ Translation.get("gb.login"), JOptionPane.OK_CANCEL_OPTION);\r
if (result != JOptionPane.OK_OPTION) {\r
return false;\r
}\r
panel));\r
return true;\r
} catch (IOException e) {\r
- JOptionPane.showMessageDialog(GitblitClient.this, e.getMessage(), "Error",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitClient.this, e.getMessage(),\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
return false;\r
}\r
DownloadListener downloadListener = new DownloadListener() {\r
@Override\r
public void downloading(String name) {\r
- updateSplash(splash, "Downloading " + name + "..."); \r
+ updateSplash(splash, Translation.get("gb.downloading") + " " + name + "..."); \r
}\r
};\r
\r
// download rpc client runtime dependencies\r
Build.rpcClient(downloadListener);\r
\r
- updateSplash(splash, "Scanning Library Folder...");\r
File libFolder = new File("ext");\r
List<File> jars = Launcher.findJars(libFolder.getAbsoluteFile());\r
\r
Collections.reverse(jars);\r
for (File jar : jars) {\r
try {\r
- updateSplash(splash, "Loading " + jar.getName() + "...");\r
+ updateSplash(splash, Translation.get("gb.loading") + " " + jar.getName() + "...");\r
Launcher.addJarFile(jar);\r
} catch (IOException e) {\r
\r
}\r
}\r
\r
- updateSplash(splash, "Starting Gitblit RPC Client...");\r
+ updateSplash(splash, Translation.get("gb.starting") + " Gitblit RPC Client...");\r
GitblitClient.main(args);\r
}\r
\r
\r
private NameRenderer nameRenderer;\r
\r
- private TypeRenderer typeRenderer;\r
+ private IndicatorsRenderer typeRenderer;\r
\r
private DefaultTableCellRenderer ownerRenderer;\r
\r
this.account = account;\r
this.password = password;\r
\r
- final JButton browseRepository = new JButton("Browse");\r
+ final JButton browseRepository = new JButton(Translation.get("gb.browse"));\r
browseRepository.setEnabled(false);\r
browseRepository.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
}\r
});\r
\r
- JButton refreshRepositories = new JButton("Refresh");\r
+ JButton refreshRepositories = new JButton(Translation.get("gb.refresh"));\r
refreshRepositories.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
try {\r
}\r
});\r
\r
- createRepository = new JButton("Create");\r
+ createRepository = new JButton(Translation.get("gb.create"));\r
createRepository.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
createRepository();\r
}\r
});\r
\r
- final JButton editRepository = new JButton("Edit");\r
+ final JButton editRepository = new JButton(Translation.get("gb.edit"));\r
editRepository.setEnabled(false);\r
editRepository.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
}\r
});\r
\r
- delRepository = new JButton("Delete");\r
+ delRepository = new JButton(Translation.get("gb.delete"));\r
delRepository.setEnabled(false);\r
delRepository.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
}\r
});\r
\r
- final JButton cloneRepository = new JButton("Clone");\r
+ final JButton cloneRepository = new JButton(Translation.get("gb.clone"));\r
cloneRepository.setEnabled(false);\r
cloneRepository.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
});\r
\r
nameRenderer = new NameRenderer();\r
- typeRenderer = new TypeRenderer();\r
+ typeRenderer = new IndicatorsRenderer();\r
\r
sizeRenderer = new DefaultTableCellRenderer();\r
sizeRenderer.setHorizontalAlignment(SwingConstants.RIGHT);\r
repositoriesTable.setDefaultRenderer(Date.class,\r
new DateCellRenderer(null, Color.orange.darker()));\r
setRenderer(RepositoriesModel.Columns.Name, nameRenderer);\r
- setRenderer(RepositoriesModel.Columns.Type, typeRenderer);\r
+ setRenderer(RepositoriesModel.Columns.Indicators, typeRenderer);\r
setRenderer(RepositoriesModel.Columns.Owner, ownerRenderer);\r
setRenderer(RepositoriesModel.Columns.Size, sizeRenderer);\r
\r
});\r
\r
JPanel filterPanel = new JPanel(new BorderLayout(margin, margin));\r
- filterPanel.add(new JLabel("Filter"), BorderLayout.WEST);\r
+ filterPanel.add(new JLabel(Translation.get("gb.filter")), BorderLayout.WEST);\r
filterPanel.add(repositoryFilter, BorderLayout.CENTER);\r
\r
JPanel tablePanel = new JPanel(new BorderLayout(margin, margin));\r
repositoryControls.add(delRepository);\r
\r
JPanel repositoriesPanel = new JPanel(new BorderLayout(margin, margin));\r
- repositoriesPanel.add(newHeaderLabel("Repositories"), BorderLayout.NORTH);\r
+ repositoriesPanel.add(newHeaderLabel(Translation.get("gb.repositories")),\r
+ BorderLayout.NORTH);\r
repositoriesPanel.add(tablePanel, BorderLayout.CENTER);\r
repositoriesPanel.add(repositoryControls, BorderLayout.SOUTH);\r
\r
- JButton refreshUsers = new JButton("Refresh");\r
+ JButton refreshUsers = new JButton(Translation.get("gb.refresh"));\r
refreshUsers.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
try {\r
}\r
});\r
\r
- JButton createUser = new JButton("Create");\r
+ JButton createUser = new JButton(Translation.get("gb.create"));\r
createUser.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
createUser();\r
}\r
});\r
\r
- final JButton editUser = new JButton("Edit");\r
+ final JButton editUser = new JButton(Translation.get("gb.edit"));\r
editUser.setEnabled(false);\r
editUser.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
}\r
});\r
\r
- final JButton delUser = new JButton("Delete");\r
+ final JButton delUser = new JButton(Translation.get("gb.delete"));\r
delUser.setEnabled(false);\r
delUser.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent e) {\r
userControls.add(delUser);\r
\r
usersPanel = new JPanel(new BorderLayout(margin, margin));\r
- usersPanel.add(newHeaderLabel("Users"), BorderLayout.NORTH);\r
+ usersPanel.add(newHeaderLabel(Translation.get("gb.users")), BorderLayout.NORTH);\r
usersPanel.add(new JScrollPane(usersList), BorderLayout.CENTER);\r
usersPanel.add(userControls, BorderLayout.SOUTH);\r
\r
mainPanel.add(usersPanel, BorderLayout.EAST);\r
\r
tabs = new JTabbedPane(JTabbedPane.BOTTOM);\r
- tabs.addTab("Main", mainPanel);\r
- tabs.addTab("Federation", new JPanel());\r
+ tabs.addTab(Translation.get("gb.repositories"), mainPanel);\r
+ tabs.addTab(Translation.get("gb.federation"), new JPanel());\r
\r
setLayout(new BorderLayout());\r
add(tabs, BorderLayout.CENTER);\r
String msg = MessageFormat.format(\r
"Failed to execute request \"{0}\" for repository \"{1}\".",\r
request.name(), newRepository.name);\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
String msg = MessageFormat.format(\r
"Failed to execute request \"{0}\" for repository \"{1}\".",\r
request.name(), repository.name);\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
refreshRepositoriesTable();\r
} else {\r
String msg = "Failed to delete specified repositories!";\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
String msg = MessageFormat.format(\r
"Failed to execute request \"{0}\" for user \"{1}\".",\r
request.name(), newUser.username);\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
String msg = MessageFormat.format(\r
"Failed to execute request \"{0}\" for user \"{1}\".",\r
request.name(), user.username);\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
refreshUsersTable();\r
} else {\r
String msg = "Failed to delete specified users!";\r
- JOptionPane.showMessageDialog(GitblitPanel.this, msg, "Error!",\r
- JOptionPane.ERROR_MESSAGE);\r
+ JOptionPane.showMessageDialog(GitblitPanel.this, msg,\r
+ Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (ForbiddenException e) {\r
explainForbidden(request);\r
--- /dev/null
+/*\r
+ * Copyright 2011 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit.client;\r
+\r
+import java.awt.Component;\r
+import java.awt.GridLayout;\r
+import java.io.Serializable;\r
+\r
+import javax.swing.ImageIcon;\r
+import javax.swing.JLabel;\r
+import javax.swing.JPanel;\r
+import javax.swing.JTable;\r
+import javax.swing.table.TableCellRenderer;\r
+\r
+import com.gitblit.models.RepositoryModel;\r
+\r
+/**\r
+ * Renders the type indicators (tickets, frozen, access restriction, etc) in a\r
+ * single cell.\r
+ * \r
+ * @author James Moger\r
+ * \r
+ */\r
+public class IndicatorsRenderer extends JPanel implements TableCellRenderer, Serializable {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ private final ImageIcon blankIcon;\r
+\r
+ private final ImageIcon pushIcon;\r
+\r
+ private final ImageIcon pullIcon;\r
+\r
+ private final ImageIcon viewIcon;\r
+\r
+ private final ImageIcon tixIcon;\r
+\r
+ private final ImageIcon doxIcon;\r
+\r
+ private final ImageIcon frozenIcon;\r
+\r
+ private final ImageIcon federatedIcon;\r
+\r
+ public IndicatorsRenderer() {\r
+ super(new GridLayout(1, 0, 1, 0));\r
+ blankIcon = new ImageIcon(getClass().getResource("/blank.png"));\r
+ pushIcon = new ImageIcon(getClass().getResource("/lock_go_16x16.png"));\r
+ pullIcon = new ImageIcon(getClass().getResource("/lock_pull_16x16.png"));\r
+ viewIcon = new ImageIcon(getClass().getResource("/shield_16x16.png"));\r
+ tixIcon = new ImageIcon(getClass().getResource("/bug_16x16.png"));\r
+ doxIcon = new ImageIcon(getClass().getResource("/book_16x16.png"));\r
+ frozenIcon = new ImageIcon(getClass().getResource("/cold_16x16.png"));\r
+ federatedIcon = new ImageIcon(getClass().getResource("/federated_16x16.png"));\r
+ }\r
+\r
+ @Override\r
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,\r
+ boolean hasFocus, int row, int column) {\r
+ if (isSelected)\r
+ setBackground(table.getSelectionBackground());\r
+ else\r
+ setBackground(table.getBackground());\r
+ removeAll();\r
+ if (value instanceof RepositoryModel) {\r
+ StringBuilder tooltip = new StringBuilder();\r
+ RepositoryModel model = (RepositoryModel) value;\r
+ if (model.useTickets) {\r
+ JLabel icon = new JLabel(tixIcon);\r
+ tooltip.append(Translation.get("gb.tickets")).append("<br/>");\r
+ add(icon);\r
+ } else {\r
+ add(new JLabel(blankIcon));\r
+ }\r
+ if (model.useDocs) {\r
+ JLabel icon = new JLabel(doxIcon);\r
+ tooltip.append(Translation.get("gb.docs")).append("<br/>");\r
+ add(icon);\r
+ } else {\r
+ add(new JLabel(blankIcon));\r
+ }\r
+ if (model.isFrozen) {\r
+ JLabel icon = new JLabel(frozenIcon);\r
+ tooltip.append(Translation.get("gb.isFrozen")).append("<br/>");\r
+ add(icon);\r
+ } else {\r
+ add(new JLabel(blankIcon));\r
+ }\r
+ if (model.isFederated) {\r
+ JLabel icon = new JLabel(federatedIcon);\r
+ tooltip.append(Translation.get("gb.isFederated")).append("<br/>");\r
+ add(icon);\r
+ } else {\r
+ add(new JLabel(blankIcon));\r
+ }\r
+\r
+ switch (model.accessRestriction) {\r
+ case NONE: {\r
+ add(new JLabel(blankIcon));\r
+ break;\r
+ }\r
+ case PUSH: {\r
+ JLabel icon = new JLabel(pushIcon);\r
+ tooltip.append(Translation.get("gb.pushRestricted")).append("<br/>");\r
+ add(icon);\r
+ break;\r
+ }\r
+ case CLONE: {\r
+ JLabel icon = new JLabel(pullIcon);\r
+ tooltip.append(Translation.get("gb.pullRestricted")).append("<br/>");\r
+ add(icon);\r
+ break;\r
+ }\r
+ case VIEW: {\r
+ JLabel icon = new JLabel(viewIcon);\r
+ tooltip.append(Translation.get("gb.viewRestricted")).append("<br/>");\r
+ add(icon);\r
+ break;\r
+ }\r
+ default:\r
+ add(new JLabel(blankIcon));\r
+ }\r
+ if (tooltip.length() > 0) {\r
+ tooltip.insert(0, "<html><body>");\r
+ setToolTipText(tooltip.toString().trim());\r
+ }\r
+ }\r
+ return this;\r
+ }\r
+}
\ No newline at end of file
import java.awt.BorderLayout;\r
import java.awt.Color;\r
import java.awt.Dimension;\r
+import java.awt.Font;\r
import java.awt.GridBagLayout;\r
import java.awt.GridLayout;\r
import java.awt.event.ActionEvent;\r
JPanel center = new JPanel(new GridBagLayout());\r
center.add(controls);\r
\r
- add(newListPanel("Available", available), BorderLayout.WEST);\r
+ add(newListPanel(Translation.get("gb.available"), available), BorderLayout.WEST);\r
add(center, BorderLayout.CENTER);\r
- add(newListPanel("Selected", selected), BorderLayout.EAST);\r
+ add(newListPanel(Translation.get("gb.selected"), selected), BorderLayout.EAST);\r
}\r
\r
private JPanel newListPanel(String label, JTable table) {\r
JScrollPane jsp = new JScrollPane(table);\r
jsp.setPreferredSize(new Dimension(225, 175));\r
JPanel panel = new JPanel(new BorderLayout());\r
- panel.add(new JLabel(label), BorderLayout.NORTH);\r
+ JLabel jlabel = new JLabel(label);\r
+ jlabel.setFont(jlabel.getFont().deriveFont(Font.BOLD));\r
+ panel.add(jlabel, BorderLayout.NORTH);\r
panel.add(jsp, BorderLayout.CENTER);\r
return panel;\r
}\r
\r
@Override\r
public String getColumnName(int column) {\r
- return "Name";\r
+ return Translation.get("gb.name");\r
}\r
\r
public Class<?> getColumnClass(int columnIndex) {\r
List<RepositoryModel> list;\r
\r
enum Columns {\r
- Name, Description, Owner, Type, Last_Change, Size;\r
+ Name, Description, Owner, Indicators, Last_Change, Size;\r
\r
@Override\r
public String toString() {\r
@Override\r
public String getColumnName(int column) {\r
Columns col = Columns.values()[column];\r
- return col.toString();\r
+ switch (col) {\r
+ case Name:\r
+ return Translation.get("gb.name");\r
+ case Description:\r
+ return Translation.get("gb.description");\r
+ case Owner:\r
+ return Translation.get("gb.owner");\r
+ case Last_Change:\r
+ return Translation.get("gb.lastChange");\r
+ case Size:\r
+ return Translation.get("gb.size");\r
+ }\r
+ return "";\r
}\r
\r
/**\r
Columns col = Columns.values()[columnIndex];\r
switch (col) {\r
case Name:\r
- case Type:\r
+ case Indicators:\r
return RepositoryModel.class;\r
case Last_Change:\r
return Date.class;\r
return model.description;\r
case Owner:\r
return model.owner;\r
- case Type:\r
+ case Indicators:\r
return model;\r
case Last_Change:\r
return model.lastChange;\r
--- /dev/null
+/*\r
+ * Copyright 2011 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit.client;\r
+\r
+import java.io.InputStream;\r
+import java.util.Properties;\r
+\r
+public class Translation {\r
+\r
+ private final static Properties translation;\r
+\r
+ static {\r
+ translation = new Properties();\r
+ InputStream is = null;\r
+ try {\r
+ is = Translation.class.getResource("/com/gitblit/wicket/GitBlitWebApp.properties")\r
+ .openStream();\r
+ } catch (Throwable t) {\r
+ try {\r
+ is = Translation.class.getResource("/GitBlitWebApp.properties").openStream();\r
+ } catch (Throwable x) {\r
+ }\r
+ }\r
+ if (is != null) {\r
+ try {\r
+ translation.load(is);\r
+ } catch (Throwable t) {\r
+\r
+ } finally {\r
+ try {\r
+ is.close();\r
+ } catch (Throwable t) {\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ public static String get(String key) {\r
+ if (translation.containsKey(key)) {\r
+ return translation.getProperty(key).trim();\r
+ }\r
+ return key;\r
+ }\r
+}\r
+++ /dev/null
-/*\r
- * Copyright 2011 gitblit.com.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package com.gitblit.client;\r
-\r
-import java.awt.Component;\r
-import java.awt.GridLayout;\r
-import java.io.Serializable;\r
-\r
-import javax.swing.ImageIcon;\r
-import javax.swing.JLabel;\r
-import javax.swing.JPanel;\r
-import javax.swing.JTable;\r
-import javax.swing.table.TableCellRenderer;\r
-\r
-import com.gitblit.models.RepositoryModel;\r
-\r
-/**\r
- * Renders the type indicators (tickets, frozen, access restriction, etc) in a\r
- * single cell.\r
- * \r
- * @author James Moger\r
- * \r
- */\r
-public class TypeRenderer extends JPanel implements TableCellRenderer, Serializable {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- private final ImageIcon blankIcon;\r
-\r
- private final ImageIcon pushIcon;\r
-\r
- private final ImageIcon pullIcon;\r
-\r
- private final ImageIcon viewIcon;\r
-\r
- private final ImageIcon tixIcon;\r
-\r
- private final ImageIcon doxIcon;\r
-\r
- private final ImageIcon frozenIcon;\r
-\r
- private final ImageIcon federatedIcon;\r
-\r
- public TypeRenderer() {\r
- super(new GridLayout(1, 0, 1, 0));\r
- blankIcon = new ImageIcon(getClass().getResource("/blank.png"));\r
- pushIcon = new ImageIcon(getClass().getResource("/lock_go_16x16.png"));\r
- pullIcon = new ImageIcon(getClass().getResource("/lock_pull_16x16.png"));\r
- viewIcon = new ImageIcon(getClass().getResource("/shield_16x16.png"));\r
- tixIcon = new ImageIcon(getClass().getResource("/bug_16x16.png"));\r
- doxIcon = new ImageIcon(getClass().getResource("/book_16x16.png"));\r
- frozenIcon = new ImageIcon(getClass().getResource("/cold_16x16.png"));\r
- federatedIcon = new ImageIcon(getClass().getResource("/federated_16x16.png"));\r
- }\r
-\r
- @Override\r
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,\r
- boolean hasFocus, int row, int column) {\r
- if (isSelected)\r
- setBackground(table.getSelectionBackground());\r
- else\r
- setBackground(table.getBackground());\r
- removeAll();\r
- if (value instanceof RepositoryModel) {\r
- RepositoryModel model = (RepositoryModel) value;\r
- if (model.useTickets) {\r
- add(new JLabel(tixIcon));\r
- } else {\r
- add(new JLabel(blankIcon));\r
- }\r
- if (model.useDocs) {\r
- add(new JLabel(doxIcon));\r
- } else {\r
- add(new JLabel(blankIcon));\r
- }\r
- if (model.isFrozen) {\r
- add(new JLabel(frozenIcon));\r
- } else {\r
- add(new JLabel(blankIcon));\r
- }\r
- if (model.isFederated) {\r
- add(new JLabel(federatedIcon));\r
- } else {\r
- add(new JLabel(blankIcon));\r
- }\r
-\r
- switch (model.accessRestriction) {\r
- case NONE:\r
- add(new JLabel(blankIcon));\r
- break;\r
- case PUSH:\r
- add(new JLabel(pushIcon));\r
- break;\r
- case CLONE:\r
- add(new JLabel(pullIcon));\r
- break;\r
- case VIEW:\r
- add(new JLabel(viewIcon));\r
- break;\r
- default:\r
- add(new JLabel(blankIcon));\r
- }\r
- }\r
- return this;\r
- }\r
-}
\ No newline at end of file
gb.destinationUrl = send to\r
gb.destinationUrlDescription = the url of the Gitblit instance to send your proposal\r
gb.users = users\r
-gb.federation = federation
\ No newline at end of file
+gb.federation = federation\r
+gb.error = error\r
+gb.refresh = refresh\r
+gb.browse = browse\r
+gb.clone = clone\r
+gb.filter = filter\r
+gb.create = create\r
+gb.servers = servers\r
+gb.recent = recent\r
+gb.available = available\r
+gb.selected = selected\r
+gb.size = size\r
+gb.downloading = downloading\r
+gb.loading = loading\r
+gb.starting = starting
\ No newline at end of file