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
29 changed files
with
1,457 additions
and
269 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
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
70 changes: 70 additions & 0 deletions
70
...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,70 @@ | ||
/******************************************************************************* | ||
* 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; | ||
|
||
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("Less than 0 sec."); | ||
} | ||
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) { | ||
System.out.println(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
65 changes: 0 additions & 65 deletions
65
...oss.tools.openshift.ui/src/org/jboss/tools/openshift/internal/ui/explorer/Deployment.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.