KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > correction > ExternalizeStringsResolution


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.correction;
12
13 import org.eclipse.core.resources.IMarker;
14 import org.eclipse.jface.viewers.IStructuredSelection;
15 import org.eclipse.jface.viewers.StructuredSelection;
16 import org.eclipse.pde.core.IBaseModel;
17 import org.eclipse.pde.internal.ui.PDEUIMessages;
18 import org.eclipse.pde.internal.ui.nls.GetNonExternalizedStringsAction;
19 import org.eclipse.pde.internal.ui.util.SWTUtil;
20 import org.eclipse.swt.custom.BusyIndicator;
21
22 public class ExternalizeStringsResolution extends AbstractPDEMarkerResolution {
23     
24     public ExternalizeStringsResolution(int type) {
25         super(type);
26     }
27     
28     public void run(final IMarker marker) {
29         BusyIndicator.showWhile(SWTUtil.getStandardDisplay(), new Runnable JavaDoc() {
30             public void run() {
31                 GetNonExternalizedStringsAction fGetExternAction = new GetNonExternalizedStringsAction();
32                 IStructuredSelection selection = new StructuredSelection(marker.getResource().getProject());
33                 fGetExternAction.selectionChanged(null, selection);
34                 fGetExternAction.run(null);
35             }
36         });
37     }
38     
39     protected void createChange(IBaseModel model) {
40         // nothin to do - all handled by run
41
}
42
43     public String JavaDoc getDescription() {
44         return PDEUIMessages.ExternalizeStringsResolution_desc;
45     }
46
47     public String JavaDoc getLabel() {
48         return PDEUIMessages.ExternalizeStringsResolution_label;
49     }
50     
51 }
52
Popular Tags