Trim trailing whitespace and organize imports
Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
| | |
| | | * @return true or false
|
| | | * @since 1.0.0
|
| | | */
|
| | | @Override
|
| | | public boolean supportsTeamMembershipChanges() {
|
| | | return true;
|
| | | }
|
| | |
| | | return this.ordinal() >= type.ordinal();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return name();
|
| | | }
|
| | |
| | | return NAMED;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return name();
|
| | | }
|
| | |
| | | return REPOSITORIES;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return name();
|
| | | }
|
| | |
| | | return PULL_REPOSITORIES;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return name();
|
| | | }
|
| | |
| | | /**
|
| | | * Updates the specified settings in the settings file.
|
| | | */
|
| | | @Override
|
| | | public synchronized boolean saveSettings(Map<String, String> settings) {
|
| | | String content = FileUtils.readContent(propertiesFile, "\n");
|
| | | for (Map.Entry<String, String> setting:settings.entrySet()) {
|
| | |
| | | delay = (int) ((cd.getTime() - now.getTime())/TimeUtils.MIN); |
| | | String when = delay + " mins"; |
| | | if (delay > 60) { |
| | | when = MessageFormat.format("{0,number,0.0} hours", ((float)delay)/60f); |
| | | when = MessageFormat.format("{0,number,0.0} hours", (delay)/60f); |
| | | } |
| | | logger.info(MessageFormat.format("Next scheculed GC scan is in {0}", when)); |
| | | scheduledExecutor.scheduleAtFixedRate(gcExecutor, delay, 60*24, TimeUnit.MINUTES); |
| | |
| | | * If the key is set to false, then it is determined if the account is local |
| | | * according to the logic of the GitblitUserService. |
| | | */ |
| | | @Override |
| | | protected boolean isLocalAccount(String username) |
| | | { |
| | | if ( settings.getBoolean(KEY_OVERRIDE_LOCALAUTH, DEFAULT_OVERRIDE_LOCALAUTH) ) { |
| | |
| | | * |
| | | * @return AccountType.HTPASSWD |
| | | */ |
| | | @Override |
| | | protected AccountType getAccountType() |
| | | { |
| | | return AccountType.HTPASSWD; |
| | |
| | | * @See java.lang.Object.toString();
|
| | | * @return string representation of the login service
|
| | | */
|
| | | @Override
|
| | | String toString();
|
| | | }
|
| | |
| | | * @return true or false
|
| | | * @since 1.0.0
|
| | | */
|
| | | @Override
|
| | | public boolean supportsTeamMembershipChanges() {
|
| | | return !settings.getBoolean(Keys.realm.ldap.maintainTeams, false);
|
| | | }
|
| | |
| | | if (!StringUtils.isEmpty(mailUser) && !StringUtils.isEmpty(mailPassword)) {
|
| | | // SMTP requires authentication
|
| | | session = Session.getInstance(props, new Authenticator() {
|
| | | @Override
|
| | | protected PasswordAuthentication getPasswordAuthentication() {
|
| | | PasswordAuthentication passwordAuthentication = new PasswordAuthentication(
|
| | | mailUser, mailPassword);
|
| | |
| | | /*
|
| | | * Copyright 2012 gitblit.com.
|
| | | *
|
| | | * Licensed under the Apache License, Version 2.0 (the "License");
|
| | | * you may not use this file except in compliance with the License.
|
| | | * You may obtain a copy of the License at
|
| | | *
|
| | | * http://www.apache.org/licenses/LICENSE-2.0
|
| | | *
|
| | | * Unless required by applicable law or agreed to in writing, software
|
| | | * distributed under the License is distributed on an "AS IS" BASIS,
|
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| | | * See the License for the specific language governing permissions and
|
| | | * limitations under the License.
|
| | | */
|
| | | package com.gitblit;
|
| | |
|
| | | import java.io.File;
|
| | |
| | | import com.sforce.ws.ConnectorConfig; |
| | | |
| | | public class SalesforceUserService extends GitblitUserService { |
| | | public static final Logger logger = LoggerFactory |
| | | .getLogger(SalesforceUserService.class); |
| | | |
| | | public static final Logger logger = LoggerFactory.getLogger(SalesforceUserService.class); |
| | | private IStoredSettings settings; |
| | | |
| | | @Override |
| | | protected AccountType getAccountType() { |
| | | return AccountType.SALESFORCE; |
| | | } |
| | |
| | | return doRequest();
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected void done() {
|
| | | parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
| | | try {
|
| | |
| | | okIcon = new ImageIcon(getClass().getResource("/bullet_green.png"));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | Columns col = Columns.values()[columnIndex];
|
| | | switch (col) {
|
| | |
| | | }
|
| | | final String baseFolder = folder;
|
| | | EventQueue.invokeLater(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
| | |
| | | certificateConfig.update(metadata);
|
| | | }
|
| | | InputVerifier verifier = new InputVerifier() {
|
| | | @Override
|
| | | public boolean verify(JComponent comp) {
|
| | | boolean returnValue;
|
| | | JTextField textField = (JTextField) comp;
|
| | |
| | |
|
| | | final JTextField filterTextfield = new JTextField(15);
|
| | | filterTextfield.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | filterUsers(filterTextfield.getText());
|
| | | }
|
| | | });
|
| | | filterTextfield.addKeyListener(new KeyAdapter() {
|
| | | @Override
|
| | | public void keyReleased(KeyEvent e) {
|
| | | filterUsers(filterTextfield.getText());
|
| | | }
|
| | |
| | |
|
| | | JPanel root = new JPanel(new BorderLayout()) {
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return Utils.INSETS;
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | RowFilter<UserCertificateTableModel, Object> containsFilter = new RowFilter<UserCertificateTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(Entry<? extends UserCertificateTableModel, ? extends Object> entry) {
|
| | | for (int i = entry.getValueCount() - 1; i >= 0; i--) {
|
| | | if (entry.getStringValue(i).toLowerCase().contains(fragment.toLowerCase())) {
|
| | |
| | | }
|
| | | try {
|
| | | EventQueue.invokeAndWait(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | Graphics2D g = splash.createGraphics();
|
| | | if (g != null) {
|
| | |
| | | */
|
| | | public class NewCertificateConfig {
|
| | | public static final SectionParser<NewCertificateConfig> KEY = new SectionParser<NewCertificateConfig>() {
|
| | | @Override
|
| | | public NewCertificateConfig parse(final Config cfg) {
|
| | | return new NewCertificateConfig(cfg);
|
| | | }
|
| | |
| | |
|
| | | JButton ok = new JButton(Translation.get("gb.ok"));
|
| | | ok.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | if (validateInputs()) {
|
| | | isCanceled = false;
|
| | |
| | | });
|
| | | JButton cancel = new JButton(Translation.get("gb.cancel"));
|
| | | cancel.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | isCanceled = true;
|
| | | setVisible(false);
|
| | |
| | |
|
| | | JButton ok = new JButton(Translation.get("gb.ok"));
|
| | | ok.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | if (validateInputs()) {
|
| | | isCanceled = false;
|
| | |
| | | });
|
| | | JButton cancel = new JButton(Translation.get("gb.cancel"));
|
| | | cancel.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | isCanceled = true;
|
| | | setVisible(false);
|
| | |
| | | */
|
| | | public class UserCertificateConfig {
|
| | | public static final SectionParser<UserCertificateConfig> KEY = new SectionParser<UserCertificateConfig>() {
|
| | | @Override
|
| | | public UserCertificateConfig parse(final Config cfg) {
|
| | | return new UserCertificateConfig(cfg);
|
| | | }
|
| | |
| | | saveUserButton = new JButton(Translation.get("gb.save"));
|
| | | saveUserButton.setEnabled(false);
|
| | | saveUserButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | setEditable(false);
|
| | | String username = ucm.user.username;
|
| | |
| | | editUserButton = new JButton(Translation.get("gb.edit"));
|
| | | editUserButton.setEnabled(false);
|
| | | editUserButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | setEditable(true);
|
| | | }
|
| | |
| | | }
|
| | | });
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | int row = table.rowAtPoint(e.getPoint());
|
| | |
| | | newCertificateButton = new JButton(Translation.get("gb.newCertificate"));
|
| | | newCertificateButton.setEnabled(false);
|
| | | newCertificateButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | try {
|
| | | if (saveUserButton.isEnabled()) {
|
| | |
| | | revokeCertificateButton = new JButton(Translation.get("gb.revokeCertificate"));
|
| | | revokeCertificateButton.setEnabled(false);
|
| | | revokeCertificateButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | try {
|
| | | int row = table.getSelectedRow();
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | Columns col = Columns.values()[columnIndex];
|
| | | switch (col) {
|
| | |
| | | /*
|
| | | * Copyright 2011 gitblit.com.
|
| | | *
|
| | | * Licensed under the Apache License, Version 2.0 (the "License");
|
| | | * you may not use this file except in compliance with the License.
|
| | | * You may obtain a copy of the License at
|
| | | *
|
| | | * http://www.apache.org/licenses/LICENSE-2.0
|
| | | *
|
| | | * Unless required by applicable law or agreed to in writing, software
|
| | | * distributed under the License is distributed on an "AS IS" BASIS,
|
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| | | * See the License for the specific language governing permissions and
|
| | | * limitations under the License.
|
| | | */
|
| | | package com.gitblit.authority;
|
| | |
|
| | | import java.awt.Color;
|
| | |
| | |
|
| | | JButton ok = new JButton(Translation.get("gb.ok"));
|
| | | ok.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | | setHorizontalAlignment(SwingConstants.CENTER);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | if (value instanceof Boolean) {
|
| | |
| | |
|
| | | private static final String R_CHANGES = "refs/changes/";
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private static final MouseListener BUTTON_MOUSE_LISTENER = new MouseAdapter() { |
| | | @Override |
| | | public void mouseEntered(MouseEvent e) { |
| | | Component component = e.getComponent(); |
| | | if (component instanceof AbstractButton) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void mouseExited(MouseEvent e) { |
| | | Component component = e.getComponent(); |
| | | if (component instanceof AbstractButton) { |
| | |
| | | addActionListener(this); |
| | | } |
| | | |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | int i = pane.indexOfTabComponent(ClosableTabComponent.this); |
| | | Component c = pane.getComponentAt(i); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateUI() { |
| | | } |
| | | |
| | |
| | | setHorizontalAlignment(SwingConstants.CENTER);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | JButton cancel = new JButton(Translation.get("gb.cancel"));
|
| | | cancel.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | final JButton save = new JButton(Translation.get(isLogin ? "gb.login" : "gb.save"));
|
| | | save.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | if (validateFields()) {
|
| | | canceled = false;
|
| | |
| | |
|
| | | // on enter in password field, save or login
|
| | | passwordField.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | save.doClick();
|
| | | }
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | JButton createButton = new JButton(Translation.get("gb.save"));
|
| | | createButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | if (validateFields()) {
|
| | | canceled = false;
|
| | |
| | |
|
| | | JButton cancelButton = new JButton(Translation.get("gb.cancel"));
|
| | | cancelButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | canceled = true;
|
| | | setVisible(false);
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return _insets;
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return _insets;
|
| | | }
|
| | |
| | |
|
| | | JButton createButton = new JButton(Translation.get("gb.save"));
|
| | | createButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | if (validateFields()) {
|
| | | canceled = false;
|
| | |
| | |
|
| | | JButton cancelButton = new JButton(Translation.get("gb.cancel"));
|
| | | cancelButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | canceled = true;
|
| | | setVisible(false);
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return _insets;
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return _insets;
|
| | | }
|
| | |
| | |
|
| | | JButton createButton = new JButton(Translation.get("gb.save"));
|
| | | createButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | if (validateFields()) {
|
| | | canceled = false;
|
| | |
| | |
|
| | | JButton cancelButton = new JButton(Translation.get("gb.cancel"));
|
| | | cancelButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | canceled = true;
|
| | | setVisible(false);
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | if (Columns.Date.ordinal() == columnIndex) {
|
| | | return Date.class;
|
| | |
| | | prev.setToolTipText(Translation.get("gb.pagePrevious"));
|
| | | prev.setEnabled(false);
|
| | | prev.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshFeeds(--page);
|
| | | }
|
| | |
| | | next.setToolTipText(Translation.get("gb.pageNext"));
|
| | | next.setEnabled(false);
|
| | | next.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshFeeds(++page);
|
| | | }
|
| | |
| | |
|
| | | JButton refreshFeeds = new JButton(Translation.get("gb.refresh"));
|
| | | refreshFeeds.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshFeeds(0);
|
| | | }
|
| | |
| | | final JButton viewCommit = new JButton(Translation.get("gb.view"));
|
| | | viewCommit.setEnabled(false);
|
| | | viewCommit.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewCommit();
|
| | | }
|
| | |
| | | final JButton viewCommitDiff = new JButton(Translation.get("gb.commitdiff"));
|
| | | viewCommitDiff.setEnabled(false);
|
| | | viewCommitDiff.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewCommitDiff();
|
| | | }
|
| | |
| | | final JButton viewTree = new JButton(Translation.get("gb.tree"));
|
| | | viewTree.setEnabled(false);
|
| | | viewTree.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewTree();
|
| | | }
|
| | |
| | |
|
| | | JButton subscribeFeeds = new JButton(Translation.get("gb.subscribe") + "...");
|
| | | subscribeFeeds.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | subscribeFeeds(gitblit.getAvailableFeeds());
|
| | | }
|
| | |
| | | table.getColumn(name).setCellRenderer(new MessageRenderer(gitblit));
|
| | |
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | if (e.isControlDown()) {
|
| | |
| | | repositorySelector.setRenderer(nameRenderer);
|
| | | repositorySelector.setForeground(nameRenderer.getForeground());
|
| | | repositorySelector.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | // repopulate the author list based on repository selection
|
| | | // preserve author selection, if possible
|
| | |
| | | authorSelector.setRenderer(nameRenderer);
|
| | | authorSelector.setForeground(nameRenderer.getForeground());
|
| | | authorSelector.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | filterFeeds();
|
| | | }
|
| | |
| | | if (repository.equals(ALL)) {
|
| | | // author filter
|
| | | containsFilter = new RowFilter<FeedEntryTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(
|
| | | Entry<? extends FeedEntryTableModel, ? extends Object> entry) {
|
| | | return entry.getStringValue(authorIndex).equalsIgnoreCase(author);
|
| | |
| | | } else if (author.equals(ALL)) {
|
| | | // repository filter
|
| | | containsFilter = new RowFilter<FeedEntryTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(
|
| | | Entry<? extends FeedEntryTableModel, ? extends Object> entry) {
|
| | | return entry.getStringValue(repositoryIndex).equalsIgnoreCase(repository);
|
| | |
| | | } else {
|
| | | // repository-author filter
|
| | | containsFilter = new RowFilter<FeedEntryTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(
|
| | | Entry<? extends FeedEntryTableModel, ? extends Object> entry) {
|
| | | boolean authorMatch = entry.getStringValue(authorIndex)
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | Columns col = Columns.values()[columnIndex];
|
| | | switch (col) {
|
| | |
| | | JMenuItem manage = new JMenuItem(Translation.get("gb.manage") + "...");
|
| | | manage.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_DOWN_MASK, false));
|
| | | manage.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | manageRegistrations();
|
| | | }
|
| | |
| | | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1 + i, KeyEvent.CTRL_DOWN_MASK,
|
| | | false));
|
| | | item.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | login(reg);
|
| | | }
|
| | |
| | | GitblitRegistration reg = new GitblitRegistration(server, url, account, password) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | protected void cacheFeeds() {
|
| | | writeFeedCache(this);
|
| | | }
|
| | |
| | |
|
| | | public static void main(String[] args) {
|
| | | EventQueue.invokeLater(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
| | |
| | | }
|
| | | try {
|
| | | EventQueue.invokeAndWait(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | Graphics2D g = splash.createGraphics();
|
| | | if (g != null) {
|
| | |
| | | tabs.addTab(Translation.get("gb.settings"), createSettingsPanel());
|
| | | tabs.addTab(Translation.get("gb.status"), createStatusPanel());
|
| | | tabs.addChangeListener(new ChangeListener() {
|
| | | @Override
|
| | | public void stateChanged(ChangeEvent e) {
|
| | | tabs.getSelectedComponent().requestFocus();
|
| | | }
|
| | |
| | | return doRequest();
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected void done() {
|
| | | parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
| | | try {
|
| | |
| | |
|
| | | add = new JButton("->");
|
| | | add.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | List<T> move = new ArrayList<T>();
|
| | | if (available.getSelectedRowCount() <= 0) {
|
| | |
| | | }
|
| | | for (int row : available.getSelectedRows()) {
|
| | | int modelIndex = available.convertRowIndexToModel(row);
|
| | | T item = (T) availableModel.list.get(modelIndex);
|
| | | T item = availableModel.list.get(modelIndex);
|
| | | move.add(item);
|
| | | }
|
| | | availableModel.list.removeAll(move);
|
| | |
| | | });
|
| | | subtract = new JButton("<-");
|
| | | subtract.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | List<T> move = new ArrayList<T>();
|
| | | if (selected.getSelectedRowCount() <= 0) {
|
| | |
| | | }
|
| | | for (int row : selected.getSelectedRows()) {
|
| | | int modelIndex = selected.convertRowIndexToModel(row);
|
| | | T item = (T) selectedModel.list.get(modelIndex);
|
| | | T item = selectedModel.list.get(modelIndex);
|
| | | move.add(item);
|
| | | }
|
| | | selectedModel.list.removeAll(move);
|
| | |
| | |
|
| | | up = new JButton("\u2191");
|
| | | up.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | int row = selected.getSelectedRow();
|
| | | if (row > 0) {
|
| | |
| | |
|
| | | down = new JButton("\u2193");
|
| | | down.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | int row = selected.getSelectedRow();
|
| | | if (row < selected.getRowCount() - 1) {
|
| | |
| | | return Translation.get("gb.name");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | return String.class;
|
| | | }
|
| | |
| | | label.setVisible(true);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | if (isSelected)
|
| | |
| | | return sb.toString();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | return String.class;
|
| | | }
|
| | |
| | | permissionSelector = new JComboBox(AccessPermission.NEWPERMISSIONS);
|
| | | addButton = new JButton(Translation.get("gb.add"));
|
| | | addButton.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | if (registrantSelector.getSelectedIndex() < 0) {
|
| | | return;
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | if (columnIndex == Columns.Permission.ordinal()) {
|
| | | return AccessPermission.class;
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | | .getColumnName(RegistrationsTableModel.Columns.Name.ordinal());
|
| | | registrationsTable.getColumn(id).setCellRenderer(nameRenderer);
|
| | | registrationsTable.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | login();
|
| | |
| | |
|
| | | final JButton create = new JButton(Translation.get("gb.create"));
|
| | | create.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | create();
|
| | | }
|
| | |
| | | final JButton login = new JButton(Translation.get("gb.login"));
|
| | | login.setEnabled(false);
|
| | | login.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | login();
|
| | | }
|
| | |
| | | final JButton edit = new JButton(Translation.get("gb.edit"));
|
| | | edit.setEnabled(false);
|
| | | edit.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | edit();
|
| | | }
|
| | |
| | | final JButton delete = new JButton(Translation.get("gb.delete"));
|
| | | delete.setEnabled(false);
|
| | | delete.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | delete();
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return insets;
|
| | | }
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | if (columnIndex == Columns.Last_Login.ordinal()) {
|
| | | return Date.class;
|
| | |
| | | final JButton browseRepository = new JButton(Translation.get("gb.browse"));
|
| | | browseRepository.setEnabled(false);
|
| | | browseRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | RepositoryModel model = getSelectedRepositories().get(0);
|
| | | String url = gitblit.getURL("summary", model.name, null);
|
| | |
| | |
|
| | | JButton refreshRepositories = new JButton(Translation.get("gb.refresh"));
|
| | | refreshRepositories.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshRepositories();
|
| | | }
|
| | |
| | |
|
| | | clearCache = new JButton(Translation.get("gb.clearCache"));
|
| | | clearCache.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | clearCache();
|
| | | }
|
| | |
| | |
|
| | | createRepository = new JButton(Translation.get("gb.create"));
|
| | | createRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | createRepository();
|
| | | }
|
| | |
| | | editRepository = new JButton(Translation.get("gb.edit"));
|
| | | editRepository.setEnabled(false);
|
| | | editRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | editRepository(getSelectedRepositories().get(0));
|
| | | }
|
| | |
| | | delRepository = new JButton(Translation.get("gb.delete"));
|
| | | delRepository.setEnabled(false);
|
| | | delRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | deleteRepositories(getSelectedRepositories());
|
| | | }
|
| | |
| | | final JButton subscribeRepository = new JButton(Translation.get("gb.subscribe") + "...");
|
| | | subscribeRepository.setEnabled(false);
|
| | | subscribeRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | List<FeedModel> feeds = gitblit.getAvailableFeeds(getSelectedRepositories().get(0));
|
| | | subscribeFeeds(feeds);
|
| | |
| | | final JButton logRepository = new JButton(Translation.get("gb.log") + "...");
|
| | | logRepository.setEnabled(false);
|
| | | logRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | RepositoryModel model = getSelectedRepositories().get(0);
|
| | | showSearchDialog(false, model);
|
| | |
| | | final JButton searchRepository = new JButton(Translation.get("gb.search") + "...");
|
| | | searchRepository.setEnabled(false);
|
| | | searchRepository.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | RepositoryModel model = getSelectedRepositories().get(0);
|
| | | showSearchDialog(true, model);
|
| | |
| | | });
|
| | |
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2 && gitblit.allowManagement()) {
|
| | | editRepository(getSelectedRepositories().get(0));
|
| | |
| | |
|
| | | filterTextfield = new JTextField();
|
| | | filterTextfield.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | filterRepositories(filterTextfield.getText());
|
| | | }
|
| | | });
|
| | | filterTextfield.addKeyListener(new KeyAdapter() {
|
| | | @Override
|
| | | public void keyReleased(KeyEvent e) {
|
| | | filterRepositories(filterTextfield.getText());
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | RowFilter<RepositoriesTableModel, Object> containsFilter = new RowFilter<RepositoriesTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(Entry<? extends RepositoriesTableModel, ? extends Object> entry) {
|
| | | for (int i = entry.getValueCount() - 1; i >= 0; i--) {
|
| | | if (entry.getStringValue(i).toLowerCase().contains(fragment.toLowerCase())) {
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | Columns col = Columns.values()[columnIndex];
|
| | | switch (col) {
|
| | |
| | | prev.setToolTipText(Translation.get("gb.pagePrevious"));
|
| | | prev.setEnabled(false);
|
| | | prev.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | search(--page);
|
| | | }
|
| | |
| | | next.setToolTipText(Translation.get("gb.pageNext"));
|
| | | next.setEnabled(false);
|
| | | next.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | search(++page);
|
| | | }
|
| | |
| | |
|
| | | final JButton search = new JButton(Translation.get(isSearch ? "gb.search" : "gb.refresh"));
|
| | | search.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | search(0);
|
| | | }
|
| | |
| | | final JButton viewCommit = new JButton(Translation.get("gb.view"));
|
| | | viewCommit.setEnabled(false);
|
| | | viewCommit.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewCommit();
|
| | | }
|
| | |
| | | final JButton viewCommitDiff = new JButton(Translation.get("gb.commitdiff"));
|
| | | viewCommitDiff.setEnabled(false);
|
| | | viewCommitDiff.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewCommitDiff();
|
| | | }
|
| | |
| | | final JButton viewTree = new JButton(Translation.get("gb.tree"));
|
| | | viewTree.setEnabled(false);
|
| | | viewTree.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | viewTree();
|
| | | }
|
| | |
| | | table.getColumn(name).setCellRenderer(new MessageRenderer());
|
| | |
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | if (e.isControlDown()) {
|
| | |
| | | repositorySelector.setRenderer(nameRenderer);
|
| | | repositorySelector.setForeground(nameRenderer.getForeground());
|
| | | repositorySelector.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | // repopulate the branch list based on repository selection
|
| | | // preserve branch selection, if possible
|
| | |
| | |
|
| | | searchFragment = new JTextField(25);
|
| | | searchFragment.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | search(0);
|
| | | }
|
| | |
| | | modifiedFont = defaultFont.deriveFont(Font.BOLD);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | private void initialize() {
|
| | | JButton refreshSettings = new JButton(Translation.get("gb.refresh"));
|
| | | refreshSettings.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshSettings();
|
| | | }
|
| | |
| | |
|
| | | final JButton editSetting = new JButton(Translation.get("gb.edit"));
|
| | | editSetting.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | int viewRow = table.getSelectedRow();
|
| | | int modelRow = table.convertRowIndexToModel(viewRow);
|
| | |
| | | }
|
| | | });
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | int viewRow = table.getSelectedRow();
|
| | |
| | |
|
| | | filterTextfield = new JTextField();
|
| | | filterTextfield.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | filterSettings(filterTextfield.getText());
|
| | | }
|
| | | });
|
| | | filterTextfield.addKeyListener(new KeyAdapter() {
|
| | | @Override
|
| | | public void keyReleased(KeyEvent e) {
|
| | | filterSettings(filterTextfield.getText());
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | RowFilter<SettingsTableModel, Object> containsFilter = new RowFilter<SettingsTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(Entry<? extends SettingsTableModel, ? extends Object> entry) {
|
| | | for (int i = entry.getValueCount() - 1; i >= 0; i--) {
|
| | | if (entry.getStringValue(i).toLowerCase().contains(fragment.toLowerCase())) {
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | if (Columns.Value.ordinal() == columnIndex) {
|
| | | return SettingModel.class;
|
| | |
| | | private void initialize() {
|
| | | JButton refreshStatus = new JButton(Translation.get("gb.refresh"));
|
| | | refreshStatus.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshStatus();
|
| | | }
|
| | |
| | | subscribedIcon = new ImageIcon(getClass().getResource("/bullet_feed.png"));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | final JButton cancel = new JButton(Translation.get("gb.cancel"));
|
| | | cancel.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | setVisible(false);
|
| | | }
|
| | |
| | |
|
| | | final JButton save = new JButton(Translation.get("gb.save"));
|
| | | save.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent event) {
|
| | | save();
|
| | | }
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return insets;
|
| | | }
|
| | |
| | | private void initialize() {
|
| | | JButton refreshTeams = new JButton(Translation.get("gb.refresh"));
|
| | | refreshTeams.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshTeams();
|
| | | }
|
| | |
| | |
|
| | | JButton createTeam = new JButton(Translation.get("gb.create"));
|
| | | createTeam.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | createTeam();
|
| | | }
|
| | |
| | | final JButton editTeam = new JButton(Translation.get("gb.edit"));
|
| | | editTeam.setEnabled(false);
|
| | | editTeam.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | editTeam(getSelectedTeams().get(0));
|
| | | }
|
| | |
| | | final JButton delTeam = new JButton(Translation.get("gb.delete"));
|
| | | delTeam.setEnabled(false);
|
| | | delTeam.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | deleteTeams(getSelectedTeams());
|
| | | }
|
| | |
| | | });
|
| | |
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | editTeam(getSelectedTeams().get(0));
|
| | |
| | |
|
| | | filterTextfield = new JTextField();
|
| | | filterTextfield.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | filterTeams(filterTextfield.getText());
|
| | | }
|
| | | });
|
| | | filterTextfield.addKeyListener(new KeyAdapter() {
|
| | | @Override
|
| | | public void keyReleased(KeyEvent e) {
|
| | | filterTeams(filterTextfield.getText());
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | RowFilter<TeamsTableModel, Object> containsFilter = new RowFilter<TeamsTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(Entry<? extends TeamsTableModel, ? extends Object> entry) {
|
| | | for (int i = entry.getValueCount() - 1; i >= 0; i--) {
|
| | | if (entry.getStringValue(i).toLowerCase().contains(fragment.toLowerCase())) {
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | return String.class;
|
| | | }
|
| | |
| | | private void initialize() {
|
| | | JButton refreshUsers = new JButton(Translation.get("gb.refresh"));
|
| | | refreshUsers.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | refreshUsers();
|
| | | }
|
| | |
| | |
|
| | | JButton createUser = new JButton(Translation.get("gb.create"));
|
| | | createUser.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | createUser();
|
| | | }
|
| | |
| | | final JButton editUser = new JButton(Translation.get("gb.edit"));
|
| | | editUser.setEnabled(false);
|
| | | editUser.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | editUser(getSelectedUsers().get(0));
|
| | | }
|
| | |
| | | final JButton delUser = new JButton(Translation.get("gb.delete"));
|
| | | delUser.setEnabled(false);
|
| | | delUser.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | deleteUsers(getSelectedUsers());
|
| | | }
|
| | |
| | | });
|
| | |
|
| | | table.addMouseListener(new MouseAdapter() {
|
| | | @Override
|
| | | public void mouseClicked(MouseEvent e) {
|
| | | if (e.getClickCount() == 2) {
|
| | | editUser(getSelectedUsers().get(0));
|
| | |
| | |
|
| | | filterTextfield = new JTextField();
|
| | | filterTextfield.addActionListener(new ActionListener() {
|
| | | @Override
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | filterUsers(filterTextfield.getText());
|
| | | }
|
| | | });
|
| | | filterTextfield.addKeyListener(new KeyAdapter() {
|
| | | @Override
|
| | | public void keyReleased(KeyEvent e) {
|
| | | filterUsers(filterTextfield.getText());
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | RowFilter<UsersTableModel, Object> containsFilter = new RowFilter<UsersTableModel, Object>() {
|
| | | @Override
|
| | | public boolean include(Entry<? extends UsersTableModel, ? extends Object> entry) {
|
| | | for (int i = entry.getValueCount() - 1; i >= 0; i--) {
|
| | | if (entry.getStringValue(i).toLowerCase().contains(fragment.toLowerCase())) {
|
| | |
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | return String.class;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | public static class FanoutAdapter implements FanoutListener {
|
| | | @Override
|
| | | public void pong(Date timestamp) { }
|
| | | @Override
|
| | | public void announcement(String channel, String message) { }
|
| | | }
|
| | |
|
| | |
| | | Set<SelectionKey> keys = selector.selectedKeys();
|
| | | Iterator<SelectionKey> keyItr = keys.iterator();
|
| | | while (keyItr.hasNext()) {
|
| | | SelectionKey key = (SelectionKey) keyItr.next();
|
| | | SelectionKey key = keyItr.next();
|
| | | if (key.isAcceptable()) {
|
| | | // new fanout client connection
|
| | | ServerSocketChannel sch = (ServerSocketChannel) key.channel();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected void broadcast(Collection<FanoutServiceConnection> connections, String channel, String message) {
|
| | | super.broadcast(connections, channel, message);
|
| | |
|
| | |
| | | run.set(true);
|
| | | acceptSocket = listenSock;
|
| | | acceptThread = new Thread(processors, "Git-Daemon-Accept") {
|
| | | @Override
|
| | | public void run() {
|
| | | while (isRunning()) {
|
| | | try {
|
| | |
| | | dc.setRemoteAddress(((InetSocketAddress) peer).getAddress());
|
| | |
|
| | | new Thread(processors, "Git-Daemon-Client " + peer.toString()) {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | dc.execute(s);
|
| | |
| | | GitDaemonService(final String cmdName, final String cfgName) {
|
| | | command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName; //$NON-NLS-1$ //$NON-NLS-2$
|
| | | configKey = new SectionParser<ServiceConfig>() {
|
| | | @Override
|
| | | public ServiceConfig parse(final Config cfg) {
|
| | | return new ServiceConfig(GitDaemonService.this, cfg, cfgName);
|
| | | }
|
| | |
| | | * @param oldId |
| | | * @param newId |
| | | */ |
| | | @Override |
| | | public void updateRef(String ref, ReceiveCommand.Type type, String oldId, String newId) { |
| | | // daily digests are filled from most recent to oldest |
| | | String preservedNewId = getNewId(ref); |
| | |
| | | this.url = url;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return path + "=" + url;
|
| | | }
|
| | |
| | | return format(Long.valueOf(value)); |
| | | } |
| | | |
| | | @Override |
| | | public StringBuffer format(Object obj, StringBuffer buf, FieldPosition pos) { |
| | | if (obj instanceof Number) { |
| | | long numBytes = ((Number) obj).longValue(); |
| | |
| | | buf.append(formatter.format((double) numBytes)).append(" b"); |
| | | } else if (numBytes < 1024 * 1024) { |
| | | DecimalFormat formatter = new DecimalFormat("#,##0"); |
| | | buf.append(formatter.format((double) numBytes / 1024.0)).append(" KB"); |
| | | buf.append(formatter.format(numBytes / 1024.0)).append(" KB"); |
| | | } else if (numBytes < 1024 * 1024 * 1024) { |
| | | DecimalFormat formatter = new DecimalFormat("#,##0.0"); |
| | | buf.append(formatter.format((double) numBytes / (1024.0 * 1024.0))).append(" MB"); |
| | | buf.append(formatter.format(numBytes / (1024.0 * 1024.0))).append(" MB"); |
| | | } else { |
| | | DecimalFormat formatter = new DecimalFormat("#,##0.0"); |
| | | buf.append(formatter.format((double) numBytes / (1024.0 * 1024.0 * 1024.0))) |
| | | buf.append(formatter.format(numBytes / (1024.0 * 1024.0 * 1024.0))) |
| | | .append(" GB"); |
| | | } |
| | | } |
| | | return buf; |
| | | } |
| | | |
| | | @Override |
| | | public Object parseObject(String source, ParsePosition pos) { |
| | | return null; |
| | | } |
| | |
| | |
|
| | | // mb.setBytes(test, 0, test.length);
|
| | | Method mByteChunck_setBytes = cByteChunk.getMethod("setBytes", byte[].class, int.class, int.class);
|
| | | mByteChunck_setBytes.invoke(mb, test, (int) 0, test.length);
|
| | | mByteChunck_setBytes.invoke(mb, test, 0, test.length);
|
| | |
|
| | | // UDecoder ud=new UDecoder();
|
| | | Class<?> cUDecoder = Class.forName("org.apache.tomcat.util.buf.UDecoder");
|
| | |
| | | start();
|
| | | }
|
| | |
|
| | | @Override
|
| | | @SuppressWarnings("unchecked")
|
| | | public void run() {
|
| | |
|
| | |
| | | */ |
| | | package com.gitblit.utils; |
| | | |
| | | import com.sun.jna.Library; |
| | | import com.sun.jna.Native; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import com.sun.jna.Library; |
| | | import com.sun.jna.Native; |
| | | |
| | | /** |
| | | * Collection of static methods to access native OS library functionality. |
| | | * |
| | |
| | | this.fieldName = fqfn.substring(fqfn.lastIndexOf(".") + 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean shouldSkipClass(Class<?> arg0) {
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean shouldSkipField(FieldAttributes f) {
|
| | | return (f.getDeclaringClass() == c && f.getName().equals(fieldName));
|
| | | }
|
| | |
| | | this.os = os;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void format(DiffEntry entry) throws IOException {
|
| | | currentTouple = new PatchTouple();
|
| | | changes.put(entry.getNewPath(), currentTouple);
|
| | |
| | | private static String toHex(byte[] bytes) {
|
| | | StringBuilder sb = new StringBuilder(bytes.length * 2);
|
| | | for (int i = 0; i < bytes.length; i++) {
|
| | | if (((int) bytes[i] & 0xff) < 0x10) {
|
| | | if ((bytes[i] & 0xff) < 0x10) {
|
| | | sb.append('0');
|
| | | }
|
| | | sb.append(Long.toString((int) bytes[i] & 0xff, 16));
|
| | | sb.append(Long.toString(bytes[i] & 0xff, 16));
|
| | | }
|
| | | return sb.toString();
|
| | | }
|
| | |
| | | super(id, new Model<String>(url));
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected void onComponentTag(ComponentTag tag) {
|
| | | super.onComponentTag(tag);
|
| | | checkComponentTag(tag, "img");
|
| | |
| | | authenticationType = AuthenticationType.CREDENTIALS;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void invalidate() {
|
| | | super.invalidate();
|
| | | user = null;
|
| | |
| | | * string to be encoded
|
| | | * @return encoded string
|
| | | */
|
| | | @Override
|
| | | protected String urlEncodePathComponent(String string) {
|
| | | char altChar = GitBlit.getChar(Keys.web.forwardSlashCharacter, '/');
|
| | | if (altChar != '/') {
|
| | |
| | | * @param value
|
| | | * @return Decodes the value
|
| | | */
|
| | | @Override
|
| | | protected String urlDecodePathComponent(String value) {
|
| | | char altChar = GitBlit.getChar(Keys.web.forwardSlashCharacter, '/');
|
| | | if (altChar != '/') {
|
| | |
| | | * @param servletRequest
|
| | | * @return The last modified time stamp
|
| | | */
|
| | | @Override
|
| | | protected long getLastModified(final HttpServletRequest servletRequest) {
|
| | | final String pathInfo = getRelativePath(servletRequest);
|
| | | if (Strings.isEmpty(pathInfo))
|
| | |
| | | return new HeaderContributor(new IHeaderContributor() {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void renderHead(IHeaderResponse response) {
|
| | | String contentType = "application/rss+xml";
|
| | |
|
| | |
| | | IChartData data = new AbstractChartData(max) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public double[][] getData() {
|
| | | return new double[][] { commits, tags };
|
| | | }
|
| | |
| | | IChartData data = new AbstractChartData(max) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public double[][] getData() {
|
| | | return new double[][] { x, y };
|
| | | }
|
| | |
| | | See the License for the specific language governing permissions and
|
| | | limitations under the License.
|
| | | */
|
| | |
|
| | | package com.gitblit.wicket.charting;
|
| | |
|
| | | import java.util.ArrayList;
|
| | |
| | |
|
| | | SIMPLE("s", "", ",") {
|
| | |
|
| | | @Override
|
| | | CharSequence convert(double value, double max) {
|
| | | if (value < 0) {
|
| | | return "_";
|
| | |
| | | },
|
| | | TEXT("t", ",", "|") {
|
| | |
|
| | | @Override
|
| | | CharSequence convert(double value, double max) {
|
| | | if (value < 0) {
|
| | | value = -1;
|
| | |
| | | },
|
| | | EXTENDED("e", "", ",") {
|
| | |
|
| | | @Override
|
| | | CharSequence convert(double value, double max) {
|
| | | if (value < 0) {
|
| | | return "__";
|
| | |
| | | * @see org.apache.wicket.markup.IMarkupResourceStreamProvider#getMarkupResourceStream(org.apache
|
| | | * .wicket.MarkupContainer, java.lang.Class)
|
| | | */
|
| | | @Override
|
| | | public final IResourceStream getMarkupResourceStream(MarkupContainer container,
|
| | | Class< ? > containerClass)
|
| | | {
|
| | |
| | | * @see org.apache.wicket.markup.IMarkupCacheKeyProvider#getCacheKey(org.apache.wicket.
|
| | | * MarkupContainer, java.lang.Class)
|
| | | */
|
| | | @Override
|
| | | public final String getCacheKey(MarkupContainer container, Class< ? > containerClass)
|
| | | {
|
| | | // don't cache the evaluated template
|
| | |
| | | See the License for the specific language governing permissions and
|
| | | limitations under the License.
|
| | | */
|
| | |
|
| | | package com.gitblit.wicket.ng;
|
| | |
|
| | | import java.text.MessageFormat;
|
| | |
| | | private boolean showInitials = true;
|
| | | private String zeroId = ObjectId.zeroId().getName();
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<AnnotatedLine> item) {
|
| | | AnnotatedLine entry = item.getModelObject();
|
| | | item.add(new Label("line", "" + entry.lineNumber));
|
| | |
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.ExternalImage;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.panels.CommitHeaderPanel;
|
| | | import com.gitblit.wicket.panels.PathBreadcrumbsPanel;
|
| | |
|
| | |
| | | DataView<GitNote> notesView = new DataView<GitNote>("notes", notesDp) { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Override |
| | | public void populateItem(final Item<GitNote> item) { |
| | | GitNote entry = item.getModelObject(); |
| | | item.add(new RefsPanel("refName", repositoryName, Arrays.asList(entry.notesRef))); |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | int counter; |
| | | |
| | | @Override |
| | | public void populateItem(final Item<PathChangeModel> item) { |
| | | final PathChangeModel entry = item.getModelObject(); |
| | | Label changeType = new Label("changeType", ""); |
| | |
| | | DataView<String> parentsView = new DataView<String>("commitParents", parentsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String entry = item.getModelObject();
|
| | | item.add(new LinkPanel("commitParent", "list", entry, CommitPage.class,
|
| | |
| | | DataView<GitNote> notesView = new DataView<GitNote>("notes", notesDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<GitNote> item) {
|
| | | GitNote entry = item.getModelObject();
|
| | | item.add(new RefsPanel("refName", repositoryName, Arrays.asList(entry.notesRef)));
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<PathChangeModel> item) {
|
| | | final PathChangeModel entry = item.getModelObject();
|
| | | Label changeType = new Label("changeType", "");
|
| | |
| | | private static final long serialVersionUID = 1L; |
| | | int counter; |
| | | |
| | | @Override |
| | | public void populateItem(final Item<PathChangeModel> item) { |
| | | final PathChangeModel entry = item.getModelObject(); |
| | | Label changeType = new Label("changeType", ""); |
| | |
| | | import com.gitblit.utils.ByteFormat;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.LinkPanel;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<PathModel> item) {
|
| | | PathModel entry = item.getModelObject();
|
| | | item.add(WicketUtils.newImage("docIcon", "file_world_16x16.png"));
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | protected void onUpdate(AjaxRequestTarget target) {
|
| | | // enable/disable permissions panel based on access restriction
|
| | | boolean allowAuthorizationControl = repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE);
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | protected void onUpdate(AjaxRequestTarget target) {
|
| | | // enable/disable permissions panel based on access restriction
|
| | | boolean allowAuthorizationControl = repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE);
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryStatus> item) {
|
| | | final RepositoryStatus entry = item.getModelObject();
|
| | | item.add(WicketUtils.getPullStatusImage("statusIcon", entry.status));
|
| | |
| | | DataView<FlatFork> forksList = new DataView<FlatFork>("fork", forksDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<FlatFork> item) {
|
| | | FlatFork fork = item.getModelObject();
|
| | | RepositoryModel repository = fork.repository;
|
| | |
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.SearchPanel;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
| | |
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.HistoryPanel;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | |
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.LogPanel;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | | ListDataProvider<SearchResult> resultsDp = new ListDataProvider<SearchResult>(results);
|
| | | final DataView<SearchResult> resultsView = new DataView<SearchResult>("searchResults", resultsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Override
|
| | | public void populateItem(final Item<SearchResult> item) {
|
| | | final SearchResult sr = item.getModelObject();
|
| | | switch(sr.type) {
|
| | |
| | | ListDataProvider<String> tagsDp = new ListDataProvider<String>(tags);
|
| | | final DataView<String> tagsView = new DataView<String>("tag", tagsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String tag = item.getModelObject();
|
| | | Component c = new LinkPanel("tagLink", null, tag, TagPage.class,
|
| | |
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
|
| | | @CacheControl(LastModified.BOOT)
|
| | | public class MarkdownPage extends RepositoryPage {
|
| | |
| | | import com.gitblit.utils.MetricUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.charting.SecureChart;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.panels.FilterableProjectList;
|
| | | import com.gitblit.wicket.panels.FilterableRepositoryList;
|
| | |
|
| | |
| | | import com.gitblit.models.UserModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.charting.GoogleChart;
|
| | | import com.gitblit.wicket.charting.GoogleCharts;
|
| | | import com.gitblit.wicket.charting.GoogleLineChart;
|
| | |
| | | DataView<String> ownersView = new DataView<String>("repositoryOwners", ownersDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | | int counter = 0;
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String ownername = item.getModelObject();
|
| | | UserModel ownerModel = GitBlit.self().getUserModel(ownername);
|
| | |
| | | setup(params);
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected Class<? extends BasePage> getRootNavPageClass() {
|
| | | return RepositoriesPage.class;
|
| | | }
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<ProjectModel> item) {
|
| | | final ProjectModel entry = item.getModelObject();
|
| | |
|
| | |
| | | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
| | |
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.ReflogPanel;
|
| | |
|
| | | @CacheControl(LastModified.REPOSITORY)
|
| | |
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.PageRegistration;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.PageRegistration.DropDownMenuItem;
|
| | | import com.gitblit.wicket.PageRegistration.DropDownMenuRegistration;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
| | | add(new HeaderContributor(new IHeaderContributor() {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void renderHead(IHeaderResponse response) {
|
| | | StringBuilder buffer = new StringBuilder();
|
| | | buffer.append("<style type=\"text/css\">\n");
|
| | |
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.CacheControl;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.CacheControl.LastModified;
|
| | | import com.gitblit.wicket.charting.SecureChart;
|
| | | import com.gitblit.wicket.panels.BranchesPanel;
|
| | | import com.gitblit.wicket.panels.LinkPanel;
|
| | |
| | | DataView<String> ownersView = new DataView<String>("repositoryOwners", ownersDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | | int counter = 0;
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String ownername = item.getModelObject();
|
| | | UserModel ownerModel = GitBlit.self().getUserModel(ownername);
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<PathModel> item) {
|
| | | PathModel entry = item.getModelObject();
|
| | | item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
|
| | |
| | | DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("repositoryList", dp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryModel> item) {
|
| | | final RepositoryModel entry = item.getModelObject();
|
| | |
|
| | |
| | | new ListDataProvider<Activity>(recentActivity)) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<Activity> activityItem) {
|
| | | final Activity entry = activityItem.getModelObject();
|
| | | activityItem.add(WicketUtils.createDatestampLabel("title", entry.startDate, getTimeZone(), getTimeUtils()));
|
| | |
| | | new ListDataProvider<RepositoryCommit>(entry.getCommits())) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryCommit> commitItem) {
|
| | | final RepositoryCommit commit = commitItem.getModelObject();
|
| | |
|
| | |
| | | super(event, true, new Model<String>(msg));
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected String newValue(final String currentValue, final String replacementValue) {
|
| | | String prefix = "var conf = confirm('" + replacementValue + "'); "
|
| | | + "if (!conf) return false; ";
|
| | |
| | | initialValue = value;
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected String newValue(final String currentValue, final String message) {
|
| | | String result = "var userText = prompt('" + message + "','"
|
| | | + (initialValue == null ? "" : initialValue) + "'); " + "return userText; ";
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RefModel> item) {
|
| | | final RefModel entry = item.getModelObject();
|
| | |
|
| | |
| | | DataView<String> listView = new DataView<String>("list", listDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<String> item) {
|
| | | String entry = item.getModelObject();
|
| | | item.add(new Label("listItem", entry));
|
| | |
| | | DataView<ChangeType> legendsView = new DataView<ChangeType>("legend", legendDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<ChangeType> item) {
|
| | | ChangeType entry = item.getModelObject();
|
| | |
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.wicket.Component;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | | import org.apache.wicket.markup.repeater.Item;
|
| | |
| | | DataView<DailyLogEntry> pushView = new DataView<DailyLogEntry>("change", dp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<DailyLogEntry> logItem) {
|
| | | final DailyLogEntry change = logItem.getModelObject();
|
| | | String fullRefName = change.getChangedRefs().get(0);
|
| | |
| | | DataView<RepositoryCommit> commitsView = new DataView<RepositoryCommit>("commit", cdp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryCommit> commitItem) {
|
| | | final RepositoryCommit commit = commitItem.getModelObject();
|
| | |
|
| | |
| | | DataView<DropDownMenuItem> view = new DataView<DropDownMenuItem>("menuItems", items) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<DropDownMenuItem> item) {
|
| | | DropDownMenuItem entry = item.getModelObject();
|
| | | if (entry.isDivider()) {
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<FederationProposal> item) {
|
| | | final FederationProposal entry = item.getModelObject();
|
| | | item.add(new LinkPanel("url", "list", entry.url, ReviewProposalPage.class,
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<FederationModel> item) {
|
| | | final FederationModel entry = item.getModelObject();
|
| | | item.add(new LinkPanel("url", "list", entry.url, FederationRegistrationPage.class,
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<String[]> item) {
|
| | | final String[] entry = item.getModelObject();
|
| | | final FederationToken token = FederationToken.fromName(entry[0]);
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RevCommit> item) {
|
| | | final RevCommit entry = item.getModelObject();
|
| | | final Date date = JGitUtils.getCommitDate(entry);
|
| | |
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
|
| | | import com.gitblit.BranchGraphServlet;
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.BranchGraphServlet;
|
| | | import com.gitblit.models.RefModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RevCommit> item) {
|
| | | final RevCommit entry = item.getModelObject();
|
| | | final Date date = JGitUtils.getCommitDate(entry);
|
| | |
| | | DataView<PageRegistration> refsView = new DataView<PageRegistration>("navLink", refsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<PageRegistration> item) {
|
| | | PageRegistration entry = item.getModelObject();
|
| | | if (entry.hiddenPhone) {
|
| | |
| | | return (src);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onComponentTag(ComponentTag tag) {
|
| | | super.onComponentTag(tag);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
|
| | | Response response = getResponse();
|
| | | response.write("\n");
|
| | |
| | | final DataView<PageObject> pagesView = new DataView<PageObject>("page", pagesProvider) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<PageObject> item) {
|
| | | PageObject pageItem = item.getModelObject();
|
| | | PageParameters pageParams = new PageParameters(baseParams);
|
| | |
| | | DataView<BreadCrumb> pathsView = new DataView<BreadCrumb>("path", crumbsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<BreadCrumb> item) {
|
| | | final BreadCrumb entry = item.getModelObject();
|
| | | String path = entry.path;
|
| | |
| | | DataView<RefLogEntry> changeView = new DataView<RefLogEntry>("change", dp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RefLogEntry> changeItem) {
|
| | | final RefLogEntry change = changeItem.getModelObject();
|
| | | String fullRefName = change.getChangedRefs().get(0);
|
| | |
| | | DataView<RepositoryCommit> commitsView = new DataView<RepositoryCommit>("commit", cdp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryCommit> commitItem) {
|
| | | final RepositoryCommit commit = commitItem.getModelObject();
|
| | |
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | private boolean alreadyInsertedBreak = !shouldBreak;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RefModel> item) {
|
| | | RefModel entry = item.getModelObject();
|
| | | String name = entry.displayName;
|
| | |
| | | return new OddEvenItem<RegistrantAccessPermission>(id, index, model); |
| | | } |
| | | |
| | | @Override |
| | | public void populateItem(final Item<RegistrantAccessPermission> item) { |
| | | final RegistrantAccessPermission entry = item.getModelObject(); |
| | | if (RegistrantType.REPOSITORY.equals(entry.registrantType)) { |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Override |
| | | protected void onUpdate(AjaxRequestTarget target) { |
| | | target.addComponent(permissionChoice); |
| | | } |
| | |
| | | add(addPermissionForm.setVisible(registrants.size() > 0)); |
| | | } |
| | | |
| | | @Override |
| | | protected boolean getStatelessHint() |
| | | { |
| | | return false; |
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryModel> item) {
|
| | | final RepositoryModel entry = item.getModelObject();
|
| | | if (entry instanceof GroupRepositoryModel) {
|
| | |
| | | DataView<RepositoryUrl> repoUrlMenuItems = new DataView<RepositoryUrl>("repoUrls", urlsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryUrl> item) {
|
| | | RepositoryUrl repoUrl = item.getModelObject();
|
| | | // repository url
|
| | |
| | | DataView<GitClientApplication> appMenus = new DataView<GitClientApplication>("appMenus", displayedAppsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<GitClientApplication> item) {
|
| | | final GitClientApplication clientApp = item.getModelObject();
|
| | |
|
| | |
| | | DataView<RepositoryUrl> actionItems = new DataView<RepositoryUrl>("actionItems", urlsDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RepositoryUrl> repoLinkItem) {
|
| | | RepositoryUrl repoUrl = repoLinkItem.getModelObject();
|
| | | Fragment fragment = new Fragment("actionItem", "actionFragment", this);
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RevCommit> item) {
|
| | | final RevCommit entry = item.getModelObject();
|
| | | final Date date = JGitUtils.getCommitDate(entry);
|
| | |
| | | setValue("height", height);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setValue(String name, String value) {
|
| | | // IE and other browsers handle movie/data differently. So movie is used
|
| | | // for IE, whereas
|
| | |
| | | parameters.put(parameter, value);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getValue(String name) {
|
| | | String parameter = name.toLowerCase();
|
| | | String value = null;
|
| | |
| | | return value;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onComponentTag(ComponentTag tag) {
|
| | | // get options from the markup
|
| | | IValueMap valueMap = tag.getAttributes();
|
| | |
| | | super.onComponentTag(tag);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
|
| | |
|
| | | super.onComponentTagBody(markupStream, openTag);
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | | int counter;
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<RefModel> item) {
|
| | | RefModel entry = item.getModelObject();
|
| | |
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<TeamModel> item) {
|
| | | final TeamModel entry = item.getModelObject();
|
| | | LinkPanel editLink = new LinkPanel("teamname", "list", entry.name,
|
| | |
| | | counter = 0;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void populateItem(final Item<UserModel> item) {
|
| | | final UserModel entry = item.getModelObject();
|
| | | LinkPanel editLink = new LinkPanel("username", "list", entry.username,
|
| | |
| | | import java.io.FilenameFilter; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.junit.After; |
| | | import org.junit.Before; |
| | |
| | | */ |
| | | package com.gitblit.tests; |
| | | |
| | | import com.gitblit.utils.JGitUtils; |
| | | import com.gitblit.utils.JnaUtils; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import static org.junit.Assert.assertEquals; |
| | | import static org.junit.Assert.assertNotNull; |
| | | import static org.junit.Assert.assertTrue; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.eclipse.jgit.lib.Repository; |
| | |
| | | import org.eclipse.jgit.util.FS; |
| | | import org.junit.Test; |
| | | |
| | | import com.gitblit.utils.JGitUtils; |
| | | import com.gitblit.utils.JnaUtils; |
| | | |
| | | /** |
| | | * |
| | | * @author Florian Zschocke |