ItEr46S18RFComportamentoGraficoPlanificadorItEr31S05: Added information of order scheduling state next to name in breadcrumbs

This commit is contained in:
Lorenzo Tilve 2010-02-03 20:05:15 +01:00 committed by Javier Moran Rua
parent ed2bc04448
commit 5683547189
5 changed files with 57 additions and 19 deletions

View file

@ -82,6 +82,7 @@ public class SchedulingState {
public boolean isPartiallyScheduled() {
return true;
}
},
COMPLETELY_SCHEDULED_SUPERELEMENT {
@Override
@ -98,6 +99,7 @@ public class SchedulingState {
public boolean isPartiallyScheduled() {
return false;
}
},
NO_SCHEDULED {
@Override
@ -350,4 +352,24 @@ public class SchedulingState {
return children.size();
}
public String getStateName() {
if (isCompletelyScheduled()) {
return _("Completely scheduled");
} else if (isPartiallyScheduled()) {
return _("Partially scheduled");
} else {
return _("Unscheduled");
}
}
public String getStateAbbreviation() {
if (isCompletelyScheduled()) {
return _("C");
} else if (isPartiallyScheduled()) {
return _("P");
} else {
return _("U");
}
}
}

View file

@ -18,8 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.navalplanner.web.orders;
import static org.navalplanner.web.I18nHelper._;
import org.apache.commons.lang.Validate;
import org.navalplanner.business.orders.entities.SchedulingState;
import org.navalplanner.business.orders.entities.SchedulingState.ITypeChangedListener;
@ -62,23 +60,11 @@ public class SchedulingStateToggler extends HtmlMacroComponent {
}
public String getButtonLabel() {
if (state.isCompletelyScheduled()) {
return _("C");
} else if (state.isPartiallyScheduled()) {
return _("P");
} else {
return _("U");
}
return state.getStateAbbreviation();
}
public String getButtonTextTooltip() {
if (state.isCompletelyScheduled()) {
return _("Completely scheduled");
} else if (state.isPartiallyScheduled()) {
return _("Partially scheduled");
} else {
return _("Unscheduled");
}
return state.getStateName();
}
}

View file

@ -54,6 +54,7 @@ public class PlanningTabCreator {
public static final String ENTERPRISE_VIEW = _("Company Scheduling");
public static final String ORDER_ENTERPRISE_VIEW = _("Order Scheduling");
public static final int MAX_ORDERNAME_LENGHT = 90;
private final Mode mode;
private final CompanyPlanningController companyPlanningController;
@ -196,9 +197,21 @@ public class PlanningTabCreator {
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs.appendChild(new Label(ORDER_ENTERPRISE_VIEW));
if (mode.isOf(ModeType.ORDER)) {
Label nameLabel = new Label(mode.getOrder().getName());
nameLabel.setTooltiptext(mode.getOrder().getName() + "."
+ mode.getOrder().getDescription());
nameLabel.setMaxlength(MAX_ORDERNAME_LENGHT);
Label schedulingStateLabel = new Label(mode.getOrder()
.getSchedulingState().getStateAbbreviation());
schedulingStateLabel.setSclass("scheduling-state");
schedulingStateLabel.setTooltiptext(mode.getOrder()
.getSchedulingState().getStateName());
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
breadcrumbs
.appendChild(new Label(mode.getOrder().getName()));
breadcrumbs.appendChild(nameLabel);
breadcrumbs.appendChild(schedulingStateLabel);
}
}

View file

@ -165,7 +165,7 @@ a.sub_menu:hover {
}
.help-link {
width: 180px;
width: 80px;
}
.help-link a {

View file

@ -1137,3 +1137,20 @@ tr.z-tree-row-seld, tr.z-list-item-seld,
.function {
min-width: 90px;
}
.migas_linea .scheduling-state {
-moz-border-radius-bottomleft: 6px;
-moz-border-radius-bottomright: 1px;
-moz-border-radius-topleft: 1px;
-moz-border-radius-topright: 6px;
-webkit-borderbottom-left-radius: 3px;
-webkit-border-bottomright-radius: 1px;
-webkit-border-radius-top-left-radius: 1px;
-webkit-border-topright-radius: 6px;
border: 1px solid #888888;
color: #888888;
font-weight: bold;
margin: 4px 3px 2px 5px;
padding: 1px 5px;
cursor: default;
}