private void sensibleValueInitCases(@Nonnegative short type,
@Nonnull Node comp,
@Nonnull EncryptedNode node,
@Nonnull String sensible_key) {
SensibleEditorComponent secomp = null;
Label cell = null;
if (comp instanceof SensibleEditorComponent) {
secomp = (SensibleEditorComponent) comp;
} else {
cell = (Label) comp;
}
try {
switch (type) {
case SensibleValueTypeListener.CLEAR_VALUE_TYPE: {
String value = getSensibleValue(node, sensible_key);
if (secomp != null) {
secomp.setValueInClear(value);
} else {
cell.setText(value);
cell.setId("generic_label");
}
break;
}
case SensibleValueTypeListener.PASS_VALUE_TYPE: {
String value = getSensibleValue(node, sensible_key);
if (secomp != null) {
secomp.setValueInPassword(value.toCharArray());
} else {
String ris = "";
for (int i = 0; i < value.length(); i++) {
ris += '*';
}
cell.setText(ris);
cell.setId("generic_label");
}
break;
}
case SensibleValueTypeListener.HIDDEN_VALUE_TYPE: {
if (secomp != null) {
secomp.setValueHidden();
} else {
cell.setId("hidden_label");
cell.setText("<"
+ RBLoader.ll(
SensibleEditorComponent.HIDDEN_TXT) + ">");