- Notifications
You must be signed in to change notification settings - Fork17
#67 - Use smart time (configurable)#78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
PhilippSalvisberg merged 12 commits intoutPLSQL:masterfromPhilippSalvisberg:67_smart_time_unitJul 27, 2019
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
af619fe
remove warnings regarding plugin versions
PhilippSalvisberg345b405
update dependency versions
PhilippSalvisberg48d1706
remove unnecessary cast to RunnerView
PhilippSalvisberg4c4a6c2
remove Xtend compiler warning (cast to int)
PhilippSalvisbergf598bec
increase tolerance to reduce false positives on slow computers
PhilippSalvisberg88d5a75
avoid test failure when frame is not shown on slow computers
PhilippSalvisberg9b28b83
add copyright header
PhilippSalvisbergcd0c85a
SmartTime to represent time without leading zeros
PhilippSalvisberg9ffdfad
extend preference model by useSmartTime
PhilippSalvisberg9b9db36
add useSmartTime to preferences
PhilippSalvisberg1ec4ae1
show time header with or without unit based on useSmartTime preference
PhilippSalvisberg66126b8
format time based on useSmartTime preference
PhilippSalvisbergFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
16 changes: 8 additions & 8 deletionssqldev/pom.xml
This file contains hidden or 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
9 changes: 9 additions & 0 deletionssqldev/src/main/java/org/utplsql/sqldev/model/preference/PreferenceModel.xtend
This file contains hidden or 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
2 changes: 1 addition & 1 deletionsqldev/src/main/java/org/utplsql/sqldev/runner/UtplsqlRunner.xtend
This file contains hidden or 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
9 changes: 9 additions & 0 deletionssqldev/src/main/java/org/utplsql/sqldev/ui/preference/PreferencePanel.xtend
This file contains hidden or 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
2 changes: 1 addition & 1 deletionsqldev/src/main/java/org/utplsql/sqldev/ui/runner/GradientToolbar.xtend
This file contains hidden or 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
17 changes: 11 additions & 6 deletionssqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.xtend
This file contains hidden or 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
72 changes: 72 additions & 0 deletionssqldev/src/main/java/org/utplsql/sqldev/ui/runner/SmartTime.xtend
This file contains hidden or 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,72 @@ | ||
/* | ||
* Copyright 2019 Philipp Salvisberg <philipp.salvisberg@trivadis.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.utplsql.sqldev.ui.runner | ||
import java.text.DecimalFormat | ||
class SmartTime { | ||
var Double seconds | ||
var boolean smart = false | ||
new() { | ||
super() | ||
} | ||
new(Double seconds, boolean smart) { | ||
super() | ||
this.seconds = seconds | ||
this.smart = smart | ||
} | ||
def setMillis(Double seconds) { | ||
this.seconds = seconds | ||
} | ||
def setSmart(boolean smart) { | ||
this.smart = smart | ||
} | ||
def getSeconds() { | ||
return seconds | ||
} | ||
override toString() { | ||
var String ret; | ||
if (seconds === null) { | ||
ret = null | ||
} else if (smart) { | ||
if (seconds >= 60*60) { | ||
val DecimalFormat formatter = new DecimalFormat("#0.00") | ||
ret = formatter.format(seconds / 60 / 60) + " h" | ||
} else if (seconds >= 60) { | ||
val DecimalFormat formatter = new DecimalFormat("#0.00") | ||
ret = formatter.format(seconds / 60) + " min" | ||
} else if (seconds >= 1) { | ||
val DecimalFormat formatter = new DecimalFormat("#0.000") | ||
ret = formatter.format(seconds) + " s" | ||
} else { | ||
val DecimalFormat formatter = new DecimalFormat("##0") | ||
ret = formatter.format(seconds * 1000) + " ms" | ||
} | ||
} else { | ||
val DecimalFormat formatter = new DecimalFormat("##,##0.000") | ||
ret = formatter.format(seconds) | ||
} | ||
return ret | ||
} | ||
} |
11 changes: 9 additions & 2 deletionssqldev/src/main/java/org/utplsql/sqldev/ui/runner/TestOverviewTableModel.xtend
This file contains hidden or 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
3 changes: 2 additions & 1 deletionsqldev/src/main/resources/org/utplsql/sqldev/resources/UtplsqlResources.properties
This file contains hidden or 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
3 changes: 2 additions & 1 deletionsqldev/src/main/resources/org/utplsql/sqldev/resources/UtplsqlResources_de.properties
This file contains hidden or 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
2 changes: 1 addition & 1 deletionsqldev/src/test/java/org/utplsql/sqldev/test/coverage/CodeCoverageReporterDialogTest.xtend
This file contains hidden or 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
2 changes: 1 addition & 1 deletionsqldev/src/test/java/org/utplsql/sqldev/test/dal/RealtimeReporterFetchSizeTest.xtend
This file contains hidden or 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
1 change: 1 addition & 0 deletionssqldev/src/test/java/org/utplsql/sqldev/test/preference/PreferenceModelTest.xtend
This file contains hidden or 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.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.