This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PdfRendererPrinting { | |
public static void main(final String[] args) { | |
PrintingHelper.lookupAllPrinters(); | |
final PrintService[] printers = PrintingHelper.findPrinterOutputLocation("\\\\My_Remote_Or_Locally_Installed_Printer"); | |
if (0 == printers.length || 1 < printers.length) { | |
// Handle | |
} | |
final PrintService printService = printers[0]; | |
PrintingHelper.listsPrinterAttributes(printService); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JPdfPrinting { | |
public static void main(final String[] args) { | |
PrintingHelper.lookupAllPrinters(); | |
final PrintService[] printers = PrintingHelper.findPrinterOutputLocation("\\\\My_Remote_Or_Locally_Installed_Printer"); | |
if (0 == printers.length || 1 < printers.length) { | |
// Handle | |
} | |
final PrintService printService = printers[0]; | |
PrintingHelper.listsPrinterAttributes(printService); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IcePdfPrinting { | |
public static void main(final String[] args) { | |
PrintingHelper.lookupAllPrinters(); | |
final PrintService[] printers = PrintingHelper.findPrinterOutputLocation("\\\\My_Remote_Or_Locally_Installed_Printer"); | |
if (0 == printers.length || 1 < printers.length) { | |
// Handle | |
} | |
final PrintService printService = printers[0]; | |
PrintingHelper.listsPrinterAttributes(printService); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class AutowiredPropertyBean { | |
private String notAnnotated = "Original value"; | |
@ReloadableProperty("not.in.the.file") | |
private String withDefaultValue = "Default Value"; | |
@ReloadableProperty("not.in.the.file") | |
private int primitiveWithDefaultValue = 55; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dynamicProperty.longValue=12345 | |
dynamicProperty.substitutionProperty=${dynamicProperty.substitutionValue} | |
dynamicProperty.doubleValue=12345.67 | |
dynamicProperty.localTimeValue=12:22:45 | |
dynamicProperty.stringValue=Injected String Value | |
dynamicProperty.substitutionValue=elephant | |
dynamicProperty.bigDecimalValue=20012.56 | |
dynamicProperty.intValue=42 | |
dynamicProperty.localDateValue=2009-06-12 | |
dynamicProperty.periodValue=00:12:22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-enforcer-plugin</artifactId> | |
<version>1.0.1</version> | |
<executions> | |
<execution> | |
<id>enforce-versions</id> | |
<goals> | |
<goal>enforce</goal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is called when your application is upgraded and it has a higher version number. This allows you to adjust the various data to | |
* match the new version number. | |
*/ | |
@Override | |
public void onUpgrade(final SQLiteDatabase db, final ConnectionSource connectionSource, int oldVersion, final int newVersion) { | |
Logger.i(LOG_TAG, "onUpgrade, oldVersion=[%s], newVersion=[%s]", oldVersion, newVersion); | |
try { | |
// Simply loop round until newest version has been reached and add the appropriate migration | |
while (++oldVersion <= newVersion) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AdminDashboardComponent implements OnDestroy { | |
/** Public data */ | |
competitions:[]; | |
/** Subscriber */ | |
private _competitionsEventHandler:EventEmitter<>; | |
constructor(private _competitionsService:CompetitionsService) { | |
// Get a handle on the event emitter to react on the changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must import this or the actual feature you require form rxjs to use things like delay(), map(), retry() | |
import 'rxjs/Rx'; | |
... | |
export class Test { | |
constructor(private _http:Http) { | |
_http.get('http://localhost:8080/competitions') | |
.map(res => res.json()) // map to json | |
.delay(2000) // atrificially delay the | |
.retry(3) // attempt to retry x number of times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function () { | |
this._competitionsEventHandler = this._competitionsService.onCompetitionsChanged.subscribe((competitions) => { | |
this.competitions = competitions; | |
}); | |
}.bind(this), 5000); |