OpenKeyWord  Build_ID: 457, Datum: 01.02.2020 07:45:48
Dont repeat yourself. - Do it once and only once!
OKWLocator.java
1 package okw.gui;
2 
3 /*
4  ==============================================================================
5  Author: Zoltán Hrabovszki <zh@openkeyword.de>
6 
7  Copyright © 2012 - 2019 IT-Beratung Hrabovszki
8  www.OpenKeyWord.de
9  ==============================================================================
10 
11  This file is part of OpenKeyWord.
12 
13  OpenKeyWord is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenKeyWord is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenKeyWord. If not, see <http://www.gnu.org/licenses/>.
25 
26  Diese Datei ist Teil von OpenKeyWord.
27 
28  OpenKeyWord ist Freie Software: Sie können es unter den Bedingungen
29  der GNU General Public License, wie von der Free Software Foundation,
30  Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
31  veröffentlichten Version, weiterverbreiten und/oder modifizieren.
32 
33  OpenKeyWord wird in der Hoffnung, dass es nützlich sein wird, aber
34  OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
35  Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
36  Siehe die GNU General Public License für weitere Details.
37 
38  Sie sollten eine Kopie der GNU General Public License zusammen mit
39  OpenKeyWord erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
40 */
41 
42 import okw.log.*;
43 import org.stringtemplate.v4.*;
44 
104 public class OKWLocator extends OKWLocatorBase
105 {
109  protected String _locator = null;
110 
114  protected OKWLocatorBase[] _Locators = null;
115 
116  protected Logger_Sngltn myLogger = Logger_Sngltn.getInstance();
117 
118 
119  public OKWLocator( )
120  {
121  }
122 
123 
124  public OKWLocator( String fpsLocator, OKWLocatorBase... fpLocators )
125  {
126  setLocator( fpsLocator, fpLocators );
127  }
128 
151  public String getLocator()
152  {
153  myLogger.LogFunctionStartDebug( "getLocator()" );
154  String lvsReturn = "";
155 
156  if ( _Locators != null )
157  {
158  ST st = new ST( _locator, '$', '$' );
159 
160  Integer i = 1;
161 
162  for ( OKWLocatorBase Locator : _Locators )
163  {
164  st.add( "L" + i.toString(), Locator.getLocator() );
165  i++;
166  }
167 
168  lvsReturn = st.render();
169  }
170  else
171  {
172  lvsReturn = _locator;
173  }
174 
175  myLogger.LogFunctionEndDebug( lvsReturn );
176  return lvsReturn;
177  }
178 
179 
194  public void setLocator( String fpsLocator, OKWLocatorBase... fpLocators )
195  {
196  myLogger.LogFunctionStartDebug( "OKWLocator.setLocator" );
197 
198  _locator = fpsLocator;
199 
200  if ( fpLocators.length != 0 )
201  {
202  this.setLocators( fpLocators );
203  }
204 
205  myLogger.LogFunctionEndDebug();
206  }
207 
208 
221  @Override
222  public void setLocators( OKWLocatorBase... fpLocators )
223  {
224  myLogger.LogFunctionStartDebug( "OKWLocator.setLocators" );
225 
226  // if ( fpLocators.length != 0 )
227  if ( fpLocators != null )
228  {
229  _Locators = fpLocators;
230  }
231 
232  myLogger.LogFunctionEndDebug();
233  }
234 
245  @Override
246  public void copyLocator( OKWLocatorBase fpSource )
247  {
248  myLogger.LogFunctionStartDebug( "OKWLocator.copyLocator" );
249 
250  this.setLocator( fpSource.getlocator() );
251  this.setLocators(fpSource.getLocators());
252 
253  myLogger.LogFunctionEndDebug();
254  }
255 
266  @Override
267  public String getlocator()
268  {
269  return this._locator;
270  }
271 
272 
283  @Override
285  {
286  return this._Locators;
287  }
288 }
okw.gui.OKWLocatorBase
Definition: OKWLocatorBase.java:3
okw.gui.OKWLocator._locator
String _locator
Base Locator.
Definition: OKWLocator.java:109
okw.gui.OKWLocator.getLocator
String getLocator()
Holt den vollständig (rekursiv) aufgelösten des Locators.
Definition: OKWLocator.java:151
okw.gui.OKWLocator.setLocator
void setLocator(String fpsLocator, OKWLocatorBase... fpLocators)
Setzt den Wert (z.B.
Definition: OKWLocator.java:194
okw.gui.OKWLocator.copyLocator
void copyLocator(OKWLocatorBase fpSource)
Copiert bzw, überträgt die Werte des fpSource Locators auf die Aktuelle Instanz.
Definition: OKWLocator.java:246
okw.log.Logger_Sngltn.LogFunctionEndDebug
void LogFunctionEndDebug()
LogFunctionEndDebug:
Definition: Logger_Sngltn.java:249
okw.log.Logger_Sngltn.getInstance
static Logger_Sngltn getInstance()
Zentrale Logger-Klasse stellt Logger-Methoden innerhalb von OKW zur Verfügung.
Definition: Logger_Sngltn.java:88
okw.gui.OKWLocator.setLocators
void setLocators(OKWLocatorBase... fpLocators)
Setzt den Wert (z.B.
Definition: OKWLocator.java:222
okw.log.Logger_Sngltn.LogFunctionStartDebug
void LogFunctionStartDebug(String fps_FunctionName, String... fpsParameter)
LogFunctionStartDebug:
Definition: Logger_Sngltn.java:311
okw.gui.OKWLocator.getlocator
String getlocator()
gettet den Basis-Locator.
Definition: OKWLocator.java:267
okw.gui.OKWLocator._Locators
OKWLocatorBase[] _Locators
List of reference Locators.
Definition: OKWLocator.java:114
okw.gui.OKWLocator
Definition: OKWLocator.java:104
okw.gui.OKWLocator.getLocators
OKWLocatorBase[] getLocators()
gettet die Referenz Locatoren als Liste.
Definition: OKWLocator.java:284
okw.log.Logger_Sngltn
Definition: Logger_Sngltn.java:54