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 361123 | Differences between
and this patch

Collapse All | Expand All

(-)a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+1 lines)
Lines 1439-1444 Link Here
1439
	public static String EditorActions_cut;
1439
	public static String EditorActions_cut;
1440
	public static String EditorActions_copy;
1440
	public static String EditorActions_copy;
1441
	public static String EditorActions_paste;
1441
	public static String EditorActions_paste;
1442
	public static String EditorActions_selectall;
1442
	public static String EditorActions_revert;
1443
	public static String EditorActions_revert;
1443
	public static String Actions_open_label;
1444
	public static String Actions_open_label;
1444
	public static String Actions_delete_label;
1445
	public static String Actions_delete_label;
(-)a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditorContributor.java (-4 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2012 IBM Corporation and others.
2
 * Copyright (c) 2003, 2014 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 10-17 Link Here
10
 *     Joern Dinkla <devnull@dinkla.com> - bug 197821
10
 *     Joern Dinkla <devnull@dinkla.com> - bug 197821
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.pde.internal.ui.editor;
12
package org.eclipse.pde.internal.ui.editor;
13
14
import org.eclipse.jface.action.Action;
15
13
16
import java.util.Hashtable;
14
import java.util.Hashtable;
17
import org.eclipse.jface.action.*;
15
import org.eclipse.jface.action.*;
Lines 42-47 Link Here
42
	private ClipboardAction fCopyAction;
40
	private ClipboardAction fCopyAction;
43
41
44
	private ClipboardAction fPasteAction;
42
	private ClipboardAction fPasteAction;
43
44
	private SelectAllAction fSelectAllAction;
45
45
46
	private Hashtable<String, Action> fGlobalActions = new Hashtable<String, Action>();
46
	private Hashtable<String, Action> fGlobalActions = new Hashtable<String, Action>();
47
47
Lines 123-128 Link Here
123
		}
123
		}
124
	}
124
	}
125
125
126
	class SelectAllAction extends ClipboardAction {
127
		public SelectAllAction() {
128
			super(ActionFactory.SELECT_ALL.getId());
129
			setText(PDEUIMessages.EditorActions_selectall);
130
			setActionDefinitionId(ActionFactory.SELECT_ALL.getCommandId());
131
			setEnabled(true);
132
		}
133
	}
134
126
	class SaveAction extends Action implements IUpdate {
135
	class SaveAction extends Action implements IUpdate {
127
		public SaveAction() {
136
		public SaveAction() {
128
		}
137
		}
Lines 168-173 Link Here
168
		mng.add(fCutAction);
177
		mng.add(fCutAction);
169
		mng.add(fCopyAction);
178
		mng.add(fCopyAction);
170
		mng.add(fPasteAction);
179
		mng.add(fPasteAction);
180
		mng.add(new Separator());
181
		mng.add(fSelectAllAction);
171
		mng.add(new Separator());
182
		mng.add(new Separator());
172
		mng.add(fRevertAction);
183
		mng.add(fRevertAction);
173
	}
184
	}
Lines 221-226 Link Here
221
		fCutAction = new CutAction();
232
		fCutAction = new CutAction();
222
		fCopyAction = new CopyAction();
233
		fCopyAction = new CopyAction();
223
		fPasteAction = new PasteAction();
234
		fPasteAction = new PasteAction();
235
		fSelectAllAction = new SelectAllAction();
224
		addGlobalAction(ActionFactory.CUT.getId(), fCutAction);
236
		addGlobalAction(ActionFactory.CUT.getId(), fCutAction);
225
		addGlobalAction(ActionFactory.COPY.getId(), fCopyAction);
237
		addGlobalAction(ActionFactory.COPY.getId(), fCopyAction);
226
		addGlobalAction(ActionFactory.PASTE.getId(), fPasteAction);
238
		addGlobalAction(ActionFactory.PASTE.getId(), fPasteAction);
Lines 229-235 Link Here
229
		addGlobalAction(ActionFactory.UNDO.getId());
241
		addGlobalAction(ActionFactory.UNDO.getId());
230
		addGlobalAction(ActionFactory.REDO.getId());
242
		addGlobalAction(ActionFactory.REDO.getId());
231
		// select/find
243
		// select/find
232
		addGlobalAction(ActionFactory.SELECT_ALL.getId());
244
		addGlobalAction(ActionFactory.SELECT_ALL.getId(), fSelectAllAction);
233
		addGlobalAction(ActionFactory.FIND.getId());
245
		addGlobalAction(ActionFactory.FIND.getId());
234
		// bookmark
246
		// bookmark
235
		addGlobalAction(IDEActionFactory.BOOKMARK.getId());
247
		addGlobalAction(IDEActionFactory.BOOKMARK.getId());
(-)a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoSection.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2000, 2010 IBM Corporation and others.
2
 *  Copyright (c) 2000, 2014 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 248-253 Link Here
248
		} else if (actionId.equals(ActionFactory.REDO.getId())) {
248
		} else if (actionId.equals(ActionFactory.REDO.getId())) {
249
			fSourceViewer.doOperation(ITextOperationTarget.REDO);
249
			fSourceViewer.doOperation(ITextOperationTarget.REDO);
250
			return true;
250
			return true;
251
		} else if (actionId.equals(ActionFactory.SELECT_ALL.getId())) {
252
			fSourceViewer.doOperation(ITextOperationTarget.SELECT_ALL);
251
		}
253
		}
252
		return false;
254
		return false;
253
	}
255
	}
