本文整理汇总了Java中ch.rgw.tools.TimeTool.toString方法的典型用法代码示例。如果您正苦于以下问题:Java TimeTool.toString方法的具体用法?Java TimeTool.toString怎么用?Java TimeTool.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.rgw.tools.TimeTool
的用法示例。
在下文中一共展示了TimeTool.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
public void run(){
TimeTool tool = new TimeTool("01.01.2020");
while (!failed) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
// ignore
}
String toString = tool.toString(TimeTool.DATE_GER);
if (!toString.equals("01.01.2020")) {
failed = true;
failedToString = toString;
}
}
}
示例2: TerminDialog
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Use this constructor for creating a new {@link Termin} from a date and for a resource.
*
* @param date
* @param resource
* @param patient
*/
public TerminDialog(@NonNull TimeTool date, @NonNull String resource, Patient patient){
super(UiDesk.getTopShell());
Free act = new Termin.Free(date.toString(TimeTool.DATE_COMPACT),
date.get(TimeTool.HOUR_OF_DAY) * 60 + date.get(TimeTool.MINUTE), 30);
actKontakt = patient;
Color green = UiDesk.getColor(UiDesk.COL_GREEN);
if (green == null) {
UiDesk.getColorRegistry().put(UiDesk.COL_GREEN, new RGB(0, 255, 0));
}
actPlannable = act;
agenda.setActResource(resource);
tMap = Plannables.getTimePrefFor(agenda.getActResource());
tMap.put(Termin.typFrei(), "0"); //$NON-NLS-1$
tMap.put(Termin.typReserviert(), "0"); //$NON-NLS-1$
}
示例3: importKumulations
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Import all the kumulations from the LEISTUNG_KUMULATION table for the given code. The
* kumulations contain inclusions, exclusions and exclusives.
*
* @param code
* of a tarmed value
* @param stmCached
* @throws SQLException
*/
private void importKumulations(String blockName) throws SQLException{
Stm subStm = cacheDb.getStatement();
try {
try (ResultSet res = subStm.query(String.format(
"SELECT * FROM %sLEISTUNG_KUMULATION WHERE LNR_MASTER=%s AND ART_MASTER='B'",
TarmedReferenceDataImporter.ImportPrefix, JdbcLink.wrap(blockName)))) {
TimeTool fromTime = new TimeTool();
TimeTool toTime = new TimeTool();
while (res != null && res.next()) {
fromTime.set(res.getString("GUELTIG_VON"));
toTime.set(res.getString("GUELTIG_BIS"));
new TarmedKumulation(blockName, res.getString("ART_MASTER"),
res.getString("LNR_SLAVE"), res.getString("ART_SLAVE"),
res.getString("TYP"), res.getString("ANZEIGE"),
res.getString("GUELTIG_SEITE"), fromTime.toString(TimeTool.DATE_COMPACT),
toTime.toString(TimeTool.DATE_COMPACT), law);
}
}
} finally {
if (subStm != null) {
cacheDb.releaseStatement(subStm);
}
}
}
示例4: recalc
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
void recalc(double widthPerColumn, int left_offset, int padding, int textSize){
GridData gd = (GridData) getLayoutData();
gd.heightHint = textSize + 2;
for (Control c : getChildren()) {
if (c instanceof Label) {
c.dispose();
}
}
Point bSize = ihRes.computeSize(SWT.DEFAULT, SWT.DEFAULT);
ihRes.setBounds(0, 0, bSize.x, bSize.y);
String[] labels = view.getDisplayedDays();
int count = labels.length;
for (int i = 0; i < count; i++) {
int lx = left_offset + (int) Math.round(i * (widthPerColumn + padding));
Label l = new Label(this, SWT.NONE);
TimeTool tt = new TimeTool(labels[i]);
StringBuilder sb = new StringBuilder(tt.toString(TimeTool.WEEKDAY));
sb.append(", ").append(tt.toString(TimeTool.DATE_GER)); //$NON-NLS-1$
String coltext = sb.toString();
Point extend = SWTHelper.getStringBounds(this, coltext);
if (extend.x > widthPerColumn) {
coltext = coltext.substring(0, coltext.length() - 4);
extend = SWTHelper.getStringBounds(this, coltext);
if (extend.x > widthPerColumn) {
coltext = coltext.substring(0, 2);
}
}
l.setText(coltext);
int outer = (int) Math.round(widthPerColumn);
int inner = l.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
int off = (outer - inner) / 2;
lx += off;
l.setBounds(lx, 0, inner, textSize + 2);
}
}
示例5: importKumulations
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Import all the kumulations from the LEISTUNG_KUMULATION table for the given code. The
* kumulations contain inclusions, exclusions and exclusives.
*
* @param code
* of a tarmed value
* @param stmCached
* @throws SQLException
*/
private void importKumulations() throws SQLException{
Stm subStm = cacheDb.getStatement();
try {
try (ResultSet res = subStm
.query(String.format(
"SELECT * FROM %sLEISTUNG_KUMULATION WHERE LNR_MASTER=%s AND ART_MASTER='L'",
TarmedReferenceDataImporter.ImportPrefix, JdbcLink.wrap(code)))) {
TimeTool fromTime = new TimeTool();
TimeTool toTime = new TimeTool();
while (res != null && res.next()) {
fromTime.set(res.getString("GUELTIG_VON"));
toTime.set(res.getString("GUELTIG_BIS"));
new TarmedKumulation(code, res.getString("ART_MASTER"),
res.getString("LNR_SLAVE"), res.getString("ART_SLAVE"),
res.getString("TYP"), res.getString("ANZEIGE"),
res.getString("GUELTIG_SEITE"), fromTime.toString(TimeTool.DATE_COMPACT),
toTime.toString(TimeTool.DATE_COMPACT), law);
}
}
} finally {
if (subStm != null) {
cacheDb.releaseStatement(subStm);
}
}
}
示例6: importKumulations
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Import all the kumulations from the LEISTUNG_KUMULATION table for the given code. The
* kumulations contain inclusions, exclusions and exclusives.
*
* @param code
* of a tarmed value
* @param stmCached
* @throws SQLException
*/
private void importKumulations(String groupName) throws SQLException{
Stm subStm = importer.cacheDb.getStatement();
try {
try (ResultSet res = subStm.query(String.format(
"SELECT * FROM %sLEISTUNG_KUMULATION WHERE LNR_MASTER=%s AND ART_MASTER='G'",
TarmedReferenceDataImporter.ImportPrefix, JdbcLink.wrap(groupName)))) {
TimeTool fromTime = new TimeTool();
TimeTool toTime = new TimeTool();
while (res != null && res.next()) {
fromTime.set(res.getString("GUELTIG_VON"));
toTime.set(res.getString("GUELTIG_BIS"));
new TarmedKumulation(groupName, res.getString("ART_MASTER"),
res.getString("LNR_SLAVE"), res.getString("ART_SLAVE"),
res.getString("TYP"), res.getString("ANZEIGE"),
res.getString("GUELTIG_SEITE"),
fromTime.toString(TimeTool.DATE_COMPACT),
toTime.toString(TimeTool.DATE_COMPACT), law);
}
}
} finally {
if (subStm != null) {
importer.cacheDb.releaseStatement(subStm);
}
}
}
示例7: setDate
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public void setDate(TimeTool date, boolean bIsUnexact){
String val = date.toString(TimeTool.DATE_COMPACT);
if (bIsUnexact) {
val = val.substring(0, 4) + "0000"; //$NON-NLS-1$
}
set(DATE, val);
}
示例8: Message
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public Message(final Anwender an, final String text){
create(null);
TimeTool tt = new TimeTool();
String dt = tt.toString(TimeTool.TIMESTAMP);
set(new String[] {
FLD_FROM, FLD_TO, FLD_TIME, FLD_TEXT
}, new String[] {
CoreHub.actUser.getId(), an.getId(), dt, text
});
}
示例9: refresh
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
protected void refresh(){
TimeTool ttMonday = agenda.getActDate();
ttMonday.set(TimeTool.DAY_OF_WEEK, TimeTool.MONDAY);
StringBuilder sb = new StringBuilder(ttMonday.toString(TimeTool.DATE_GER));
ttMonday.addDays(6);
sb.append("-").append(ttMonday.toString(TimeTool.DATE_GER)); //$NON-NLS-1$
showCalendarAction.setText(sb.toString());
sheet.refresh();
}
示例10: getBeginDate
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String getBeginDate(){
String timestamp = checkNull(get(FLD_DATE_FROM));
if (!timestamp.isEmpty()) {
TimeTool timetool = new TimeTool(timestamp);
return timetool.toString(TimeTool.DATE_GER);
}
return "";
}
示例11: getBeginTime
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String getBeginTime(){
String timestamp = checkNull(get(FLD_DATE_FROM));
if (!timestamp.isEmpty()) {
TimeTool timetool = new TimeTool(timestamp);
return timetool.toString(TimeTool.FULL_GER);
}
return "";
}
示例12: getEndDate
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String getEndDate(){
String timestamp = checkNull(get(FLD_DATE_UNTIL));
if (!timestamp.isEmpty()) {
TimeTool timetool = new TimeTool(timestamp);
return timetool.toString(TimeTool.DATE_GER);
}
return "";
}
示例13: getKonsBeginn
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String getKonsBeginn(){
String ts = get(FLD_KONSBEGINN);
if (ts == null || ts.equals(""))
return "";
TimeTool t = new TimeTool();
t.setTimeInMillis(Long.parseLong(ts));
return t.toString(TimeTool.TIME_SMALL);
}
示例14: addReminderEntry
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private void addReminderEntry(Element root, Rechnung rechnung, String reminderLevel){
boolean firstReminder = false;
Element payload = root.getChild("payload", XMLExporter.nsinvoice);//$NON-NLS-1$
payload.setAttribute(ATTR_PAYLOAD_TYPE, "reminder"); //$NON-NLS-1$
TimeTool tt = new TimeTool(new Date());
String timestamp = Long.toString(tt.getTimeInMillis() / 1000);
String dateString = tt.toString(TimeTool.DATE_MYSQL) + "T00:00:00";
Element reminder = payload.getChild(ELEMENT_REMINDER, nsinvoice);
if (reminder == null) {
reminder = new Element(ELEMENT_REMINDER, nsinvoice);
firstReminder = true;
}
reminder.setAttribute(ATTR_REQUEST_TIMESTAMP, timestamp); //$NON-NLS-1$
reminder.setAttribute(ATTR_REQUEST_DATE, dateString); //$NON-NLS-1$
reminder.setAttribute(ATTR_REQUEST_ID, rechnung.getRnId()); //$NON-NLS-1$
reminder.setAttribute(ATTR_REMINDER_LEVEL, reminderLevel); //$NON-NLS-1$
// add amount reminder and recalculate amount due
Element body = payload.getChild("body", XMLExporter.nsinvoice);
if (body != null) {
Element balance = body.getChild("balance", XMLExporter.nsinvoice);
Money amountReminder = rechnung.getRemindersBetrag();
balance.setAttribute(XMLExporter.ATTR_AMOUNT_REMINDER,
XMLTool.moneyToXmlDouble(amountReminder));
// rewrite amount due
Money mDue = new Money(rechnung.getBetrag());
mDue.addMoney(amountReminder);
mDue.subtractMoney(rechnung.getAnzahlung());
balance.setAttribute(XMLExporter.ATTR_AMOUNT_DUE, XMLTool.moneyToXmlDouble(mDue));
}
if (firstReminder) {
@SuppressWarnings("unchecked")
List<Element> children = payload.getChildren();
List<Element> newChildren = new ArrayList<>();
for (int i = 0; i < children.size(); i++) {
newChildren.add(children.get(i));
// add reminder after invoice
if (children.get(i).getName().equals("invoice")) {
newChildren.add(reminder);
}
}
payload.removeContent();
payload.setContent(newChildren);
}
}
示例15: getLabel
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
public String getLabel() {
TimeTool tt = new TimeTool(get("Datum"));
return tt.toString(TimeTool.DATE_GER);
}