Skip to content

Commit

Permalink
LibreOffice#393 issue: Update Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sourav492 committed Feb 19, 2023
1 parent 42bd0eb commit c0ebbde
Show file tree
Hide file tree
Showing 28 changed files with 530 additions and 550 deletions.
11 changes: 0 additions & 11 deletions core/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,5 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
12 changes: 6 additions & 6 deletions core/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.APILeak=warning
Expand Down Expand Up @@ -49,15 +49,15 @@ org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ public class GlobalFunctions
private static GlobalFunctions instance;

/**
* Enthält die im Funktionen-Abschnitt der wollmux,conf definierten Funktionen.
* Contains the functions defined in the functions section of wollmux.conf.
*/
private FunctionLibrary globalFunctions;
/**
* Enthält die im Dokumentaktionen der wollmux,conf definierten Funktionen.
* Contains the functions defined in the Wollmux.conf document actions.
*/
private FunctionLibrary documentActionFunctions;
/**
* Enthält die im Funktionsdialoge-Abschnitt der wollmux,conf definierten Dialoge.
* Contains the dialogs defined in the function dialogs section of wollmux,conf.
*/
private DialogLibrary funcDialogs;
/**
* Enthält die im Funktionen-Abschnitt der wollmux,conf definierten Funktionen.
* Contains the functions defined in the functions section of wollmux.conf.
*/
private PrintFunctionLibrary globalPrintFunctions;

Expand All @@ -65,64 +65,64 @@ public static GlobalFunctions getInstance()
private GlobalFunctions()
{
/*
* Globale Funktionsdialoge parsen. ACHTUNG! Muss vor parseGlobalFunctions() erfolgen. Als
* context wird null übergeben, weil globale Funktionen keinen Kontext haben.
* Parse global function dialogs. DANGER! Must be done before parseGlobalFunctions(). As
* context is passed null because global functions have no context.
*/
funcDialogs =
DialogFactory.parseFunctionDialogs(WollMuxFiles.getWollmuxConf(), null, null);

/*
* Globale Funktionen parsen. ACHTUNG! Verwendet die Funktionsdialoge. Diese
* müssen also vorher geparst sein. Als context wird null übergeben, weil globale
* Funktionen keinen Kontext haben.
* Parse global functions. DANGER! Uses the function dialogs. This
* must therefore be parsed beforehand. As context, null is passed because global
* Functions have no context.
*/
globalFunctions =
FunctionFactory.parseFunctions(WollMuxFiles.getWollmuxConf(),
getFunctionDialogs(), null, null);

/*
* Globale Druckfunktionen parsen.
* Parse global print functions.
*/
globalPrintFunctions =
PrintFunctionLibrary.parsePrintFunctions(WollMuxFiles.getWollmuxConf());
PrintFunction.addPrintFunctions(globalPrintFunctions);

/*
* Dokumentaktionen parsen. Diese haben weder Kontext noch Dialoge.
* Parse document actions. These have neither context nor dialogues.
*/
documentActionFunctions = new FunctionLibrary(null, true);
FunctionFactory.parseFunctions(documentActionFunctions,
WollMuxFiles.getWollmuxConf(), "Dokumentaktionen", null, null);
}

/**
* Liefert die Funktionsbibliothek, die die global definierten Funktionen enthält.
* Returns the function library containing the globally defined functions.
*/
public FunctionLibrary getGlobalFunctions()
{
return globalFunctions;
}

/**
* Liefert die Funktionsbibliothek, die die Dokumentaktionen enthält.
* Returns the function library containing the document actions.
*/
public FunctionLibrary getDocumentActionFunctions()
{
return documentActionFunctions;
}

/**
* Liefert die Funktionsbibliothek, die die global definierten Druckfunktionen
* enthält.
* Returns the function library containing the globally defined print functions
* contains.
*/
public PrintFunctionLibrary getGlobalPrintFunctions()
{
return globalPrintFunctions;
}

