Author: snjeza
Date: 2010-02-10 16:52:51 -0500 (Wed, 10 Feb 2010)
New Revision: 20231
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5700 Simplify project examples update process
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -22,6 +22,13 @@
public static String ECFExamplesTransport_Loading;
public static String ECFExamplesTransport_ReceivedSize_Of_FileSize_At_RatePerSecond;
public static String ECFExamplesTransport_Server_redirected_too_many_times;
+ public static String FixDialog_Description;
+ public static String FixDialog_Finish;
+ public static String FixDialog_Fix;
+ public static String FixDialog_Requirement_details;
+ public static String FixDialog_Requirements;
+ public static String FixDialog_Short_description;
+ public static String FixDialog_Type;
public static String MarkerDialog_Description;
public static String MarkerDialog_Finish;
public static String MarkerDialog_Markers;
@@ -38,13 +45,17 @@
public static String NewProjectExamplesWizard_OverwriteProject;
public static String NewProjectExamplesWizard_Question;
public static String NewProjectExamplesWizardPage_Description;
+ public static String NewProjectExamplesWizardPage_Details;
public static String NewProjectExamplesWizardPage_Import_Project_Example;
+ public static String NewProjectExamplesWizardPage_Invalid_fix;
+ public static String NewProjectExamplesWizardPage_Note;
public static String NewProjectExamplesWizardPage_Project_Example;
public static String NewProjectExamplesWizardPage_Project_name;
public static String NewProjectExamplesWizardPage_Project_size;
public static String NewProjectExamplesWizardPage_Projects;
public static String NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog;
public static String NewProjectExamplesWizardPage_URL;
+ public static String PluginFix_Invalid_plugin_fix;
public static String Project_Unknown;
public static String ProjectExamplesActivator_All;
public static String ProjectExamplesActivator_Waiting;
@@ -53,10 +64,17 @@
public static String ProjectExamplesPreferencePage_Remove;
public static String ProjectExamplesPreferencePage_Show_experimental_sites;
public static String ProjectExamplesPreferencePage_Sites;
+ public static String ProjectFix_Missing_Drools_Runtime;
+ public static String ProjectFix_Missing_plugin;
+ public static String ProjectFix_Missing_Seam_Runtime;
+ public static String ProjectFix_Missing_WTP_Runtime;
+ public static String ProjectUtil_Invalid_fix;
public static String ProjectUtil_Invalid_preferences;
+ public static String ProjectUtil_Invalid_property;
public static String ProjectUtil_Invalid_URL;
public static String ProjectUtil_Invalid_welcome_element;
public static String ProjectUtil_Test;
+ public static String SeamRuntimeFix_Invalid_seam_runtime_fix;
public static String SiteDialog_Add_Project_Example_Site;
public static String SiteDialog_Browse;
public static String SiteDialog_Edit_Project_Example_Site;
@@ -68,6 +86,7 @@
public static String SiteDialog_URL;
public static String Sites_Plugin_provided_sites;
public static String Sites_User_sites;
+ public static String WTPRuntimeFix_Invalid_WTP_runtime_fix;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -29,6 +29,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.wizard.NewProjectExamplesWizardPage;
@@ -72,12 +73,12 @@
gd.heightHint = 300;
contents.setLayoutData(gd);
contents.setLayout(new GridLayout());
- getShell().setText("Fixing Requirements");
+ getShell().setText(Messages.FixDialog_Requirement_details);
applyDialogFont(contents);
initializeDialogUnits(area);
Label fixesLabel = new Label(contents, SWT.NULL);
- fixesLabel.setText("Requirements:");
+ fixesLabel.setText(Messages.FixDialog_Requirements);
tableViewer = new TableViewer(contents, SWT.H_SCROLL | SWT.V_SCROLL
| SWT.BORDER | SWT.SINGLE);
Table table = tableViewer.getTable();
@@ -87,7 +88,7 @@
table.setHeaderVisible(true);
table.setLinesVisible(true);
- String[] columnNames = new String[] { "Type", "Short description"
};
+ String[] columnNames = new String[] { Messages.FixDialog_Type,
Messages.FixDialog_Short_description };
int[] columnWidths = new int[] { 200, 350 };
for (int i = 0; i < columnNames.length; i++) {
@@ -101,7 +102,7 @@
tableViewer.setInput(fixes);
Label descriptionLabel = new Label(contents, SWT.NONE);
- descriptionLabel.setText("Description:");
+ descriptionLabel.setText(Messages.FixDialog_Description);
final Text description = new Text(contents, SWT.BORDER | SWT.MULTI | SWT.WRAP |
SWT.READ_ONLY);
gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL |
GridData.GRAB_VERTICAL);
gd.heightHint=50;
@@ -131,7 +132,7 @@
@Override
protected void createButtonsForButtonBar(Composite parent) {
- fixButton = createButton(parent, FIX_BUTTON, "Fix", true);
+ fixButton = createButton(parent, FIX_BUTTON, Messages.FixDialog_Fix, true);
if (fix == null) {
fixButton.setEnabled(false);
} else {
@@ -151,7 +152,7 @@
}
});
- createButton(parent, IDialogConstants.OK_ID, "Finish",
+ createButton(parent, IDialogConstants.OK_ID, Messages.FixDialog_Finish,
true);
}
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -2,6 +2,8 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
@@ -15,7 +17,7 @@
}
String symbolicName = fix.getProperties().get(ProjectFix.ID);
if (symbolicName == null) {
- ProjectExamplesActivator.log("Invalid plugin fix in " + project.getName() +
".");
+ ProjectExamplesActivator.log(NLS.bind(Messages.PluginFix_Invalid_plugin_fix,
project.getName()));
return true;
}
Bundle bundle = Platform.getBundle(symbolicName);
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -5,6 +5,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
@@ -26,7 +28,7 @@
private SeamRuntime getBestRuntime(Project project, ProjectFix fix) {
String allowedVersions = fix.getProperties().get(ProjectFix.ALLOWED_VERSIONS);
if (allowedVersions == null) {
- ProjectExamplesActivator.log("Invalid Seam runtime fix in " +
project.getName() + ".");
+ ProjectExamplesActivator.log(NLS.bind(Messages.SeamRuntimeFix_Invalid_seam_runtime_fix,
project.getName()));
return null;
}
StringTokenizer tokenizer = new StringTokenizer(allowedVersions,",");
//$NON-NLS-1$
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -3,15 +3,16 @@
import java.util.StringTokenizer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
@@ -64,8 +65,7 @@
String allowedTypes = fix.getProperties().get(
ProjectFix.ALLOWED_TYPES);
if (allowedTypes == null) {
- ProjectExamplesActivator.log("Invalid WTP runtime fix in "
- + project.getName() + ".");
+ ProjectExamplesActivator.log(NLS.bind(Messages.WTPRuntimeFix_Invalid_WTP_runtime_fix,
project.getName()));
return null;
}
StringTokenizer tokenizer = new StringTokenizer(allowedTypes, ",");
//$NON-NLS-1$
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2010-02-10
21:52:51 UTC (rev 20231)
@@ -9,6 +9,13 @@
# eg 241.73 KB of 30.95 MB (at 34.18 KB/s)
ECFExamplesTransport_ReceivedSize_Of_FileSize_At_RatePerSecond={0} of {1} (at {2}/s)
ECFExamplesTransport_Server_redirected_too_many_times=Server redirected too many times
+FixDialog_Description=Description:
+FixDialog_Finish=Finish
+FixDialog_Fix=Fix
+FixDialog_Requirement_details=Requirement details
+FixDialog_Requirements=Requirements:
+FixDialog_Short_description=Short description
+FixDialog_Type=Type
MarkerDialog_Description=Description
MarkerDialog_Finish=Finish
MarkerDialog_Markers=Markers:
@@ -25,13 +32,17 @@
NewProjectExamplesWizard_OverwriteProject=Overwrite project ''{0}''
NewProjectExamplesWizard_Question=Question
NewProjectExamplesWizardPage_Description=Description:
+NewProjectExamplesWizardPage_Details=Details...
NewProjectExamplesWizardPage_Import_Project_Example=Import Project Example
+NewProjectExamplesWizardPage_Invalid_fix=Invalid fix in {0}.
+NewProjectExamplesWizardPage_Note=This example has some requirements that could not be
automatically configured. When importing the example you might see some errors which would
need fixing manually or via Quick Fixes. Click "Details" to see more.
NewProjectExamplesWizardPage_Project_Example=Project Example
NewProjectExamplesWizardPage_Project_name=Project name:
NewProjectExamplesWizardPage_Project_size=Project size:
NewProjectExamplesWizardPage_Projects=Projects:
NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog=Show the Quick Fix dialog
NewProjectExamplesWizardPage_URL=URL:
+PluginFix_Invalid_plugin_fix=Invalid plugin fix in {0}.
Project_Unknown=Unknown
ProjectExamplesActivator_All=All
ProjectExamplesActivator_Waiting=Waiting...
@@ -40,11 +51,18 @@
ProjectExamplesPreferencePage_Remove=Remove
ProjectExamplesPreferencePage_Show_experimental_sites=Show experimental sites
ProjectExamplesPreferencePage_Sites=Sites
+ProjectFix_Missing_Drools_Runtime=Missing Drools Runtime
+ProjectFix_Missing_plugin=Missing plugin
+ProjectFix_Missing_Seam_Runtime=Missing Seam Runtime
+ProjectFix_Missing_WTP_Runtime=Missing WTP Runtime
+ProjectUtil_Invalid_fix=Invalid fix.
ProjectUtil_Invalid_preferences=Invalid preferences.
+ProjectUtil_Invalid_property=Invalid property.
ProjectUtil_Invalid_URL=Invalid URL\: {0}
ProjectUtil_Invalid_welcome_element=The welcome element has invalid the url attribute
ProjectUtil_Test=Test
NewProjectExamplesWizardPage_Site=Site\:
+SeamRuntimeFix_Invalid_seam_runtime_fix=Invalid Seam runtime fix in {0}.
SiteDialog_Add_Project_Example_Site=Add Project Example Site
SiteDialog_Browse=Browse...
SiteDialog_Edit_Project_Example_Site=Edit Project Example Site
@@ -56,3 +74,4 @@
SiteDialog_URL=URL:
Sites_Plugin_provided_sites=Plugin provided sites
Sites_User_sites=User sites
+WTPRuntimeFix_Invalid_WTP_runtime_fix=Invalid WTP runtime fix in {0}.
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -15,6 +15,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
public class ProjectFix {
@@ -31,18 +32,18 @@
public final static String DESCRIPTION = "description"; //$NON-NLS-1$
public final static String ANY = "any"; //$NON-NLS-1$
- public static final String SEAM_PREFERENCES_ID =
"org.jboss.tools.common.model.ui.seam";
- public static final String WTP_PREFERENCES_ID =
"org.eclipse.wst.server.ui.runtime.preferencePage";
+ public static final String SEAM_PREFERENCES_ID =
"org.jboss.tools.common.model.ui.seam"; //$NON-NLS-1$
+ public static final String WTP_PREFERENCES_ID =
"org.eclipse.wst.server.ui.runtime.preferencePage"; //$NON-NLS-1$
private String type;
private Map<String,String> properties = new HashMap<String,String>();
private static Map<String,String> shortDescriptions = new HashMap<String,
String>();
private static Map<String,Boolean> fixableMaps = new HashMap<String,
Boolean>();
static {
- shortDescriptions.put(WTP_RUNTIME, "Missing WTP Runtime");
- shortDescriptions.put(SEAM_RUNTIME, "Missing Seam Runtime");
- shortDescriptions.put(PLUGIN_TYPE, "Missing plugin");
- shortDescriptions.put(DROOLS_RUNTIME, "Missing Drools Runtime");
+ shortDescriptions.put(WTP_RUNTIME, Messages.ProjectFix_Missing_WTP_Runtime);
+ shortDescriptions.put(SEAM_RUNTIME, Messages.ProjectFix_Missing_Seam_Runtime);
+ shortDescriptions.put(PLUGIN_TYPE, Messages.ProjectFix_Missing_plugin);
+ shortDescriptions.put(DROOLS_RUNTIME, Messages.ProjectFix_Missing_Drools_Runtime);
fixableMaps.put(WTP_RUNTIME,true);
fixableMaps.put(SEAM_RUNTIME,true);
fixableMaps.put(PLUGIN_TYPE,true);
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -356,7 +356,7 @@
private static void parseFix(Project project, Element node) {
String type = node.getAttribute("type"); //$NON-NLS-1$
if (type == null || type.trim().length() <= 0) {
- ProjectExamplesActivator.log("Invalid fix.");
+ ProjectExamplesActivator.log(Messages.ProjectUtil_Invalid_fix);
return;
}
ProjectFix fix = new ProjectFix();
@@ -371,7 +371,7 @@
if (nodeName.equals("property")) { //$NON-NLS-1$
String name = child.getAttribute("name"); //$NON-NLS-1$
if (name == null || name.trim().length() <= 0) {
- ProjectExamplesActivator.log("Invalid property.");
+ ProjectExamplesActivator.log(Messages.ProjectUtil_Invalid_property);
return;
}
String value = getContent(child);
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-02-10
21:44:01 UTC (rev 20230)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-02-10
21:52:51 UTC (rev 20231)
@@ -30,6 +30,7 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -227,10 +228,10 @@
gd.heightHint=50;
gd.widthHint = 400;
noteText.setLayoutData(gd);
- noteText.setText("This example has some requirements that could not be
automatically configured. When importing the example you might see some errors which would
need fixing manually or via Quick Fixes. Click \"Details\" to see more.");
+ noteText.setText(Messages.NewProjectExamplesWizardPage_Note);
details = new Button(noteComposite, SWT.PUSH);
- details.setText("Details...");
+ details.setText(Messages.NewProjectExamplesWizardPage_Details);
details.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -296,7 +297,7 @@
if (ProjectFix.SEAM_RUNTIME.equals(type)) {
return new SeamRuntimeFix().canFix(project, fix);
}
- ProjectExamplesActivator.log("Invalid fix in " + project.getName() +
".");
+ ProjectExamplesActivator.log(NLS.bind(Messages.NewProjectExamplesWizardPage_Invalid_fix,
project.getName()));
return true;
}