|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 22-31
Link Here
|
| 22 |
|
22 |
|
| 23 |
public class CopyRepositoryNameAction extends CVSAction { |
23 |
public class CopyRepositoryNameAction extends CVSAction { |
| 24 |
public boolean isEnabled() { |
24 |
public boolean isEnabled() { |
| 25 |
return true; |
25 |
return getSelectedRepositories().length > 0; |
| 26 |
} |
26 |
} |
| 27 |
public void execute(IAction action) { |
27 |
public void execute(IAction action) { |
| 28 |
ICVSRepositoryLocation[] locations = getSelectedRepositories(); |
28 |
ICVSRepositoryLocation[] locations = getSelectedRepositories(); |
|
|
29 |
if (locations.length == 0) |
| 30 |
return; |
| 31 |
|
| 29 |
StringBuffer buffer = new StringBuffer(); |
32 |
StringBuffer buffer = new StringBuffer(); |
| 30 |
for (int i = 0; i < locations.length; i++) { |
33 |
for (int i = 0; i < locations.length; i++) { |
| 31 |
buffer.append(locations[i].getLocation(true)); |
34 |
buffer.append(locations[i].getLocation(true)); |
|
Lines 56-62
Link Here
|
| 56 |
} |
59 |
} |
| 57 |
private void copyToClipbard(Display display, String str) { |
60 |
private void copyToClipbard(Display display, String str) { |
| 58 |
Clipboard clipboard = new Clipboard(display); |
61 |
Clipboard clipboard = new Clipboard(display); |
| 59 |
clipboard.setContents(new String[] { str }, new Transfer[] { TextTransfer.getInstance()}); |
62 |
clipboard.setContents(new String[] { str }, new Transfer[] { TextTransfer.getInstance()}); |
| 60 |
clipboard.dispose(); |
63 |
clipboard.dispose(); |
| 61 |
} |
64 |
} |
| 62 |
} |
65 |
} |