SPARK-1791: Maven (#305)

* SPARK-1791: Re-organize into a Maven structure.

This commit re-organizes the Spark code base into a Apache Maven-compatible struture.

The project in this commit can be used to create a working Spark instance, by executing:

    mvn clean package

An assembly (tied to the package phase) is used to generate a distributable directory.

The includes EJ-Technologies install4j configuration file has been adjusted to reflect the changes, and can be used to generate most types of distributables. This requires the non-free install4j application to be installed at the host that executes the build.

The build currently misses all 'external' plugins. Work remains to be done to move that into a Maven structure. A future improvement to this structure could include splitting off the assembly part from the core module, into a dedicated module, that allows for easy inclusiong of plugin-module artifacts.

* SPARK-1791: Replace JTattoo source with Maven artifact.

The JTattoo theme can be retrieved as a Maven artifact. No need to include the original source code in Spark.

* SPARK-1791: Moved Roar plugin into Maven structure

This commit reorganizes the bulk of the code for the Roar plugin into a Maven structure. It is not a functional Maven module yet though.

* SPARK-1791: Introduce parent project.

This commit adds a parent project, that wraps the pre-existing 'core' module. It is expected that other modules (for example, plugins) are added to this parent project later.

* SPARK-1791: Remove Ant from Travis config.

The Travis Continuous Integration platform should no longer try to execute the Apache Ant script, that has now been replaced by the pom.xml files from Maven.

* SPARK-1791: Distributales should include plugins.

The earlier structure generated the Spark distributables from the 'core' module. This module did not contain optional features (notably: plugins). This in turn made it impossible to include those optional features in the distributables.

To work around this problem, the distributables are now created in a dedicated module (aptly named 'distribution'). This module defines dependencies and assembly references to other modules of which artifacts need to be included in the distributables.

As a proof-of-concept, the 'roar' plugin was re-instated.

* SPARK-1791: Removing Roar plugin Ant buildscript.

* SPARK-1791: Replaced lobobrowser with JxBrowser (eval)

The project for the embedded browser that we used, lobobrowser, is defunct. Maven artifacts are not to be found.

A possible replacement is JxBrowser (by TeamDev). This software is proprietary, but they do offer free licenses to open source software.

In order to evaluate wether we'd like to apply for one, this commit replaces lobobrowser with JxBrowser. An evaluation license is included, but will no longer be valid in 30 days from now.

* SPARK-1791: Moving Fastpath plugin from Ant to Maven.

* SPARK-1791: Moving Battleships plugin from Ant to Maven.

Note that the code does not compile properly (SPARK-1818). I have disabled the Maven module (and sent Wolf an email).

* SPARK-1791: Moving Growl plugin from Ant to Maven

This plugin probably won't work properly, as it depends on a native library. We would better use one of the Java implementations for the GNTP protocol instead (SPARK-1880), which should improve portability.

* SPARK-1880: Growl plugin should use java binding.

Instead of the old native library that was used, the plugin now makes use of a Java-based API.

* SPARK-1791: Moving Apple plugin from Ant to Maven.

* SPARK-1791: Moving Reversi plugin from Ant to Maven.

* SPARK-1791: Moving TicTacToe plugin from Ant to Maven.

* SPARK-1791: Moving Flashing plugin from Ant to Maven.

* SPARK-1791: Moving Google plugin from Ant to Maven.

* SPARK-1791: Restoring the internal 'idle' plugin.

The 'idle' plugin was an internal (in core) that was initially not migrated from Ant to Maven. It depended on both an unknown libary, as well as the 'phone' internal plugin, which had issues of its own.

This commit restores the 'idle' plugin, by providing a reference to the previously unknown library (JNA), and removing the dependency to the 'phone' internal plugin.

* SPARK-1791: Moving Jingle plugin from Ant to Maven.

As this plugin depends on the internal 'phone' plugin, which has issues, I've left the module out of the Maven parent pom.

* SPARK-1791: Moving TransferGuard plugin from Ant to Maven.

* SPARK-1791: Moving Translator plugin from Ant to Maven.

* SPARK-1791: Moving OTR plugin from Ant to Maven.

There's a compatibility issue with the third party otr library that is being used (Maven has a different version than the one that shipped with Spark). I've not included this plugin as a Maven module to prevent build failures.

* SPARK-1791: Moving Spelling plugin from Ant to Maven.

I'm unable to find the correct maven artifact for the jmyspell dependency. As a result, the Maven module for this plugin is commented in the parent pom.

* SPARK-1791: Moving SIP plugin from Ant to Maven.

This plugin does not compile properly, with the existing dependencies (and/or missing 'phone' internal plugin). It's maven module has not been added to the parent pom.

* SPARK-1791: Moving SystemTray plugin from Ant to Maven.

The directory in which this plugin lived was named 'linux'. This has been renamed to match the plugin name: 'systemtray'.

* SPARK-1791: Moving plugin Meet from Ant to Maven.

There's a compilation problem, for which the plugin has not been added to the parent pom.

* SPARK-1791: Removing directory that held binary builds for previously commercial plugins.

* SPARK-1791: Removing old build scripts.

* SPARK-1791: Removed all third party libraries.

These are now managed by Maven.

* SPARK-1791: Removing IDE project files.

* SPARK-1791: Removing the old Spark plugin template.

* SPARK-1791: Removing deb and rpm buildfiles (we now use install4j for this).

* SPARK-1791: Removing installer-files (we now use install4j for this).

* SPARK-1791: Moved docbook content to core module.

* SPARK-1791: Add distributables that embed JRE.

Some people prefer to have a JRE embedded in the download, which makes the installer pretty much self-containing.

* SPARK-1791: Restore Mac Notification Center of Roar plugin.

* SPARK-1791: Delete the Google plugin.

The Google plugin provides integration with Google Desktop. This application was discontinued in 2011. There's no longer a need for this plugin.

* SPARK-1791: Upgrade JTattoo look-and-feel from 1.6.7 to 1.6.11.

* SPARK-1881: Upgrade Smack from 4.1.7 to 4.1.9.

* SPARK-1791: Replace duplicate assembly descriptors.

* SPARK-1791: Move plugin pom.xml boilerplate into one parent module.

The first draft of the Maven structure for Spark introduced a lot of boilerplate pom.xml content. In this commit, a new module is introduced that, when used as a parent module for a plugin, removes most of the duplication.

The parent provides:
- A dependency on Spark core
- The assembly-plugin, configured to transform a module (that has the correct sturcture) into a workable plugin jar.

* SPARK-1791 / SPARK-1688: Restoring and updating Look and Feels.

* SPARK-1791: Adding metadata from plugin.xml into pom.xml

The project data from the plugin.xml is used to populate the related fields in the Maven pom.xml.

Also, all plugin version numbers were increased. Although the Mavenization of Spark should not have introduced changes, it can't be ruled out.

* SPARK-1791: Populate plugin.xml from pom.xml

Both the pom.xml file and the plugin.xml file define the plugin name, version and description. It is error prone to keep both files in sync. Instead, the plugin.xml file should be popluated from the data that is in the pom.xml file.

Maven resource filtering is employed for this purpose. The drawback of this approach is that the plugin.xml file needs to be a Maven resource, which makes it part of the jar file. This means that this file is included twice in each plugin: once in the 'outer' plugin jar file, and once in the jar file that contains the plugin's compiled sources.

* SPARK-1791: Define version number.

When building, Maven will add the project name and version in the manifest of the jar. This manifest is now used when displaying the version number of Spark.

Unlike Subversion, Git does not have consecutive build numbers. I've removed that identifier from the Spark source.

* SPARK-1791 / /SPARK-1883: When installing, uninstall previous version.

By uninstalling the previous version, old libraries will be removed.
This commit is contained in:
Guus der Kinderen
2017-02-22 19:22:44 +01:00
committed by wroot
parent 6c1129b56b
commit 6c64f5cba4
2619 changed files with 3435 additions and 61010 deletions

27
plugins/flashing/pom.xml Normal file
View File

@ -0,0 +1,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.igniterealtime.spark.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../plugin/pom.xml</relativePath>
</parent>
<artifactId>flashing</artifactId>
<version>1.2</version>
<name>Spark Flashing Plugin</name>
<description>Flashes window on new messages (Microsoft Windows only).</description>
<contributors>
<contributor>
<name>Michael Will</name>
<email>michael-will@gmx.net</email>
<roles>
<role>Author</role>
</roles>
</contributor>
</contributors>
</project>

View File

@ -0,0 +1,10 @@
set JDK=C:\Programme\Java\jdk1.6.0_12
set MSDK=C:\Programme\Microsoft SDKs\Windows\v6.0A\
set WORKDIR=C:\Dokumente und Einstellungen\Michael\workspace\Spark\src\plugins\flashing\src\c
rem Compile
set PATH=%PATH%;%MVS%\VC\bin\
set PATH=%PATH%;%MVS%\Common7\IDE\
cd C:\cygwin\bin\
g++ -LD -mno-cygwin -I"%JDK%\include" -I"%JDK%\include\win32" -L"%JDK%\lib" -shared -Wl,--add-stdcall-alias -o "%WORKDIR%\FlashWindow.dll" "%WORKDIR%\org_jivesoftware_spark_plugin_flashing_FlashWindow.c" -L"%JDK%\jre\bin" -ljawt
pause

View File

@ -0,0 +1,10 @@
#include "org_jivesoftware_spark_plugin_flashing_FlashWindow.h"
#include <Windows.h>
JNIEXPORT void JNICALL Java_org_jivesoftware_spark_plugin_flashing_FlashWindow_flash(JNIEnv * env, jobject obj, jstring windowTitle, jboolean flash)
{
const wchar_t * utf16 = (wchar_t *)env->GetStringChars(windowTitle, NULL);
HWND hwnd = FindWindowW(NULL, utf16);
env->ReleaseStringChars(windowTitle, (jchar*)utf16);
FlashWindow(hwnd, flash);
}

View File

@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_jivesoftware_spark_plugin_flashing_FlashWindow */
#ifndef _Included_org_jivesoftware_spark_plugin_flashing_FlashWindow
#define _Included_org_jivesoftware_spark_plugin_flashing_FlashWindow
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_jivesoftware_spark_plugin_flashing_FlashWindow
* Method: flash
* Signature: (Ljava/lang/String;Z)V
*/
JNIEXPORT void JNICALL Java_org_jivesoftware_spark_plugin_flashing_FlashWindow_flash
(JNIEnv *, jobject, jstring, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,137 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.awt.FlowLayout;
import java.awt.Window;
import java.io.File;
import java.util.HashMap;
import javax.swing.JButton;
import javax.swing.JFrame;
import org.jivesoftware.spark.PluginManager;
public class FlashWindow {
private HashMap<Window, Thread> flashings = new HashMap<>();
static {
boolean is64bit = System.getProperty("sun.arch.data.model").equals("64");
String arch = "";
if (is64bit) {
arch = "64";
}
try {
System.load(PluginManager.PLUGINS_DIRECTORY + File.separator + "flashing" + File.separator + "native"
+ File.separator + "FlashWindow" + arch + ".dll");
} catch (UnsatisfiedLinkError e) {
// So, we are on 64bit using 64bit java and you rather wand a 32bit.dll ?? suuuureeee....
if (e.getMessage().contains("Can't load AMD 64-bit .dll on a IA 32-bit platform")) {
System.load(PluginManager.PLUGINS_DIRECTORY + File.separator + "flashing" + File.separator + "native"
+ File.separator + "FlashWindow.dll" );
} else {
e.printStackTrace();
}
}
// System.load("C:\\PATH\FlashWindow"+s+".dll");
}
public native void flash(String name, boolean bool);
/*
* @param frame The JFrame to be flashed
* @param intratime The amount of time between the on and off states of a
* single flash
* @param intertime The amount of time between different flashes
* @param count The number of times to flash the window
*/
public void flash(final Window window, final int intratime,
final int count) {
new Thread( () -> {
try {
if (window instanceof JFrame)
{
// flash on and off each time
for (int i = 0; i < count; i++) {
flash(((JFrame) window).getTitle(), true);
Thread.sleep(intratime);
}
// turn the flash off
flash(((JFrame) window).getTitle(), false);
}
} catch (Exception ex) {
// System.out.println(ex.getMessage());
}
} ).start();
}
public void startFlashing(final Window window) {
if (flashings.get(window) == null) {
Thread t = new Thread() {
public void run() {
try {
while (true) {
Thread.sleep(1500);
// System.out.println("Flash Window");
if (window instanceof JFrame)
flash(((JFrame) window).getTitle(), true);
}
} catch (Exception ex) {
flash(((JFrame) window).getTitle(), false);
// System.out.println(ex.getMessage());
}
}
};
t.start();
flashings.put(window, t);
}
}
public void stopFlashing(final Window window) {
if (flashings.get(window) != null) {
flashings.get(window).interrupt();
flashings.remove(window);
}
}
public static void main(String[] args) throws Exception {
final JFrame frame = new JFrame();
frame.setTitle("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new FlowLayout());
JButton button = new JButton("Temp Flashing");
frame.getContentPane().add(button);
final FlashWindow winutil = new FlashWindow();
button.addActionListener( evt -> winutil.flash(frame, 750, 5) );
JButton startButton = new JButton("Start Flashing");
frame.getContentPane().add(startButton);
startButton.addActionListener( evt -> winutil.startFlashing(frame) );
JButton stopButton = new JButton("Stop Flashing");
frame.getContentPane().add(stopButton);
stopButton.addActionListener( evt -> {
// winutil.flash(frame,750,1500,5);
winutil.stopFlashing(frame);
} );
frame.pack();
frame.setVisible(true);
}
}

View File

@ -0,0 +1,58 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.awt.Window;
import org.jivesoftware.spark.NativeHandler;
import org.jivesoftware.spark.SparkManager;
public class FlashingHandler implements NativeHandler {
private FlashWindow flasher;
public FlashingHandler() {
flasher = new FlashWindow();
}
@Override
public void flashWindow(Window window) {
FlashingPreference preference = (FlashingPreference) SparkManager.getPreferenceManager().getPreference(FlashingPreference.NAMESPACE);
if (preference.getPreferences().isFlashingEnabled()) {
if (preference.getPreferences().getFlashingType().equals(FlashingPreferences.TYPE_CONTINOUS)) {
flasher.startFlashing(window);
}
else if (preference.getPreferences().getFlashingType().equals(FlashingPreferences.TYPE_TEMPORARY)) {
flasher.flash(window, 1500, 5);
}
}
}
@Override
public void flashWindowStopWhenFocused(Window window) {
flasher.stopFlashing(window);
}
@Override
public boolean handleNotification() {
return true;
}
@Override
public void stopFlashing(Window window) {
flasher.stopFlashing( window );
}
}

View File

@ -0,0 +1,43 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.plugin.Plugin;
public class FlashingPlugin implements Plugin {
@Override
public boolean canShutDown() {
return true;
}
@Override
public void initialize() {
FlashingPreference preference = new FlashingPreference();
SparkManager.getPreferenceManager().addPreference(preference);
SparkManager.getNativeManager().addNativeHandler(new FlashingHandler());
}
@Override
public void shutdown() {
}
@Override
public void uninstall() {
}
}

View File

@ -0,0 +1,113 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.awt.EventQueue;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import org.jivesoftware.spark.preference.Preference;
import org.jivesoftware.spark.util.log.Log;
public class FlashingPreference implements Preference {
public static String NAMESPACE = "flashing";
private FlashingPreferenceDialog dialog;
private FlashingPreferences preferences;
public FlashingPreference() {
preferences = new FlashingPreferences();
try {
if (EventQueue.isDispatchThread()) {
dialog = new FlashingPreferenceDialog();
} else {
EventQueue.invokeAndWait( () -> dialog = new FlashingPreferenceDialog() );
}
} catch (Exception e) {
Log.error(e);
}
}
public FlashingPreferences getPreferences() {
return preferences;
}
@Override
public void commit() {
preferences.setFlashingEnabled(dialog.getFlashing());
preferences.setFlashingType(dialog.getFlashingType());
preferences.save();
}
@Override
public Object getData() {
return preferences;
}
@Override
public String getErrorMessage() {
return null;
}
@Override
public JComponent getGUI() {
return dialog;
}
@Override
public Icon getIcon() {
ClassLoader cl = getClass().getClassLoader();
return new ImageIcon(cl.getResource("lightning16.png"));
}
@Override
public String getListName() {
return FlashingResources.getString("title.flashing");
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
public String getTitle() {
return FlashingResources.getString("title.flashing");
}
@Override
public String getTooltip() {
return FlashingResources.getString("title.flashing");
}
@Override
public boolean isDataValid() {
return true;
}
@Override
public void load() {
dialog.setFlashing(preferences.isFlashingEnabled());
dialog.setFlashingType(preferences.getFlashingType());
}
@Override
public void shutdown() {
}
}

View File

@ -0,0 +1,100 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.jivesoftware.spark.component.VerticalFlowLayout;
import org.jivesoftware.spark.util.ResourceUtils;
public class FlashingPreferenceDialog extends JPanel {
private static final long serialVersionUID = -5274539572483246530L;
private JCheckBox flashingEnabled;
private JComboBox flashingType;
public FlashingPreferenceDialog() {
JPanel flashingPanel = new JPanel();
flashingEnabled = new JCheckBox();
flashingType = new JComboBox();
JLabel lTyps = new JLabel();
flashingPanel.setLayout(new GridBagLayout());
flashingEnabled.addActionListener( e -> updateUI(flashingEnabled.isSelected()) );
flashingType.addItem(FlashingResources.getString("flashing.type.continuous"));
flashingType.addItem(FlashingResources.getString("flashing.type.temporary"));
flashingPanel.add(flashingEnabled, new GridBagConstraints(0, 0, 3, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
flashingPanel.add(lTyps, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
flashingPanel.add(flashingType, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
flashingPanel.setBorder(BorderFactory.createTitledBorder(FlashingResources.getString("title.flashing")));
// Setup MNEMORICS
ResourceUtils.resButton(flashingEnabled, FlashingResources.getString("flashing.enable"));
ResourceUtils.resLabel(lTyps, flashingType, FlashingResources.getString("flashing.type"));
setLayout(new VerticalFlowLayout());
add( flashingPanel );
}
public void updateUI(boolean enabled) {
flashingType.setEnabled(enabled);
}
public void setFlashing(boolean enabled) {
flashingEnabled.setSelected(enabled);
updateUI(enabled);
}
public boolean getFlashing() {
return flashingEnabled.isSelected();
}
public void setFlashingType(String type) {
if (FlashingPreferences.TYPE_CONTINOUS.equals(type)) {
flashingType.setSelectedIndex(0);
}
else if (FlashingPreferences.TYPE_TEMPORARY.equals(type)) {
flashingType.setSelectedIndex(1);
}
else {
flashingType.setSelectedIndex(0);
}
}
public String getFlashingType() {
if (flashingType.getSelectedIndex() == 0) {
return FlashingPreferences.TYPE_CONTINOUS;
}
else if (flashingType.getSelectedIndex() == 1) {
return FlashingPreferences.TYPE_TEMPORARY;
}
return "continuous";
}
}

View File

@ -0,0 +1,84 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
import org.jivesoftware.Spark;
public class FlashingPreferences {
public static final String TYPE_CONTINOUS = "continuous";
public static final String TYPE_TEMPORARY = "temporary";
private Properties props;
private File configFile;
public FlashingPreferences() {
this.props = new Properties();
try {
props.load(new FileInputStream(getConfigFile()));
} catch (IOException e) {
// Can't load ConfigFile
}
}
public File getConfigFile() {
if (configFile == null)
configFile = new File(Spark.getSparkUserHome(),
"flashing.properties");
return configFile;
}
public void save() {
try {
props.store(new FileOutputStream(getConfigFile()), "");
} catch (Exception e) {
e.printStackTrace();
}
}
public boolean isFlashingEnabled() {
return getBoolean("flashingEnabled", true);
}
public void setFlashingEnabled(boolean enabled) {
setBoolean("flashingEnabled", enabled);
}
public String getFlashingType() {
return props.getProperty("flashingType", TYPE_CONTINOUS);
}
public void setFlashingType(String type) {
props.setProperty("flashingType", type);
}
private boolean getBoolean(String property, boolean defaultValue) {
return Boolean.parseBoolean(props.getProperty(property, Boolean
.toString(defaultValue)));
}
private void setBoolean(String property, boolean value) {
props.setProperty(property, Boolean.toString(value));
}
}

View File

@ -0,0 +1,42 @@
/**
* Copyright (C) 2004-2011 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.spark.plugin.flashing;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import org.jivesoftware.spark.util.log.Log;
public class FlashingResources {
private static PropertyResourceBundle prb;
static ClassLoader cl = FlashingResources.class.getClassLoader();
static {
prb = (PropertyResourceBundle)ResourceBundle.getBundle("i18n/flashing_i18n");
}
public static final String getString(String propertyName) {
try {
return prb.getString(propertyName);
}
catch (Exception e) {
Log.error(e);
return propertyName;
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,13 @@
<!-- Define your plugins -->
<plugin>
<name>${project.name}</name>
<version>${project.version}</version>
<description>${project.description}</description>
<author>Michael Will</author>
<homePage>http://www.igniterealtime.org</homePage>
<email>michael-will@gmx.net</email>
<class>org.jivesoftware.spark.plugin.flashing.FlashingPlugin</class>
<minSparkVersion>2.7.0</minSparkVersion>
<os>Windows</os>
<java>1.7.0</java>
</plugin>

View File

@ -0,0 +1,6 @@
title.flashing = Taskbar Flashing
flashing.enable = &Enable Taskbar flashing
flashing.type = &Type
flashing.type.continuous = Continuous
flashing.type.temporary = Temporary

View File

@ -0,0 +1,6 @@
title.flashing = Blinkende Taskleiste
flashing.enable = &Blinken in der Taskleiste aktivieren
flashing.type = &Art
flashing.type.continuous = Durchgehend
flashing.type.temporary = Tempor<EFBFBD>r

View File

@ -0,0 +1,6 @@
title.flashing = Clignotement de la barre des t\u00E2ches
flashing.enable = &Activer le clignotement
flashing.type = &Taper
flashing.type.continuous = Continue
flashing.type.temporary = Temporaire

View File

@ -0,0 +1,6 @@
title.flashing = Mirg\u0117jimas
flashing.enable = \u012ejungti informacin\u012f mirg\u0117jim\u0105 u\u017eduo\u010di\u0173 juostoje
flashing.type = B\u016bdas
flashing.type.continuous = Mirg\u0117ti be galo
flashing.type.temporary = Pamirg\u0117jus nustoti

View File

@ -0,0 +1,6 @@
title.flashing = Migotanie paska zada\u0144
flashing.enable = W\u0142\u0105cz migotanie paska zada\u0144
flashing.type = Rodzaj migotania
flashing.type.continuous = Ci\u0105g\u0142y
flashing.type.temporary = Tymczasowy

View File

@ -0,0 +1,6 @@
title.flashing = \u041c\u0438\u0433\u0430\u043d\u0438\u0435 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0437\u0430\u0434\u0430\u0447
flashing.enable = &\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0437\u0430\u0434\u0430\u0447
flashing.type = &\u0422\u0438\u043f
flashing.type.continuous = \u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e
flashing.type.temporary = \u0412\u0440\u0435\u043c\u0435\u043d\u043d\u043e

View File

@ -0,0 +1,8 @@
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
flashing.enable = \u5141\u8BB8\u4EFB\u52A1\u680F\u95EA\u52A8
flashing.type = \u7C7B\u578B
flashing.type.continuous = \u6301\u7EED
flashing.type.temporary = \u4E34\u65F6
title.flashing = \u4EFB\u52A1\u680F\u95EA\u52A8

View File

@ -0,0 +1,6 @@
title.flashing = \u5de5\u5177\u5217\u9583\u52d5
flashing.enable = \u555f\u52d5\u5de5\u5177\u5217\u9583\u52d5
flashing.type = \u9583\u52d5\u985e\u578b
flashing.type.continuous = \u6301\u7e8c\u9583\u52d5
flashing.type.temporary = \u81e8\u6642\u9583\u52d5

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B