Skip to content

Commit

Permalink
fixes for Eclipse 4.6 NEON
Browse files Browse the repository at this point in the history
 - Issue#29 EasyShell v1.4.2 cannot be installed in Eclipse
Neon(4.6.0M5)
    #29
  - removed dependency to removed org.eclipse.core.runtime.compatibility
  - added target defintions for 4.5 and 4.6
  - adapted Activator
  
Signed-off-by: Andre Bossert <anb0s@anbos.de>
  • Loading branch information
anb0s committed May 20, 2016
1 parent d533255 commit 3c83fc2
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 85 deletions.
8 changes: 4 additions & 4 deletions easyshell-feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES
Expand Down Expand Up @@ -793,7 +793,7 @@ of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
PARTIES
Expand Down Expand Up @@ -906,8 +906,8 @@ Public License instead of this License.
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.expressions"/>
<import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.swt"/>
<import plugin="org.eclipse.core.variables"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>

<plugin
Expand Down
11 changes: 5 additions & 6 deletions easyshell/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ Bundle-ManifestVersion: 2
Bundle-Name: Easy Shell Plugin
Bundle-SymbolicName: com.tetrade.eclipse.plugins.easyshell; singleton:=true
Bundle-Version: 1.5.0.qualifier
Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
Bundle-Vendor: Marcel Schoen, Andre Bossert
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.resources,
org.eclipse.ui,
org.eclipse.core.expressions,
org.eclipse.core.runtime.compatibility,
org.eclipse.core.variables
Plugin-Class: com.tetrade.eclipse.plugins.easyshell.EasyShellPlugin
org.eclipse.core.variables,
org.eclipse.core.runtime
Plugin-Class: com.tetrade.eclipse.plugins.easyshell.Activator
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: target/easyshell-lib.jar
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: target/easyshell-library.jar
Bundle-Activator: com.tetrade.eclipse.plugins.easyshell.Activator
6 changes: 2 additions & 4 deletions easyshell/build.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
output.. = target/
bin.includes = icon/,\
plugin.xml,\
releases/README.TXT,\
releases/CHANGES.TXT,\
META-INF/,\
target/easyshell-lib.jar
target/easyshell-library.jar
src.includes = icon/,\
manpages/,\
patches/,\
releases/CHANGES.TXT,\
releases/README.TXT,\
pom.xml,\
readme.txt
jars.compile.order = .
source.target/easyshell-lib.jar = src/
source.target/easyshell-library.jar = src/
134 changes: 64 additions & 70 deletions easyshell/src/com/tetrade/eclipse/plugins/easyshell/Activator.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2004 - 2015 by Marcel Schoen and Andre Bossert
* Copyright (C) 2004 - 2008 by Marcel Schoen
* Copyright (C) 2009 - 2016 by Andre Bossert
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -21,35 +22,32 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

import com.tetrade.eclipse.plugins.easyshell.preferences.EasyShellDebug;
import com.tetrade.eclipse.plugins.easyshell.preferences.EasyShellPreferencePage;
import com.tetrade.eclipse.plugins.easyshell.preferences.EasyShellPreferenceEntry;
import com.tetrade.eclipse.plugins.easyshell.preferences.EasyShellQuotes;
import com.tetrade.eclipse.plugins.easyshell.preferences.EasyShellTokenizer;
import com.tetrade.eclipse.plugins.easyshell.preferences.Debug;
import com.tetrade.eclipse.plugins.easyshell.preferences.PreferencePage;
import com.tetrade.eclipse.plugins.easyshell.preferences.PreferenceEntry;
import com.tetrade.eclipse.plugins.easyshell.preferences.Quotes;
import com.tetrade.eclipse.plugins.easyshell.preferences.Tokenizer;

