use of com.ramussoft.gui.common.BaseDialog in project ramus by Vitaliy-Yakovchuk.
the class QualifierPreferencesPanel method showDialog.
public void showDialog() {
dialog = new BaseDialog(framework.getMainFrame(), true) {
/**
*/
private static final long serialVersionUID = -8447199076378835917L;
@Override
protected void onOk() {
if (QualifierPreferencesPanel.this.ok())
super.onOk();
}
};
dialog.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/com/ramussoft/gui/table/qualifier.png")));
dialog.setTitle(GlobalResourcesManager.getString("QialifierPreferenciesDialog.Title"));
dialog.setMainPane(this);
dialog.pack();
dialog.setLocationRelativeTo(null);
Options.loadOptions("QualifierPreferencesDialog", dialog);
dialog.getOKButton().setEnabled(rules.canUpdateQualifier(qualifier.getId()));
dialog.setVisible(true);
Options.saveOptions("QualifierPreferencesDialog", dialog);
attributeEditor.close();
}
use of com.ramussoft.gui.common.BaseDialog in project ramus by Vitaliy-Yakovchuk.
the class QualifierSelectComponent method showDialog.
public List<Qualifier> showDialog(JFrame frame, JPanel jPanel, Object constraints) {
final List<Qualifier> result = new ArrayList<Qualifier>();
BaseDialog dialog = new BaseDialog(frame, true) {
/**
*/
private static final long serialVersionUID = -2166014042175217388L;
@Override
protected void onOk() {
result.addAll(getSelected());
super.onOk();
}
};
dialog.setTitle(GlobalResourcesManager.getString("QualifierView"));
JPanel panel = new JPanel(new BorderLayout());
panel.add(this, BorderLayout.CENTER);
if (jPanel != null) {
panel.add(jPanel, constraints);
}
dialog.setMainPane(panel);
dialog.pack();
dialog.setLocationRelativeTo(frame);
dialog.setMinimumSize(dialog.getSize());
Options.loadOptions(dialog);
dialog.setVisible(true);
Options.saveOptions(dialog);
return result;
}
use of com.ramussoft.gui.common.BaseDialog in project ramus by Vitaliy-Yakovchuk.
the class IconPreviewPanel method select.
public IconPersistent select(JFrame frame) {
BaseDialog dialog = new BaseDialog(frame, true) {
/**
*/
private static final long serialVersionUID = 1L;
@Override
protected void onOk() {
super.onOk();
res = getSelectedValue();
}
};
dialog.setTitle(GlobalResourcesManager.getString("IconPreviewDialog.Title"));
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setMainPane(this);
dialog.pack();
dialog.setLocationRelativeTo(null);
Options.loadOptions(dialog);
dialog.setVisible(true);
Options.saveOptions(dialog);
return res;
}
use of com.ramussoft.gui.common.BaseDialog in project ramus by Vitaliy-Yakovchuk.
the class ClientPlugin method getActionDescriptors.
@Override
public ActionDescriptor[] getActionDescriptors() {
ActionDescriptor changePassword = new ActionDescriptor();
changePassword.setAction(new AbstractAction() {
/**
*/
private static final long serialVersionUID = 1388478861191637977L;
{
putValue(ACTION_COMMAND_KEY, "Action.ChangePassword");
}
public void actionPerformed(ActionEvent e) {
final JPasswordField oldPassword = new JPasswordField();
final JPasswordField newPassword = new JPasswordField();
final JPasswordField conformNewPassword = new JPasswordField();
double[][] size = { { 5, TableLayout.FILL, 5 }, { 5, TableLayout.FILL, 5, TableLayout.FILL, 5, TableLayout.FILL, 5, TableLayout.FILL, 5, TableLayout.FILL, 5, TableLayout.FILL, 5 } };
final JPanel panel = new JPanel(new TableLayout(size));
panel.add(new JLabel(getString("Message.OldPassword")), "1,1");
panel.add(oldPassword, "1,3");
panel.add(new JLabel(getString("Message.NewPassword")), "1,5");
panel.add(newPassword, "1,7");
panel.add(new JLabel(getString("Message.ConformNewPassword")), "1,9");
panel.add(conformNewPassword, "1,11");
BaseDialog dialog = new BaseDialog(framework.getMainFrame(), true) {
{
setTitle(getString("ChangePasswordDialog.Title"));
setMainPane(panel);
}
/**
*/
private static final long serialVersionUID = 1L;
@Override
protected void onOk() {
if (!Arrays.equals(newPassword.getPassword(), conformNewPassword.getPassword())) {
JOptionPane.showMessageDialog(framework.getMainFrame(), getString("Message.ConforPasswordsFailded"));
return;
}
User user = provider.me();
if (Arrays.equals(user.getPassword().toCharArray(), oldPassword.getPassword())) {
provider.changePassword(new String(newPassword.getPassword()));
super.onOk();
} else {
JOptionPane.showMessageDialog(framework.getMainFrame(), getString("Message.OldPasswordWrong"));
}
}
};
dialog.pack();
dialog.setResizable(false);
dialog.setLocationRelativeTo(null);
dialog.setVisible(true);
}
});
changePassword.setMenu("Net");
ActionDescriptor refresh = new ActionDescriptor();
refreshAction.putValue(Action.ACTION_COMMAND_KEY, "Refresh");
refreshAction.putValue(Action.SMALL_ICON, getIcon("/com/ramussoft/gui/refresh.png"));
// refreshAction.putValue(Action.LARGE_ICON_KEY,
// getIcon("/com/ramussoft/gui/22x22/refresh.png"));
refresh.setAction(refreshAction);
refresh.setMenu("Edit");
refresh.setToolBar("Edit");
if (refreshSupport)
return new ActionDescriptor[] { changePassword, refresh };
else
return new ActionDescriptor[] { changePassword };
}
use of com.ramussoft.gui.common.BaseDialog in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method showDialog.
public boolean showDialog() {
res = false;
BaseDialog dialog = new BaseDialog(framework.getMainFrame(), true) {
/**
*/
private static final long serialVersionUID = 8037833645038528124L;
@Override
protected void onOk() {
if (qualifierSelectPanel != null)
saveSelectedElements();
close();
res = true;
super.onOk();
}
};
dialog.setMainPane(this);
dialog.pack();
dialog.setLocationRelativeTo(null);
Options.loadOptions(dialog);
dialog.setVisible(true);
return res;
}
Aggregations