Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/#80 #84

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eclipse-rbe-feature/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.settings/
4 changes: 2 additions & 2 deletions eclipse-rbe-feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.essiembre.eclipse.rbe"
label="ResourceBundle Editor"
version="1.0.6"
version="1.0.6.1"
provider-name="Pascal Essiembre"
plugin="com.essiembre.eclipse.rbe">

Expand Down Expand Up @@ -237,7 +237,7 @@
id="com.essiembre.eclipse.rbe"
download-size="0"
install-size="0"
version="1.0.6"
version="0.0.0"
unpack="false"/>

</feature>
2 changes: 1 addition & 1 deletion eclipse-rbe-plugin/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
4 changes: 2 additions & 2 deletions eclipse-rbe-plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: com.essiembre.eclipse.rbe;singleton:=true
Bundle-Version: 1.0.6
Bundle-Version: 1.0.6.1
Bundle-Activator: com.essiembre.eclipse.rbe.RBEPlugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %plugin.provider
Require-Bundle: org.eclipse.ui,
Expand Down
18 changes: 18 additions & 0 deletions eclipse-rbe-plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,23 @@
The font for the editors on the properties tab
</description>
</fontDefinition>
<colorDefinition
categoryId="com.essiembre.eclipse.rbe.ui.preferences.themeElementCategory"
defaultsTo="org.eclipse.ui.workbench.INFORMATION_FOREGROUND"
id="com.essiembre.eclipse.rbe.ui.preferences.textColorDefinition"
label="Properties editor text color">
<description>
The text color for the editors on the properties tab
</description>
</colorDefinition>
<colorDefinition
categoryId="com.essiembre.eclipse.rbe.ui.preferences.themeElementCategory"
defaultsTo="QUALIFIER_COLOR"
id="com.essiembre.eclipse.rbe.ui.preferences.textCommentedColorDefinition"
label="Properties editor text commented out color">
<description>
The text color for commented out texts in the editors on the properties tab
</description>
</colorDefinition>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Map;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
Expand All @@ -44,6 +45,7 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
Expand Down Expand Up @@ -549,10 +551,7 @@ private void createTextViewerRow() {
// for arabic and some other languages
textBox.setOrientation(getOrientation(locale));

FontRegistry fontRegistry = PlatformUI.getWorkbench().getThemeManager()
.getCurrentTheme().getFontRegistry();
Font font = fontRegistry.get(
"com.essiembre.eclipse.rbe.ui.preferences.fontDefinition");
Font font = getEditorTextFontFromRegistry();
if ( font != null ) {
textBox.setFont(font);
}
Expand Down Expand Up @@ -694,12 +693,13 @@ private Image loadCountryIcon(Locale countryLocale) {
if (commentedCheckbox.getSelection()) {
commentedCheckbox.setToolTipText(
RBEPlugin.getString("value.uncomment.tooltip"));
textBox.setForeground(
getDisplay().getSystemColor(SWT.COLOR_GRAY));
// GRO 30.09.2022
textBox.setForeground(getEditorTextColorCommentedFromRegistry());
} else {
commentedCheckbox.setToolTipText(
RBEPlugin.getString("value.comment.tooltip"));
textBox.setForeground(null);
// GRO 30.09.2022
textBox.setForeground(getEditorTextColorFromRegistry());
}
}

Expand Down Expand Up @@ -872,6 +872,29 @@ private static int getOrientation(Locale locale){
}
return SWT.LEFT_TO_RIGHT;
}

private Font getEditorTextFontFromRegistry() {
FontRegistry fontRegistry = PlatformUI.getWorkbench().getThemeManager()
.getCurrentTheme().getFontRegistry();
return fontRegistry.get("com.essiembre.eclipse.rbe.ui.preferences.fontDefinition");
}

// GRO 30.09.2022
// Default ID org.eclipse.ui.showkeys.foregroundColor
// https://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui/plugin.xml
private Color getEditorTextColorFromRegistry() {
ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager()
.getCurrentTheme().getColorRegistry();
return colorRegistry.get("com.essiembre.eclipse.rbe.ui.preferences.textColorDefinition");
}

// GRO 30.09.2022
// Default ID org.eclipse.jface.REVISION_NEWEST_COLOR
private Color getEditorTextColorCommentedFromRegistry() {
ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager()
.getCurrentTheme().getColorRegistry();
return colorRegistry.get("com.essiembre.eclipse.rbe.ui.preferences.textCommentedColorDefinition");
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class KeyTreeLabelProvider

// private Color colorInactive = UIUtils.getSystemColor(SWT.COLOR_GRAY);
private Color colorCommented = UIUtils.getSystemColor(SWT.COLOR_GRAY);
// GRO 30.09.2022 Default color not commented keys
private Color colorDefault = null;

/** Group font. */
private Font keyFont = UIUtils.createFont(SWT.NORMAL);
Expand Down Expand Up @@ -134,7 +136,7 @@ public Color getForeground(Object element) {
return colorCommented;
}

return null;
return colorDefault;
}

@Override
Expand Down