Skip to content

Commit

Permalink
Adding tooltip information to dumpInterval input field - shows value …
Browse files Browse the repository at this point in the history
…type (minutes)
  • Loading branch information
Erik Suta committed Oct 2, 2014
1 parent b24c9bd commit fefc840
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
Expand Up @@ -120,6 +120,8 @@ <h3><wicket:message key="LoggingConfigPanel.profiling.general"/></h3>
<input type="text" class="form-control input-sm" wicket:id="dumpInterval"
wicket:message="placeholder:LoggingConfigPanel.profiling.dumpInterval.placeholder">
</div>

<i wicket:id="dumpIntervalTooltip" wicket:message="title:LoggingConfigPanel.profiling.dumpInterval.tooltip"/>
</div>

<!-- Subsystem profiling section -->
Expand Down
Expand Up @@ -20,7 +20,6 @@
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.DropDownMultiChoice;
import com.evolveum.midpoint.web.component.data.TablePanel;
import com.evolveum.midpoint.web.component.data.column.*;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
Expand All @@ -31,8 +30,8 @@
import com.evolveum.midpoint.web.component.util.ListDataProvider;
import com.evolveum.midpoint.web.component.util.LoadableModel;
import com.evolveum.midpoint.web.component.util.SimplePanel;
import com.evolveum.midpoint.web.page.admin.configuration.PageSystemConfiguration;
import com.evolveum.midpoint.web.page.admin.configuration.dto.*;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