(-)a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/LicenseFeatureSection.java (-3 / +42 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2010, 2012 IBM Corporation and others.
2
 *  Copyright (c) 2010, 2014 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 10-23 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.editor.feature;
11
package org.eclipse.pde.internal.ui.editor.feature;
12
12
13
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
14
15
import java.util.ArrayList;
13
import java.util.ArrayList;
16
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.jface.resource.JFaceResources;
15
import org.eclipse.jface.resource.JFaceResources;
18
import org.eclipse.jface.text.*;
16
import org.eclipse.jface.text.*;
19
import org.eclipse.jface.text.source.SourceViewer;
17
import org.eclipse.jface.text.source.SourceViewer;
20
import org.eclipse.jface.text.source.SourceViewerConfiguration;
18
import org.eclipse.jface.text.source.SourceViewerConfiguration;
19
import org.eclipse.jface.viewers.*;
21
import org.eclipse.jface.window.Window;
20
import org.eclipse.jface.window.Window;
22
import org.eclipse.pde.core.IEditable;
21
import org.eclipse.pde.core.IEditable;
23
import org.eclipse.pde.internal.core.PDECore;
22
import org.eclipse.pde.internal.core.PDECore;
Lines 29-38 Link Here
29
import org.eclipse.pde.internal.ui.editor.text.XMLConfiguration;
28
import org.eclipse.pde.internal.ui.editor.text.XMLConfiguration;
30
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.custom.*;
30
import org.eclipse.swt.custom.*;
31
import org.eclipse.swt.dnd.Clipboard;
32
import org.eclipse.swt.events.*;
32
import org.eclipse.swt.events.*;
33
import org.eclipse.swt.layout.GridData;
33
import org.eclipse.swt.layout.GridData;
34
import org.eclipse.swt.layout.GridLayout;
34
import org.eclipse.swt.layout.GridLayout;
35
import org.eclipse.swt.widgets.*;
35
import org.eclipse.swt.widgets.*;
36
import org.eclipse.ui.actions.ActionFactory;
36
import org.eclipse.ui.forms.IFormColors;
37
import org.eclipse.ui.forms.IFormColors;
37
import org.eclipse.ui.forms.widgets.*;
38
import org.eclipse.ui.forms.widgets.*;
38
39
Lines 175-180 Link Here
175
		fSourceViewer = new SourceViewer(localLicenseComposite, null, styles);
176
		fSourceViewer = new SourceViewer(localLicenseComposite, null, styles);
176
		fSourceViewer.configure(fSourceConfiguration);
177
		fSourceViewer.configure(fSourceConfiguration);
177
		fSourceViewer.setDocument(fDocument);
178
		fSourceViewer.setDocument(fDocument);
179
		fSourceViewer.addSelectionChangedListener(new ISelectionChangedListener() {
180
			public void selectionChanged(SelectionChangedEvent event) {
181
				updateSelection(event.getSelection());
182
			}
183
		});
178
		StyledText styledText = fSourceViewer.getTextWidget();
184
		StyledText styledText = fSourceViewer.getTextWidget();
179
		styledText.setFont(JFaceResources.getTextFont());
185
		styledText.setFont(JFaceResources.getTextFont());
180
		styledText.setMenu(getPage().getPDEEditor().getContextMenu());
186
		styledText.setMenu(getPage().getPDEEditor().getContextMenu());
Lines 330-333 Link Here
330
		}
336
		}
331
		super.commit(onSave);
337
		super.commit(onSave);
332
	}
338
	}
339
340
	public boolean doGlobalAction(String actionId) {
341
		if (actionId.equals(ActionFactory.CUT.getId())) {
342
			fSourceViewer.doOperation(ITextOperationTarget.CUT);
343
			return true;
344
		} else if (actionId.equals(ActionFactory.COPY.getId())) {
345
			fSourceViewer.doOperation(ITextOperationTarget.COPY);
346
			return true;
347
		} else if (actionId.equals(ActionFactory.PASTE.getId())) {
348
			fSourceViewer.doOperation(ITextOperationTarget.PASTE);
349
			return true;
350
		} else if (actionId.equals(ActionFactory.DELETE.getId())) {
351
			fSourceViewer.doOperation(ITextOperationTarget.DELETE);
352
			return true;
353
		} else if (actionId.equals(ActionFactory.UNDO.getId())) {
354
			fSourceViewer.doOperation(ITextOperationTarget.UNDO);
355
			return true;
356
		} else if (actionId.equals(ActionFactory.REDO.getId())) {
357
			fSourceViewer.doOperation(ITextOperationTarget.REDO);
358
			return true;
359
		} else if (actionId.equals(ActionFactory.SELECT_ALL.getId())) {
360
			fSourceViewer.doOperation(ITextOperationTarget.SELECT_ALL);
361
		}
362
		return false;
363
	}
364
365
	public boolean canPaste(Clipboard clipboard) {
366
		return fSourceViewer.canDoOperation(ITextOperationTarget.PASTE);
367
	}
368
369
	private void updateSelection(ISelection selection) {
370
		getPage().getPDEEditor().setSelection(selection);
371
	}
333
}
372
}
(-)a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties (+1 lines)
Lines 1187-1192 Link Here
1187
EditorActions_cut = Cu&t
1187
EditorActions_cut = Cu&t
1188
EditorActions_copy = &Copy
1188
EditorActions_copy = &Copy
1189
EditorActions_paste = &Paste
1189
EditorActions_paste = &Paste
1190
EditorActions_selectall = Select &All
1190
EditorActions_revert = Re&vert
1191
EditorActions_revert = Re&vert
1191
Actions_open_label = &Open
1192
Actions_open_label = &Open
1192
Actions_delete_label = &Delete
1193
Actions_delete_label = &Delete

Return to bug 361123