]> source.dussan.org Git - gitblit.git/commitdiff
Localized RPC client using server's resource file.
authorJames Moger <james.moger@gitblit.com>
Thu, 13 Oct 2011 21:01:51 +0000 (17:01 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 13 Oct 2011 21:01:51 +0000 (17:01 -0400)
13 files changed:
build.xml
src/com/gitblit/build/Build.java
src/com/gitblit/client/EditRepositoryDialog.java
src/com/gitblit/client/EditUserDialog.java
src/com/gitblit/client/GitblitClient.java
src/com/gitblit/client/GitblitClientLauncher.java
src/com/gitblit/client/GitblitPanel.java
src/com/gitblit/client/IndicatorsRenderer.java [new file with mode: 0644]
src/com/gitblit/client/JPalette.java
src/com/gitblit/client/RepositoriesModel.java
src/com/gitblit/client/Translation.java [new file with mode: 0644]
src/com/gitblit/client/TypeRenderer.java [deleted file]
src/com/gitblit/wicket/GitBlitWebApp.properties

index 96da02dd2841eb89f45d7aeddaf7d5ac786ac336..97df46c64945db6c1026d26be5b4e06330d3006b 100644 (file)
--- a/build.xml
+++ b/build.xml
                        <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
index 5589c5fc0103f981afbfa399260591ec8b0e5237..1f6642d26a6d2febc6ca070a8e7e8451bd527a8d 100644 (file)
@@ -139,6 +139,8 @@ public class Build {
                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
@@ -389,6 +391,12 @@ public class Build {
                                "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
index 756128a33f9fad361730e120bb492cc8c59bd595..49d9047991852a4dfa68e7a5f3c9eb4bf354eca0 100644 (file)
@@ -16,6 +16,7 @@
 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
@@ -32,9 +33,11 @@ import javax.swing.JComboBox;
 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
@@ -42,6 +45,11 @@ import com.gitblit.models.RepositoryModel;
 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
@@ -76,7 +84,7 @@ public class EditRepositoryDialog extends JDialog {
 \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
@@ -84,7 +92,7 @@ public class EditRepositoryDialog extends JDialog {
                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
@@ -105,48 +113,56 @@ public class EditRepositoryDialog extends JDialog {
                        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
@@ -156,7 +172,7 @@ public class EditRepositoryDialog extends JDialog {
                        }\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
@@ -203,8 +219,8 @@ public class EditRepositoryDialog extends JDialog {
        }\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
@@ -221,4 +237,70 @@ public class EditRepositoryDialog extends JDialog {
                }\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
index 5fce8c541f2199356a83a2607bdade57e73bbb0b..e2f6417d6a09d9a02baf7cd538147e66b119e8bb 100644 (file)
@@ -70,7 +70,7 @@ public class EditUserDialog extends JDialog {
 \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
@@ -79,7 +79,7 @@ public class EditUserDialog extends JDialog {
                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
@@ -88,24 +88,26 @@ public class EditUserDialog extends JDialog {
                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
@@ -115,7 +117,7 @@ public class EditUserDialog extends JDialog {
                        }\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
@@ -164,7 +166,7 @@ public class EditUserDialog extends JDialog {
                }\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
@@ -210,7 +212,7 @@ public class EditUserDialog extends JDialog {
        }\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
index 65a8c36a5fb02482be3be9cd45db5343d4d74a4d..d66fdeaddc54f90ff5c0b9662986eeae104e2b41 100644 (file)
@@ -18,6 +18,7 @@ package com.gitblit.client;
 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
@@ -92,11 +93,11 @@ public class GitblitClient extends JFrame {
 \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
@@ -109,6 +110,7 @@ public class GitblitClient extends JFrame {
 \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
@@ -132,13 +134,13 @@ public class GitblitClient extends JFrame {
                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
@@ -165,8 +167,8 @@ public class GitblitClient extends JFrame {
                                        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
index 24832d198ddecdbe3a3b8e97eff934e897d3cb2e..463dc963f186a3b4234727f73de6757d488eaa32 100644 (file)
@@ -44,14 +44,13 @@ public class GitblitClientLauncher {
                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
@@ -61,14 +60,14 @@ public class GitblitClientLauncher {
                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
index d29f2a90366b2358f313bb502d49d2b3a7efc8e0..ec7385ea8437a621682dbf38bb5dcbb6c97107d5 100644 (file)
@@ -108,7 +108,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
 \r
        private NameRenderer nameRenderer;\r
 \r
-       private TypeRenderer typeRenderer;\r
+       private IndicatorsRenderer typeRenderer;\r
 \r
        private DefaultTableCellRenderer ownerRenderer;\r
 \r
@@ -127,7 +127,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                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
@@ -142,7 +142,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -157,14 +157,14 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -172,7 +172,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -180,7 +180,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -191,7 +191,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                });\r
 \r
                nameRenderer = new NameRenderer();\r
-               typeRenderer = new TypeRenderer();\r
+               typeRenderer = new IndicatorsRenderer();\r
 \r
                sizeRenderer = new DefaultTableCellRenderer();\r
                sizeRenderer.setHorizontalAlignment(SwingConstants.RIGHT);\r
@@ -216,7 +216,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                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
@@ -252,7 +252,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                });\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
@@ -267,11 +267,12 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                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
@@ -286,14 +287,14 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -301,7 +302,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                        }\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
@@ -331,7 +332,7 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                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
@@ -343,8 +344,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                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
@@ -541,8 +542,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                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
@@ -597,8 +598,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                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
@@ -642,8 +643,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                        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
@@ -690,8 +691,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                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
@@ -738,8 +739,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                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
@@ -783,8 +784,8 @@ public class GitblitPanel extends JPanel implements CloseTabListener {
                                                        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
diff --git a/src/com/gitblit/client/IndicatorsRenderer.java b/src/com/gitblit/client/IndicatorsRenderer.java
new file mode 100644 (file)
index 0000000..8c13122
--- /dev/null
@@ -0,0 +1,142 @@
+/*\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
index 19456e1bc966be4f3746e7de02a0f1478fcbdf5d..eb445b45b58b701eca70bd986a06729662a8b6cb 100644 (file)
@@ -18,6 +18,7 @@ package com.gitblit.client;
 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
@@ -92,9 +93,9 @@ public class JPalette<T> extends JPanel {
                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
@@ -110,7 +111,9 @@ public class JPalette<T> extends JPanel {
                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
@@ -161,7 +164,7 @@ public class JPalette<T> extends JPanel {
 \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
index d8e448fced4564bed27b3f92628e357900bd828d..c1fead91ddc086938aab4ee315621f6ec8abc249 100644 (file)
@@ -37,7 +37,7 @@ public class RepositoriesModel extends AbstractTableModel {
        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
@@ -67,7 +67,19 @@ public class RepositoriesModel extends AbstractTableModel {
        @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
@@ -81,7 +93,7 @@ public class RepositoriesModel extends AbstractTableModel {
                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
@@ -100,7 +112,7 @@ public class RepositoriesModel extends AbstractTableModel {
                        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
diff --git a/src/com/gitblit/client/Translation.java b/src/com/gitblit/client/Translation.java
new file mode 100644 (file)
index 0000000..cd5515b
--- /dev/null
@@ -0,0 +1,57 @@
+/*\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
diff --git a/src/com/gitblit/client/TypeRenderer.java b/src/com/gitblit/client/TypeRenderer.java
deleted file mode 100644 (file)
index 8f92dcf..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*\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
index 30fac60022d2ec23a9e30735e46666010b6de505..c7ee6ce12bdff56755b0c086f0cec4761f3207dd 100644 (file)
@@ -140,4 +140,18 @@ gb.myUrlDescription = the publicly accessible url for your Gitblit instance
 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