Skip to content

Commit

Permalink
incorrect deprecation removed, added correct one. improving GUI prese…
Browse files Browse the repository at this point in the history
…ntation for deprecated items (MID-7408)
  • Loading branch information
katkav committed Nov 21, 2021
1 parent 81dae66 commit 1c97c2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ private void initLayout() {
}

protected void initHeaderLabel(){

// WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
// labelContainer.setOutputMarkupId(true);
// add(labelContainer);

createTitle();
createHelpText();
createExperimentalTooltip();
Expand All @@ -87,12 +82,8 @@ protected void initHeaderLabel(){
//TODO: pending operations
}

// protected WebMarkupContainer getLabelContainer() {
// return (WebMarkupContainer)get(ID_LABEL_CONTAINER);
// }

private void createTitle() {
Component displayName = createTitle(new PropertyModel<>(getModel(), "displayName"));//.of(getModel(), IW::getDisplayName));
Component displayName = createTitle(new PropertyModel<>(getModel(), "displayName"));
displayName.add(new AttributeModifier("style", getDeprecatedCss())); //TODO create deprecated css class?

add(displayName);
Expand All @@ -107,7 +98,7 @@ private void createHelpText() {
IModel<String> helpModel = new PropertyModel<>(getModel(), "help");
help.add(AttributeModifier.replace("title",createStringResource(helpModel.getObject() != null ? helpModel.getObject() : "")));
help.add(new InfoTooltipBehavior());
help.add(new VisibleBehaviour(() -> isHelpTextVisible()));
help.add(new VisibleBehaviour(this::isHelpTextVisible));
add(help);
}

Expand Down Expand Up @@ -137,7 +128,8 @@ public String getCssClass() {

private void createDeprecated() {
Label deprecated = new Label(ID_DEPRECATED);
deprecated.add(AttributeModifier.replace("deprecated", new PropertyModel<>(getModel(), "deprecatedSince")));
deprecated.add(AttributeModifier.replace("title",
createStringResource("ItemHeaderPanel.deprecated", getModelObject() != null && getModelObject().getDeprecatedSince() != null ? getModelObject().getDeprecatedSince() : "N/A")));
deprecated.add(new InfoTooltipBehavior() {

private static final long serialVersionUID = 1L;
Expand All @@ -146,8 +138,6 @@ private void createDeprecated() {
public String getCssClass() {
return "fa fa-fw fa-warning text-warning";
}


});
deprecated.add(new VisibleBehaviour(() -> getModelObject() != null && getModelObject().isDeprecated()));
add(deprecated);
Expand All @@ -164,7 +154,7 @@ public IModel<String> getDeprecatedCss() {
}

protected void initButtons() {
AjaxLink<Void> addButton = new AjaxLink<Void>(ID_ADD_BUTTON) {
AjaxLink<Void> addButton = new AjaxLink<>(ID_ADD_BUTTON) {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -188,7 +178,7 @@ public boolean isVisible() {
});
add(addButton);

AjaxLink<Void> removeButton = new AjaxLink<Void>(ID_REMOVE_BUTTON) {
AjaxLink<Void> removeButton = new AjaxLink<>(ID_REMOVE_BUTTON) {
private static final long serialVersionUID = 1L;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@
Basic info section will contains attributes describing organizationalUnit, emailAddress
or job position and additional info will contain attributes about user's nickname and so on.
</xsd:documentation>
<xsd:appinfo>
<a:deprecatedSince>4.4</a:deprecatedSince>
<a:deprecated/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="panel" type="tns:ContainerPanelConfigurationType" minOccurs="0" maxOccurs="unbounded">
Expand All @@ -863,8 +867,7 @@
Specifies which panels will be show, in which order, ...
</p>
<xsd:appinfo>
<a:deprecatedSince>4.4</a:deprecatedSince>
<a:deprecated/>
<a:since>4.4</a:since>
</xsd:appinfo>
</xsd:documentation>
</xsd:annotation>
Expand Down

0 comments on commit 1c97c2b

Please sign in to comment.