use of org.kse.utilities.oid.InvalidObjectIdException in project keystore-explorer by kaikramer.
the class DObjectIdChooser method okPressed.
private void okPressed() {
String firstArc = "" + jcbFirstArc.getSelectedItem();
String secondArc = "" + jcbSecondArc.getSelectedItem();
String remainingArcs = jtfRemainingArcs.getText().trim();
ASN1ObjectIdentifier newObjectId = new ASN1ObjectIdentifier(firstArc + "." + secondArc + "." + remainingArcs);
try {
ObjectIdUtil.validate(newObjectId);
} catch (InvalidObjectIdException e) {
JOptionPane.showMessageDialog(this, e.getMessage(), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
objectId = newObjectId;
closeDialog();
}
use of org.kse.utilities.oid.InvalidObjectIdException in project keystore-explorer by kaikramer.
the class JObjectId method editObjectId.
private void editObjectId() {
Container container = getTopLevelAncestor();
try {
DObjectIdChooser dObjectIdChooser = null;
if (container instanceof JDialog) {
dObjectIdChooser = new DObjectIdChooser((JDialog) container, title, objectId);
dObjectIdChooser.setLocationRelativeTo(container);
dObjectIdChooser.setVisible(true);
} else if (container instanceof JFrame) {
dObjectIdChooser = new DObjectIdChooser((JFrame) container, title, objectId);
dObjectIdChooser.setLocationRelativeTo(container);
dObjectIdChooser.setVisible(true);
}
ASN1ObjectIdentifier newObjectId = dObjectIdChooser.getObjectId();
if (newObjectId == null) {
return;
}
setObjectId(newObjectId);
} catch (InvalidObjectIdException ex) {
DError dError = null;
if (container instanceof JDialog) {
dError = new DError((JDialog) container, ex);
} else {
dError = new DError((JFrame) container, ex);
}
dError.setLocationRelativeTo(container);
dError.setVisible(true);
}
}
Aggregations