|
|
|
@ -24,6 +24,7 @@ import javax.swing.text.SimpleAttributeSet;
|
|
|
|
import javax.swing.text.StyleConstants;
|
|
|
|
import javax.swing.text.StyleConstants;
|
|
|
|
import org.openide.util.Exceptions;
|
|
|
|
import org.openide.util.Exceptions;
|
|
|
|
import org.openide.util.Lookup;
|
|
|
|
import org.openide.util.Lookup;
|
|
|
|
|
|
|
|
import org.openide.util.NbBundle;
|
|
|
|
import org.openide.util.NbPreferences;
|
|
|
|
import org.openide.util.NbPreferences;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -91,7 +92,7 @@ public class TitanEditor {
|
|
|
|
private static Object colorModel;
|
|
|
|
private static Object colorModel;
|
|
|
|
|
|
|
|
|
|
|
|
private static final String DEFAULT_THEME_NAME = "NetBeans"; //NOI18N
|
|
|
|
private static final String DEFAULT_THEME_NAME = "NetBeans"; //NOI18N
|
|
|
|
private static final String TITAN_THEME_NAME = "[idP!] Titan"; //NOI18N
|
|
|
|
private static final String TITAN_THEME_NAME = NbBundle.getMessage(TitanLookAndFeel.class, "LBL_TITAN");
|
|
|
|
|
|
|
|
|
|
|
|
private static Class provider_GIT = null;
|
|
|
|
private static Class provider_GIT = null;
|
|
|
|
private static Class provider_SVN = null;
|
|
|
|
private static Class provider_SVN = null;
|
|
|
|
@ -296,9 +297,7 @@ public class TitanEditor {
|
|
|
|
private static void setup_theme () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
|
|
|
private static void setup_theme () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String current_profile = (String) getCurrentProfile.invoke( colorModel, new Object[0] );
|
|
|
|
String current_profile = (String) getCurrentProfile.invoke( colorModel, new Object[0] );
|
|
|
|
// System.out.println("Current profile = " + current_profile);
|
|
|
|
|
|
|
|
// if (!current_profile.equals(TITAN_THEME_NAME))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
Set<String> profile_set = (Set<String>) getProfiles.invoke( colorModel, new Object[0] );
|
|
|
|
Set<String> profile_set = (Set<String>) getProfiles.invoke( colorModel, new Object[0] );
|
|
|
|
boolean contain_target_theme = false;
|
|
|
|
boolean contain_target_theme = false;
|
|
|
|
for (String str : profile_set)
|
|
|
|
for (String str : profile_set)
|
|
|
|
@ -317,6 +316,29 @@ public class TitanEditor {
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void remove_editor () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Set<String> profile_set = (Set<String>) getProfiles.invoke( colorModel, new Object[0] );
|
|
|
|
|
|
|
|
boolean contain_target_theme = false;
|
|
|
|
|
|
|
|
for (String str : profile_set)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (str.equals(TITAN_THEME_NAME)) contain_target_theme = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (contain_target_theme)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setCurrentProfile.invoke(colorModel, TITAN_THEME_NAME);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setCurrentProfile.invoke(colorModel, DEFAULT_THEME_NAME);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void extractColorsForModule (String name, Class provider) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
|
|
|
private static void extractColorsForModule (String name, Class provider) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|