Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 142704 Details for
Bug 234139
[fiximprove][proguard]: Add proguard preverifier
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Add proguard preverifier
proguardRC6.patch (text/plain), 50.39 KB, created by
David Aragão
on 2009-07-27 17:05:58 EDT
(
hide
)
Description:
Add proguard preverifier
Filename:
MIME Type:
Creator:
David Aragão
Created:
2009-07-27 17:05:58 EDT
Size:
50.39 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mtj.core >Index: src/org/eclipse/mtj/internal/core/IMTJCoreConstants.java >=================================================================== >--- src/org/eclipse/mtj/internal/core/IMTJCoreConstants.java (revision 1355) >+++ src/org/eclipse/mtj/internal/core/IMTJCoreConstants.java (working copy) >@@ -76,7 +76,10 @@ > public static final String PREF_PREVERIFY_CONFIG_LOCATION = "preverify_config_location"; //$NON-NLS-1$ > public static final String PREF_PREVERIFY_CONFIG_VALUE = "preverify_config_value"; //$NON-NLS-1$ > public static final String PREF_DEFAULT_PREVERIFIER = "default_preverifier"; //$NON-NLS-1$ >- >+ public static final String PREF_PREVERIFY_TYPE = "preverify_type"; //$NON-NLS-1$ >+ public static final String PREF_PREVERIFY_TYPE_EMULATOR = "preverify_emulator"; //$NON-NLS-1$ >+ public static final String PREF_PREVERIFY_TYPE_PROGUARD = "preverify_proguard"; //$NON-NLS-1$ >+ > public static final String PREF_PREVERIFY_CONFIG_LOCATION_JAD = "jad"; //$NON-NLS-1$ > public static final String PREF_PREVERIFY_CONFIG_LOCATION_PLATFORM = "platform"; //$NON-NLS-1$ > public static final String PREF_PREVERIFY_CONFIG_LOCATION_SPECIFIED = "specified"; //$NON-NLS-1$ >Index: src/org/eclipse/mtj/internal/core/PreferenceAccessor.java >=================================================================== >--- src/org/eclipse/mtj/internal/core/PreferenceAccessor.java (revision 1355) >+++ src/org/eclipse/mtj/internal/core/PreferenceAccessor.java (working copy) >@@ -16,6 +16,7 @@ > * Gang Ma (Sybase) - Add getting debug level from preference > * David Marques (Motorola) - Updating getSpecifiedProguardOptions in order to support > * project specific proguard config file path. >+ * Gustavo de Paula (Motorola) - Add proguard preverifier > */ > package org.eclipse.mtj.internal.core; > >@@ -44,6 +45,8 @@ > * A helper wrapper around the more complex preferences supported by MTJ. > * > * @author Craig Setera >+ * >+ * Gustavo de Paula (Motorola) - Add proguard preverifier > */ > public class PreferenceAccessor { > >@@ -354,4 +357,17 @@ > > return prefNode; > } >+ >+ /** >+ * >+ * @param project >+ * @return >+ */ >+ public String getPreverifierType (IProject project) { >+ IEclipsePreferences preferences = getProjectPreferences(project, >+ IMTJCoreConstants.PREF_PREVERIFY_USE_PROJECT, >+ IMTJCoreConstants.PREF_PREVERIFY_TYPE); >+ return preferences.get(IMTJCoreConstants.PREF_PREVERIFY_TYPE, >+ MTJCorePreferenceInitializer.PREF_DEF_PREVERIFY_TYPE); >+ } > } >Index: src/org/eclipse/mtj/internal/core/build/preverifier/ProguardPreverifier.java >=================================================================== >--- src/org/eclipse/mtj/internal/core/build/preverifier/ProguardPreverifier.java (revision 0) >+++ src/org/eclipse/mtj/internal/core/build/preverifier/ProguardPreverifier.java (revision 0) >@@ -0,0 +1,570 @@ >+/** >+ * Copyright (c) 2003,2008 Motorola Inc. and others. >+ * All Rights Reserved. >+ * Licensed under the Eclipse Public License - v 1.0 >+ * For more information see http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Gustavo de Paula (Motorola) - Initial Creation >+ * David Aragao(Motorola) - Adding Singleton implementation >+ */ >+package org.eclipse.mtj.internal.core.build.preverifier; >+ >+import java.io.File; >+import java.io.FileFilter; >+import java.io.IOException; >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.Iterator; >+import java.util.List; >+import java.util.regex.Matcher; >+import java.util.regex.Pattern; >+ >+import org.eclipse.core.resources.IFolder; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.debug.core.IStreamListener; >+import org.eclipse.debug.core.model.IProcess; >+import org.eclipse.debug.core.model.IStreamMonitor; >+import org.eclipse.debug.core.model.IStreamsProxy; >+import org.eclipse.jdt.core.IJavaProject; >+import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.launching.IVMInstall; >+import org.eclipse.jdt.launching.JavaRuntime; >+import org.eclipse.mtj.core.MTJCore; >+import org.eclipse.mtj.core.build.preverifier.IPreverifier; >+import org.eclipse.mtj.core.persistence.IPersistenceProvider; >+import org.eclipse.mtj.core.persistence.PersistenceException; >+import org.eclipse.mtj.core.project.IMTJProject; >+import org.eclipse.mtj.core.project.midp.IMidletSuiteProject; >+import org.eclipse.mtj.internal.core.IMTJCoreConstants; >+import org.eclipse.mtj.internal.core.build.BuildConsoleProxy; >+import org.eclipse.mtj.internal.core.build.BuildLoggingConfiguration; >+import org.eclipse.mtj.internal.core.build.IBuildConsoleProxy; >+import org.eclipse.mtj.internal.core.util.TemporaryFileManager; >+import org.eclipse.mtj.internal.core.util.Utils; >+import org.eclipse.mtj.internal.core.util.log.MTJLogger; >+ >+ >+/** >+ * Use proguard to preverify the MIDlet suite classes. Design and code is mostly >+ * based on org.eclipse.mtj.core.model.impl.StandardPreverifier. >+ * >+ * TODO Refactore code to have a common class to be used both by StandPreverifier and ProguardPreverifier >+ * >+ * @author wgp010 >+ */ >+public class ProguardPreverifier implements IPreverifier { >+ >+ /** >+ * The list of locations in which to look for the java executable in >+ * candidate VM install locations, relative to the VM install location. >+ * Code from org.eclipse.mtj.core.model.implJavaEmulatorDevice. >+ * TODO Refactore to have a common place for it >+ */ >+ private static final String[] CANDIDATE_JAVA_LOCATIONS = { >+ "bin" + File.separatorChar + "java", //$NON-NLS-2$ //$NON-NLS-1$ >+ "bin" + File.separatorChar + "java.exe", //$NON-NLS-2$ //$NON-NLS-1$ >+ "jre" + File.separatorChar + "bin" + File.separatorChar + "java", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ >+ "jre" + File.separatorChar + "bin" + File.separatorChar + "java.exe" }; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ >+ >+ /** >+ * Path to proguard lib >+ */ >+ private String proguardJarFilePath = null; >+ >+ /** >+ * Max number of characters in the command >+ */ >+ private static final int MAX_COMMAND_LENGTH = 2000; >+ >+ >+ // The regular expression we will use to match the preverify >+ // error >+ private static final String PREV_ERR_REGEX = "^Unable to access jarfile (\\S*)$"; >+ >+ // The compiled pattern for regular expression matching >+ private static final Pattern PREV_ERR_PATTERN = Pattern.compile( >+ PREV_ERR_REGEX, Pattern.MULTILINE); >+ // >+ private static ProguardPreverifier proguardPreverifier; >+ >+ /** >+ * Class constructor >+ */ >+ private ProguardPreverifier () { >+ this.proguardJarFilePath = MTJCore.getProguardJarFile().getAbsolutePath(); >+ } >+ >+ /** >+ * singleton implementation >+ * @return >+ */ >+ public static ProguardPreverifier getInstance() { >+ if (proguardPreverifier == null) { >+ proguardPreverifier = new ProguardPreverifier(); >+ } >+ return proguardPreverifier; >+ } >+ >+ public PreverificationError[] preverify(IMTJProject mtjProject, >+ IResource[] toVerify, IFolder outputFolder, IProgressMonitor monitor) >+ throws CoreException { >+ ArrayList allErrors = new ArrayList(); >+ >+ // Create the temporary file of commands for >+ // the verifier >+ ensureFolderExists(outputFolder, monitor); >+ >+ // construct the command line to call proguard >+ ArrayList baseArguments = constructCommandLine(); >+ >+ // read the final arguments that will be added to proguard command line. those parameters should be added >+ // after the -injar parameter >+ File outputFile = outputFolder.getLocation().toFile(); >+ String[] configurationParameters = getProguardFinalConfigurationParameters(mtjProject, outputFile.getAbsolutePath()); >+ >+ ArrayList arguments = new ArrayList(baseArguments); >+ >+ //add the output folder >+ addOutputToInJar (arguments, mtjProject); >+ >+ for (int i = 0; i < toVerify.length; i++) { >+ IResource resource = toVerify[i]; >+ >+ //add projects and jar files >+ switch (resource.getType()) { >+ case IResource.FOLDER: >+ case IResource.PROJECT: >+ addFileToInJar(arguments, resource.getLocation().toOSString()); >+ break; >+ >+ case IResource.FILE: >+ if (resource.getName().endsWith(".jar")) { >+ addFileToInJar(arguments, resource.getLocation().toOSString()); >+ } >+ break; >+ } >+ >+ if (commandLength(arguments) > MAX_COMMAND_LENGTH) { >+ // Configuration parameters >+ for (String configuration:configurationParameters) { >+ arguments.add(configuration); >+ } >+ >+ // Launch the system process >+ String[] commandLine = (String[]) arguments >+ .toArray(new String[arguments.size()]); >+ PreverificationError[] errors = runPreverifier(commandLine, >+ null, monitor); >+ allErrors.addAll(Arrays.asList(errors)); >+ >+ arguments = new ArrayList(baseArguments); >+ //add the output folder >+ addOutputToInJar (arguments, mtjProject); >+ } >+ } >+ >+ if (arguments.size() != baseArguments.size()) { >+ for (String configuration:configurationParameters) { >+ arguments.add(configuration); >+ } >+ >+ // Launch the system process >+ String[] commandLine = (String[]) arguments >+ .toArray(new String[arguments.size()]); >+ PreverificationError[] errors = runPreverifier(commandLine, null, >+ monitor); >+ allErrors.addAll(Arrays.asList(errors)); >+ } >+ >+ return (PreverificationError[]) allErrors >+ .toArray(new PreverificationError[allErrors.size()]); >+ } >+ >+ public PreverificationError[] preverifyJarFile( >+ IMTJProject mtjProject, File jarFile, >+ IFolder outputFolder, IProgressMonitor monitor) >+ throws CoreException{ >+ // Rather than trying to preverify a jar file, we will expand it >+ // first and then preverify against the expanded classes. >+ File srcDirectory = new File(""); >+ try { >+ srcDirectory = TemporaryFileManager.instance.createTempDirectory( >+ jarFile.getName().replace('.', '_') + "_", ".tmp"); >+ } catch (IOException ioe) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, "Failed to create directory.", >+ ioe); >+ throw new CoreException(status); >+ } >+ srcDirectory.mkdirs(); >+ >+ try { >+ Utils.extractArchive(jarFile, srcDirectory); >+ } catch (SecurityException se) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, >+ "Failed to inflate jar file due to a security violation.", >+ se); >+ throw new CoreException(status); >+ } catch (IOException ioe) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, "Failed to inflate jar file.", >+ ioe); >+ throw new CoreException(status); >+ } >+ >+ // Create the target directory for the preverification. We will >+ // tell the preverifier to use this when doing the preverification. >+ File tgtDirectory = new File(""); >+ try { >+ tgtDirectory = TemporaryFileManager.instance.createTempDirectory( >+ jarFile.getName().replace('.', '_') + "_", ".tmp"); >+ } catch (IOException ioe) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, "Failed to create directory.", >+ ioe); >+ throw new CoreException(status); >+ } >+ tgtDirectory.mkdirs(); >+ >+ ArrayList arguments = constructCommandLine(); >+ arguments.add(srcDirectory.toString()); >+ >+ // Launch the system process >+ String[] commandLine = (String[]) arguments >+ .toArray(new String[arguments.size()]); >+ PreverificationError[] errors = runPreverifier(commandLine, >+ null, monitor); >+ >+ // TODO we need to test the outcome of the previous before going much >+ // further >+ // here... >+ // Copy all of the non-class resources so they end up back in the >+ // jar file >+ FileFilter classFilter = new FileFilter() { >+ public boolean accept(File pathname) { >+ return pathname.isDirectory() >+ || !pathname.getName().endsWith(".class"); >+ } >+ }; >+ try { >+ Utils.copy(srcDirectory, tgtDirectory, classFilter); >+ } catch (SecurityException se) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, >+ "Failed copy specified source due to a security violation.", >+ se); >+ throw new CoreException(status); >+ } catch (IOException ioe) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, "Failed to copy specified source.", >+ ioe); >+ throw new CoreException(status); >+ } >+ >+ // Finally, re-jar the output of the pre-verification into the requested >+ // jar file... >+ File outputJarFile = new File(outputFolder.getLocation().toFile(), >+ jarFile.getName()); >+ try { >+ Utils.createArchive(outputJarFile, tgtDirectory); >+ } catch (IOException ioe) { >+ IStatus status = new Status(IStatus.ERROR, >+ IMTJCoreConstants.PLUGIN_ID, "Failed to create zip source folder.", >+ ioe); >+ throw new CoreException(status); >+ } >+ >+ return errors; >+ } >+ >+ public void loadUsing(IPersistenceProvider persistenceProvider) >+ throws PersistenceException { >+ // Not necessary to load any data >+ } >+ >+ public void storeUsing(IPersistenceProvider persistenceProvider) >+ throws PersistenceException { >+ // Not necessary to store any data >+ } >+ >+ /** >+ * Run the preverifier program and capture the errors that occurred during >+ * pre-verification. >+ * >+ * @param commandLine >+ * @param environment >+ * @throws CoreException >+ */ >+ private PreverificationError[] runPreverifier(String[] commandLine, >+ String[] environment, IProgressMonitor monitor) >+ throws CoreException { >+ final ArrayList errorList = new ArrayList(); >+ >+ IProcess process = Utils.launchApplication(commandLine, null, >+ environment, "Preverifier", "CLDC Preverifier"); >+ >+ // Listen on the process output streams >+ IStreamsProxy proxy = process.getStreamsProxy(); >+ if (BuildLoggingConfiguration.getInstance().isPreverifierOutputEnabled()) { >+ BuildConsoleProxy.getInstance() >+ .traceln("======================== Launching Preverification ========================="); >+ BuildConsoleProxy.getInstance().addConsoleStreamListener( >+ IBuildConsoleProxy.Stream.ERROR, proxy >+ .getErrorStreamMonitor()); >+ BuildConsoleProxy.getInstance().addConsoleStreamListener( >+ IBuildConsoleProxy.Stream.OUTPUT, proxy >+ .getOutputStreamMonitor()); >+ } >+ >+ proxy.getErrorStreamMonitor().addListener(new IStreamListener() { >+ public void streamAppended(String text, IStreamMonitor monitor) { >+ handleErrorReceived(text, errorList); >+ } >+ }); >+ >+ // Wait until completion >+ while ((!monitor.isCanceled()) && (!process.isTerminated())) { >+ try { >+ Thread.sleep(100); >+ } catch (InterruptedException e) { >+ } >+ ; >+ } >+ >+ if (BuildLoggingConfiguration.getInstance().isPreverifierOutputEnabled()) { >+ BuildConsoleProxy.getInstance() >+ .traceln("======================== Preverification exited with code: " >+ + process.getExitValue()); >+ } >+ >+ return (PreverificationError[]) errorList >+ .toArray(new PreverificationError[errorList.size()]); >+ } >+ >+ /** >+ * Handle the arrival of text on the error stream. >+ * >+ * TODO Change to support proguard error messages >+ * >+ * @param text >+ * @param errorList >+ */ >+ private void handleErrorReceived(String text, List errorList) { >+ text = text.trim(); >+ Matcher matcher = PREV_ERR_PATTERN.matcher(text); >+ if (matcher.find()) { >+ // Found a match for the error... >+ if (matcher.groupCount() > 0) { >+ final String classname = matcher.group(1); >+ >+ String errorText = "Error preverifying class"; >+ if (matcher.end() < text.length()) { >+ StringBuffer sb = new StringBuffer(errorText); >+ sb.append(": "); >+ >+ String detail = text.substring(matcher.end()); >+ detail = detail.trim(); >+ sb.append(detail); >+ errorText = sb.toString(); >+ } >+ >+ IClassErrorInformation classInfo = new IClassErrorInformation() { >+ public String getName() { >+ return classname; >+ } >+ >+ public String getSourceFile() { >+ return null; >+ } >+ }; >+ >+ PreverificationErrorLocation location = new PreverificationErrorLocation( >+ PreverificationErrorLocationType.UNKNOWN_LOCATION, >+ classInfo); >+ PreverificationError error = new PreverificationError( >+ PreverificationErrorType.UNKNOWN_ERROR, location, text); >+ errorList.add(error); >+ } >+ } else { >+ MTJLogger.log(IStatus.WARNING, text); >+ } >+ } >+ /** >+ * Ensure the specified output folder exists or create if it does not >+ * already exist. >+ * >+ * @param folder >+ * @param monitor >+ * @throws CoreException >+ */ >+ private void ensureFolderExists(IFolder folder, IProgressMonitor monitor) >+ throws CoreException { >+ // Make sure the output folder exists before we start >+ if (!folder.exists()) { >+ folder.create(true, true, monitor); >+ } >+ } >+ >+ /** >+ * Construct the command line for the specified pre-verification. >+ * >+ * @param midletProject >+ * @param target >+ * @return >+ * @throws CoreException >+ */ >+ private ArrayList constructCommandLine() throws CoreException { >+ ArrayList arguments = new ArrayList(); >+ >+ // The program we are running... >+ arguments.add(this.getJavaExecutable().getAbsolutePath()); >+ arguments.add("-jar"); >+ arguments.add(this.proguardJarFilePath); >+ >+ return arguments; >+ } >+ >+ /** >+ * Return the parameters to be used for controlling the proguard preverifier >+ * >+ * @param midletProject >+ * @return >+ * @throws CoreException if an error occurs working with the MIDlet project. >+ */ >+ private String [] getProguardFinalConfigurationParameters(IMTJProject mtjProject, String output) throws CoreException { >+ return new String [] { >+ "-outjars", >+ "'"+output+"'", >+ "-libraryjars", >+ this.getFullClasspath(mtjProject), >+ "'-ignorewarnings'", >+ "-dontusemixedcaseclassnames", >+ "-dontshrink", >+ "-dontoptimize", >+ "-dontobfuscate", >+ "-microedition" >+ }; >+ } >+ >+ /** >+ * Get the full classpath including all J2ME libraries. >+ * >+ * @param midletProject >+ * @return >+ * @throws CoreException >+ */ >+ private String getFullClasspath(IMTJProject mtjProject) >+ throws CoreException { >+ IJavaProject javaProject = mtjProject.getJavaProject(); >+ >+ String[] entries = JavaRuntime.computeDefaultRuntimeClassPath(javaProject); >+ >+ // start in 1 to remove the output folder from the runtime. the output folder should be included in the >+ // -injar proguard options >+ StringBuffer sb = new StringBuffer(); >+ for (int i = 1; i < entries.length; i++) { >+ if (i != 1) { >+ sb.append(File.pathSeparatorChar); >+ } >+ sb.append("'"+entries[i]+"'"); >+ } >+ >+ return sb.toString(); >+ } >+ >+ /** >+ * Add the output folder target to be verified. >+ * >+ * @param args >+ * @param resource >+ * @throws JavaModelException >+ */ >+ private void addOutputToInJar(List args, IMTJProject mtjProject) >+ throws JavaModelException { >+ >+ // Find the source directory this class resides in >+ String outputPath = null; >+ >+ String s1 = mtjProject.getProject().getLocation().toOSString(); >+ String s2 = mtjProject.getJavaProject().getOutputLocation().removeFirstSegments(1).toOSString(); >+ //IPath.SEPARATOR >+ outputPath = s1 + File.separatorChar + s2; >+ >+ if (outputPath != null) { >+ args.add("-injars"); >+ args.add("'"+outputPath+"'"); >+ } >+ } >+ >+ /** >+ * Add any file to be preverified >+ * >+ * @param args >+ * @param resource >+ * @throws JavaModelException >+ */ >+ private void addFileToInJar(List args, String filePath) >+ throws JavaModelException { >+ if (filePath != null) { >+ args.add("-injars"); >+ args.add("'"+filePath+"'"); >+ } >+ } >+ >+ >+ /** >+ * Return the length of the command-line length given the specified argument >+ * list. >+ * >+ * @param arguments >+ * @return >+ */ >+ private int commandLength(ArrayList arguments) { >+ int length = 0; >+ >+ Iterator iter = arguments.iterator(); >+ while (iter.hasNext()) { >+ Object arg = (Object) iter.next(); >+ length += arg.toString().length(); >+ if (iter.hasNext()) >+ length++; >+ } >+ >+ return length; >+ } >+ >+ /** >+ * Return the Java executable to be used for launching this device. >+ * Code from org.eclipse.mtj.core.model.implJavaEmulatorDevice. >+ * TODO Refactore to have a common place for it >+ * >+ * @return >+ */ >+ private File getJavaExecutable() { >+ File executable = null; >+ >+ IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall(); >+ File installLocation = vmInstall.getInstallLocation(); >+ >+ for (int i = 0; i < CANDIDATE_JAVA_LOCATIONS.length; i++) { >+ String javaLocation = CANDIDATE_JAVA_LOCATIONS[i]; >+ File javaExecutable = new File(installLocation, javaLocation); >+ if (javaExecutable.exists()) { >+ executable = javaExecutable; >+ break; >+ } >+ } >+ return executable; >+ } >+ >+ public File getPreverifierExecutable() { >+ // TODO Auto-generated method stub >+ return null; >+ } >+} >\ No newline at end of file >Index: src/org/eclipse/mtj/internal/core/MTJCorePreferenceInitializer.java >=================================================================== >--- src/org/eclipse/mtj/internal/core/MTJCorePreferenceInitializer.java (revision 1355) >+++ src/org/eclipse/mtj/internal/core/MTJCorePreferenceInitializer.java (working copy) >@@ -12,6 +12,8 @@ > * standards > * Hugo Raniere (Motorola) - Default value for default preverifier > * Gang Ma (Sybase) - Default value for preprocess debug level >+ * David Aragao (Motorola) - Add proguard preverifier refactoring >+ * > */ > package org.eclipse.mtj.internal.core; > >@@ -55,7 +57,9 @@ > public static final String PREF_DEF_PREVERIFY_CONFIG_LOCATION = PREF_PREVERIFY_CONFIG_LOCATION_PLATFORM; > public static final String PREF_DEF_PREVERIFY_CONFIG_VALUE = ""; //$NON-NLS-1$ > public static final String PREF_DEF_DEFAULT_PREVERIFIER = ""; //$NON-NLS-1$ >- >+ //public static final boolean PREF_DEF_PREVERIFY_BUILT_IN = false; >+ public static final String PREF_DEF_PREVERIFY_TYPE = IMTJCoreConstants.PREF_PREVERIFY_TYPE_EMULATOR; >+ > public static final String PREF_DEF_WTK_ROOT = ""; //$NON-NLS-1$ > public static final String PREF_DEF_ANTENNA_JAR = ""; //$NON-NLS-1$ > >@@ -103,9 +107,10 @@ > PREF_DEF_PREVERIFY_CONFIG_LOCATION); > prefs.setDefault(PREF_PREVERIFY_CONFIG_VALUE, > PREF_DEF_PREVERIFY_CONFIG_VALUE); >- prefs >- .setDefault(PREF_DEFAULT_PREVERIFIER, >- PREF_DEF_DEFAULT_PREVERIFIER); >+ prefs.setDefault(PREF_PREVERIFY_CONFIG_VALUE, >+ PREF_DEF_PREVERIFY_TYPE); >+ prefs.setDefault(PREF_DEFAULT_PREVERIFIER, >+ PREF_DEF_DEFAULT_PREVERIFIER); > > prefs.setDefault(PREF_ANTENNA_JAR, PREF_DEF_ANTENNA_JAR); > prefs.setDefault(PREF_WTK_ROOT, PREF_DEF_WTK_ROOT); >Index: src/org/eclipse/mtj/core/build/preverifier/IPreverifier.java >=================================================================== >--- src/org/eclipse/mtj/core/build/preverifier/IPreverifier.java (revision 1355) >+++ src/org/eclipse/mtj/core/build/preverifier/IPreverifier.java (working copy) >@@ -10,6 +10,7 @@ > * Craig Setera (EclipseME) - Initial implementation > * Diego Sandin (Motorola) - Refactoring package name to follow eclipse > * standards >+ * David Aragao (Motorola) - Adding proguard constant > */ > package org.eclipse.mtj.core.build.preverifier; > >@@ -70,6 +71,11 @@ > * Constant that represents the standard preverifier > */ > public static final String PREVERIFIER_STANDARD = "org.eclipse.mtj.preverifier.standard"; >+ >+ /** >+ * Constant that represents the Proguard preverifier >+ */ >+ public static final String PREVERIFIER_PROGUARD = "org.eclipse.mtj.preverifier.proguard"; > > /** > * Constant that represents an unknown preverifier >@@ -75,6 +81,7 @@ > * Constant that represents an unknown preverifier > */ > public static final String PREVERIFIER_UNKNOWN = "org.eclipse.mtj.preverifier.unknown"; >+ > > /** > * Launch the preverification process on the specified resources from the >Index: src/org/eclipse/mtj/core/MTJCore.java >=================================================================== >--- src/org/eclipse/mtj/core/MTJCore.java (revision 1355) >+++ src/org/eclipse/mtj/core/MTJCore.java (working copy) >@@ -17,7 +17,8 @@ > * Gustavo de Paula (Motorola) - Add preverifier factory > * Gustavo de Paula (Motorola) - Add mtj project converter > * David Marques (Motorola) - Adding build.properties resource changes >- * listener. >+ * listener. >+ * David Aragao (Motorola) - Create Proguard Preverifier option > */ > package org.eclipse.mtj.core; > >@@ -56,6 +57,7 @@ > import org.eclipse.mtj.core.symbol.ISymbolSetRegistry; > import org.eclipse.mtj.internal.core.IMTJCoreConstants; > import org.eclipse.mtj.internal.core.build.preprocessor.PreprocessedSourceMapper; >+import org.eclipse.mtj.internal.core.build.preverifier.ProguardPreverifier; > import org.eclipse.mtj.internal.core.build.preverifier.StandardPreverifierFactory; > import org.eclipse.mtj.internal.core.hook.sourceMapper.SourceMapperAccess; > import org.eclipse.mtj.internal.core.project.midp.MetaData; >@@ -206,7 +208,9 @@ > preverifier = StandardPreverifierFactory > .createPreverifier((File) param); > } >- } >+ }else if (preverifierType.equals(IPreverifier.PREVERIFIER_PROGUARD)) { >+ preverifier = ProguardPreverifier.getInstance(); >+ } > > return preverifier; > } >@@ -319,7 +323,7 @@ > File proguardLibDir = new File(proguardDir, "lib"); //$NON-NLS-1$ > File proguardJar = new File(proguardLibDir, > IMTJCoreConstants.PROGUARD_JAR); >- >+ > return proguardJar; > } > >#P org.eclipse.mtj.ui >Index: src/org/eclipse/mtj/internal/ui/preferences/PreverificationPreferencePage.java >=================================================================== >--- src/org/eclipse/mtj/internal/ui/preferences/PreverificationPreferencePage.java (revision 1356) >+++ src/org/eclipse/mtj/internal/ui/preferences/PreverificationPreferencePage.java (working copy) >@@ -17,6 +17,8 @@ > * Diego Sandin (Motorola) - Use Eclipse Message Bundles [Bug 255874] > * Gustavo de Paula (Motorola) - Preverifier api refactoring > * David Aragao (Motorola) - Default preverifier file validation >+ * David Aragao (Motorola) - Preverifier Type selection >+ * > */ > package org.eclipse.mtj.internal.ui.preferences; > >@@ -34,10 +36,14 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.core.runtime.preferences.IEclipsePreferences; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jface.operation.IRunnableWithProgress; >+import org.eclipse.jface.preference.FieldEditorPreferencePage; > import org.eclipse.jface.preference.FileFieldEditor; > import org.eclipse.jface.preference.IPreferenceStore; >-import org.eclipse.jface.preference.PreferencePage; >+import org.eclipse.jface.preference.RadioGroupFieldEditor; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.mtj.core.MTJCore; > import org.eclipse.mtj.core.build.preverifier.IPreverifier; > import org.eclipse.mtj.core.sdk.device.IAPI; >@@ -65,7 +71,7 @@ > * > * @author Craig Setera > */ >-public class PreverificationPreferencePage extends PreferencePage implements >+public class PreverificationPreferencePage extends FieldEditorPreferencePage implements > IEmbeddableWorkbenchPreferencePage { > > private static final String[] BUTTON_TEXTS = new String[] { >@@ -82,8 +88,14 @@ > private IAPI[] configSpecs; > private FileFieldEditor defaultPreverifierField; > private boolean embeddedInProperties; >+ private Group defaultPreverifierGroup; >+ >+ // The java project on which this MIDlet suite is based >+ private IJavaProject javaProject; >+ private Button[] preverificationRadios; >+ private RadioGroupFieldEditor radioGroupFieldEditor; > >- private Button[] preverificationRadios; >+ private String currentRadioSelected; > > /** > * Default constructor. >@@ -211,7 +223,7 @@ > * @param composite > */ > private void addDefaultPreverifierControls(Composite composite) { >- Group defaultPreverifierGroup = new Group(composite, SWT.NONE); >+ defaultPreverifierGroup = new Group(composite, SWT.NONE); > defaultPreverifierGroup > .setText(MTJUIMessages.PreverificationPreferencePage_defaultPreverifierGroup_label_text); > defaultPreverifierGroup.setLayout(new GridLayout(3, false)); >@@ -235,8 +247,7 @@ > if (Platform.getOS().equals(Platform.OS_WIN32)) { > extensions = new String[] { "*.exe" }; //$NON-NLS-1$ > } >- defaultPreverifierField.getTextControl(defaultPreverifierGroup) >- .setEnabled(false); >+ defaultPreverifierField.getTextControl(defaultPreverifierGroup).setEnabled(false); > defaultPreverifierField.setFileExtensions(extensions); > defaultPreverifierField.setPreferenceStore(getPreferenceStore()); > } >@@ -299,36 +310,49 @@ > } > > private void setControlsFromDefaults() { >- if (preverificationRadios != null) { >- IPreferenceStore store = getPreferenceStore(); >- String location = store >- .getDefaultString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_LOCATION); >- for (int i = 0; i < preverificationRadios.length; i++) { >- String fieldValue = CONFIG_FILE_LOCATIONS[i]; >- preverificationRadios[i].setSelection(fieldValue >- .equals(location)); >- } >+ if (preverificationRadios != null) { >+ IPreferenceStore store = getPreferenceStore(); >+ String location = store >+ .getDefaultString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_LOCATION); >+ for (int i = 0; i < preverificationRadios.length; i++) { >+ String fieldValue = CONFIG_FILE_LOCATIONS[i]; >+ preverificationRadios[i].setSelection(fieldValue >+ .equals(location)); >+ } > >- int specIndex = 0; >- String config = store >- .getDefaultString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_VALUE); >- for (int i = 0; i < configSpecs.length; i++) { >- IAPI spec = configSpecs[i]; >- if (spec.toString().equals(config)) { >- specIndex = i; >- break; >- } >- } >+ IPreferenceStore preverifierTypestore = radioGroupFieldEditor >+ .getPreferenceStore(); > >- configCombo.select(specIndex); >- } >+ String preverifyType = preverifierTypestore >+ .getString(IMTJCoreConstants.PREF_PREVERIFY_TYPE); >+ if (preverifyType.equals("preverify_default")) { >+ defaultPreverifierField.setEnabled(true, >+ defaultPreverifierGroup); >+ } else { >+ defaultPreverifierField.setEnabled(false, >+ defaultPreverifierGroup); >+ } > >- if (defaultPreverifierField != null) { >- defaultPreverifierField.loadDefault(); >- } >+ int specIndex = 0; >+ String config = store >+ .getDefaultString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_VALUE); >+ for (int i = 0; i < configSpecs.length; i++) { >+ IAPI spec = configSpecs[i]; >+ if (spec.toString().equals(config)) { >+ specIndex = i; >+ break; >+ } >+ } > >- isDefaultPreverifierValid(); >- } >+ configCombo.select(specIndex); >+ } >+ >+ if (defaultPreverifierField != null) { >+ defaultPreverifierField.loadDefault(); >+ } >+ >+ isDefaultPreverifierValid(); >+ } > > /** > * Set the state of the controls based on the preferences. >@@ -334,102 +358,175 @@ > * Set the state of the controls based on the preferences. > */ > private void setControlsFromPreferences() { >- if (preverificationRadios != null) { >- IPreferenceStore store = getPreferenceStore(); >- String location = store >- .getString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_LOCATION); >- for (int i = 0; i < preverificationRadios.length; i++) { >- String fieldValue = CONFIG_FILE_LOCATIONS[i]; >- preverificationRadios[i].setSelection(fieldValue >- .equals(location)); >- } >+ if (preverificationRadios != null) { >+ IPreferenceStore store = getPreferenceStore(); >+ String location = store >+ .getString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_LOCATION); >+ for (int i = 0; i < preverificationRadios.length; i++) { >+ String fieldValue = CONFIG_FILE_LOCATIONS[i]; >+ preverificationRadios[i].setSelection(fieldValue >+ .equals(location)); >+ } > >- int specIndex = 0; >- String config = store >- .getString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_VALUE); >- for (int i = 0; i < configSpecs.length; i++) { >- IAPI spec = configSpecs[i]; >- if (spec.toString().equals(config)) { >- specIndex = i; >- break; >- } >- } >+ IPreferenceStore preverifierTypestore = radioGroupFieldEditor >+ .getPreferenceStore(); >+ String preverifierTypeString = preverifierTypestore >+ .getString(IMTJCoreConstants.PREF_PREVERIFY_TYPE); >+ if (preverifierTypeString.equals("default_preverifier")) { >+ defaultPreverifierField.setEnabled(true, >+ defaultPreverifierGroup); >+ } else { >+ defaultPreverifierField.setEnabled(false, >+ defaultPreverifierGroup); >+ } > >- configCombo.select(specIndex); >- } >- if (defaultPreverifierField != null) { >- defaultPreverifierField.load(); >- } >- isDefaultPreverifierValid(); >- } >+ int specIndex = 0; >+ String config = store >+ .getString(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_VALUE); >+ for (int i = 0; i < configSpecs.length; i++) { >+ IAPI spec = configSpecs[i]; >+ if (spec.toString().equals(config)) { >+ specIndex = i; >+ break; >+ } >+ } >+ >+ configCombo.select(specIndex); >+ } >+ if (defaultPreverifierField != null) { >+ defaultPreverifierField.load(); >+ } >+ isDefaultPreverifierValid(); >+ } > > private void setDefaultPreverifier() { > >- String errorMessage = null; >+ String errorMessage = null; >+ >+ // if the default preverifier value changed >+ if (!defaultPreverifierField.getStringValue().equals( >+ getPreferenceStore().getString( >+ IMTJCoreConstants.PREF_DEFAULT_PREVERIFIER))) { >+ File preverifierExecutable = new File(defaultPreverifierField >+ .getStringValue()); >+ IPreverifier preverifier = null; >+ try { >+ preverifier = MTJCore.createPreverifier( >+ IPreverifier.PREVERIFIER_STANDARD, >+ preverifierExecutable); >+ } catch (CoreException e) { >+ MTJUIPlugin >+ .displayError( >+ getShell(), >+ IStatus.ERROR, >+ -999, >+ MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_title, >+ MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_message, >+ e); >+ MTJLogger >+ .log( >+ IStatus.ERROR, >+ NLS >+ .bind( >+ MTJUIMessages.PreverificationPreferencePage_device_store_error, >+ new String[] { >+ e.getClass().getName(), >+ e.getMessage() }), e); >+ } >+ if (preverifier == null) { >+ errorMessage = MTJUIMessages.PreverificationPreferencePage_error_invalid_preverifier_file; >+ } else { >+ MTJCore.getDeviceRegistry().setDefaultPreverifer(preverifier); >+ >+ try { >+ MTJCore.getDeviceRegistry().store(); >+ } catch (Exception e) { >+ MTJUIPlugin >+ .displayError( >+ getShell(), >+ IStatus.ERROR, >+ -999, >+ MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_title, >+ MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_message, >+ e); >+ MTJLogger >+ .log( >+ IStatus.ERROR, >+ NLS >+ .bind( >+ MTJUIMessages.PreverificationPreferencePage_device_store_error, >+ new String[] { >+ e.getClass() >+ .getName(), >+ e.getMessage() }), >+ e); >+ } >+ } >+ setErrorMessage(errorMessage); >+ } > >- // if the default preverifier value changed >- if (!defaultPreverifierField.getStringValue().equals( >- getPreferenceStore().getString( >- IMTJCoreConstants.PREF_DEFAULT_PREVERIFIER))) { >- File preverifierExecutable = new File(defaultPreverifierField >- .getStringValue()); >- IPreverifier preverifier = null; >- try { >- preverifier = MTJCore.createPreverifier( >- IPreverifier.PREVERIFIER_STANDARD, >- preverifierExecutable); >- } catch (CoreException e) { >- MTJUIPlugin >- .displayError( >- getShell(), >- IStatus.ERROR, >- -999, >- MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_title, >- MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_message, >- e); >- MTJLogger >- .log( >- IStatus.ERROR, >- NLS >- .bind( >- MTJUIMessages.PreverificationPreferencePage_device_store_error, >- new String[] { >- e.getClass().getName(), >- e.getMessage() }), e); >- } >- if (preverifier == null) { >- errorMessage = MTJUIMessages.PreverificationPreferencePage_error_invalid_preverifier_file; >- } else { >- MTJCore.getDeviceRegistry().setDefaultPreverifer(preverifier); >+ } >+ >+ private void setProguardPreverifier() { >+ >+ String errorMessage = null; > >- try { >- MTJCore.getDeviceRegistry().store(); >- } catch (Exception e) { >- MTJUIPlugin >- .displayError( >- getShell(), >- IStatus.ERROR, >- -999, >- MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_title, >- MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_message, >- e); >- MTJLogger >- .log( >- IStatus.ERROR, >- NLS >- .bind( >- MTJUIMessages.PreverificationPreferencePage_device_store_error, >- new String[] { >- e.getClass() >- .getName(), >- e.getMessage() }), >- e); >- } >- } >- setErrorMessage(errorMessage); >- } >+ >+ IPreverifier preverifier = null; >+ try { >+ preverifier = MTJCore.createPreverifier( >+ IPreverifier.PREVERIFIER_PROGUARD, >+ null); >+ } catch (CoreException e) { >+ MTJUIPlugin >+ .displayError( >+ getShell(), >+ IStatus.ERROR, >+ -999, >+ MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_title, >+ MTJUIMessages.PreverificationPreferencePage_invalid_preverifier_dialog_message, >+ e); >+ MTJLogger >+ .log( >+ IStatus.ERROR, >+ NLS >+ .bind( >+ MTJUIMessages.PreverificationPreferencePage_device_store_error, >+ new String[] { >+ e.getClass().getName(), >+ e.getMessage() }), e); >+ } >+ if (preverifier == null) { >+ errorMessage = MTJUIMessages.PreverificationPreferencePage_error_invalid_preverifier_file; >+ } else { >+ MTJCore.getDeviceRegistry().setDefaultPreverifer(preverifier); > >- } >+ try { >+ MTJCore.getDeviceRegistry().store(); >+ } catch (Exception e) { >+ MTJUIPlugin >+ .displayError( >+ getShell(), >+ IStatus.ERROR, >+ -999, >+ MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_title, >+ MTJUIMessages.PreverificationPreferencePage_error_store_preverifier_dialog_message, >+ e); >+ MTJLogger >+ .log( >+ IStatus.ERROR, >+ NLS >+ .bind( >+ MTJUIMessages.PreverificationPreferencePage_device_store_error, >+ new String[] { >+ e.getClass() >+ .getName(), >+ e.getMessage() }), >+ e); >+ } >+ } >+ setErrorMessage(errorMessage); >+ } > > /** > * Set the state of the preferences based on the controls. >@@ -444,14 +541,17 @@ > break; > } > } >- >+ > int index = configCombo.getSelectionIndex(); > store.setValue(IMTJCoreConstants.PREF_PREVERIFY_CONFIG_VALUE, >- configSpecs[index].toString()); >- if (defaultPreverifierField != null) { >+ configSpecs[index].getIdentifier()); >+ >+ if (defaultPreverifierField != null && currentRadioSelected == "default_preverifier") { > setDefaultPreverifier(); > defaultPreverifierField.store(); >- } >+ }else if (currentRadioSelected == "preverify_proguard") { >+ setProguardPreverifier(); >+ } > } > > /** >@@ -469,9 +569,10 @@ > return prefNode.getBoolean( > IMTJCoreConstants.PREF_PREVERIFY_USE_PROJECT, false); > } >- >+ > /** >- * Return a boolean indicating if the preverifier executable is valid. >+ * Return a boolean indicating if the preverifier executable >+ * is valid. > * > * @return true if valid false otherwise. > */ >@@ -476,55 +577,111 @@ > * @return true if valid false otherwise. > */ > private boolean isDefaultPreverifierValid() { >- boolean result = false; >+ boolean result = false; >+ >+ if (!defaultPreverifierField.getStringValue().isEmpty()) { >+ File preverifierExecutable = new File(defaultPreverifierField >+ .getStringValue()); >+ IPreverifier preverifier = null; >+ >+ try { >+ preverifier = MTJCore.createPreverifier( >+ IPreverifier.PREVERIFIER_STANDARD, preverifierExecutable); >+ } catch (CoreException e) { >+ MTJLogger.log(IStatus.ERROR, e); >+ } >+ >+ if (preverifier != null) { >+ result = true; >+ setErrorMessage(null); >+ } else { >+ setErrorMessage(MTJUIMessages.PreverificationPreferencePage_error_invalid_preverifier_file); >+ } >+ } else { >+ result = true; >+ setErrorMessage(null); >+ } >+ >+ return result; >+ } >+ >+ /** >+ * Add the controls that are for work-in-progress function. >+ * >+ * @param composite >+ */ >+ private void addTypeOfPreverifier(final Composite composite) { >+ radioGroupFieldEditor = new RadioGroupFieldEditor( >+ IMTJCoreConstants.PREF_PREVERIFY_TYPE, >+ "Preverifier Type", >+ 1, >+ new String[][] { >+ { "Default Preverifier", >+ IMTJCoreConstants.PREF_DEFAULT_PREVERIFIER }, >+ { "Emulator Preverifier", >+ IMTJCoreConstants.PREF_PREVERIFY_TYPE_EMULATOR }, >+ { "Proguard Preverifier", >+ IMTJCoreConstants.PREF_PREVERIFY_TYPE_PROGUARD } }, >+ composite, true); >+ radioGroupFieldEditor.setPreferenceStore(getPreferenceStore()); >+ radioGroupFieldEditor.load(); >+ radioGroupFieldEditor.fillIntoGrid(composite, 1); >+ >+ radioGroupFieldEditor >+ .setPropertyChangeListener(new IPropertyChangeListener() { >+ public void propertyChange(PropertyChangeEvent event) { >+ currentRadioSelected = (String) event.getNewValue(); >+ if (!currentRadioSelected.equals(event.getOldValue())) { >+ if (currentRadioSelected.equals("default_preverifier")) { >+ defaultPreverifierField.setEnabled(true, >+ defaultPreverifierGroup); >+ } else if (currentRadioSelected.equals("preverify_proguard") >+ || currentRadioSelected.equals("preverify_emulator")) { >+ defaultPreverifierField.setEnabled(false, >+ defaultPreverifierGroup); >+ } >+ } >+ } >+ }); >+ addField(radioGroupFieldEditor); >+ } > >- if (!(defaultPreverifierField.getStringValue().length() == 0)) { >- File preverifierExecutable = new File(defaultPreverifierField >- .getStringValue()); >- IPreverifier preverifier = null; >+ /* >+ * (non-Javadoc) >+ * >+ * @see >+ * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse >+ * .swt.widgets.Composite) >+ */ >+ @Override >+ protected Control createContents(Composite parent) { > >- try { >- preverifier = MTJCore.createPreverifier( >- IPreverifier.PREVERIFIER_STANDARD, >- preverifierExecutable); >- } catch (CoreException e) { >- MTJLogger.log(IStatus.ERROR, e); >- } >- >- if (preverifier != null) { >- result = true; >- setErrorMessage(null); >- } else { >- setErrorMessage(MTJUIMessages.PreverificationPreferencePage_error_invalid_preverifier_file); >- } >- } else { >- result = true; >- setErrorMessage(null); >- } >- >- return result; >- } >+ Composite composite = new Composite(parent, SWT.NONE); >+ composite.setLayout(new GridLayout(1, false)); >+ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); > >- /* (non-Javadoc) >- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) >- */ >- @Override >- protected Control createContents(Composite parent) { >+ addConfigurationControls(composite); > >- Composite composite = new Composite(parent, SWT.NONE); >- composite.setLayout(new GridLayout(1, false)); >- composite.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ addTypeOfPreverifier(composite); > >- addConfigurationControls(composite); >+ if (!embeddedInProperties) { >+ addDefaultPreverifierControls(composite); >+ } else { >+ noDefaultAndApplyButton(); >+ } > >- if (!embeddedInProperties) { >- addDefaultPreverifierControls(composite); >- } else { >- noDefaultAndApplyButton(); >- } >+ setControlsFromPreferences(); > >- setControlsFromPreferences(); >+ return composite; >+ } >+ >+ public IProject getProject() { >+ return javaProject.getProject(); >+ } > >- return composite; >- } >+ @Override >+ protected void createFieldEditors() { >+ // TODO Auto-generated method stub >+ >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
wgp010
:
iplog+
wgp010
:
review+
Actions:
View
|
Diff
Attachments on
bug 234139
:
102140
|
133924
|
135358
|
135639
|
141448
| 142704