Skip to content

Instantly share code, notes, and snippets.

@jmini
jmini / pom.xml
Created September 16, 2014 12:40
Maven pom.xml File to play with JBoss Roaster
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sablokesto</groupId>
<artifactId>roaster.sandbox</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>roaster.sandbox</name>
@jmini
jmini / PlannerFieldExample
Created November 13, 2014 08:12
Planner field example - Eclipse Scout
@Order(10.0)
public class CarsPlannerField extends AbstractPlannerField<ResourceTable, ActivityMap, Long, Long> {
private static final long CLIO = 1001L;
private static final long TWINGO = 1002L;
private static final long AUDI = 1003L;
private static final long SMART = 1004L;
private Long m_ActivityIdCounter = 100L;
@Override
@jmini
jmini / SmartField_Time_Example.java
Created November 13, 2014 12:04
Smart Field Example to select a time (minute and seconds. hour is always 0). http://www.eclipse.org/forums/index.php/t/855355/
@Order(10.0)
public class TimeField extends AbstractSmartField<Date> {
@Override
protected String getConfiguredLabel() {
return TEXTS.get("TimeField");
}
@Override
protected Class<? extends ILookupCall<Date>> getConfiguredLookupCall() {
# --------------------------------------------------------------------------------
# intro comments
# --------------------------------------------------------------------------------
# export TEXINPUTS:=.:local
# PDFLATEX = pdflatex -file-line-error
PDFLATEX = "C:\Tools\MiKTeX2.9\miktex\bin\pdflatex.exe" -file-line-error
MAKEINDEX = "C:\Tools\MiKTeX2.9\miktex\bin\makeindex.exe" -s book_index_style.ist
HTLATEX = "C:\Tools\MiKTeX2.9\miktex\bin\htlatex.exe"
@jmini
jmini / BuildHelpTocMain.java
Created November 27, 2014 05:17
Create toc.xml with mylyn-intent from existing HTML files
/*******************************************************************************
* Copyright (c) 2014 BSI Business Systems Integration AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
@jmini
jmini / NormalizeHTML.java
Created December 11, 2014 16:58
Normalize HTML files (remove comments, change the date meta tag) in order to diff them.
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@jmini
jmini / AbstractTreeTable.java
Created December 18, 2014 05:37
Tree Table template for Eclipse Scout
/*******************************************************************************
* Copyright (c) 2014 BSI Business Systems Integration AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
@jmini
jmini / Main
Created January 11, 2015 06:57
Main for the Stackoverflow a question http://stackoverflow.com/q/27884534/91497
//see http://stackoverflow.com/q/27884534/91497
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Main {
public static void main(String[] args) {
@jmini
jmini / AbstractTableWithDetail.java
Created January 22, 2015 07:07
AbstractTableWithDetail template: implementation of the master/detail pattern.
/*******************************************************************************
* Copyright (c) 2015 BSI Business Systems Integration AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
@jmini
jmini / WorkaroundAsciidoctor858.java
Last active February 15, 2019 23:41
Workaround for Asciidoctor #858 (fix the HTML Ouptu)
//Workaround using JSoup to obtain the desired behavior described in #858 for the HTML output.
//see https://github.com/asciidoctor/asciidoctor/issues/858
static private Pattern pattern = Pattern.compile("Figure ([0-9]+)\\.");
/**
* Main method for the #858 workaround.
*
* @param doc
* JSoup document (type is {@link org.jsoup.nodes.Document})