Commit b8b8fea8 authored by Florian's avatar Florian

added preference to set percent value in relation to the root node.

but value is currently displayed as 0.0 because the teetime-stages lib is currently not setting the value correctly.
parent 2848281e
......@@ -20,5 +20,6 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
store.setDefault(Properties.Names.FILTERCASESENSITIVE.toString(), true);
store.setDefault(Properties.Names.ADDITIONALANALYSIS.toString(), true);
store.setDefault(Properties.Names.TIMESTAMP.toString(), Properties.TimestampTypes.DATE_AND_TIME.toString());
store.setDefault(Properties.Names.PERCENT.toString(), Properties.PercentRefernceTypes.PARENT.toString());
}
}
......@@ -11,7 +11,7 @@ import kieker.tools.eclipse.analysis.Activator;
public class Properties {
public enum Names{
TIMEUNIT, OPERATION, COMPONENTS, ADDITIONALANALYSIS, TIMESTAMP, FILTERREGEX, FILTERCASESENSITIVE
TIMEUNIT, OPERATION, COMPONENTS, ADDITIONALANALYSIS, TIMESTAMP, FILTERREGEX, FILTERCASESENSITIVE, PERCENT
}
public enum TimestampTypes {
......@@ -26,6 +26,10 @@ public class Properties {
SHORT, LONG
}
public enum PercentRefernceTypes {
PARENT, ROOT
}
public static String toTimestampString(final long aTimestamp, final TimeUnit aSourceUnit) {
String timestampType = Activator.getDefault().getPreferenceStore()
.getString(Properties.Names.TIMESTAMP.toString());
......
package kieker.tools.eclipse.analysis.provider.label;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import kieker.analysis.domain.OperationCall;
import kieker.tools.eclipse.analysis.Activator;
import kieker.tools.eclipse.analysis.model.Properties;
/**
* @author Florian Echternkamp
*/
public class PercentLabelProvider extends AbstractLabelProvider {
boolean total;
public PercentLabelProvider() {
Activator.getDefault().getPreferenceStore()
.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(Properties.Names.PERCENT.toString())) {
total = (boolean) event.getNewValue();
}
}
});
total = Activator.getDefault().getPreferenceStore()
.getBoolean(Properties.Names.PERCENT.toString());
}
@Override
public String getString(OperationCall opCall) {
if(total){
return opCall.getTotalPercent() + " %";
}
return opCall.getPercent() + " %";
}
}
......@@ -53,6 +53,7 @@ public class Messages extends NLS {
public static String PluginPreferencesPage_FilterCaseSensitive;
public static String PluginPreferencesPage_AnalysisAdditional;
public static String PluginPreferencesPage_PercentReference;
public static String PluginPreferencesPage_Timestamps;
static {
......
......@@ -40,4 +40,5 @@ AnalysisTreeView_FilterOperations=Filter Operations
AnalysisTreeView_FilterComponents=Filter Components
AnalysisTreeView_FilterContainer=Filter Container
PluginPreferencesPage_GroupFilter=Filter
PluginPreferencesPage_FilterCaseSensitive=Case Sensitive
\ No newline at end of file
PluginPreferencesPage_FilterCaseSensitive=Case Sensitive
PluginPreferencesPage_PercentReference=Refer to topmost method call for percentage calculation
\ No newline at end of file
......@@ -40,4 +40,5 @@ AnalysisTreeView_FilterOperations=Filter Methoden
AnalysisTreeView_FilterComponents=Filter Komponenten
AnalysisTreeView_FilterContainer=Filter Container
PluginPreferencesPage_GroupFilter=Filter
PluginPreferencesPage_FilterCaseSensitive=Gro-/Kleinschreibung beachten
\ No newline at end of file
PluginPreferencesPage_FilterCaseSensitive=Gro-/Kleinschreibung beachten
PluginPreferencesPage_PercentReference=Prozentuale Berechnung auf den obersten Methodenaufruf beziehen
\ No newline at end of file
......@@ -57,6 +57,8 @@ public class PluginPreferencesPage extends FieldEditorPreferencePage implements
addField(new BooleanFieldEditor(Properties.Names.ADDITIONALANALYSIS.toString(),
Messages.PluginPreferencesPage_AnalysisAdditional, analysis));
addField(new BooleanFieldEditor(Properties.Names.PERCENT.toString(),
Messages.PluginPreferencesPage_PercentReference, analysis));
}
private Group createGroup(Composite parent, String text) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment