+ org.jboss.tools.common.core
org.jboss.tools.common
org.jboss.tools.common.el.core
org.jboss.tools.common.el.ui
Index: plugins/org.jboss.tools.common.core/about.html
===================================================================
--- plugins/org.jboss.tools.common.core/about.html (revision 0)
+++ plugins/org.jboss.tools.common.core/about.html (working copy)
@@ -0,0 +1,34 @@
+
+
+
+
+About
+
+
+
+
+
+About This Content
+
+©2007 - 2012 Red Hat, Inc. All rights reserved
+
+License
+
+Red Hat Inc., through its JBoss division, makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+http://www.eclipse.org/org/documents/epl-v10.php.
+For purposes of the EPL, "Program" will mean the Content.
+
+If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ http://www.jboss.org/tools.
+
+
+
\ No newline at end of file
Index: plugins/org.jboss.tools.common.core/.project
===================================================================
--- plugins/org.jboss.tools.common.core/.project (revision 0)
+++ plugins/org.jboss.tools.common.core/.project (working copy)
@@ -0,0 +1,34 @@
+
+
+ org.jboss.tools.common.core
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.api.tools.apiAnalysisBuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.PluginNature
+ org.eclipse.pde.api.tools.apiAnalysisNature
+
+
Property changes on: plugins/org.jboss.tools.common.core/.project
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java (working copy)
@@ -30,8 +30,8 @@
import org.apache.xml.serialize.Method;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
-import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.Messages;
+import org.jboss.tools.common.core.CommonCorePlugin;
+import org.jboss.tools.common.core.Messages;
import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
@@ -136,7 +136,7 @@
d.setErrorHandler(new ErrorHandlerImpl());
return d;
} catch (ParserConfigurationException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
return null;
}
@@ -196,18 +196,18 @@
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(fr);
return getElement(inSource, resolver);
} catch (FileNotFoundException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} catch (SAXException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} finally {
try {
if (fr != null) {
fr.close();
}
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
return null;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java (working copy)
@@ -23,7 +23,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.jboss.tools.common.util.HttpUtil;
import org.osgi.framework.Bundle;
import org.xml.sax.EntityResolver;
@@ -72,7 +72,7 @@
if(location == null) {
if(systemId != null && !unfound.contains(systemId)) {
unfound.add(systemId);
-// CommonPlugin.getPluginLog().logInfo("Cannot find locally: " //$NON-NLS-1$
+// CommonCorePlugin.getPluginLog().logInfo("Cannot find locally: " //$NON-NLS-1$
// + "Public ID " + publicId //$NON-NLS-1$
// + " System ID " + systemId); //$NON-NLS-1$
}
@@ -87,7 +87,7 @@
return url.openStream();
}
} catch(FileNotFoundException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
@@ -109,9 +109,9 @@
is = HttpUtil.getInputStreamFromUrlByGetMethod(systemId);
}
} catch (MalformedURLException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
return is;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java (working copy)
@@ -10,7 +10,7 @@
import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -104,7 +104,7 @@
source = new InputSource(new ByteArrayInputStream("".getBytes())); //$NON-NLS-1$
}
if(source == null) {
- CommonPlugin.getDefault().logError("WARNING: Cannot resolve entity " + systemId); //$NON-NLS-1$
+ CommonCorePlugin.getDefault().logError("WARNING: Cannot resolve entity " + systemId); //$NON-NLS-1$
}
// TODO study if we can always return non-null value.
return source;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java (working copy)
@@ -22,16 +22,15 @@
import org.apache.xerces.util.XMLCatalogResolver;
import org.apache.xerces.xni.XMLResourceIdentifier;
import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.Messages;
-import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.common.core.CommonCorePlugin;
+import org.jboss.tools.common.core.Messages;
+import org.jboss.tools.common.util.FileUtils;
import org.osgi.framework.Bundle;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
* @author eskimo(dgolovin@exadel.com)
@@ -73,9 +72,9 @@
try {
parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
} catch (SAXNotRecognizedException e1) {
- CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
+ CommonCorePlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
} catch (SAXNotSupportedException e1) {
- CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
+ CommonCorePlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
}
parserInstance.setContentHandler(handler);
@@ -94,7 +93,7 @@
parser.setFeature(name, value);
} catch (SAXException e) {
// TODO - Move to NLS bundle
- CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
+ CommonCorePlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -108,7 +107,7 @@
try {
parser.setProperty(name, value);
} catch (SAXException e) {
- CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
+ CommonCorePlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -159,7 +158,7 @@
*/
String getCatalog() {
- Bundle b = Platform.getBundle(CommonPlugin.PLUGIN_ID);
+ Bundle b = Platform.getBundle(CommonCorePlugin.PLUGIN_ID);
String location = Platform.getStateLocation(b).toString().replace('\\', '/');
if(!location.endsWith("/")) { //$NON-NLS-1$
location += "/"; //$NON-NLS-1$
@@ -174,20 +173,20 @@
}
urlString += "schemas"; //$NON-NLS-1$
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
File f1 = new File(url.getFile() + "/schemas/catalog.xml"); //$NON-NLS-1$
File f2 = new File(location + "schemas/catalog.xml"); //$NON-NLS-1$
if(f2.exists()) {
return "file:///" + location + "schemas/catalog.xml"; //$NON-NLS-1$ //$NON-NLS-2$
}
- FileUtil.copyDir(f1.getParentFile(), f2.getParentFile(), true);
- String text = FileUtil.readFile(f2);
+ FileUtils.copyDir(f1.getParentFile(), f2.getParentFile(), true);
+ String text = FileUtils.readFile(f2);
while(text.indexOf("%install%") >= 0) { //$NON-NLS-1$
int i = text.indexOf("%install%"); //$NON-NLS-1$
text = text.substring(0, i) + urlString + text.substring(i + 9);
}
- FileUtil.writeFile(f2, text);
+ FileUtils.writeFile(f2, text);
return "file:///" + location + "schemas/catalog.xml"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java (working copy)
@@ -19,7 +19,7 @@
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.apache.xerces.xni.parser.XMLInputSource;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.xml.sax.SAXException;
@@ -52,7 +52,7 @@
result = new XMLInputSource(rid.getPublicId(), systemId, rid.getBaseSystemId(), is, null);
}
} catch (SAXException e) {
- CommonPlugin.getPluginLog().logError( "Exception publicId=" + publicId + " systemId=" + systemId + " exception=" + e.getClass().getName() + ":" + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ CommonCorePlugin.getPluginLog().logError( "Exception publicId=" + publicId + " systemId=" + systemId + " exception=" + e.getClass().getName() + ":" + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return result;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java (working copy)
@@ -18,7 +18,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jdt.core.JavaCore;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
/**
* Constants for names of seam preferences.
@@ -46,9 +46,9 @@
public abstract class SeverityPreferences {
public static final String ENABLE_BLOCK_PREFERENCE_NAME = "enableBlock"; //$NON-NLS-1$
- public static final String MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME = CommonPlugin.PLUGIN_ID + ".validator.problem.markersBlock"; //$NON-NLS-1$
+ public static final String MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME = CommonCorePlugin.PLUGIN_ID + ".validator.problem.markersBlock"; //$NON-NLS-1$
public static final int DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE = 20;
- public static final String WRONG_BUILDER_ORDER_PREFERENCE_NAME = CommonPlugin.PLUGIN_ID + ".validator.problem.wrongBuilderOrder"; //$NON-NLS-1$
+ public static final String WRONG_BUILDER_ORDER_PREFERENCE_NAME = CommonCorePlugin.PLUGIN_ID + ".validator.problem.wrongBuilderOrder"; //$NON-NLS-1$
public static final String ERROR = "error"; //$NON-NLS-1$
public static final String WARNING = "warning"; //$NON-NLS-1$
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java (working copy)
@@ -18,7 +18,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.jboss.tools.common.util.HttpUtil;
/**
@@ -27,11 +27,11 @@
*/
public class Submit {
- public static String REPORT_DESRIPTION_PARAMETER_NAME = CommonPlugin.getMessage("%reportParameterName"); //$NON-NLS-1$
+ public static String REPORT_DESRIPTION_PARAMETER_NAME = CommonCorePlugin.getMessage("%reportParameterName"); //$NON-NLS-1$
- private static String URL = CommonPlugin.getMessage("%reportingUrl"); //$NON-NLS-1$
- private static String JOB_NAME = CommonPlugin.getMessage("%reportingJobName"); //$NON-NLS-1$
- private static String ERROR_MESSAGE = CommonPlugin.getMessage("%errorReportingMessage"); //$NON-NLS-1$
+ private static String URL = CommonCorePlugin.getMessage("%reportingUrl"); //$NON-NLS-1$
+ private static String JOB_NAME = CommonCorePlugin.getMessage("%reportingJobName"); //$NON-NLS-1$
+ private static String ERROR_MESSAGE = CommonCorePlugin.getMessage("%errorReportingMessage"); //$NON-NLS-1$
private static Submit INSTANCE = new Submit();
@@ -63,7 +63,7 @@
if(exceptionMessage!=null && exceptionMessage.trim().length()>0) {
message = message + ".\r\n" + e.getClass().getName() + ": " + exceptionMessage; //$NON-NLS-1$ //$NON-NLS-2$
}
- Status status = new Status(IStatus.WARNING, CommonPlugin.PLUGIN_ID, IStatus.WARNING, message, e);
+ Status status = new Status(IStatus.WARNING, CommonCorePlugin.PLUGIN_ID, IStatus.WARNING, message, e);
return status;
}
if(cleanBuffer) {
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java (working copy)
@@ -12,14 +12,14 @@
import java.io.File;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.util.FileUtils;
+import org.osgi.framework.Bundle;
//import org.eclipse.core.internal.runtime.PlatformLogWriter;
//import org.eclipse.core.runtime.ILogListener;
//import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
//import org.eclipse.core.runtime.adaptor.EclipseLog;
//import org.eclipse.osgi.framework.log.FrameworkLog;
-import org.jboss.tools.common.util.FileUtil;
-import org.osgi.framework.Bundle;
/**
* This class is intended only to be called by Report Problem Framework.
@@ -68,12 +68,12 @@
*/
public String getContent() {
File f = getLogFile();
- return (!f.isFile()) ? "" : FileUtil.readFile(f); //$NON-NLS-1$
+ return (!f.isFile()) ? "" : FileUtils.readFile(f); //$NON-NLS-1$
}
public String getEclipseLogContent() {
File f = Platform.getLogFileLocation().toFile();
- return (f.isFile()) ? FileUtil.readFile(f) : ""; //$NON-NLS-1$
+ return (f.isFile()) ? FileUtils.readFile(f) : ""; //$NON-NLS-1$
}
public void clean() {
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java (working copy)
@@ -30,7 +30,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
public class WebUtils {
@@ -87,7 +87,7 @@
try {
facetedProject = ProjectFacetsManager.create(project);
} catch (CoreException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
IVirtualComponent component = ComponentCore.createComponent(project);
@@ -137,9 +137,9 @@
// Not available in this WTP version, let's ignore it
WTP_3_3_0 = true;
} catch (IllegalArgumentException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
} catch (IllegalAccessException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
} catch (InvocationTargetException e) {
// Not available in this WTP version, let's ignore it
WTP_3_3_0 = true;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java (working copy)
@@ -17,7 +17,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
public class TypeResolutionCache {
private static TypeResolutionCache instance = new TypeResolutionCache();
@@ -83,9 +83,9 @@
typeName += (!"".equals(typeName) ? "." : "") + resolvedArray[0][i]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return typeName;
} catch (JavaModelException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} catch (IllegalArgumentException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
return null;
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java (working copy)
@@ -21,7 +21,7 @@
import org.apache.commons.httpclient.methods.PostMethod;
import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.core.net.proxy.IProxyService;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -193,7 +193,7 @@
private static IProxyService getProxyService() {
if(proxyService==null) {
- BundleContext bundleContext = CommonPlugin.getInstance().getBundle().getBundleContext();
+ BundleContext bundleContext = CommonCorePlugin.getInstance().getBundle().getBundleContext();
ServiceReference serviceReference = bundleContext.getServiceReference(IProxyService.class.getName());
proxyService = (IProxyService)bundleContext.getService(serviceReference);
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java (working copy)
@@ -39,30 +39,21 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.LocationKind;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
-public final class FileUtil {
+public class FileUtils {
- public FileUtil() {}
+ public FileUtils() {}
public static String getEncoding(IFile f) {
String encoding = null;
if(f != null && f.exists() && f.isSynchronized(0)) try {
encoding = f.getCharset();
} catch (CoreException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
return encoding != null ? encoding : "8859_1"; //$NON-NLS-1$
}
@@ -187,7 +178,7 @@
sb.append(new String(b, 0, l));
}
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} finally {
try {
is.close();
@@ -213,7 +204,7 @@
try {
in.close();
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
}
@@ -230,7 +221,7 @@
sb.append(new String(b, 0, l, charset));
}
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
} finally {
try {
is.close();
@@ -252,7 +243,7 @@
try {
is.close();
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
}
@@ -284,9 +275,9 @@
if(f.isFile() && !isSameFile(f)) f.delete();
if(!f.exists()) f.createNewFile();
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
+ CommonCorePlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
} catch (SecurityException e) {
- CommonPlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
+ CommonCorePlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
}
PrintWriter pw = new PrintWriter(new FileWriter(f));
pw.print(value);
@@ -316,7 +307,7 @@
try {
dest.createNewFile();
} catch (IOException e1) {
- CommonPlugin.getPluginLog().logError(e1);
+ CommonCorePlugin.getPluginLog().logError(e1);
}
InputStream is = null;
OutputStream os = null;
@@ -326,18 +317,18 @@
copyStream(is, os);
return true;
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
return false;
} finally {
try {
if (is != null) is.close();
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
try {
if (os != null) os.close();
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
}
}
@@ -643,7 +634,7 @@
f.createNewFile();
}
} catch (IOException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
FileOutputStream fs = new FileOutputStream(f);
OutputStreamWriter osw = new OutputStreamWriter(fs, encoding);
@@ -732,46 +723,4 @@
}
return -1;
}
-
- /**
- * Returns the content of the file. If this file is open in an active editor
- * then the content of the editor will be returned.
- *
- * @param file
- * @return
- */
- public static String getContentFromEditorOrFile(IFile file) {
- IFileBuffer b = FileBuffers.getTextFileBufferManager().getFileBuffer(file.getFullPath(), LocationKind.IFILE);
- if (b instanceof ITextFileBuffer) {
- IDocument doc = ((ITextFileBuffer)b).getDocument();
- if(doc != null) {
- return doc.get();
- }
- }
- ITextEditor editor = EclipseUIUtil.getActiveEditor();
- if (editor != null) {
- IEditorInput editorInput = editor.getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- IFileEditorInput fileInput = (IFileEditorInput) editorInput;
- if (file.equals(fileInput.getFile())) {
- IDocumentProvider dp = editor.getDocumentProvider();
- try {
- dp.connect(fileInput);
- IDocument doc = dp.getDocument(fileInput);
- return doc.get();
- } catch (CoreException e) {
- CommonPlugin.getDefault().logError(e);
- } finally {
- dp.disconnect(fileInput);
- }
- }
- }
- }
- try {
- return FileUtil.readStream(file);
- } catch (CoreException e) {
- CommonPlugin.getDefault().logError(e);
- return null;
- }
- }
}
\ No newline at end of file
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java (working copy)
@@ -32,7 +32,7 @@
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
public class EclipseJavaUtil {
@@ -48,7 +48,7 @@
String typeName = new String(Signature.toCharArray(f.getTypeSignature().toCharArray()));
return resolveType(f.getDeclaringType(), typeName);
} catch (JavaModelException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
return null;
}
@@ -58,7 +58,7 @@
try {
return resolveTypeAsString(m.getDeclaringType(), m.getReturnType());
} catch (JavaModelException e) {
- CommonPlugin.getPluginLog().logError(e);
+ CommonCorePlugin.getPluginLog().logError(e);
}
return null;
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java (working copy)
@@ -23,7 +23,7 @@
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
/**
*
@@ -224,7 +224,7 @@
}
}
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
this.inheritedTypes = inheritedTypes;
inheritanceIsBuilt = true;
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java (working copy)
@@ -24,7 +24,7 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IType;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.java.IAnnotationType;
import org.jboss.tools.common.java.IJavaAnnotation;
@@ -159,7 +159,7 @@
}
} catch (CoreException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java (working copy)
@@ -18,7 +18,7 @@
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.jboss.tools.common.java.IJavaAnnotation;
import org.jboss.tools.common.util.EclipseJavaUtil;
@@ -35,7 +35,7 @@
annotationTypeName = EclipseJavaUtil.resolveType(declaringType, name);
type = EclipseJavaUtil.findType(annotation.getJavaProject(), annotationTypeName);
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
}
@@ -58,7 +58,7 @@
return range.getLength();
}
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
return 0;
}
@@ -70,7 +70,7 @@
return range.getOffset();
}
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
return 0;
}
@@ -94,7 +94,7 @@
try {
return annotation.getMemberValuePairs();
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
return new IMemberValuePair[0];
}
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java (working copy)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java (working copy)
@@ -21,7 +21,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
import org.jboss.tools.common.util.EclipseJavaUtil;
public class ParametedTypeFactory {
@@ -48,7 +48,7 @@
try {
r = type.getNameRange();
} catch (CoreException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
if(r != null) {
parametedType = new TypeDeclaration(parametedType, type.getResource(), r.getOffset(), r.getLength());
@@ -61,7 +61,7 @@
try {
ps = type.getTypeParameterSignatures();
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
if(ps != null && ps.length > 0) {
for (int i = 0; i < ps.length; i++) {
@@ -69,7 +69,7 @@
ParametedType p = getParametedTypeForParameter(type, ps[i], null);
if(p != null) parametedType.addParameter(p);
} catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
}
}
@@ -137,7 +137,7 @@
ParametedType st = getParametedTypeForParameter(context, ps[i], result);
if(st != null) {
if(st.getSignature().indexOf(Signature.C_COLON) >= 0) {
- CommonPlugin.getDefault().logWarning("Wrong signature=" + st.getSignature());
+ CommonCorePlugin.getDefault().logWarning("Wrong signature=" + st.getSignature());
}
return st;
}
@@ -163,7 +163,7 @@
try {
paramSignatures = Signature.getTypeArguments(typeSignature);
} catch (IllegalArgumentException e) {
- CommonPlugin.getDefault().logError(e);
+ CommonCorePlugin.getDefault().logError(e);
}
if(paramSignatures != null) for (String paramSignature: paramSignatures) {
ParametedType param = getParametedType(context, basetype, paramSignature);
Index: plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java
===================================================================
--- plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java (revision 0)
+++ plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java (working copy)
@@ -0,0 +1,117 @@
+package org.jboss.tools.common.core;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.log.BasePlugin;
+import org.jboss.tools.common.log.IPluginLog;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+public class CommonCorePlugin extends BasePlugin {
+ public static final String PLUGIN_ID = "org.jboss.tools.common"; //$NON-NLS-1$
+ protected static CommonCorePlugin instance;
+ private static String environment;
+
+ public CommonCorePlugin() {
+ super();
+ instance = this;
+ }
+
+ public static CommonCorePlugin getInstance() {
+ return instance;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+ /**
+ * Gets message from plugin.properties
+ * @param key
+ * @return
+ */
+ public static String getMessage(String key) {
+ return Platform.getResourceString(instance.getBundle(), key);
+ }
+
+ /**
+ * @return Studio environment.
+ */
+ public static String getEnvironment() {
+ if(environment == null) {
+ String osName = System.getProperty("os.name"); //$NON-NLS-1$
+ String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
+ String studioName = "unknown"; //$NON-NLS-1$
+ String studioVersion = "unknown"; //$NON-NLS-1$
+ String eclipseVersion = "unknown"; //$NON-NLS-1$
+ String eclipseBuildId = "unknown"; //$NON-NLS-1$
+
+ Bundle studio = Platform.getBundle("org.jboss.tools.common"); //$NON-NLS-1$
+ if(studio!=null) {
+ Dictionary studioDic = studio.getHeaders();
+ studioName = (String)studioDic.get("Bundle-Name"); //$NON-NLS-1$
+ studioVersion = (String)studioDic.get("Bundle-Version"); //$NON-NLS-1$
+ }
+
+ Bundle eclipse = Platform.getBundle("org.eclipse.platform"); //$NON-NLS-1$
+ if(eclipse!=null) {
+ Dictionary eclipseDic = eclipse.getHeaders();
+ eclipseVersion = (String)eclipseDic.get("Bundle-Version"); //$NON-NLS-1$
+ FileInputStream fis = null;
+ try {
+ String path = FileLocator.resolve(eclipse.getEntry("/")).getPath(); //$NON-NLS-1$
+ if(path!=null) {
+ File aboutMappings = new File(path, "about.mappings"); //$NON-NLS-1$
+ if(aboutMappings.exists()) {
+ Properties properties = new Properties();
+ fis = new FileInputStream(aboutMappings);
+ properties.load(fis);
+ String buildId = properties.getProperty("0"); //$NON-NLS-1$
+ if(buildId!=null && buildId.length()>0) {
+ eclipseBuildId = buildId;
+ }
+ }
+ }
+ } catch (IOException e) {
+ getPluginLog().logError("Error in getting environment info: " + e.getMessage()); //$NON-NLS-1$
+ } finally {
+ if(fis!=null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ StringBuffer result = new StringBuffer(studioName).append(" ").append(studioVersion). //$NON-NLS-1$
+ append(", Eclipse ").append(eclipseVersion).append(" "). //$NON-NLS-1$ //$NON-NLS-2$
+ append(eclipseBuildId).append(", Java ").append(javaVersion). //$NON-NLS-1$
+ append(", ").append(osName); //$NON-NLS-1$
+ environment = result.toString();
+ }
+ return environment;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static CommonCorePlugin getDefault() {
+ return instance;
+ }
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+
+}
Index: plugins/org.jboss.tools.common.core/plugin.properties
===================================================================
--- plugins/org.jboss.tools.common.core/plugin.properties (revision 0)
+++ plugins/org.jboss.tools.common.core/plugin.properties (working copy)
@@ -0,0 +1,7 @@
+providerName=JBoss by Red Hat
+
+reportParameterName=reportDescription
+reportingUrl=http://box.exadel.com/goto/bugreport.jsp
+reportingJobName=Bug reporting
+errorReportingMessage=Can't submit report
+Bundle-Name.0 = JBoss Tools Common Core
Index: plugins/org.jboss.tools.common.core/build.properties
===================================================================
--- plugins/org.jboss.tools.common.core/build.properties (revision 0)
+++ plugins/org.jboss.tools.common.core/build.properties (working copy)
@@ -0,0 +1,7 @@
+source.. = src
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ plugin.properties,\
+ about.html
+source.. = src
Index: plugins/org.jboss.tools.common.core/pom.xml
===================================================================
--- plugins/org.jboss.tools.common.core/pom.xml (revision 0)
+++ plugins/org.jboss.tools.common.core/pom.xml (working copy)
@@ -0,0 +1,13 @@
+
+
+ 4.0.0
+
+ org.jboss.tools.common
+ plugins
+ 3.4.0-SNAPSHOT
+
+ org.jboss.tools.common.plugins
+ org.jboss.tools.common.core
+
+ eclipse-plugin
+
Property changes on: plugins/org.jboss.tools.common.core/pom.xml
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: plugins/org.jboss.tools.common.core/plugin.xml
===================================================================
--- plugins/org.jboss.tools.common.core/plugin.xml (revision 0)
+++ plugins/org.jboss.tools.common.core/plugin.xml (working copy)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Property changes on: plugins/org.jboss.tools.common.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: plugins/org.jboss.tools.common.core/.classpath
===================================================================
--- plugins/org.jboss.tools.common.core/.classpath (revision 0)
+++ plugins/org.jboss.tools.common.core/.classpath (working copy)
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
Property changes on: plugins/org.jboss.tools.common.core/.classpath
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF
===================================================================
--- plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF (revision 0)
+++ plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF (working copy)
@@ -0,0 +1,43 @@
+Manifest-Version: 1.0
+Bundle-Name: %Bundle-Name.0
+Bundle-ClassPath: .
+Bundle-Activator: org.jboss.tools.common.core.CommonCorePlugin
+Bundle-Vendor: %providerName
+Bundle-SymbolicName: org.jboss.tools.common.core;singleton:=true
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.common.core,
+ org.jboss.tools.common.databinding,
+ org.jboss.tools.common.java,
+ org.jboss.tools.common.java.impl,
+ org.jboss.tools.common.jobs,
+ org.jboss.tools.common.log,
+ org.jboss.tools.common.preferences,
+ org.jboss.tools.common.reporting,
+ org.jboss.tools.common.text,
+ org.jboss.tools.common.util,
+ org.jboss.tools.common.web,
+ org.jboss.tools.common.xml,
+ org.jboss.tools.common.zip
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.wst.xml.core;bundle-version="1.1.600";visibility:=reexport,
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
+ org.eclipse.jem.util;bundle-version="2.1.2",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.eclipse.jface;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.wst.common.uriresolver;bundle-version="1.1.401";visibility:=reexport,
+ org.eclipse.core.net;bundle-version="1.2.100",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
+ org.apache.commons.httpclient;bundle-version="3.1.0",
+ org.eclipse.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
+ org.eclipse.jdt.core.manipulation;bundle-version="1.5.0",
+ org.eclipse.core.filebuffers;bundle-version="3.5.200"
+Bundle-Version: 3.4.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-ManifestVersion: 2
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6