/**
* The main plugin class to be used in the desktop.
*/
public class EasyShellPlugin extends AbstractUIPlugin {
public class Activator extends AbstractUIPlugin {

public static final String PLUGIN_ID = "com.tetrade.eclipse.plugins.easyshell";
public static final String IMAGE_PATH = "icon/";
Expand All @@ -59,30 +57,58 @@ public class EasyShellPlugin extends AbstractUIPlugin {
public static final String IMAGE_COPYPATH_ID = "copy_edit.gif";

//The shared instance.
private static EasyShellPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
private static Activator plugin;

/**
/*
* The constructor.
*/
public EasyShellPlugin(IPluginDescriptor descriptor) {
super(descriptor);
public Activator() {
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
getImageRegistry();
plugin = this;
try {
resourceBundle= ResourceBundle.getBundle("org.easyexplore.EasyExplorePluginResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}

/**
* Returns the shared instance.
* Returns the shared instance
*
* @return the shared instance
*/
public static EasyShellPlugin getDefault() {
public static Activator getDefault() {
return plugin;
}

/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
/*
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
*/
public static ImageDescriptor getImageDescriptor(String id) {
return getDefault().getImageRegistry().getDescriptor(id);
}

protected void initializeImageRegistry(ImageRegistry registry) {
Bundle bundle = Platform.getBundle(PLUGIN_ID);
addImageToRegistry(registry, bundle, IMAGE_PATH + IMAGE_OPEN_ID, IMAGE_OPEN_ID);
Expand All @@ -98,78 +124,46 @@ protected void addImageToRegistry(ImageRegistry registry, Bundle bundle, String
registry.put(image_id, desc);
}

public static ImageDescriptor getImageDescriptor(String id) {
return getDefault().getImageRegistry().getDescriptor(id);
}

/**
* Returns the workspace instance.
*/
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}

/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle= EasyShellPlugin.getDefault().getResourceBundle();
try {
return bundle.getString(key);
} catch (MissingResourceException e) {
return key;
}
}

/**
* Returns the plugin's resource bundle,
*/
public ResourceBundle getResourceBundle() {
return resourceBundle;
}

static public void log(Object msg) {
ILog log = EasyShellPlugin.getDefault().getLog();
Status status = new Status(IStatus.ERROR, EasyShellPlugin.getDefault().getDescriptor().getUniqueIdentifier(), IStatus.ERROR, msg + "\n", null);
ILog log = Activator.getDefault().getLog();
Status status = new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, msg + "\n", null);
log.log(status);
}

static public void log(Throwable ex) {
ILog log = EasyShellPlugin.getDefault().getLog();
ILog log = Activator.getDefault().getLog();
StringWriter stringWriter = new StringWriter();
ex.printStackTrace(new PrintWriter(stringWriter));
String msg = stringWriter.getBuffer().toString();
Status status = new Status(IStatus.ERROR, EasyShellPlugin.getDefault().getDescriptor().getUniqueIdentifier(), IStatus.ERROR, msg, null);
Status status = new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, msg, null);
log.log(status);
}
/**
* @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
*/
protected void initializeDefaultPreferences(IPreferenceStore store) {
EasyShellPreferencePage pref = new EasyShellPreferencePage(0);
store = pref.getPreferenceStore();
super.initializeDefaultPreferences(store);
}

/**
* Return the target program setted in EasyExplorePreferencePage.
* @return String
*/
public String getTarget(int commandId, int instId) {
return getPreferenceStore().getString(EasyShellPreferencePage.getPreferenceString(commandId, instId));
return getPreferenceStore().getString(PreferencePage.getPreferenceString(commandId, instId));
}

/**
* Return the quotes setted in EasyExplorePreferencePage.
* @return EasyShellQuotes
*/
public EasyShellQuotes getQuotes(int instId) {
String quotesStr = getPreferenceStore().getString(EasyShellPreferenceEntry.preferenceQuotes.getString(instId));
public Quotes getQuotes(int instId) {
String quotesStr = getPreferenceStore().getString(PreferenceEntry.preferenceQuotes.getString(instId));
if (quotesStr != null && quotesStr.length() != 0)
return EasyShellQuotes.valueOf(quotesStr);
return Quotes.valueOf(quotesStr);
else
return EasyShellQuotes.quotesNo;
return Quotes.quotesNo;
}

static public int getInstanceNumber() {
Expand All @@ -182,9 +176,9 @@ static public int getInstanceNumber() {
*/
public boolean isDebug() {
//return debug;
String dbgStr = getPreferenceStore().getString(EasyShellPreferenceEntry.preferenceDebug.getString());
String dbgStr = getPreferenceStore().getString(PreferenceEntry.preferenceDebug.getString());
if (dbgStr != null && dbgStr.length() != 0)
return EasyShellDebug.valueOf(dbgStr) == EasyShellDebug.debugYes;
return Debug.valueOf(dbgStr) == Debug.debugYes;
else
return false;
}
Expand All @@ -194,9 +188,9 @@ public boolean isDebug() {
* @return boolean
*/
public boolean isTokenizer(int instId) {
String tokenizerStr = getPreferenceStore().getString(EasyShellPreferenceEntry.preferenceTokenizer.getString(instId));
String tokenizerStr = getPreferenceStore().getString(PreferenceEntry.preferenceTokenizer.getString(instId));
if (tokenizerStr != null && tokenizerStr.length() != 0)
return EasyShellTokenizer.valueOf(tokenizerStr) == EasyShellTokenizer.EasyShellTokenizerYes;
return Tokenizer.valueOf(tokenizerStr) == Tokenizer.EasyShellTokenizerYes;
else
return false;
}
Expand Down
6 changes: 6 additions & 0 deletions eclipse4.5.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="eclipse4.5" sequenceNumber="0">
<locations>
<location path="${eclipse_home}" type="Profile"/>
</locations>
</target>
6 changes: 6 additions & 0 deletions eclipse4.6.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="eclipse4.6" sequenceNumber="2">
<locations>
<location path="C:\Progs\eclipse-cpp-neon-M7-win32-x86_64" type="Profile"/>
</locations>
</target>
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ http://codeandme.blogspot.co.at/2012/12/tycho-build-9-updating-version-numbers.h
https://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-plugin
https://eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/plugin-info.html

30.09.2015 anb0s
16.05.2016 anb0s

0 comments on commit 3c83fc2

Please sign in to comment.