/* * Inserts current date in simple format "dd.MM.yyyy" at caret position. Robert Schwenn 01.06.2008 */ import java.text.SimpleDateFormat; void insertDate() { FormatPattern = "dd.MM.yyyy"; Calendar cal = Calendar.getInstance(); SimpleDateFormat format = new SimpleDateFormat(FormatPattern); DateString = format.format(cal.getTime()); // Insert formatted String textArea.setSelectedText(DateString); } if (! buffer.isEditable()) Macros.error(view, "Buffer ist readonly!"); else insertDate();