Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 56313
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/dialogs/ProductInfoDialog.java (+43 lines)
Lines 24-39 Link Here
24
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.custom.StyleRange;
25
import org.eclipse.swt.custom.StyleRange;
26
import org.eclipse.swt.custom.StyledText;
26
import org.eclipse.swt.custom.StyledText;
27
import org.eclipse.swt.dnd.Clipboard;
28
import org.eclipse.swt.dnd.TextTransfer;
29
import org.eclipse.swt.dnd.Transfer;
27
import org.eclipse.swt.events.KeyAdapter;
30
import org.eclipse.swt.events.KeyAdapter;
28
import org.eclipse.swt.events.KeyEvent;
31
import org.eclipse.swt.events.KeyEvent;
32
import org.eclipse.swt.events.MenuEvent;
33
import org.eclipse.swt.events.MenuListener;
29
import org.eclipse.swt.events.MouseAdapter;
34
import org.eclipse.swt.events.MouseAdapter;
30
import org.eclipse.swt.events.MouseEvent;
35
import org.eclipse.swt.events.MouseEvent;
31
import org.eclipse.swt.events.MouseMoveListener;
36
import org.eclipse.swt.events.MouseMoveListener;
37
import org.eclipse.swt.events.SelectionAdapter;
38
import org.eclipse.swt.events.SelectionEvent;
39
import org.eclipse.swt.events.SelectionListener;
32
import org.eclipse.swt.events.TraverseEvent;
40
import org.eclipse.swt.events.TraverseEvent;
33
import org.eclipse.swt.events.TraverseListener;
41
import org.eclipse.swt.events.TraverseListener;
34
import org.eclipse.swt.graphics.Color;
42
import org.eclipse.swt.graphics.Color;
35
import org.eclipse.swt.graphics.Cursor;
43
import org.eclipse.swt.graphics.Cursor;
36
import org.eclipse.swt.graphics.Point;
44
import org.eclipse.swt.graphics.Point;
45
import org.eclipse.swt.widgets.Menu;
46
import org.eclipse.swt.widgets.MenuItem;
37
import org.eclipse.swt.widgets.Shell;
47
import org.eclipse.swt.widgets.Shell;
38
import org.eclipse.ui.PartInitException;
48
import org.eclipse.ui.PartInitException;
39
import org.eclipse.ui.PlatformUI;
49
import org.eclipse.ui.PlatformUI;
Lines 207-214 Link Here
207
                }
217
                }
208
            }
218
            }
209
        });
219
        });
220
        
221
        createMenu(styledText);
210
    }
222
    }
211
223
224
	private void createMenu(final StyledText text) {
225
		Menu menu = new Menu(text);
226
		final MenuItem copyItem = new MenuItem(menu, SWT.PUSH);
227
		copyItem.setText(WorkbenchMessages.AboutDialog_copy);
228
229
		SelectionListener listener = new SelectionAdapter() {
230
			public void widgetSelected(SelectionEvent e) {
231
				if (e.widget == copyItem) {
232
					Clipboard clipboard = new Clipboard(text.getDisplay());
233
					String textToCopy = (text.getSelectionCount() > 0) ? text
234
							.getSelectionText() : text.getText();
235
					Object[] o = new Object[] { textToCopy };
236
					Transfer[] t = new Transfer[] { TextTransfer.getInstance() };
237
					clipboard.setContents(o, t);
238
					clipboard.dispose();
239
				}
240
			}
241
		};
242
		copyItem.addSelectionListener(listener);
243
		menu.addMenuListener(new MenuListener() {
244
			public void menuShown(MenuEvent e) {
245
				// always enabled...
246
				copyItem.setEnabled(true);
247
			}
248
249
			public void menuHidden(MenuEvent e) {
250
			}
251
		});
252
		text.setMenu(menu);
253
	}
254
212
    /**
255
    /**
213
     * Gets the busy cursor.
256
     * Gets the busy cursor.
214
     * @return the busy cursor
257
     * @return the busy cursor
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java (+1 lines)
Lines 261-266 Link Here
261
	public static String AboutDialog_pluginInfo;
261
	public static String AboutDialog_pluginInfo;
262
	public static String AboutDialog_systemInfo;
262
	public static String AboutDialog_systemInfo;
263
	public static String AboutDialog_defaultProductName;
263
	public static String AboutDialog_defaultProductName;
264
	public static String AboutDialog_copy;
264
	public static String ProductInfoDialog_errorTitle;
265
	public static String ProductInfoDialog_errorTitle;
265
	public static String ProductInfoDialog_unableToOpenWebBrowser;
266
	public static String ProductInfoDialog_unableToOpenWebBrowser;
266
	public static String PreferencesExportDialog_ErrorDialogTitle;
267
	public static String PreferencesExportDialog_ErrorDialogTitle;
(-)Eclipse UI/org/eclipse/ui/internal/messages.properties (+1 lines)
Lines 220-225 Link Here
220
AboutDialog_pluginInfo = &Plug-in Details
220
AboutDialog_pluginInfo = &Plug-in Details
221
AboutDialog_systemInfo = &Configuration Details
221
AboutDialog_systemInfo = &Configuration Details
222
AboutDialog_defaultProductName =
222
AboutDialog_defaultProductName =
223
AboutDialog_copy = Copy
223
ProductInfoDialog_errorTitle = Problems Opening Link
224
ProductInfoDialog_errorTitle = Problems Opening Link
224
ProductInfoDialog_unableToOpenWebBrowser = Unable to open web browser on {0}
225
ProductInfoDialog_unableToOpenWebBrowser = Unable to open web browser on {0}
225
PreferencesExportDialog_ErrorDialogTitle=Error
226
PreferencesExportDialog_ErrorDialogTitle=Error

Return to bug 56313