Expand All @@ -45,13 +44,12 @@
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.w3c.dom.html.HTMLTableElement;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
Expand All @@ -64,7 +62,6 @@ public class LoggingConfigPanel extends SimplePanel<LoggingDto> {

private static final String DOT_CLASS = LoggingConfigPanel.class.getName() + ".";
private static final String OPERATION_LOAD_LOGGING_CONFIGURATION = DOT_CLASS + "loadLoggingConfiguration";
private static final String OPERATION_UPDATE_LOGGING_CONFIGURATION = DOT_CLASS + "updateLoggingConfiguration";

private static final String ID_LOGGERS_TABLE = "loggersTable";
private static final String ID_ROOT_LEVEL = "rootLevel";
Expand All @@ -74,6 +71,7 @@ public class LoggingConfigPanel extends SimplePanel<LoggingDto> {
private static final String ID_BUTTON_ADD_FILE_APPENDER = "addFileAppender";
private static final String ID_BUTTON_DELETE_APPENDER = "deleteAppender";
private static final String ID_BUTTON_ADD_STANDARD_LOGGER = "addStandardLogger";
private static final String ID_DUMP_INTERVAL_TOOLTIP = "dumpIntervalTooltip";

public LoggingConfigPanel(String id) {
super(id, null);
Expand Down Expand Up @@ -130,9 +128,9 @@ protected void initLayout() {
private void initLoggers() {
initRoot();

ISortableDataProvider<LoggerConfiguration, String> provider = new ListDataProvider<LoggerConfiguration>(this,
ISortableDataProvider<LoggerConfiguration, String> provider = new ListDataProvider<>(this,
new PropertyModel<List<LoggerConfiguration>>(getModel(), "loggers"));
TablePanel table = new TablePanel<LoggerConfiguration>(ID_LOGGERS_TABLE, provider, initLoggerColumns());
TablePanel table = new TablePanel<>(ID_LOGGERS_TABLE, provider, initLoggerColumns());
table.setOutputMarkupId(true);
table.setShowPaging(false);
add(table);
Expand Down Expand Up @@ -181,13 +179,13 @@ public void onClick(AjaxRequestTarget target) {
}

private void initRoot() {
DropDownChoice<LoggingLevelType> rootLevel = new DropDownChoice<LoggingLevelType>(ID_ROOT_LEVEL,
DropDownChoice<LoggingLevelType> rootLevel = new DropDownChoice<>(ID_ROOT_LEVEL,
new PropertyModel<LoggingLevelType>(getModel(), LoggingDto.F_ROOT_LEVEL),
WebMiscUtil.createReadonlyModelFromEnum(LoggingLevelType.class));

add(rootLevel);

DropDownChoice<String> rootAppender = new DropDownChoice<String>(ID_ROOT_APPENDER,
DropDownChoice<String> rootAppender = new DropDownChoice<>(ID_ROOT_APPENDER,
new PropertyModel<String>(getModel(), LoggingDto.F_ROOT_APPENDER), createAppendersListModel());
rootAppender.setNullValid(true);
rootAppender.add(new OnChangeAjaxBehavior() {
Expand All @@ -207,21 +205,21 @@ private void initAudit(){
CheckBox auditDetails = new CheckBox("auditDetails", new PropertyModel<Boolean>(getModel(), "auditDetails"));
add(auditDetails);

DropDownChoice<String> auditAppender = new DropDownChoice<String>("auditAppender", new PropertyModel<String>(
DropDownChoice<String> auditAppender = new DropDownChoice<>("auditAppender", new PropertyModel<String>(
getModel(), "auditAppender"), createAppendersListModel());
auditAppender.setNullValid(true);
add(auditAppender);
}

private void initProfiling(){
//Entry-Exit profiling init
DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<ProfilingLevel>("profilingLevel",
DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel",
new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"),
WebMiscUtil.createReadonlyModelFromEnum(ProfilingLevel.class),
new EnumChoiceRenderer(this));
new EnumChoiceRenderer<ProfilingLevel>(this));
add(profilingLevel);

DropDownChoice<String> profilingAppender = new DropDownChoice<String>("profilingAppender",
DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender",
new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
profilingAppender.setNullValid(true);
add(profilingAppender);
Expand All @@ -246,9 +244,13 @@ private void initProfiling(){
add(subsystemTaskManager);
add(subsystemWorkflow);

TextField<Integer> dumpInterval = new TextField<Integer>("dumpInterval", new PropertyModel<Integer>(getModel(),
TextField<Integer> dumpInterval = new TextField<>("dumpInterval", new PropertyModel<Integer>(getModel(),
"dumpInterval"));
add(dumpInterval);

Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
dumpIntervalTooltip.add(new InfoTooltipBehavior());
add(dumpIntervalTooltip);
}

private void addStandardLoggerPerformed(AjaxRequestTarget target){
Expand Down Expand Up @@ -287,7 +289,7 @@ private TablePanel getAppendersTable(){
}

private List<IColumn<LoggerConfiguration, String>> initLoggerColumns() {
List<IColumn<LoggerConfiguration, String>> columns = new ArrayList<IColumn<LoggerConfiguration, String>>();
List<IColumn<LoggerConfiguration, String>> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<LoggerConfiguration>();
columns.add(column);

Expand Down Expand Up @@ -342,7 +344,7 @@ public String getIdValue(LoggingComponentType item, int index) {
return dropDownChoicePanel;

} else {
TextPanel<String> textPanel = new TextPanel(componentId, new PropertyModel(model, getPropertyExpression()));
TextPanel textPanel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
FormComponent input = textPanel.getBaseFormComponent();
input.add(new AttributeAppender("style", "width: 100%"));
input.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
Expand Down Expand Up @@ -415,7 +417,7 @@ protected String load() {
@Override
protected InputPanel createInputPanel(String componentId, IModel<LoggerConfiguration> model) {
IModel<Map<String, String>> options = new Model(null);
ListMultipleChoicePanel panel = new ListMultipleChoicePanel<String>(componentId,
ListMultipleChoicePanel panel = new ListMultipleChoicePanel<>(componentId,
new PropertyModel<List<String>>(model, getPropertyExpression()),
createNewLoggerAppendersListModel(), new IChoiceRenderer<String>() {

Expand Down Expand Up @@ -454,7 +456,7 @@ private IModel<List<String>> createNewLoggerAppendersListModel(){

@Override
public List<String> getObject() {
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();

LoggingDto dto = getModel().getObject();

Expand All @@ -476,7 +478,7 @@ private IModel<List<String>> createAppendersListModel() {

@Override
public List<String> getObject() {
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();

LoggingDto dto = getModel().getObject();
for (AppenderConfiguration appender : dto.getAppenders()) {
Expand All @@ -500,10 +502,10 @@ private void deleteLoggerPerformed(AjaxRequestTarget target) {
}

private void initAppenders(){
ISortableDataProvider<AppenderConfiguration, String> provider = new ListDataProvider<AppenderConfiguration>(
ISortableDataProvider<AppenderConfiguration, String> provider = new ListDataProvider<>(
this, new PropertyModel<List<AppenderConfiguration>>(getModel(), LoggingDto.F_APPENDERS));

TablePanel table = new TablePanel<AppenderConfiguration>(ID_TABLE_APPENDERS, provider, initAppenderColumns());
TablePanel table = new TablePanel<>(ID_TABLE_APPENDERS, provider, initAppenderColumns());
table.setOutputMarkupId(true);
table.setShowPaging(false);
add(table);
Expand Down Expand Up @@ -593,7 +595,7 @@ protected InputPanel createInputPanel(String componentId, IModel model) {

@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
TextPanel panel = new TextPanel(componentId, new PropertyModel(model, getPropertyExpression()));
TextPanel panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
FormComponent component = panel.getBaseFormComponent();
component.add(new AttributeModifier("size", 5));
component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
Expand All @@ -608,7 +610,7 @@ protected InputPanel createInputPanel(String componentId, IModel model) {

@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
TextPanel<String> panel = new TextPanel(componentId, new PropertyModel(model,
TextPanel<String> panel = new TextPanel<>(componentId, new PropertyModel<String>(model,
getPropertyExpression()));
FormComponent component = panel.getBaseFormComponent();
component.add(new AttributeModifier("size", 5));
Expand Down
Expand Up @@ -63,6 +63,8 @@ LoggingConfigPanel.profiling.dumpInterval=Dump interval
LoggingConfigPanel.profiling.dumpInterval.placeholder=Dump interval
LoggingConfigPanel.profiling.entryExit=Profiling entry/exit

LoggingConfigPanel.profiling.dumpInterval.tooltip=Specify value in minutes (Default is 30 min.)

StandardLoggerType.MAPPING=Mapping (c.e.m.common.mapping.Mapping)
StandardLoggerType.EXPRESSION=Expression (c.e.m.common.expression.Expression)
StandardLoggerType.SCRIPT_EXPRESSION=Script expression (c.e.m.common.expression.script.ScriptExpression)
Expand Down
Expand Up @@ -16,8 +16,6 @@

package com.evolveum.midpoint.web.page.admin.configuration.component;

import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.ObjectPolicyConfigurationEditor;
import com.evolveum.midpoint.web.component.form.DropDownFormGroup;
import com.evolveum.midpoint.web.component.util.SimplePanel;
Expand All @@ -35,7 +33,6 @@
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
Expand Down

0 comments on commit fefc840

Please sign in to comment.