You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/11/13 16:13:18 UTC
svn commit: r1769512 [14/15] - in /uima/uimaj/branches/experiment-v3-jcas:
uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/
uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/
uimaj-ep-cas-editor/src/main/java/org/apache/ui...
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-jcasgen/src/main/java/org/apache/uima/jcas/jcasgenp/ProgressMonitorImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-jcasgen/src/main/java/org/apache/uima/jcas/jcasgenp/ProgressMonitorImpl.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-jcasgen/src/main/java/org/apache/uima/jcas/jcasgenp/ProgressMonitorImpl.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-jcasgen/src/main/java/org/apache/uima/jcas/jcasgenp/ProgressMonitorImpl.java Sun Nov 13 16:13:16 2016
@@ -21,29 +21,61 @@ package org.apache.uima.jcas.jcasgenp;
import org.eclipse.core.runtime.IProgressMonitor;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ProgressMonitorImpl.
+ */
public class ProgressMonitorImpl implements org.apache.uima.tools.jcasgen.IProgressMonitor {
+
+ /** The fwd. */
private IProgressMonitor fwd;
+ /**
+ * Instantiates a new progress monitor impl.
+ *
+ * @param pm the pm
+ */
ProgressMonitorImpl(IProgressMonitor pm) {
fwd = pm;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.jcasgen.IProgressMonitor#done()
+ */
+ @Override
public void done() {
fwd.done();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.jcasgen.IProgressMonitor#beginTask(java.lang.String, int)
+ */
+ @Override
public void beginTask(String name, int totalWorked) {
fwd.beginTask(name, totalWorked);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.jcasgen.IProgressMonitor#subTask(java.lang.String)
+ */
+ @Override
public void subTask(String name) {
fwd.subTask(name);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.jcasgen.IProgressMonitor#worked(int)
+ */
+ @Override
public void worked(int work) {
fwd.worked(work);
}
+ /**
+ * Internal worked.
+ *
+ * @param work the work
+ */
/*
* (non-Javadoc)
*
@@ -52,6 +84,11 @@ public class ProgressMonitorImpl impleme
public void internalWorked(double work) {
}
+ /**
+ * Checks if is canceled.
+ *
+ * @return true, if is canceled
+ */
/*
* (non-Javadoc)
*
@@ -61,6 +98,11 @@ public class ProgressMonitorImpl impleme
return false;
}
+ /**
+ * Sets the canceled.
+ *
+ * @param value the new canceled
+ */
/*
* (non-Javadoc)
*
@@ -69,6 +111,11 @@ public class ProgressMonitorImpl impleme
public void setCanceled(boolean value) {
}
+ /**
+ * Sets the task name.
+ *
+ * @param name the new task name
+ */
/*
* (non-Javadoc)
*
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/LauncherPlugin.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/LauncherPlugin.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/LauncherPlugin.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-launcher/src/main/java/org/apache/uima/ep_launcher/LauncherPlugin.java Sun Nov 13 16:13:16 2016
@@ -25,19 +25,32 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.service.packageadmin.PackageAdmin;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class LauncherPlugin.
+ */
public class LauncherPlugin extends Plugin {
+ /** The Constant ID. */
public static final String ID = "org.apache.uima.launcher";
+ /** The plugin. */
private static LauncherPlugin plugin;
+ /** The bundle context. */
private BundleContext bundleContext;
+ /**
+ * Instantiates a new launcher plugin.
+ */
public LauncherPlugin() {
plugin = this;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
+ */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
@@ -45,12 +58,22 @@ public class LauncherPlugin extends Plug
bundleContext = context;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
+ /**
+ * Gets the bundles.
+ *
+ * @param bundleName the bundle name
+ * @param version the version
+ * @return the bundles
+ */
public Bundle[] getBundles(String bundleName, String version) {
Bundle[] bundles = Platform.getBundles(bundleName, version);
@@ -67,6 +90,12 @@ public class LauncherPlugin extends Plug
return null;
}
+ /**
+ * Gets the bundle.
+ *
+ * @param bundleName the bundle name
+ * @return the bundle
+ */
public Bundle getBundle(String bundleName) {
Bundle[] bundles = getBundles(bundleName, null);
if (bundles != null && bundles.length > 0)
@@ -78,6 +107,8 @@ public class LauncherPlugin extends Plug
/**
* Returns the shared instance.
+ *
+ * @return the default
*/
public static LauncherPlugin getDefault() {
return plugin;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearException.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearException.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearException.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearException.java Sun Nov 13 16:13:16 2016
@@ -27,6 +27,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
+// TODO: Auto-generated Javadoc
/**
*
* This is the generic exception used to handle exceptions related to PEAR.
@@ -34,37 +35,53 @@ import org.eclipse.swt.widgets.Shell;
*/
public class PearException extends Exception {
+ /** The Constant PLUGIN_ID. */
public static final String PLUGIN_ID = "org.apache.uima.pear"; //$NON-NLS-1$
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
+ /**
+ * Instantiates a new pear exception.
+ */
public PearException() {
super();
}
/**
- * @param message
+ * Instantiates a new pear exception.
+ *
+ * @param message the message
*/
public PearException(String message) {
super(message);
}
/**
- * @param cause
+ * Instantiates a new pear exception.
+ *
+ * @param cause the cause
*/
public PearException(Throwable cause) {
super(cause);
}
/**
- * @param message
- * @param cause
+ * Instantiates a new pear exception.
+ *
+ * @param message the message
+ * @param cause the cause
*/
public PearException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Gets the custom stack trace.
+ *
+ * @return the custom stack trace
+ */
IStatus[] getCustomStackTrace() {
Object[] o = getCustomStackTrace(getCause()).toArray();
if (o != null) {
@@ -76,6 +93,12 @@ public class PearException extends Excep
return new IStatus[0];
}
+ /**
+ * Gets the custom stack trace.
+ *
+ * @param e the e
+ * @return the custom stack trace
+ */
synchronized ArrayList getCustomStackTrace(Throwable e) {
ArrayList a = new ArrayList();
if (e != null) {
@@ -96,8 +119,8 @@ public class PearException extends Excep
/**
* opens an ErrorDialog with details about this exception.
- *
- * @param shell
+ *
+ * @param shell the shell
*/
public void openErrorDialog(Shell shell) {
try {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearPlugin.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearPlugin.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearPlugin.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/PearPlugin.java Sun Nov 13 16:13:16 2016
@@ -25,6 +25,7 @@ import org.eclipse.jface.resource.ImageD
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+// TODO: Auto-generated Javadoc
/**
* The main plugin class.
*
@@ -37,6 +38,7 @@ public class PearPlugin extends Abstract
*/
public static final String PLUGIN_ID = "org.apache.uima.pear";//$NON-NLS-1$
+ /** The plugin. */
// The shared instance.
private static PearPlugin plugin;
@@ -50,6 +52,8 @@ public class PearPlugin extends Abstract
/**
* Returns the shared instance.
+ *
+ * @return the default
*/
public static PearPlugin getDefault() {
return plugin;
@@ -60,6 +64,7 @@ public class PearPlugin extends Abstract
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(final BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -67,13 +72,18 @@ public class PearPlugin extends Abstract
/**
* Returns the workspace instance.
+ *
+ * @return the workspace
*/
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
/**
- * Returns the image descriptor with the given path relative to the icons/ directory
+ * Returns the image descriptor with the given path relative to the icons/ directory.
+ *
+ * @param relativePath the relative path
+ * @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(final String relativePath) {
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/" + relativePath); //$NON-NLS-1$
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/AddUimaNatureAction.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/AddUimaNatureAction.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/AddUimaNatureAction.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/AddUimaNatureAction.java Sun Nov 13 16:13:16 2016
@@ -34,33 +34,39 @@ import org.eclipse.ui.IWorkbenchPart;
import org.apache.uima.pear.tools.InstallationDescriptor;
+// TODO: Auto-generated Javadoc
/**
- *
- * This class handles the "Add UIMA Nature" action, which appear in the context menu of a project
- *
- *
- *
+ * This class handles the "Add UIMA Nature" action, which appear in the context menu of a project.
*/
public class AddUimaNatureAction implements IObjectActionDelegate {
+ /** The ssel. */
private IStructuredSelection ssel;
/**
- * Constructor
+ * Constructor.
*/
public AddUimaNatureAction() {
super();
}
/**
+ * Sets the active part.
+ *
+ * @param action the action
+ * @param targetPart the target part
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
- * See IActionDelegate#run(IAction)
+ * See IActionDelegate#run(IAction).
+ *
+ * @param action the action
*/
+ @Override
public void run(IAction action) {
Shell shell = new Shell();
@@ -120,8 +126,12 @@ public class AddUimaNatureAction impleme
}
/**
- * See IActionDelegate#selectionChanged(IAction, ISelection)
+ * See IActionDelegate#selectionChanged(IAction, ISelection).
+ *
+ * @param action the action
+ * @param selection the selection
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
ssel = null;
if (selection instanceof IStructuredSelection)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/EditInstallationDescriptorAction.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/EditInstallationDescriptorAction.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/EditInstallationDescriptorAction.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/EditInstallationDescriptorAction.java Sun Nov 13 16:13:16 2016
@@ -31,6 +31,7 @@ import org.eclipse.ui.IObjectActionDeleg
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
+// TODO: Auto-generated Javadoc
/**
*
* This class handles the "Edit Installation Descriptor" action, which appear in the context menu of
@@ -41,24 +42,33 @@ import org.eclipse.ui.PlatformUI;
*/
public class EditInstallationDescriptorAction implements IObjectActionDelegate {
+ /** The ssel. */
private IStructuredSelection ssel;
/**
- * Constructor
+ * Constructor.
*/
public EditInstallationDescriptorAction() {
super();
}
/**
+ * Sets the active part.
+ *
+ * @param action the action
+ * @param targetPart the target part
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
- * See IActionDelegate#run(IAction)
+ * See IActionDelegate#run(IAction).
+ *
+ * @param action the action
*/
+ @Override
public void run(IAction action) {
Shell shell = new Shell();
@@ -87,8 +97,12 @@ public class EditInstallationDescriptorA
}
/**
- * See IActionDelegate#selectionChanged(IAction, ISelection)
+ * See IActionDelegate#selectionChanged(IAction, ISelection).
+ *
+ * @param action the action
+ * @param selection the selection
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
ssel = null;
if (selection instanceof IStructuredSelection)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/GeneratePearFileAction.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/GeneratePearFileAction.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/GeneratePearFileAction.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/GeneratePearFileAction.java Sun Nov 13 16:13:16 2016
@@ -38,6 +38,7 @@ import org.eclipse.ui.IObjectActionDeleg
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
+// TODO: Auto-generated Javadoc
/**
*
* This class handles the "Generate PEAR" action, which appear in the context menu of a project with
@@ -48,24 +49,33 @@ import org.eclipse.ui.PlatformUI;
*/
public class GeneratePearFileAction implements IObjectActionDelegate {
+ /** The ssel. */
private IStructuredSelection ssel;
/**
- * Constructor
+ * Constructor.
*/
public GeneratePearFileAction() {
super();
}
/**
+ * Sets the active part.
+ *
+ * @param action the action
+ * @param targetPart the target part
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
- * See IActionDelegate#run(IAction)
+ * See IActionDelegate#run(IAction).
+ *
+ * @param action the action
*/
+ @Override
public void run(IAction action) {
Shell shell = new Shell();
@@ -102,8 +112,12 @@ public class GeneratePearFileAction impl
}
/**
- * See IActionDelegate#selectionChanged(IAction, ISelection)
+ * See IActionDelegate#selectionChanged(IAction, ISelection).
+ *
+ * @param action the action
+ * @param selection the selection
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
ssel = null;
if (selection instanceof IStructuredSelection)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/PearProjectCustomizationException.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/PearProjectCustomizationException.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/PearProjectCustomizationException.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/actions/PearProjectCustomizationException.java Sun Nov 13 16:13:16 2016
@@ -27,43 +27,58 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
+// TODO: Auto-generated Javadoc
/**
- *
- *
- *
+ * The Class PearProjectCustomizationException.
*/
public class PearProjectCustomizationException extends Exception {
+ /** The Constant PLUGIN_ID. */
public static final String PLUGIN_ID = "org.apache.uima.pear";
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
+ /**
+ * Instantiates a new pear project customization exception.
+ */
public PearProjectCustomizationException() {
super();
}
/**
- * @param message
+ * Instantiates a new pear project customization exception.
+ *
+ * @param message the message
*/
public PearProjectCustomizationException(String message) {
super(message);
}
/**
- * @param cause
+ * Instantiates a new pear project customization exception.
+ *
+ * @param cause the cause
*/
public PearProjectCustomizationException(Throwable cause) {
super(cause);
}
/**
- * @param message
- * @param cause
+ * Instantiates a new pear project customization exception.
+ *
+ * @param message the message
+ * @param cause the cause
*/
public PearProjectCustomizationException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Gets the custom stack trace.
+ *
+ * @return the custom stack trace
+ */
public IStatus[] getCustomStackTrace() {
Object[] o = getCustomStackTrace(getCause()).toArray();
if (o != null) {
@@ -75,15 +90,21 @@ public class PearProjectCustomizationExc
return new IStatus[0];
}
+ /**
+ * Gets the custom stack trace.
+ *
+ * @param e the e
+ * @return the custom stack trace
+ */
synchronized ArrayList getCustomStackTrace(Throwable e) {
ArrayList a = new ArrayList();
if (e != null) {
String msg = e.getMessage();
msg = msg == null ? "" : msg;
- a.add(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR, msg, e));
+ a.add(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, msg, e));
StackTraceElement[] trace = e.getStackTrace();
for (int i = 0; i < trace.length; i++) {
- a.add(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR, " at " + trace[i], e));
+ a.add(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, " at " + trace[i], e));
}
Throwable aCause = e.getCause();
@@ -94,16 +115,16 @@ public class PearProjectCustomizationExc
}
/**
- * Opens an Error dialog for this exception
- *
- * @param shell
+ * Opens an Error dialog for this exception.
+ *
+ * @param shell the shell
*/
public void openErrorDialog(Shell shell) {
try {
getCause().printStackTrace();
String msg = getCause().getMessage();
msg = msg == null ? "" : msg;
- MultiStatus status = new MultiStatus(PLUGIN_ID, Status.ERROR, getCustomStackTrace(), msg,
+ MultiStatus status = new MultiStatus(PLUGIN_ID, IStatus.ERROR, getCustomStackTrace(), msg,
getCause());
ErrorDialog.openError(shell, "Project Customization Error", getMessage()
+ " \nPlease see the details (below).", status, 0xFFFF);
@@ -113,12 +134,10 @@ public class PearProjectCustomizationExc
}
/**
- * Opens an Error dialog for a given exception
- *
- * @param e
- * A Throwable instance
- * @param shell
- * Ashell
+ * Opens an Error dialog for a given exception.
+ *
+ * @param e A Throwable instance
+ * @param shell Ashell
*/
public static void openErrorDialog(Throwable e, Shell shell) {
PearProjectCustomizationException subEx = new PearProjectCustomizationException(
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/GeneratePearWizard.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/GeneratePearWizard.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/GeneratePearWizard.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/GeneratePearWizard.java Sun Nov 13 16:13:16 2016
@@ -46,6 +46,7 @@ import org.eclipse.ui.plugin.AbstractUIP
import org.apache.uima.pear.tools.InstallationDescriptor;
import org.apache.uima.pear.tools.InstallationDescriptorHandler;
+// TODO: Auto-generated Javadoc
/**
* Wizard to generate a PEAR file.
*
@@ -53,22 +54,31 @@ import org.apache.uima.pear.tools.Instal
*
*/
public class GeneratePearWizard extends Wizard implements IWizard, InsdConstants {
+
+ /** The current container. */
private IContainer currentContainer;
+ /** The insd. */
private InstallationDescriptor insd;
+ /** The wizard data. */
private Hashtable wizardData = new Hashtable();
// WIZARD PAGES
+ /** The component page. */
// private WizardNewProjectCreationPage projectPage;
private INSDComponentPage componentPage;
+ /** The environment page. */
private INSDEnvironmentPage environmentPage;
+ /** The pear export page. */
private PearFileResourceExportPage pearExportPage;
/**
- * Constructor
+ * Constructor.
+ *
+ * @param container the container
*/
public GeneratePearWizard(IContainer container) {
super();
@@ -116,6 +126,7 @@ public class GeneratePearWizard extends
*
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
+ @Override
public void addPages() {
try {
componentPage = new INSDComponentPage(currentContainer, insd, wizardData);
@@ -137,10 +148,11 @@ public class GeneratePearWizard extends
/**
* This method is called when 'Finish' button is pressed in the wizard.
- *
+ *
+ * @return true, if successful
* @see org.eclipse.jface.wizard.IWizard#performFinish()
- *
*/
+ @Override
public boolean performFinish() {
try {
// currentContainer.refreshLocal(IResource.DEPTH_INFINITE,null);
@@ -160,6 +172,12 @@ public class GeneratePearWizard extends
}
}
+ /**
+ * Edits the installation descriptor.
+ *
+ * @throws CoreException the core exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
private void editInstallationDescriptor() throws CoreException, IOException {
handleComponentInformation();
addEnvOptions();
@@ -167,6 +185,9 @@ public class GeneratePearWizard extends
PearInstallationDescriptor.saveInstallationDescriptor(currentContainer, insd);
}
+ /**
+ * Handle component information.
+ */
private void handleComponentInformation() {
insd.setMainComponent(componentPage.compID);
insd
@@ -174,6 +195,9 @@ public class GeneratePearWizard extends
.addMacro(componentPage.compDescriptorPath));
}
+ /**
+ * Adds the env options.
+ */
private void addEnvOptions() {
insd.clearOSSpecs();
insd.clearToolkitsSpecs();
@@ -189,6 +213,9 @@ public class GeneratePearWizard extends
}
+ /**
+ * Adds the env vars.
+ */
private void addEnvVars() {
insd.deleteInstallationActions(InstallationDescriptor.ActionInfo.SET_ENV_VARIABLE_ACT);
Iterator envVarsItr = environmentPage.envVarList.tableRows.iterator();
@@ -210,6 +237,12 @@ public class GeneratePearWizard extends
}
}
+ /**
+ * Inits the.
+ *
+ * @param workbench the workbench
+ * @param selection the selection
+ */
/*
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
* org.eclipse.jface.viewers.IStructuredSelection)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExport.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExport.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExport.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExport.java Sun Nov 13 16:13:16 2016
@@ -23,17 +23,16 @@ import java.io.File;
import org.apache.uima.pear.PearException;
+// TODO: Auto-generated Javadoc
/**
- *
- * A util class for PEAR export operations
- *
- *
- *
+ * A util class for PEAR export operations.
*/
public class PearExport {
/**
- * @param targetFile
+ * Ensure target file is valid.
+ *
+ * @param targetFile the target file
* @return true
* @throws PearException -
*/
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportMessages.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportMessages.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportMessages.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportMessages.java Sun Nov 13 16:13:16 2016
@@ -23,19 +23,21 @@ import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+// TODO: Auto-generated Javadoc
/**
- *
- * Utility class which helps managing messages
- *
- *
- *
+ * Utility class which helps managing messages.
*/
public class PearExportMessages {
+ /** The Constant RESOURCE_BUNDLE. */
private static final String RESOURCE_BUNDLE = "org.apache.uima.pear.generate.messages";//$NON-NLS-1$
+ /** The bundle. */
private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+ /**
+ * Instantiates a new pear export messages.
+ */
private PearExportMessages() {
// prevent instantiation of class
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportOperation.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportOperation.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportOperation.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearExportOperation.java Sun Nov 13 16:13:16 2016
@@ -38,36 +38,33 @@ import org.eclipse.core.runtime.Operatio
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
+// TODO: Auto-generated Javadoc
/**
- * {@link IRunnableWithProgress} that creates a zip file containing a given set of resources *
+ * {@link IRunnableWithProgress} that creates a zip file containing a given set of resources *.
*/
public class PearExportOperation implements IRunnableWithProgress {
- /** An array of files that should be included in the zip file */
+ /** An array of files that should be included in the zip file. */
protected final IFile[] fExports;
- /** Prefix to strip off from the provided files paths */
+ /** Prefix to strip off from the provided files paths. */
protected final IContainer fRoot;
- /** Filename for the destination zip file */
+ /** Filename for the destination zip file. */
protected final String fFilename;
- /** whether zip contents should be compressed */
+ /** whether zip contents should be compressed. */
protected final boolean fCompress;
/**
- * Constructor
- *
- * @param exports
- * An array of files that should be included in the zip file
- * @param virtualRoot
- * Prefix to strip off from the provided files paths, e.g. if '/foo/bar/baz.txt' is
+ * Constructor.
+ *
+ * @param exports An array of files that should be included in the zip file
+ * @param virtualRoot Prefix to strip off from the provided files paths, e.g. if '/foo/bar/baz.txt' is
* included and '/foo' is the virtual root, than '/bar/baz.txt' will be created in the
* zip file
- * @param filename
- * Filename for the destination zip file
- * @param compress
- * <code>true</code> if the zip contents should be compressed, <code>false</code>
+ * @param filename Filename for the destination zip file
+ * @param compress <code>true</code> if the zip contents should be compressed, <code>false</code>
* otherwise
*/
public PearExportOperation(final IFile[] exports, final IContainer virtualRoot,
@@ -83,6 +80,7 @@ public class PearExportOperation impleme
*
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
try {
@@ -161,9 +159,10 @@ public class PearExportOperation impleme
}
/**
- * @param file
- * The file to read
- * @param monitor
+ * Read contents.
+ *
+ * @param file The file to read
+ * @param monitor the monitor
* @return A byte array with the file contents
* @throws IOException -
*/
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearFileResourceExportPage.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearFileResourceExportPage.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearFileResourceExportPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/generate/PearFileResourceExportPage.java Sun Nov 13 16:13:16 2016
@@ -56,40 +56,38 @@ import org.eclipse.ui.model.WorkbenchCon
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.model.WorkbenchViewerSorter;
+// TODO: Auto-generated Javadoc
/**
- *
- * Wizard page for exporting resource to a PEAR file
+ * Wizard page for exporting resource to a PEAR file.
*/
public class PearFileResourceExportPage extends WizardPage implements InsdConstants {
- /** Preference store key for the last pear file export location */
+ /** Preference store key for the last pear file export location. */
protected static final String PEAR_FILE = "pear_file"; //$NON-NLS-1$
- /** Plugins preference store */
+ /** Plugins preference store. */
protected final IPreferenceStore fPreferenceStore;
- /** Folder or Project that contains the Pear structure */
+ /** Folder or Project that contains the Pear structure. */
protected final IContainer fCurrentContainer;
- /** Initial selection for the TreeViewer */
+ /** Initial selection for the TreeViewer. */
protected final IStructuredSelection fSelection;
- /** TreeViewer that shows resources to export */
+ /** TreeViewer that shows resources to export. */
protected ContainerCheckedTreeViewer fTreeViewer;
- /** Text input for the */
+ /** Text input for the. */
protected Text fDestinationFileInput;
- /** Checkbox for choosing whether pear file should be compressed */
+ /** Checkbox for choosing whether pear file should be compressed. */
protected Button fCompressCheckbox;
/**
- * constructor
- *
- * @param selection
- * Initial selection for the export TreeViewer
- * @param currentContainer
- * Container (project or folder) with Pear structure
+ * constructor.
+ *
+ * @param selection Initial selection for the export TreeViewer
+ * @param currentContainer Container (project or folder) with Pear structure
*/
public PearFileResourceExportPage(final IStructuredSelection selection,
final IContainer currentContainer) {
@@ -103,7 +101,7 @@ public class PearFileResourceExportPage
}
/**
- * Update buttons and messages
+ * Update buttons and messages.
*/
protected void pageStateChanged() {
// check whether the metadata folder is included for export
@@ -147,6 +145,8 @@ public class PearFileResourceExportPage
}
/**
+ * Checks if is metadata included.
+ *
* @return <code>true</code> if all files in the metadata folder are selected for export or the
* members cannot be determined, <code>false</code> otherwise
*/
@@ -161,7 +161,9 @@ public class PearFileResourceExportPage
}
/**
- * @param checked
+ * Checks if is metadata included.
+ *
+ * @param checked the checked
* @return <code>true</code> if all files in the metadata folder are selected for export or the
* members cannot be determined, <code>false</code> otherwise
*/
@@ -183,7 +185,7 @@ public class PearFileResourceExportPage
/**
* Opens a file selection dialog to select a pear file as export location and sets the chosen
- * value to the input field
+ * value to the input field.
*/
protected void handleDestinationBrowseButtonPressed() {
final FileDialog dialog = new FileDialog(getContainer().getShell(), SWT.SAVE);
@@ -203,7 +205,9 @@ public class PearFileResourceExportPage
}
/**
- * Stores the Pear filename in the preference store
+ * Stores the Pear filename in the preference store.
+ *
+ * @param filename the filename
*/
protected void saveDestinationValue(final String filename) {
fPreferenceStore.setValue(PEAR_FILE, filename);
@@ -211,6 +215,8 @@ public class PearFileResourceExportPage
}
/**
+ * Gets the destination value.
+ *
* @return The value of the Pear file export destination as chosen by the user, or the last used
* one if the widget was not created yet
*/
@@ -227,6 +233,7 @@ public class PearFileResourceExportPage
*
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new GridLayout());
@@ -242,10 +249,9 @@ public class PearFileResourceExportPage
}
/**
- * Create the options group with the compression checkbox
- *
- * @param parent
- * the parent composite
+ * Create the options group with the compression checkbox.
+ *
+ * @param parent the parent composite
*/
protected void createOptionsGroup(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
@@ -261,10 +267,9 @@ public class PearFileResourceExportPage
/**
* Create the TreeViewer for selection of files to export in the Pear file and select/deselect all
- * buttons
- *
- * @param parent
- * the parent composite
+ * buttons.
+ *
+ * @param parent the parent composite
*/
protected void createSourceControl(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
@@ -275,6 +280,7 @@ public class PearFileResourceExportPage
fTreeViewer.setInput(fCurrentContainer);
fTreeViewer.setCheckedElements(fSelection.toArray());
fTreeViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(final CheckStateChangedEvent event) {
pageStateChanged();
}
@@ -286,6 +292,7 @@ public class PearFileResourceExportPage
final Button selectAllButton = new Button(buttonsComposite, SWT.PUSH);
selectAllButton.setText(PearExportMessages.getString("PearFileResourceExportPage.SelectAll")); //$NON-NLS-1$
selectAllButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setAllChecked(fTreeViewer.getTree().getItems(), true);
pageStateChanged(); // above doesn't trigger a checkStateChanged
@@ -297,6 +304,7 @@ public class PearFileResourceExportPage
deselectAllButton.setText(PearExportMessages
.getString("PearFileResourceExportPage.DeselectAll")); //$NON-NLS-1$
deselectAllButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setAllChecked(fTreeViewer.getTree().getItems(), false);
pageStateChanged(); // above doesn't trigger a checkStateChanged
@@ -306,10 +314,10 @@ public class PearFileResourceExportPage
}
/**
- * @param items
- * A set of TreeItems that should be (un)checked, including their children
- * @param checked
- * <code>true</code> to check all items, <code>false</code> to uncheck all items
+ * Sets the all checked.
+ *
+ * @param items A set of TreeItems that should be (un)checked, including their children
+ * @param checked <code>true</code> to check all items, <code>false</code> to uncheck all items
*/
protected void setAllChecked(final TreeItem[] items, final boolean checked) {
for (int i = 0; i < items.length; i++) {
@@ -337,6 +345,7 @@ public class PearFileResourceExportPage
fDestinationFileInput.setText(fPreferenceStore.getString(PEAR_FILE));
fDestinationFileInput.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
fDestinationFileInput.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
pageStateChanged();
saveDestinationValue(fDestinationFileInput.getText());
@@ -347,6 +356,7 @@ public class PearFileResourceExportPage
destinationBrowseButton.setText(PearExportMessages
.getString("PearFileResourceExportPage.Browse")); //$NON-NLS-1$
destinationBrowseButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
handleDestinationBrowseButtonPressed();
}
@@ -354,8 +364,9 @@ public class PearFileResourceExportPage
}
/**
- * @param parent
- * the parent composite
+ * Creates the tree viewer.
+ *
+ * @param parent the parent composite
* @return TreeViewer that shows uses Workbench Content- and LabelProvider
*/
protected ContainerCheckedTreeViewer createTreeViewer(Composite parent) {
@@ -373,6 +384,8 @@ public class PearFileResourceExportPage
}
/**
+ * Gets the export runnable.
+ *
* @return An {@link IRunnableWithProgress} that will export the files chosen in the TreeViewer to
* the file chosen in the destination input field when run
*/
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/EditInstallationDescriptorWizard.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/EditInstallationDescriptorWizard.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/EditInstallationDescriptorWizard.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/EditInstallationDescriptorWizard.java Sun Nov 13 16:13:16 2016
@@ -38,6 +38,7 @@ import org.eclipse.ui.IWorkbench;
import org.apache.uima.pear.tools.InstallationDescriptor;
import org.apache.uima.pear.tools.InstallationDescriptorHandler;
+// TODO: Auto-generated Javadoc
/**
* Wizard to edit the PEAR Installation Descriptor.
*
@@ -46,15 +47,20 @@ import org.apache.uima.pear.tools.Instal
*/
public class EditInstallationDescriptorWizard extends Wizard implements IWizard, InsdConstants {
+ /** The current project. */
private IProject currentProject;
+ /** The insd. */
private InstallationDescriptor insd;
+ /** The wizard data. */
private Hashtable wizardData = new Hashtable();
+ /** The component page. */
// WIZARD PAGES
private INSDComponentPage componentPage;
+ /** The environment page. */
private INSDEnvironmentPage environmentPage;
/**
@@ -99,6 +105,7 @@ public class EditInstallationDescriptorW
*
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
+ @Override
public void addPages() {
try {
componentPage = new INSDComponentPage(currentProject, insd, wizardData);
@@ -118,10 +125,11 @@ public class EditInstallationDescriptorW
/**
* This method is called when 'Finish' button is pressed in the wizard.
- *
+ *
+ * @return true, if successful
* @see org.eclipse.jface.wizard.IWizard#performFinish()
- *
*/
+ @Override
public boolean performFinish() {
try {
editInstallationDescriptor();
@@ -134,6 +142,12 @@ public class EditInstallationDescriptorW
return true;
}
+ /**
+ * Edits the installation descriptor.
+ *
+ * @throws CoreException the core exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
private void editInstallationDescriptor() throws CoreException, IOException {
handleComponentInformation();
addEnvOptions();
@@ -141,6 +155,9 @@ public class EditInstallationDescriptorW
PearInstallationDescriptor.saveInstallationDescriptor(currentProject, insd);
}
+ /**
+ * Handle component information.
+ */
private void handleComponentInformation() {
insd.setMainComponent(componentPage.compID);
insd
@@ -148,6 +165,9 @@ public class EditInstallationDescriptorW
.addMacro(componentPage.compDescriptorPath));
}
+ /**
+ * Adds the env options.
+ */
private void addEnvOptions() {
insd.clearOSSpecs();
insd.clearToolkitsSpecs();
@@ -163,6 +183,9 @@ public class EditInstallationDescriptorW
}
+ /**
+ * Adds the env vars.
+ */
private void addEnvVars() {
insd.deleteInstallationActions(InstallationDescriptor.ActionInfo.SET_ENV_VARIABLE_ACT);
Iterator envVarsItr = environmentPage.envVarList.tableRows.iterator();
@@ -185,7 +208,10 @@ public class EditInstallationDescriptorW
}
/**
- * See IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ * See IWorkbenchWizard#init(IWorkbench, IStructuredSelection).
+ *
+ * @param workbench the workbench
+ * @param selection the selection
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
// this.workbench = workbench;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDComponentPage.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDComponentPage.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDComponentPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDComponentPage.java Sun Nov 13 16:13:16 2016
@@ -48,33 +48,45 @@ import org.eclipse.ui.dialogs.ResourceSe
import org.apache.uima.pear.tools.InstallationDescriptor;
+// TODO: Auto-generated Javadoc
/**
- *
- * This is wizard page to edit UIMA component basic information
- *
+ * This is wizard page to edit UIMA component basic information.
*/
public class INSDComponentPage extends WizardPage implements InsdConstants {
+ /** The insd. */
InstallationDescriptor insd;
+ /** The gr. */
private Group gr;
+ /** The comp ID. */
public String compID = "";
+ /** The comp descriptor path. */
public String compDescriptorPath = "";
+ /** The comp type. */
public String compType = COMP_TYPE_ANALYSIS_ENGINE;
+ /** The comp ID text. */
private Text compIDText;
+ /** The comp descriptor path text. */
private Text compDescriptorPathText;
+ /** The current container. */
IContainer currentContainer;
+ /** The wizard data. */
Hashtable wizardData;
/**
- * Constructor
+ * Constructor.
+ *
+ * @param currentContainer the current container
+ * @param insd the insd
+ * @param wizardData the wizard data
*/
public INSDComponentPage(IContainer currentContainer, InstallationDescriptor insd,
Hashtable wizardData) {
@@ -114,6 +126,9 @@ public class INSDComponentPage extends W
return s;
}
+ /**
+ * Initialize page.
+ */
void initializePage() {
String temp = "";
@@ -129,6 +144,15 @@ public class INSDComponentPage extends W
}
+ /**
+ * Adds the text field.
+ *
+ * @param parent the parent
+ * @param strLabel the str label
+ * @param strText the str text
+ * @param editable the editable
+ * @return the text
+ */
public Text addTextField(Composite parent, String strLabel, String strText, boolean editable) {
Label label = new Label(parent, SWT.NULL);
label.setText(strLabel);
@@ -137,6 +161,7 @@ public class INSDComponentPage extends W
text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
text.setText(strText);
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
dialogChanged();
}
@@ -146,8 +171,11 @@ public class INSDComponentPage extends W
}
/**
- * See IDialogPage#createControl(Composite)
+ * See IDialogPage#createControl(Composite).
+ *
+ * @param parent the parent
*/
+ @Override
public void createControl(Composite parent) {
try {
@@ -215,6 +243,9 @@ public class INSDComponentPage extends W
}
+ /**
+ * Validate comp info.
+ */
void validateCompInfo() {
if (compID == null || compID.trim().length() == 0 || compDescriptorPath == null
|| compDescriptorPath.trim().length() == 0) {
@@ -225,10 +256,18 @@ public class INSDComponentPage extends W
updateStatus(null);
}
+ /**
+ * Save wizard data.
+ */
void saveWizardData() {
wizardData.put(COMP_DESCRIPTOR_PATH, compDescriptorPath);
}
+ /**
+ * Update status.
+ *
+ * @param message the message
+ */
private void updateStatus(String message) {
if (message == null) {
@@ -241,6 +280,11 @@ public class INSDComponentPage extends W
}
}
+ /**
+ * Validate files.
+ *
+ * @return the string
+ */
private String validateFiles() {
String message = null;
StringBuffer sb = new StringBuffer();
@@ -274,14 +318,13 @@ public class INSDComponentPage extends W
* layout is assumed to be a GridLayout and the number of columns in this layout is incremented.
* Subclasses may override.
* </p>
- *
- * @param parent
- * the parent composite
- * @param label
- * the label from the button
- * @param defaultButton
- * <code>true</code> if the button is to be the default button, and <code>false</code>
+ *
+ * @param parent the parent composite
+ * @param label the label from the button
+ * @param defaultButton <code>true</code> if the button is to be the default button, and <code>false</code>
* otherwise
+ * @param text the text
+ * @return the button
*/
protected Button addButton(Composite parent, String label, boolean defaultButton, final Text text) {
@@ -298,6 +341,7 @@ public class INSDComponentPage extends W
button.setFont(parent.getFont());
SelectionListener listener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
ResourceSelectionDialog dialog = new ResourceSelectionDialog(getShell(), currentContainer,
@@ -319,15 +363,13 @@ public class INSDComponentPage extends W
}
/**
- * Creates a new Radio button
- *
- * @param parent
- * the parent composite
- * @param label
- * the label from the button
- * @param initialSelection
- * <code>true</code> if the button is to be the default button, and <code>false</code>
+ * Creates a new Radio button.
+ *
+ * @param parent the parent composite
+ * @param label the label from the button
+ * @param initialSelection <code>true</code> if the button is to be the default button, and <code>false</code>
* otherwise
+ * @return the button
*/
protected Button addRadioButton(Composite parent, String label, boolean initialSelection) {
@@ -337,6 +379,7 @@ public class INSDComponentPage extends W
button.setSelection(initialSelection);
SelectionListener listener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
dialogChanged();
}
@@ -345,9 +388,13 @@ public class INSDComponentPage extends W
return button;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
/*
* see @DialogPage.setVisible(boolean)
*/
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDEnvironmentPage.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDEnvironmentPage.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDEnvironmentPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/INSDEnvironmentPage.java Sun Nov 13 16:13:16 2016
@@ -54,43 +54,46 @@ import org.eclipse.swt.widgets.Label;
import org.apache.uima.pear.tools.InstallationDescriptor;
import org.apache.uima.pear.tools.InstallationDescriptorHandler;
+// TODO: Auto-generated Javadoc
/**
- *
- * This is wizard page to edit PEAR Installation Environment parameters
- *
- *
- *
+ * This is wizard page to edit PEAR Installation Environment parameters.
*/
public class INSDEnvironmentPage extends WizardPage implements InsdConstants {
+ /** The os combo. */
public Combo osCombo;
+ /** The jdk version combo. */
public Combo jdkVersionCombo;
+ /** The viewer. */
public VarValViewerHandler viewer;
+ /** The env var list. */
public VarValList envVarList = new VarValList();
+ /** The insd. */
InstallationDescriptor insd;
+ /** The current container. */
IContainer currentContainer;
+ /** The gr. */
Group gr;
+ /** The gr 1. */
Group gr1;
+ /** The Missing libraries. */
ArrayList MissingLibraries = new ArrayList();
/**
- * Constructor
- *
- * @param currentContainer
- * An IProject with the UIMA Nature
- * @param insd
- * The installation Descriptor object
- * @param wizardData
- * a hash table with shared information between wizard pages
+ * Constructor.
+ *
+ * @param currentContainer An IProject with the UIMA Nature
+ * @param insd The installation Descriptor object
+ * @param wizardData a hash table with shared information between wizard pages
*/
public INSDEnvironmentPage(IContainer currentContainer, InstallationDescriptor insd,
Hashtable wizardData) {
@@ -104,8 +107,11 @@ public class INSDEnvironmentPage extends
}
/**
- * See IDialogPage#createControl(Composite)
+ * See IDialogPage#createControl(Composite).
+ *
+ * @param parent the parent
*/
+ @Override
public void createControl(Composite parent) {
try {
@@ -155,6 +161,12 @@ public class INSDEnvironmentPage extends
}
}
+ /**
+ * Gets the first item.
+ *
+ * @param tokens the tokens
+ * @return the first item
+ */
private String getFirstItem(String tokens) {
String firstItem = "";
if (tokens != null && tokens.trim().length() > 0) {
@@ -170,6 +182,13 @@ public class INSDEnvironmentPage extends
return firstItem;
}
+ /**
+ * Adds the combo.
+ *
+ * @param parent the parent
+ * @param strLabel the str label
+ * @return the combo
+ */
private Combo addCombo(Composite parent, String strLabel) {
Label label = new Label(parent, SWT.NULL);
label.setText(strLabel);
@@ -181,6 +200,7 @@ public class INSDEnvironmentPage extends
text.setLayoutData(gd);
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
dialogChanged();
}
@@ -188,6 +208,9 @@ public class INSDEnvironmentPage extends
return text;
}
+ /**
+ * Initialize combos.
+ */
private void initializeCombos() {
String selectedOS = "";
@@ -215,6 +238,9 @@ public class INSDEnvironmentPage extends
}
+ /**
+ * Initialize.
+ */
private void initialize() {
try {
envVarList = new VarValList();
@@ -253,6 +279,12 @@ public class INSDEnvironmentPage extends
}
}
+ /**
+ * Gets the initial class path.
+ *
+ * @param classPath the class path
+ * @return the initial class path
+ */
private String getInitialClassPath(String classPath) {
// do nothing if the container is not a project
if (currentContainer.getType() != IResource.PROJECT) {
@@ -324,6 +356,12 @@ public class INSDEnvironmentPage extends
return classPath;
}
+ /**
+ * Tokenize class path.
+ *
+ * @param classPath the class path
+ * @return the array list
+ */
/*
* Tokenized a class path string and returns an ArrayList of entries.
*
@@ -340,6 +378,13 @@ public class INSDEnvironmentPage extends
return resultStringEntries;
}
+ /**
+ * Adds the to class path.
+ *
+ * @param classPathEntries the class path entries
+ * @param resultStringEntries the result string entries
+ * @return the array list
+ */
/*
* Adds class path entries to a class path if not already included.
*
@@ -352,6 +397,13 @@ public class INSDEnvironmentPage extends
return resultStringEntries;
}
+ /**
+ * Convert to string.
+ *
+ * @param stringEntries the string entries
+ * @param delim the delim
+ * @return the string
+ */
/*
* converts an ArrayList of String to one String separated by a delimiter
*/
@@ -364,6 +416,13 @@ public class INSDEnvironmentPage extends
return sb.toString();
}
+ /**
+ * Adds the to class path.
+ *
+ * @param classPathEntry the class path entry
+ * @param classPath the class path
+ * @return the array list
+ */
/*
* Adds an entry to a class path if not already included. Returns an ArrayList of String objects
* representing the class path entries
@@ -417,6 +476,13 @@ public class INSDEnvironmentPage extends
return classPath;
}
+ /**
+ * Contain.
+ *
+ * @param classPath the class path
+ * @param classPathEntryString the class path entry string
+ * @return true, if successful
+ */
/*
* Returns true if the ArrayList of Strings contain the given string (not necessarly the same
* object)
@@ -450,6 +516,11 @@ public class INSDEnvironmentPage extends
updateStatus(null);
}
+ /**
+ * Update status.
+ *
+ * @param message the message
+ */
private void updateStatus(String message) {
setErrorMessage(message);
setPageComplete(message == null);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/InsdConstants.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/InsdConstants.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/InsdConstants.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/InsdConstants.java Sun Nov 13 16:13:16 2016
@@ -19,6 +19,7 @@
package org.apache.uima.pear.insd.edit;
+// TODO: Auto-generated Javadoc
/**
*
* this interface defines common constants used in classes related to handling PEAR Installation
@@ -28,25 +29,36 @@ package org.apache.uima.pear.insd.edit;
*/
public interface InsdConstants {
+ /** The comp id. */
public final String COMP_ID = "compID";
+ /** The comp descriptor path. */
public final String COMP_DESCRIPTOR_PATH = "compDescriptorPath";
+ /** The comp name. */
public final String COMP_NAME = "compName";
+ /** The collection iterator descriptor path. */
public final String COLLECTION_ITERATOR_DESCRIPTOR_PATH = "collectionIteratorDescriptorPath";
+ /** The cas initializer descriptor path. */
public final String CAS_INITIALIZER_DESCRIPTOR_PATH = "casInitializerDescriptorPath";
+ /** The cas consumer descriptor path. */
public final String CAS_CONSUMER_DESCRIPTOR_PATH = "casConsumerDescriptorPath";
+ /** The comp type analysis engine. */
public final String COMP_TYPE_ANALYSIS_ENGINE = "analysis_engine";
+ /** The comp type cas consumer. */
public final String COMP_TYPE_CAS_CONSUMER = "cas_consumer";
+ /** The comp type cas initializer. */
public final String COMP_TYPE_CAS_INITIALIZER = "cas_initializer";
+ /** The comp type collection reader. */
public final String COMP_TYPE_COLLECTION_READER = "collection_reader";
+ /** The comp type cpe. */
public final String COMP_TYPE_CPE = "cpe";
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/PearInstallationDescriptor.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/PearInstallationDescriptor.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/PearInstallationDescriptor.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/PearInstallationDescriptor.java Sun Nov 13 16:13:16 2016
@@ -33,6 +33,7 @@ import org.xml.sax.SAXException;
import org.apache.uima.pear.tools.InstallationDescriptor;
import org.apache.uima.pear.tools.InstallationDescriptorHandler;
+// TODO: Auto-generated Javadoc
/**
*
* Handles the PEAR installation descriptor (install.xml)
@@ -42,17 +43,16 @@ import org.apache.uima.pear.tools.Instal
*/
public class PearInstallationDescriptor {
+ /** The Constant INSTALLATION_DESCRIPTOR_PATH. */
public static final String INSTALLATION_DESCRIPTOR_PATH = "metadata/install.xml";
/**
- * @param currentContainer
- * An IProject with the UIMA nature
- * @param insd
- * The installation descriptor object
- * @throws CoreException
- * if there is problem accessing the corresponding resource
- * @throws IOException
- * if there is problem writing to the corresponding resource
+ * Save installation descriptor.
+ *
+ * @param currentContainer An IProject with the UIMA nature
+ * @param insd The installation descriptor object
+ * @throws CoreException if there is problem accessing the corresponding resource
+ * @throws IOException if there is problem writing to the corresponding resource
*/
public static void saveInstallationDescriptor(IContainer currentContainer,
InstallationDescriptor insd) throws CoreException, IOException {
@@ -119,10 +119,9 @@ public class PearInstallationDescriptor
}
/**
- * adds the $main_root/ macro as a prefix to the given string
- *
- * @param s
- * a String representing a relative path to the project root
+ * adds the $main_root/ macro as a prefix to the given string.
+ *
+ * @param s a String representing a relative path to the project root
* @return The String with the macro
*/
public static String addMacro(String s) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/AbstractVarValViewerHandler.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/AbstractVarValViewerHandler.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/AbstractVarValViewerHandler.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/AbstractVarValViewerHandler.java Sun Nov 13 16:13:16 2016
@@ -29,28 +29,45 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
+// TODO: Auto-generated Javadoc
/**
- *
- *
+ * The Class AbstractVarValViewerHandler.
*/
abstract class AbstractVarValViewerHandler {
+ /** The table. */
public Table table;
+ /** The table viewer. */
public TableViewer tableViewer;
+ /** The add. */
public Button add;
+ /** The delete. */
public Button delete;
+ /** The close button. */
protected Button closeButton;
+ /** The label provider. */
protected ITableLabelProvider labelProvider;
+ /** The table row list. */
protected VarValList tableRowList = new VarValList();
+ /** The column names. */
protected String[] columnNames;
+ /**
+ * Instantiates a new abstract var val viewer handler.
+ *
+ * @param parent the parent
+ * @param columnNames the column names
+ * @param numParentColumns the num parent columns
+ * @param tableRowList the table row list
+ * @param labelProvider the label provider
+ */
public AbstractVarValViewerHandler(Composite parent, String[] columnNames, int numParentColumns,
VarValList tableRowList, ITableLabelProvider labelProvider) {
this.tableRowList = tableRowList;
@@ -60,16 +77,34 @@ abstract class AbstractVarValViewerHandl
this.addChildControls(parent, numParentColumns);
}
+ /**
+ * Creates the table columns.
+ */
protected abstract void createTableColumns();
+ /**
+ * Creates the cell editors.
+ *
+ * @return the cell editor[]
+ */
protected abstract CellEditor[] createCellEditors();
+ /**
+ * Creates the cell modifiers.
+ *
+ * @return the i cell modifier
+ */
protected abstract ICellModifier createCellModifiers();
+ /**
+ * Creates the sorter.
+ *
+ * @return the viewer sorter
+ */
protected abstract ViewerSorter createSorter();
/**
- * Release resources
+ * Release resources.
*/
public void dispose() {
// Tell the label provider to release its ressources
@@ -77,7 +112,10 @@ abstract class AbstractVarValViewerHandl
}
/**
- * Create a new shell, add the widgets, open the shell
+ * Create a new shell, add the widgets, open the shell.
+ *
+ * @param composite the composite
+ * @param numColumns the num columns
*/
protected void addChildControls(Composite composite, int numColumns) {
@@ -100,7 +138,9 @@ abstract class AbstractVarValViewerHandl
}
/**
- * Create the Table
+ * Create the Table.
+ *
+ * @param parent the parent
*/
protected void createTable(Composite parent) {
int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION
@@ -121,7 +161,7 @@ abstract class AbstractVarValViewerHandl
}
/**
- * Create the TableViewer
+ * Create the TableViewer.
*/
protected void createTableViewer() {
@@ -138,6 +178,9 @@ abstract class AbstractVarValViewerHandl
tableViewer.setSorter(createSorter());
}
+ /**
+ * Close.
+ */
/*
* Close the window and dispose of resources
*/
@@ -155,6 +198,10 @@ abstract class AbstractVarValViewerHandl
*/
class ExampleContentProvider implements IStructuredContentProvider, IVarValListViewer {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if (newInput != null)
((VarValList) newInput).addChangeListener(this);
@@ -162,11 +209,19 @@ abstract class AbstractVarValViewerHandl
((VarValList) oldInput).removeChangeListener(this);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
public void dispose() {
tableRowList.removeChangeListener(this);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
// Return the tableRows as an array of Objects
+ @Override
public Object[] getElements(Object parent) {
return tableRowList.getTableRows().toArray();
}
@@ -176,6 +231,7 @@ abstract class AbstractVarValViewerHandl
*
* @see IVarValListViewer#addTableRow(VarVal)
*/
+ @Override
public void addTableRow(VarVal tableRow) {
tableViewer.add(tableRow);
}
@@ -185,6 +241,7 @@ abstract class AbstractVarValViewerHandl
*
* @see IVarValListViewer#removeTableRow(VarVal)
*/
+ @Override
public void removeTableRow(VarVal tableRow) {
tableViewer.remove(tableRow);
}
@@ -194,16 +251,16 @@ abstract class AbstractVarValViewerHandl
*
* @see IVarValListViewer#updateTableRow(VarVal)
*/
+ @Override
public void updateTableRow(VarVal tableRow) {
tableViewer.update(tableRow, null);
}
}
/**
- * Add the "Add", "Delete" and "Close" buttons
- *
- * @param parent
- * the parent composite
+ * Add the "Add", "Delete" and "Close" buttons.
+ *
+ * @param parent the parent composite
*/
protected void createButtons(Composite parent) {
@@ -217,6 +274,7 @@ abstract class AbstractVarValViewerHandl
add.addSelectionListener(new SelectionAdapter() {
// Add a tableRow to the VarValList and refresh the view
+ @Override
public void widgetSelected(SelectionEvent e) {
if (!tableRowList.addTableRow()) {
MessageDialog.openWarning(new Shell(), "Duplicate Variable",
@@ -235,6 +293,7 @@ abstract class AbstractVarValViewerHandl
delete.addSelectionListener(new SelectionAdapter() {
// Remove the selection and refresh the view
+ @Override
public void widgetSelected(SelectionEvent e) {
VarVal tableRow = (VarVal) ((IStructuredSelection) tableViewer.getSelection())
.getFirstElement();
@@ -247,8 +306,8 @@ abstract class AbstractVarValViewerHandl
}
/**
- * Return the column names in a collection
- *
+ * Return the column names in a collection.
+ *
* @return List containing column names
*/
public java.util.List getColumnNames() {
@@ -256,6 +315,8 @@ abstract class AbstractVarValViewerHandl
}
/**
+ * Gets the selection.
+ *
* @return currently selected item
*/
public ISelection getSelection() {
@@ -263,21 +324,27 @@ abstract class AbstractVarValViewerHandl
}
/**
- * Return the VarValList
+ * Return the VarValList.
+ *
+ * @return the table row list
*/
public VarValList getTableRowList() {
return tableRowList;
}
/**
- * Return the parent composite
+ * Return the parent composite.
+ *
+ * @return the control
*/
public Control getControl() {
return table.getParent();
}
/**
- * Return the 'close' Button
+ * Return the 'close' Button.
+ *
+ * @return the close button
*/
public Button getCloseButton() {
return closeButton;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/IVarValListViewer.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/IVarValListViewer.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/IVarValListViewer.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/IVarValListViewer.java Sun Nov 13 16:13:16 2016
@@ -19,31 +19,30 @@
package org.apache.uima.pear.insd.edit.vars;
+// TODO: Auto-generated Javadoc
/**
- *
- *
- *
+ * The Interface IVarValListViewer.
*/
interface IVarValListViewer {
/**
- * Update the view to reflect the fact that a VarVal was added to the VarVal list
- *
- * @param VarVal
+ * Update the view to reflect the fact that a VarVal was added to the VarVal list.
+ *
+ * @param tableRow the table row
*/
public void addTableRow(VarVal tableRow);
/**
- * Update the view to reflect the fact that a VarVal was removed from the VarVal list
- *
- * @param VarVal
+ * Update the view to reflect the fact that a VarVal was removed from the VarVal list.
+ *
+ * @param tableRow the table row
*/
public void removeTableRow(VarVal tableRow);
/**
- * Update the view to reflect the fact that one of the TableRows was modified
- *
- * @param VarVal
+ * Update the view to reflect the fact that one of the TableRows was modified.
+ *
+ * @param tableRow the table row
*/
public void updateTableRow(VarVal tableRow);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarVal.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarVal.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarVal.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarVal.java Sun Nov 13 16:13:16 2016
@@ -19,6 +19,7 @@
package org.apache.uima.pear.insd.edit.vars;
+// TODO: Auto-generated Javadoc
/**
*
* Represents a table row in a two column table (of environment varibles).
@@ -28,24 +29,28 @@ package org.apache.uima.pear.insd.edit.v
*/
public class VarVal {
+ /** The Constant VAR_NAME. */
// Set the table column property names
public static final String VAR_NAME = "Variable_Name";
+ /** The Constant VAR_VALUE. */
public static final String VAR_VALUE = "Variable_Value";
+ /** The Constant fieldNames. */
// Set column names
public static final String[] fieldNames = new String[] { VAR_NAME, VAR_VALUE };
+ /** The var name. */
private String varName = "";
+ /** The var value. */
private String varValue = "";
/**
- *
- * Create a VarVal instance
- *
- * @param varName
- * @param varValue
+ * Create a VarVal instance.
+ *
+ * @param varName the var name
+ * @param varValue the var value
*/
public VarVal(String varName, String varValue) {
super();
@@ -54,8 +59,8 @@ public class VarVal {
}
/**
- * Return field names
- *
+ * Return field names.
+ *
* @return String[] An arry of column field names
*/
public static String[] getFieldNames() {
@@ -63,8 +68,8 @@ public class VarVal {
}
/**
- * Returns the variable name
- *
+ * Returns the variable name.
+ *
* @return the variable name
*/
public String getVarName() {
@@ -72,8 +77,8 @@ public class VarVal {
}
/**
- * Returns the variable value
- *
+ * Returns the variable value.
+ *
* @return the variable value
*/
public String getVarValue() {
@@ -81,20 +86,18 @@ public class VarVal {
}
/**
- * Sets the variable name
- *
- * @param string
- * the variable name
+ * Sets the variable name.
+ *
+ * @param string the variable name
*/
public void setVarName(String string) {
varName = string;
}
/**
- * Sets the variable value
- *
- * @param string
- * the variable value
+ * Sets the variable value.
+ *
+ * @param string the variable value
*/
public void setVarValue(String string) {
varValue = string;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValCellModifier.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValCellModifier.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValCellModifier.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValCellModifier.java Sun Nov 13 16:13:16 2016
@@ -22,19 +22,25 @@ package org.apache.uima.pear.insd.edit.v
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.swt.widgets.TableItem;
+// TODO: Auto-generated Javadoc
/**
* This class implements an ICellModifier An ICellModifier is called when the user modifes a cell in
- * the tableViewer
- *
- *
+ * the tableViewer.
*/
class VarValCellModifier implements ICellModifier {
+
+ /** The table viewer example. */
private VarValViewerHandler tableViewerExample;
+ /** The table row list. */
VarValList tableRowList;
/**
- * Constructor
+ * Constructor.
+ *
+ * @param tableViewerExample the table viewer example
+ * @param columnNames the column names
+ * @param tableRowList the table row list
*/
public VarValCellModifier(VarValViewerHandler tableViewerExample, String[] columnNames,
VarValList tableRowList) {
@@ -44,15 +50,27 @@ class VarValCellModifier implements ICel
}
/**
+ * Can modify.
+ *
+ * @param element the element
+ * @param property the property
+ * @return true, if successful
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean canModify(Object element, String property) {
return true;
}
/**
+ * Gets the value.
+ *
+ * @param element the element
+ * @param property the property
+ * @return the value
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
*/
+ @Override
public Object getValue(Object element, String property) {
// Find the index of the column
@@ -75,9 +93,15 @@ class VarValCellModifier implements ICel
}
/**
+ * Modify.
+ *
+ * @param element the element
+ * @param property the property
+ * @param value the value
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String,
* java.lang.Object)
*/
+ @Override
public void modify(Object element, String property, Object value) {
// Find the index of the column
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValLabelProvider.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValLabelProvider.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValLabelProvider.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValLabelProvider.java Sun Nov 13 16:13:16 2016
@@ -23,18 +23,23 @@ import org.eclipse.jface.viewers.ITableL
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
+// TODO: Auto-generated Javadoc
/**
- * Label provider for the VarValViewerHandler
- *
+ * Label provider for the VarValViewerHandler.
+ *
* @see org.eclipse.jface.viewers.LabelProvider
- *
- *
*/
class VarValLabelProvider extends LabelProvider implements ITableLabelProvider {
/**
+ * Gets the column text.
+ *
+ * @param element the element
+ * @param columnIndex the column index
+ * @return the column text
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
*/
+ @Override
public String getColumnText(Object element, int columnIndex) {
String result = "";
VarVal tableRow = (VarVal) element;
@@ -52,8 +57,14 @@ class VarValLabelProvider extends LabelP
}
/**
+ * Gets the column image.
+ *
+ * @param element the element
+ * @param columnIndex the column index
+ * @return the column image
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
*/
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValList.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValList.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValList.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValList.java Sun Nov 13 16:13:16 2016
@@ -24,27 +24,29 @@ import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
+// TODO: Auto-generated Javadoc
/**
- *
- * Represents a list of environment variable to be displayed in a table
- *
- *
- *
+ * Represents a list of environment variable to be displayed in a table.
*/
public class VarValList {
+ /** The table rows. */
public Vector tableRows = new Vector(10);
+ /** The change listeners. */
private Set changeListeners = new HashSet();
/**
- * Constructor
+ * Constructor.
*/
public VarValList() {
super();
this.initData();
}
+ /**
+ * Inits the data.
+ */
/*
* Initialize the table data.
*/
@@ -52,14 +54,19 @@ public class VarValList {
}
/**
- * Returns a vector of VarVal objects
+ * Returns a vector of VarVal objects.
+ *
+ * @return the table rows
*/
public Vector getTableRows() {
return tableRows;
}
/**
- * Adds a new table Row
+ * Adds a new table Row.
+ *
+ * @param tableRow the table row
+ * @return true, if successful
*/
public boolean addTableRow(VarVal tableRow) {
if (!isDuplicate(tableRow)) {
@@ -70,7 +77,9 @@ public class VarValList {
}
/**
- * Adds a sample tableRow to the table
+ * Adds a sample tableRow to the table.
+ *
+ * @return true, if successful
*/
public boolean addTableRow() {
VarVal tableRow = new VarVal("New_Variable", "Value");
@@ -84,6 +93,12 @@ public class VarValList {
return false;
}
+ /**
+ * Checks if is duplicate.
+ *
+ * @param tableRow the table row
+ * @return true, if is duplicate
+ */
private boolean isDuplicate(VarVal tableRow) {
boolean duplicate = false;
String varName = tableRow.getVarName();
@@ -97,7 +112,9 @@ public class VarValList {
}
/**
- * @param tableRow
+ * Removes the table row.
+ *
+ * @param tableRow the table row
*/
public void removeTableRow(VarVal tableRow) {
tableRows.remove(tableRow);
@@ -107,9 +124,9 @@ public class VarValList {
}
/**
- * Notify listeners by calling their updateTableRow() method
- *
- * @param tableRow
+ * Notify listeners by calling their updateTableRow() method.
+ *
+ * @param tableRow the table row
*/
public void tableRowChanged(VarVal tableRow) {
Iterator iterator = changeListeners.iterator();
@@ -118,20 +135,18 @@ public class VarValList {
}
/**
- * Removes a Change Listener
- *
- * @param viewer
- * A Chnage listener
+ * Removes a Change Listener.
+ *
+ * @param viewer A Chnage listener
*/
public void removeChangeListener(IVarValListViewer viewer) {
changeListeners.remove(viewer);
}
/**
- *
- * Adds a change listener
- *
- * @param viewer
+ * Adds a change listener.
+ *
+ * @param viewer the viewer
*/
public void addChangeListener(IVarValListViewer viewer) {
changeListeners.add(viewer);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValSorter.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValSorter.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValSorter.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-pear-packager/src/main/java/org/apache/uima/pear/insd/edit/vars/VarValSorter.java Sun Nov 13 16:13:16 2016
@@ -22,6 +22,7 @@ package org.apache.uima.pear.insd.edit.v
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
+// TODO: Auto-generated Javadoc
/**
* This sorter supports three sort criteria:
* <p>
@@ -29,14 +30,14 @@ import org.eclipse.jface.viewers.ViewerS
* </p>
* <p>
* <code>VAR_VALUE</code>: (String)
- * </p>
- *
- *
+ * </p>.
*/
class VarValSorter extends ViewerSorter {
+ /** The Constant VAR_NAME. */
public static final int VAR_NAME = 0;
+ /** The Constant VAR_VALUE. */
public static final int VAR_VALUE = 1;
/**
@@ -61,6 +62,7 @@ class VarValSorter extends ViewerSorter
/*
* (non-Javadoc) Method declared on ViewerSorter.
*/
+ @Override
public int compare(Viewer viewer, Object o1, Object o2) {
VarVal tableRow1 = (VarVal) o1;