Search in sources :

Example 1 with ChangePasswordDialog

use of com.cubrid.cubridmanager.ui.host.dialog.ChangePasswordDialog in project cubrid-manager by CUBRID.

the class ChangeManagerPasswordAction method run.

/**
	 * Open change password dialog and change CUBRID Manager user password
	 */
public void run() {
    final Object[] obj = this.getSelectedObj();
    if (!isSupported(obj[0])) {
        return;
    }
    ICubridNode node = (ICubridNode) obj[0];
    CubridServer server = node.getServer();
    ChangePasswordDialog changePasswordDialog = new ChangePasswordDialog(getShell(), false);
    changePasswordDialog.setServerInfo(server.getServerInfo());
    ISelectionProvider provider = this.getSelectionProvider();
    if (IDialogConstants.OK_ID == changePasswordDialog.open() && provider instanceof TreeViewer) {
        TreeViewer viewer = (TreeViewer) provider;
        boolean isContinue = HostUtils.processHostDisconnected(server);
        if (isContinue) {
            viewer.refresh(server, true);
            ActionManager.getInstance().fireSelectionChanged(getSelection());
            CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent(server, CubridNodeChangedEventType.SERVER_DISCONNECTED));
        }
    }
}
Also used : ISelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ChangePasswordDialog(com.cubrid.cubridmanager.ui.host.dialog.ChangePasswordDialog) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent) CubridServer(com.cubrid.common.ui.spi.model.CubridServer)

Aggregations

CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)1 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)1 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)1 ChangePasswordDialog (com.cubrid.cubridmanager.ui.host.dialog.ChangePasswordDialog)1 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1