/**
* Liefert die Dialogbibliothek, die die Dialoge enthält, die in Funktionen
* (Grundfunktion "DIALOG") verwendung finden.
* Returns the dialog library containing the dialogs contained in functions
* (basic function "DIALOG") can be used.
*/
public DialogLibrary getFunctionDialogs()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
import org.libreoffice.ext.unohelper.common.UNO;

/**
* Hilfsklasse, die es ermöglicht, UNO-Componenten in HashMaps abzulegen; der
* Vergleich zweier HashableComponents mit equals(...) verwendet dazu den sicheren
* UNO-Vergleich UnoRuntime.areSame(...). Die Methode hashCode verwendet die sichere
* Oid, die UnoRuntime.generateOid(...) liefert.
* Helper class that makes it possible to store UNO components in HashMaps; the
* Comparing two HashableComponents with equals(...) uses the safe one
* UNO comparison UnoRuntime.areSame(...). The hashCode method uses the safe one
* Oid that UnoRuntime.generateOid(...) returns.
*/
public class HashableComponent
{
private XInterface compo;

/*
* Anmerkung: Es mag ineffizient wirken, hier ein Object zu nehmen und immer in
* XInterface zu casten, aber wegen Bugs in OOo ist es die einzig sichere Methode,
* auch wenn man schon ein X... Objekt hat, das von XInterface abgeleitet ist.
* Note: It may seem inefficient to take an Object here and always in
* Cast XInterface, but because of bugs in OOo it's the only safe way
* even if you already have an X... object derived from XInterface.
*/
public HashableComponent(Object compo)
{
Expand All @@ -52,7 +52,7 @@ public HashableComponent(Object compo)
}

/**
* Liefert die Komponente, die durch diese {@link HashableComponent} gewrappt ist.
* Returns the component wrapped by this {@link HashableComponent}.
*/
public XInterface getComponent()
{
Expand Down
66 changes: 33 additions & 33 deletions core/src/main/java/de/muenchen/allg/itd51/wollmux/Shortcuts.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ private Shortcuts()
}

/**
* Liest alle Attribute SHORTCUT und URL aus tastenkombinationenConf aus, löscht
* alle bisher vorhandenen Tastenkombinationen deren URL mit "wollmux:" beginnt und
* setzt neue Tastenkombination in OOo-Writer.
* Reads all attributes SHORTCUT and URL from key combinationsConf, deletes
* all existing key combinations whose URL begins with "wollmux:" and
* sets new keyboard shortcut in OOo-Writer.
*
* @param tastenkombinationenConf
* .conf Abschnitt Tastenkuerzel mit allen Knoten
* @param key combinationsConf
* .conf section shortcuts with all nodes
*/
public static void createShortcuts(ConfigThingy tastenkombinationenConf)
{
Expand All @@ -72,21 +72,21 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
return;
}

// löschen aller KeyEvents die mit "wollmux:" beginnen
// Delete all KeyEvents that start with "wollmux:".
removeComandFromAllKeyEvents(shortcutManager);

// lesen des Knoten SHORTCUT
// read the node SHORTCUT
ConfigThingy shortcutConf = tastenkombinationenConf.queryByChild("SHORTCUT");

// Iterieren über die Knoten SHORTCUT
// Iterate over the SHORTCUT nodes
Iterator<ConfigThingy> iterShortcut = shortcutConf.iterator();
while (iterShortcut.hasNext())
{

ConfigThingy tastenkombination = iterShortcut.next();

String shortcut = null;
// lesen der Knoten SHORTCUT
// read the node SHORTCUT
try
{
shortcut = tastenkombination.get("SHORTCUT").toString();
Expand All @@ -98,7 +98,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}

String url = null;
// lesen der Knoten URL
// read the node url
try
{
url = tastenkombination.get("URL").toString();
Expand All @@ -112,7 +112,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
KeyEvent keyEvent = createKeyEvent(shortcut);
if (keyEvent != null)
{
// setzen der Tastenkombination mit KeyEvent und WollMux-Url
// set the key combination with KeyEvent and WollMux-Url
try
{
shortcutManager.setKeyEvent(keyEvent, url);
Expand All @@ -128,7 +128,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}
}

// Änderung Persistent machen
// Make change persistent
try
{
if (UNO.XUIConfigurationPersistence(shortcutManager) != null)
Expand All @@ -143,32 +143,32 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}

/**
* Wenn es Tastenkuerzel mit einer UNO-url beginnent mit "wollmux:" gibt, werden
* diese gelöscht. Workaround wegen nicht funktionierendem
* If there are keyboard shortcuts with a UNO url starting with "wollmux:", they will
* these deleted. Workaround for not working
* xAcceleratorConfiguration.removeCommandFromAllKeyEvents(). OOo Issue #72558
*
* @param xAcceleratorConfiguration
* AcceleratorConfiguration (muß danach noch mit store() persistent
* gemacht werden)
* AcceleratorConfiguration (must be persistent afterwards with store()
* be made)
*/
private static void removeComandFromAllKeyEvents(
XAcceleratorConfiguration xAcceleratorConfiguration)
{
// lesen aller gesetzten Tastenkombinationen
// read all set key combinations
KeyEvent[] keys = xAcceleratorConfiguration.getAllKeyEvents();

// Wenn es Tastenkombinationen mit der UNO-url beginnent mit "wollmux:"
// gibt, werden diese gelöscht. Workaround wegen nicht funktionierendem
// If there are key combinations with the UNO url starting with "wollmux:"
// exist, these are deleted. Workaround for not working
// xAcceleratorConfiguration.removeCommandFromAllKeyEvents().
for (int i = 0; i < keys.length; i++)
{
try
{
String event = xAcceleratorConfiguration.getCommandByKeyEvent(keys[i]);
// wenn die UNO-url mit "wollmux:" beginnt, wird sie gelöscht
// if the UNO-url starts with "wollmux:" it will be deleted
if (event.startsWith("wollmux:"))
{
// löschen der Tastenkombination
// delete the key combination
xAcceleratorConfiguration.removeKeyEvent(keys[i]);
}
}
Expand All @@ -180,7 +180,7 @@ private static void removeComandFromAllKeyEvents(
}

/**
* Gibt alle KeyEvents mit Modifier, KeyCode und Command aus
* Outputs all KeyEvents with Modifier, KeyCode and Command
*
* @param xac
* AcceleratorConfigurator
Expand Down Expand Up @@ -208,12 +208,12 @@ public static void showKeyset(XAcceleratorConfiguration xac)
}

/**
* Erzeugt ein Object KeyEvent
* Generates an Object KeyEvent
*
* @param shortcutWithSeparator
* Tastenkombination mit "+" als Separator
* @return gibt ein KeyEvent zurück oder null wenn kein keyCode sondern nur
* keyModifier verwendet werden
* Key combination with "+" as separator
* @return returns a KeyEvent or null if not a keyCode but only
* keyModifier are used
*/
private static KeyEvent createKeyEvent(String shortcutWithSeparator)
{
Expand Down Expand Up @@ -253,11 +253,11 @@ private static KeyEvent createKeyEvent(String shortcutWithSeparator)
}

/**
* Gibt die Konstante com.sun.star.awt.Key für die entsprechende Taste zurück
* Returns the constant com.sun.star.awt.Key for the corresponding key
*
* @param shortcut
* Taste
* @return Key der entsprechenden Taste
* button
* @return key of the corresponding key
*/
private static Short returnKeyCode(String shortcut)
{
Expand Down Expand Up @@ -384,12 +384,12 @@ private static Short returnKeyCode(String shortcut)
}

/**
* Gibt die Konstante com.sun.star.awt.KeyModifier für die entsprechende Taste
* zurück
* Returns the constant com.sun.star.awt.KeyModifier for the corresponding key
* return
*
* @param shortcut
* Taste
* @return KeyModifier der entsprechenden Taste
* button
* @return KeyModifier of the corresponding key
*/
private static Short returnKeyModifier(String shortcut)
{
Expand Down
Loading

0 comments on commit c0ebbde

Please sign in to comment.