Add missing NetBeans *.form files.
[nbgit.git] / src / org / netbeans / modules / git / ui / status / VersioningPanel.java
blob7b308594eabc67e85dc8c1af92969ad117f599e7
1 package org.netbeans.modules.git.ui.status;
3 import java.awt.Component;
4 import java.awt.Container;
5 import java.awt.Dimension;
6 import java.awt.Font;
7 import java.awt.FontMetrics;
8 import java.awt.Graphics2D;
9 import java.awt.GridBagConstraints;
10 import java.awt.Insets;
11 import java.awt.LayoutManager;
12 import java.awt.event.ActionListener;
13 import java.awt.event.MouseAdapter;
14 import java.awt.event.MouseEvent;
15 import java.awt.image.BufferedImage;
16 import java.beans.PropertyChangeEvent;
17 import java.beans.PropertyChangeListener;
18 import java.io.File;
19 import java.util.HashSet;
20 import java.util.Set;
21 import java.util.logging.Level;
22 import java.util.prefs.PreferenceChangeEvent;
23 import java.util.prefs.PreferenceChangeListener;
24 import javax.swing.AbstractButton;
25 import javax.swing.JComponent;
26 import javax.swing.JPanel;
27 import javax.swing.JProgressBar;
28 import javax.swing.JSeparator;
29 import javax.swing.JToggleButton;
30 import javax.swing.SwingUtilities;
31 import javax.swing.UIDefaults;
32 import javax.swing.UIManager;
33 import javax.swing.border.CompoundBorder;
34 import org.netbeans.api.progress.ProgressHandle;
35 import org.netbeans.api.progress.ProgressHandleFactory;
36 import org.netbeans.modules.git.FileInformation;
37 import org.netbeans.modules.git.FileStatusCache;
38 import org.netbeans.modules.git.Git;
39 import org.netbeans.modules.git.GitException;
40 import org.netbeans.modules.git.GitFileNode;
41 import org.netbeans.modules.git.GitModuleConfig;
42 import org.netbeans.modules.git.GitProgressSupport;
43 import org.netbeans.modules.git.ui.commit.CommitAction;
44 import org.netbeans.modules.git.ui.diff.DiffAction;
45 import org.netbeans.modules.git.ui.diff.Setup;
46 import org.netbeans.modules.git.ui.update.UpdateAction;
47 import org.netbeans.modules.git.util.GitCommand;
48 import org.netbeans.modules.git.util.GitUtils;
49 import org.netbeans.modules.versioning.spi.VCSContext;
50 import org.netbeans.modules.versioning.util.NoContentPanel;
51 import org.openide.LifecycleManager;
52 import org.openide.explorer.ExplorerManager;
53 import org.openide.nodes.Node;
54 import org.openide.util.Exceptions;
55 import org.openide.util.NbBundle;
56 import org.openide.util.RequestProcessor;
57 import org.openide.windows.TopComponent;
59 /**
60 * The main class of the Synchronize view, shows and acts on set of file roots.
62 * @author Maros Sandor
64 class VersioningPanel extends JPanel implements ExplorerManager.Provider, PreferenceChangeListener, PropertyChangeListener, ActionListener {
66 private ExplorerManager explorerManager;
67 private final GitVersioningTopComponent parentTopComponent;
68 private final Git mercurial;
69 private VCSContext context;
70 private int displayStatuses;
71 private String branchInfo;
72 private SyncTable syncTable;
73 private RequestProcessor.Task refreshViewTask;
74 private Thread refreshViewThread;
76 private GitProgressSupport hgProgressSupport;
77 private static final RequestProcessor rp = new RequestProcessor("MercurialView", 1, true); // NOI18N
79 private final NoContentPanel noContentComponent = new NoContentPanel();
81 private static final int HG_UPDATE_TARGET_LIMIT = 100;
83 /**
84 * Creates a new Synchronize Panel managed by the given versioning system.
86 * @param parent enclosing top component
88 public VersioningPanel(GitVersioningTopComponent parent) {
89 this.parentTopComponent = parent;
90 this.mercurial = Git.getInstance();
91 refreshViewTask = rp.create(new RefreshViewTask());
92 explorerManager = new ExplorerManager();
93 displayStatuses = FileInformation.STATUS_LOCAL_CHANGE;
94 noContentComponent.setLabel(NbBundle.getMessage(VersioningPanel.class, "MSG_No_Changes_All")); // NOI18N
95 syncTable = new SyncTable();
97 initComponents();
98 setVersioningComponent(syncTable.getComponent());
99 reScheduleRefresh(0);
101 // XXX click it in form editor, probbaly requires Mattisse >=v2
102 jPanel2.setFloatable(false);
103 jPanel2.putClientProperty("JToolBar.isRollover", Boolean.TRUE); // NOI18N
104 jPanel2.setLayout(new ToolbarLayout());
108 public void preferenceChange(PreferenceChangeEvent evt) {
109 if (evt.getKey().startsWith(GitModuleConfig.PROP_COMMIT_EXCLUSIONS)) {
110 repaint();
115 public void propertyChange(PropertyChangeEvent evt) {
117 if (evt.getPropertyName() == FileStatusCache.PROP_FILE_STATUS_CHANGED) {
118 FileStatusCache.ChangedEvent changedEvent = (FileStatusCache.ChangedEvent) evt.getNewValue();
119 Git.LOG.log(Level.FINE, "Status.propertyChange(): {0} file: {1}", new Object [] { parentTopComponent.getContentTitle(), changedEvent.getFile()} ); // NOI18N
120 if (affectsView(evt)) {
121 reScheduleRefresh(1000);
123 return;
125 if (evt.getPropertyName() == Git.PROP_CHANGESET_CHANGED) {
126 Object source = evt.getOldValue();
127 File root = GitUtils.getRootFile(context);
128 Git.LOG.log(Level.FINE, "Git.changesetChanged: source {0} repo {1} ", new Object [] {source, root}); // NOI18N
129 if (root != null && root.equals(source)) {
130 reScheduleRefresh(1000);
132 return;
134 if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
135 TopComponent tc = (TopComponent) SwingUtilities.getAncestorOfClass(TopComponent.class, this);
136 if (tc != null) {
137 tc.setActivatedNodes((Node[]) evt.getNewValue());
139 return;
144 * Sets roots (directories) to display in the view.
146 * @param ctx new context if the Versioning panel
148 void setContext(VCSContext ctx) {
149 context = ctx;
150 //reScheduleRefresh(0);
153 public ExplorerManager getExplorerManager() {
154 return explorerManager;
157 @Override
158 public void addNotify() {
159 super.addNotify();
160 GitModuleConfig.getDefault().getPreferences().addPreferenceChangeListener(this);
161 mercurial.getFileStatusCache().addPropertyChangeListener(this);
162 mercurial.addPropertyChangeListener(this);
163 explorerManager.addPropertyChangeListener(this);
164 reScheduleRefresh(0); // the view does not listen for changes when it is not visible
167 @Override
168 public void removeNotify() {
169 GitModuleConfig.getDefault().getPreferences().removePreferenceChangeListener(this);
170 mercurial.getFileStatusCache().removePropertyChangeListener(this);
171 mercurial.removePropertyChangeListener(this);
172 explorerManager.removePropertyChangeListener(this);
173 super.removeNotify();
176 private void setVersioningComponent(JComponent component) {
177 Component [] children = getComponents();
178 for (int i = 0; i < children.length; i++) {
179 Component child = children[i];
180 if (child != jPanel2) {
181 if (child == component) {
182 return;
183 } else {
184 remove(child);
185 break;
189 GridBagConstraints gbc = new GridBagConstraints();
190 gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.gridheight = 1;
191 gbc.anchor = GridBagConstraints.FIRST_LINE_START; gbc.fill = GridBagConstraints.BOTH;
192 gbc.weightx = 1; gbc.weighty = 1;
194 add(component, gbc);
195 revalidate();
196 repaint();
200 * Must NOT be run from AWT.
202 private void setupModels() {
203 if (context == null) {
204 SwingUtilities.invokeLater(new Runnable() {
205 public void run() {
206 syncTable.setTableModel(new SyncFileNode[0]);
207 File root = GitUtils.getRootFile(GitUtils.getCurrentContext(null));
208 /* #126311: Optimize UI for Large repos
209 if (root != null) {
210 String[] info = getRepositoryBranchInfo(root);
211 String rev = info != null ? info[1] : null;
212 String changeset = info != null ? info[2] : null;
213 setRepositoryBranchInfo(rev, changeset);
217 return;
219 // XXX attach Cancelable hook
220 final ProgressHandle ph = ProgressHandleFactory.createHandle(NbBundle.getMessage(VersioningPanel.class, "MSG_Refreshing_Versioning_View")); // NOI18N
221 try {
222 refreshViewThread = Thread.currentThread();
223 Thread.interrupted(); // clear interupted status
224 ph.start();
225 final SyncFileNode [] nodes = getNodes(context, displayStatuses); // takes long
227 if (nodes == null) {
228 return;
229 // finally section
232 final String [] tableColumns;
233 final String branchTitle;
234 File [] files = context.getRootFiles().toArray(new File[context.getRootFiles().size()]);
235 if (files == null || files.length == 0) return;
237 /* #126311: Optimize UI for Large repos
238 File root = mercurial.getTopmostManagedParent(files[0]);
239 String[] info = getRepositoryBranchInfo(root);
240 String branchName = info != null ? info[0] : null;
241 String rev = info != null ? info[1] : null;
242 String changeset = info != null ? info[2] : null;
243 if (branchName != null && !branchName.equals("")) {
244 branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_BranchTitle", branchName); // NOI18N
245 } else {
246 branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_UnnamedBranchTitle"); // NOI18N
248 if (nodes.length > 0) {
249 boolean stickyCommon = false;
250 for (int i = 1; i < nodes.length; i++) {
251 if (Thread.interrupted()) {
252 // TODO set model that displays that fact to user
253 return;
256 tableColumns = new String [] { SyncFileNode.COLUMN_NAME_NAME, SyncFileNode.COLUMN_NAME_STATUS, SyncFileNode.COLUMN_NAME_PATH };
257 } else {
258 tableColumns = null;
260 /* #126311: Optimize UI for Large repos
261 setRepositoryBranchInfo(rev, changeset);
263 SwingUtilities.invokeLater(new Runnable() {
264 public void run() {
265 if (nodes.length > 0) {
266 syncTable.setColumns(tableColumns);
267 setVersioningComponent(syncTable.getComponent());
268 } else {
269 /* #126311: Optimize UI for Large repos
270 parentTopComponent.setBranchTitle(branchTitle); */
271 setVersioningComponent(noContentComponent);
273 syncTable.setTableModel(nodes);
274 // finally section, it's enqueued after this request
277 } finally {
278 SwingUtilities.invokeLater(new Runnable() {
279 public void run() {
280 ph.finish();
288 private void setRepositoryBranchInfo(String rev, String changeset){
289 String branchInfo = null;
290 if (rev != null && !rev.equals("-1")) {
291 branchInfo = org.openide.util.NbBundle.getMessage(VersioningPanel.class,
292 "CTL_VersioningView_BranchInfo", // NOI18N
293 rev, changeset);
294 } else {
295 branchInfo = org.openide.util.NbBundle.getMessage(VersioningPanel.class,
296 "CTL_VersioningView_BranchInfoNotCommitted"); // NOI18N
298 String repositoryStatus = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_StatusTitle", branchInfo); // NOI18N
299 if( !repositoryStatus.equals(statusLabel.getText())){
300 statusLabel.setText(repositoryStatus);
304 private String[] getRepositoryBranchInfo(File root){
305 String infoStr = null;
306 try {
307 infoStr = GitCommand.getBranchInfo(root);
308 } catch (GitException ex) {
309 Exceptions.printStackTrace(ex);
311 return infoStr == null ? null: infoStr.split(":");
314 private SyncFileNode [] getNodes(VCSContext context, int includeStatus) {
315 GitFileNode [] fnodes = mercurial.getNodes(context, includeStatus);
316 SyncFileNode [] nodes = new SyncFileNode[fnodes.length];
317 for (int i = 0; i < fnodes.length; i++) {
318 if (Thread.interrupted()) return null;
319 GitFileNode fnode = fnodes[i];
320 nodes[i] = new SyncFileNode(fnode, this);
322 return nodes;
325 public int getDisplayStatuses() {
326 return displayStatuses;
329 public String getDisplayBranchInfo() {
330 return branchInfo;
334 * Performs the "cvs commit" command on all diplayed roots plus "cvs add" for files that are not yet added. // NOI18N
336 private void onCommitAction() {
337 //TODO: Status Commit Action
338 LifecycleManager.getDefault().saveAll();
339 CommitAction.commit(parentTopComponent.getContentTitle(), context);
343 * Performs the "cvs update" command on all diplayed roots. // NOI18N
345 private void onUpdateAction() {
346 UpdateAction.update(context);
347 parentTopComponent.contentRefreshed();
351 * Refreshes statuses of all files in the view. It does
352 * that by issuing the "hg status -marduiC" command, updating the cache
353 * and refreshing file nodes.
355 private void onRefreshAction() {
356 LifecycleManager.getDefault().saveAll();
357 if(context == null || context.getRootFiles().size() == 0) {
358 return;
360 refreshStatuses();
364 * Programmatically invokes the Refresh action.
365 * Connects to repository and gets recent status.
367 void performRefreshAction() {
368 refreshStatuses();
371 /* Async Connects to repository and gets recent status. */
372 private void refreshStatuses() {
373 if(hgProgressSupport!=null) {
374 hgProgressSupport.cancel();
375 hgProgressSupport = null;
378 final String repository = GitUtils.getRootPath(context);
379 if (repository == null) return;
381 RequestProcessor rp = Git.getInstance().getRequestProcessor(repository);
382 hgProgressSupport = new GitProgressSupport() {
383 public void perform() {
384 StatusAction.executeStatus(context, this);
385 setupModels();
389 parentTopComponent.contentRefreshed();
390 hgProgressSupport.start(rp, repository, org.openide.util.NbBundle.getMessage(VersioningPanel.class, "LBL_Refresh_Progress")); // NOI18N
395 * Shows Diff panel for all files in the view. The initial type of diff depends on the sync mode: Local, Remote, All.
396 * In Local mode, the diff shows CURRENT <-> BASE differences. In Remote mode, it shows BASE<->HEAD differences.
398 private void onDiffAction() {
399 String title = parentTopComponent.getContentTitle();
400 if (displayStatuses == FileInformation.STATUS_LOCAL_CHANGE) {
401 LifecycleManager.getDefault().saveAll();
402 DiffAction.diff(context, Setup.DIFFTYPE_LOCAL, title);
403 } else if (displayStatuses == FileInformation.STATUS_REMOTE_CHANGE) {
404 DiffAction.diff(context, Setup.DIFFTYPE_REMOTE, title);
405 } else {
406 LifecycleManager.getDefault().saveAll();
407 DiffAction.diff(context, Setup.DIFFTYPE_ALL, title);
412 private void onDisplayedStatusChanged() {
413 setDisplayStatuses(FileInformation.STATUS_REMOTE_CHANGE | FileInformation.STATUS_LOCAL_CHANGE);
414 noContentComponent.setLabel(NbBundle.getMessage(VersioningPanel.class, "MSG_No_Changes_All")); // NOI18N
417 private void setDisplayStatuses(int displayStatuses) {
418 this.displayStatuses = displayStatuses;
419 reScheduleRefresh(0);
422 private boolean affectsView(PropertyChangeEvent event) {
423 FileStatusCache.ChangedEvent changedEvent = (FileStatusCache.ChangedEvent) event.getNewValue();
424 File file = changedEvent.getFile();
425 FileInformation oldInfo = changedEvent.getOldInfo();
426 FileInformation newInfo = changedEvent.getNewInfo();
427 if (oldInfo == null) {
428 if ((newInfo.getStatus() & displayStatuses) == 0) return false;
429 } else {
430 if ((oldInfo.getStatus() & displayStatuses) + (newInfo.getStatus() & displayStatuses) == 0) return false;
432 return context == null? false: context.contains(file);
435 /** Reloads data from cache */
436 private void reScheduleRefresh(int delayMillis) {
437 refreshViewTask.schedule(delayMillis);
440 // HACK copy&paste HACK, replace by save/restore of column width/position
441 void deserialize() {
442 if (syncTable != null) {
443 SwingUtilities.invokeLater(new Runnable() {
444 public void run() {
445 syncTable.setDefaultColumnSizes();
451 void focus() {
452 syncTable.focus();
456 * Cancels both:
457 * <ul>
458 * <li>cache data fetching
459 * <li>background cvs -N update
460 * </ul>
462 public void cancelRefresh() {
463 refreshViewTask.cancel();
466 private class RefreshViewTask implements Runnable {
467 public void run() {
468 setupModels();
473 * Hardcoded toolbar layout. It eliminates need
474 * for nested panels their look is hardly maintanable
475 * accross several look and feels
476 * (e.g. strange layouting panel borders on GTK+).
478 * <p>It sets authoritatively component height and takes
479 * "prefered" width from components itself. // NOI18N
482 private class ToolbarLayout implements LayoutManager {
484 /** Expected border height */
485 private int TOOLBAR_HEIGHT_ADJUSTMENT = 4;
487 private int TOOLBAR_SEPARATOR_MIN_WIDTH = 12;
489 /** Cached toolbar height */
490 private int toolbarHeight = -1;
492 /** Guard for above cache. */
493 private Dimension parentSize;
495 private Set<JComponent> adjusted = new HashSet<JComponent>();
497 public void removeLayoutComponent(Component comp) {
500 public void layoutContainer(Container parent) {
501 Dimension dim = VersioningPanel.this.getSize();
502 Dimension max = parent.getSize();
504 int reminder = max.width - minimumLayoutSize(parent).width;
506 int components = parent.getComponentCount();
507 int horizont = 0;
508 for (int i = 0; i<components; i++) {
509 JComponent comp = (JComponent) parent.getComponent(i);
510 if (comp.isVisible() == false) continue;
511 comp.setLocation(horizont, 0);
512 Dimension pref = comp.getPreferredSize();
513 int width = pref.width;
514 if (comp instanceof JSeparator && ((dim.height - dim.width) <= 0)) {
515 width = Math.max(width, TOOLBAR_SEPARATOR_MIN_WIDTH);
517 if (comp instanceof JProgressBar && reminder > 0) {
518 width += reminder;
520 // if (comp == getMiniStatus()) {
521 // width = reminder;
522 // }
524 // in column layout use taller toolbar
525 int height = getToolbarHeight(dim) -1;
526 comp.setSize(width, height); // 1 verySoftBevel compensation
527 horizont += width;
531 public void addLayoutComponent(String name, Component comp) {
534 public Dimension minimumLayoutSize(Container parent) {
536 // in column layout use taller toolbar
537 Dimension dim = VersioningPanel.this.getSize();
538 int height = getToolbarHeight(dim);
540 int components = parent.getComponentCount();
541 int horizont = 0;
542 for (int i = 0; i<components; i++) {
543 Component comp = parent.getComponent(i);
544 if (comp.isVisible() == false) continue;
545 if (comp instanceof AbstractButton) {
546 adjustToobarButton((AbstractButton)comp);
547 } else {
548 adjustToolbarComponentSize((JComponent)comp);
550 Dimension pref = comp.getPreferredSize();
551 int width = pref.width;
552 if (comp instanceof JSeparator && ((dim.height - dim.width) <= 0)) {
553 width = Math.max(width, TOOLBAR_SEPARATOR_MIN_WIDTH);
555 horizont += width;
558 return new Dimension(horizont, height);
561 public Dimension preferredLayoutSize(Container parent) {
562 // Eliminates double height toolbar problem
563 Dimension dim = VersioningPanel.this.getSize();
564 int height = getToolbarHeight(dim);
566 return new Dimension(Integer.MAX_VALUE, height);
570 * Computes vertical toolbar components height that can used for layout manager hinting.
571 * @return size based on font size and expected border.
573 private int getToolbarHeight(Dimension parent) {
575 if (parentSize == null || (parentSize.equals(parent) == false)) {
576 parentSize = parent;
577 toolbarHeight = -1;
580 if (toolbarHeight == -1) {
581 BufferedImage image = new BufferedImage(1,1,BufferedImage.TYPE_BYTE_GRAY);
582 Graphics2D g = image.createGraphics();
583 UIDefaults def = UIManager.getLookAndFeelDefaults();
585 int height = 0;
586 String[] fonts = {"Label.font", "Button.font", "ToggleButton.font"}; // NOI18N
587 for (int i=0; i<fonts.length; i++) {
588 Font f = def.getFont(fonts[i]);
589 FontMetrics fm = g.getFontMetrics(f);
590 height = Math.max(height, fm.getHeight());
592 toolbarHeight = height + TOOLBAR_HEIGHT_ADJUSTMENT;
593 if ((parent.height - parent.width) > 0) {
594 toolbarHeight += TOOLBAR_HEIGHT_ADJUSTMENT;
598 return toolbarHeight;
602 /** Toolbar controls must be smaller and should be transparent*/
603 private void adjustToobarButton(final AbstractButton button) {
605 if (adjusted.contains(button)) return;
607 // workaround for Ocean L&F clutter - toolbars use gradient.
608 // To make the gradient visible under buttons the content area must not
609 // be filled. To support rollover it must be temporarily filled
610 if (button instanceof JToggleButton == false) {
611 button.setContentAreaFilled(false);
612 button.setMargin(new Insets(0, 3, 0, 3));
613 button.setBorderPainted(false);
614 button.addMouseListener(new MouseAdapter() {
615 @Override
616 public void mouseEntered(MouseEvent e) {
617 button.setContentAreaFilled(true);
618 button.setBorderPainted(true);
621 @Override
622 public void mouseExited(MouseEvent e) {
623 button.setContentAreaFilled(false);
624 button.setBorderPainted(false);
629 adjustToolbarComponentSize(button);
632 private void adjustToolbarComponentSize(JComponent button) {
634 if (adjusted.contains(button)) return;
636 // as we cannot get the button small enough using the margin and border...
637 if (button.getBorder() instanceof CompoundBorder) { // from BasicLookAndFeel
638 Dimension pref = button.getPreferredSize();
640 // XXX #41827 workaround w2k, that adds eclipsis (...) instead of actual text
641 if ("Windows".equals(UIManager.getLookAndFeel().getID())) { // NOI18N
642 pref.width += 9;
644 button.setPreferredSize(pref);
647 adjusted.add(button);
651 /** This method is called from within the constructor to
652 * initialize the form.
653 * WARNING: Do NOT modify this code. The content of this method is
654 * always regenerated by the Form Editor.
656 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
657 private void initComponents() {
658 java.awt.GridBagConstraints gridBagConstraints;
660 jComboBox1 = new javax.swing.JComboBox();
661 jPanel2 = new javax.swing.JToolBar();
662 jPanel4 = new javax.swing.JPanel();
663 statusLabel = new javax.swing.JLabel();
664 jPanel1 = new javax.swing.JPanel();
665 jSeparator1 = new javax.swing.JSeparator();
666 jSeparator2 = new javax.swing.JSeparator();
667 btnRefresh = new javax.swing.JButton();
668 btnDiff = new javax.swing.JButton();
669 jPanel3 = new javax.swing.JPanel();
670 btnUpdate = new javax.swing.JButton();
671 btnCommit = new javax.swing.JButton();
672 jPanel5 = new javax.swing.JPanel();
674 jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
676 setLayout(new java.awt.GridBagLayout());
678 jPanel2.setBorderPainted(false);
680 jPanel4.setOpaque(false);
681 jPanel2.add(jPanel4);
683 java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/git/ui/status/Bundle"); // NOI18N
684 statusLabel.setText(bundle.getString("CTL_Versioning_Status_Table_Title")); // NOI18N
685 statusLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
686 statusLabel.setMaximumSize(new java.awt.Dimension(120, 17));
687 statusLabel.setMinimumSize(new java.awt.Dimension(120, 17));
688 jPanel2.add(statusLabel);
689 statusLabel.getAccessibleContext().setAccessibleName(bundle.getString("CTL_Versioning_Status_Table_Title")); // NOI18N
691 jPanel1.setOpaque(false);
692 jPanel1.add(jSeparator1);
694 jPanel2.add(jPanel1);
696 jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
697 jPanel2.add(jSeparator2);
699 btnRefresh.setToolTipText(org.openide.util.NbBundle.getMessage(VersioningPanel.class, "CTL_Synchronize_Action_Refresh_Tooltip")); // NOI18N
700 btnRefresh.setMaximumSize(new java.awt.Dimension(28, 28));
701 btnRefresh.setMinimumSize(new java.awt.Dimension(28, 28));
702 btnRefresh.setPreferredSize(new java.awt.Dimension(22, 25));
703 btnRefresh.addActionListener(this);
704 jPanel2.add(btnRefresh);
705 btnRefresh.getAccessibleContext().setAccessibleName("Refresh Status");
707 btnDiff.setToolTipText(bundle.getString("CTL_Synchronize_Action_Diff_Tooltip")); // NOI18N
708 btnDiff.setFocusable(false);
709 btnDiff.setPreferredSize(new java.awt.Dimension(22, 25));
710 btnDiff.addActionListener(this);
711 jPanel2.add(btnDiff);
712 btnDiff.getAccessibleContext().setAccessibleName("Diff All");
714 jPanel3.setOpaque(false);
715 jPanel2.add(jPanel3);
717 btnUpdate.setToolTipText(bundle.getString("CTL_Synchronize_Action_Update_Tooltip")); // NOI18N
718 btnUpdate.setFocusable(false);
719 btnUpdate.setPreferredSize(new java.awt.Dimension(22, 25));
720 btnUpdate.addActionListener(this);
721 jPanel2.add(btnUpdate);
722 btnUpdate.getAccessibleContext().setAccessibleName("Update");
724 btnCommit.setToolTipText(bundle.getString("CTL_CommitForm_Action_Commit_Tooltip")); // NOI18N
725 btnCommit.setFocusable(false);
726 btnCommit.setPreferredSize(new java.awt.Dimension(22, 25));
727 btnCommit.addActionListener(this);
728 jPanel2.add(btnCommit);
729 btnCommit.getAccessibleContext().setAccessibleName("Commit");
731 jPanel5.setOpaque(false);
732 jPanel2.add(jPanel5);
734 gridBagConstraints = new java.awt.GridBagConstraints();
735 gridBagConstraints.gridx = 0;
736 gridBagConstraints.gridy = 0;
737 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
738 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
739 gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
740 gridBagConstraints.weightx = 1.0;
741 gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 0);
742 add(jPanel2, gridBagConstraints);
745 // Code for dispatching events from components to event handlers.
747 public void actionPerformed(java.awt.event.ActionEvent evt) {
748 if (evt.getSource() == btnRefresh) {
749 VersioningPanel.this.btnRefreshActionPerformed(evt);
751 else if (evt.getSource() == btnDiff) {
752 VersioningPanel.this.btnDiffActionPerformed(evt);
754 else if (evt.getSource() == btnUpdate) {
755 VersioningPanel.this.btnUpdateActionPerformed(evt);
757 else if (evt.getSource() == btnCommit) {
758 VersioningPanel.this.btnCommitActionPerformed(evt);
760 }// </editor-fold>//GEN-END:initComponents
762 private void btnRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshActionPerformed
763 onRefreshAction();
764 }//GEN-LAST:event_btnRefreshActionPerformed
766 private void btnDiffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDiffActionPerformed
767 onDiffAction();
768 }//GEN-LAST:event_btnDiffActionPerformed
770 private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
771 onUpdateAction();
772 }//GEN-LAST:event_btnUpdateActionPerformed
774 private void btnCommitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCommitActionPerformed
775 onCommitAction();
776 }//GEN-LAST:event_btnCommitActionPerformed
779 // Variables declaration - do not modify//GEN-BEGIN:variables
780 private javax.swing.JButton btnCommit;
781 private javax.swing.JButton btnDiff;
782 private javax.swing.JButton btnRefresh;
783 private javax.swing.JButton btnUpdate;
784 private javax.swing.JComboBox jComboBox1;
785 private javax.swing.JPanel jPanel1;
786 private javax.swing.JToolBar jPanel2;
787 private javax.swing.JPanel jPanel3;
788 private javax.swing.JPanel jPanel4;
789 private javax.swing.JPanel jPanel5;
790 private javax.swing.JSeparator jSeparator1;
791 private javax.swing.JSeparator jSeparator2;
792 private javax.swing.JLabel statusLabel;
793 // End of variables declaration//GEN-END:variables