Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBIDE-21359] Add build tab to explorer deployment view
- Loading branch information
Showing
30 changed files
with
1,481 additions
and
271 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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 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 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 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
71 changes: 71 additions & 0 deletions
71
...shift.common.ui/src/org/jboss/tools/openshift/internal/common/ui/utils/DateTimeUtils.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is 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: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.internal.common.ui.utils; | ||
|
||
|
||
import java.text.DateFormat; | ||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
import org.apache.commons.lang.time.DurationFormatUtils; | ||
import org.jboss.tools.openshift.internal.common.ui.OpenShiftCommonUIActivator; | ||
|
||
public class DateTimeUtils { | ||
|
||
private static long NANOSECONDS_PER_SEC = 1000000; | ||
|
||
private DateTimeUtils () { | ||
} | ||
|
||
public static String formatDuration(long nanoseconds) { | ||
String[] parts = DurationFormatUtils.formatDuration(nanoseconds / NANOSECONDS_PER_SEC, "H:m:s:S").split(":"); | ||
StringBuilder builder = new StringBuilder(); | ||
if(Integer.valueOf(parts[0]) > 0){ | ||
builder.append(parts[0]).append(" hrs."); | ||
} | ||
if(Integer.valueOf(parts[1]) > 0){ | ||
builder.append(" ").append(parts[1]).append(" min."); | ||
} | ||
if(Integer.valueOf(parts[2]) > 0){ | ||
builder.append(" ").append(parts[2]).append(" sec."); | ||
} | ||
if(builder.length() == 0) { | ||
builder.append("Now"); | ||
} | ||
return builder.toString().trim(); | ||
} | ||
|
||
public static String formatSince(String value) { | ||
return formatSince(value, null); | ||
} | ||
public static String formatSince(String value, TimeZone timezone) { | ||
try { | ||
Date date = parse(value); | ||
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL); | ||
if(timezone != null) { | ||
formatter.setTimeZone(timezone); | ||
} | ||
return formatter.format(date); | ||
} catch (ParseException e) { | ||
OpenShiftCommonUIActivator.getDefault().getLogger().logWarning("Unable to parse format duration value: " + value, e); | ||
} | ||
return value; | ||
} | ||
public static Date parse(String value) throws ParseException { | ||
//ref: http://www.java2s.com/Code/Java/Data-Type/ISO8601dateparsingutility.htm | ||
//assume date is like: '2015-11-11T20:32:37Z' | ||
String modValue = value.substring(0, value.length()-1) + "GMT-00:00"; | ||
SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz"); | ||
return parser.parse(modValue); | ||
} | ||
} |
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 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 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 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 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
Oops, something went wrong.