Community Forums
Page 5 of 8 FirstFirst ... 34567 ... LastLast
Results 21 to 25 of 39

Thread: How to disable the Cancel button

  1. #21
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    Try the following:
    Quote Originally Posted by ckanywhere529 View Post

    public class b extends CustomCodeAction {

    public disableCancelDuringInstallAction () {
    }

    @Override
    public void install(InstallerProxy ip) throws InstallException {

    try {
    a.gui.setExitButtonEnabled(false);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    @Override
    public void uninstall(UninstallerProxy up) throws InstallException {
    throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getInstallStatusMessage() {
    throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getUninstallStatusMessage() {
    throw new UnsupportedOperationException("Not supported yet.");
    }

    }

  2. #22
    Join Date
    Jul 2007
    Posts
    55

    Talking Thanks, I've tried this and got...

    Quote Originally Posted by Yves Kreis View Post
    Try the following:
    Thanks for the quick reply Yves. I got it running.
    I was being a moron and expecting GUIAccess gui to
    be initialized in a (using a same named LOCAL variable named gui lol)

    One thing I noticed is the X box is still active, but the CANCEL button is inactive.

    Any clue if this is something editable (from the looks of it, it doesn't look like part of the open IA api.)

    Also, the panel (Pre-installation summary) now reads "Next" instead of "Install" because of the custom panel used to do this.

    If the last panel returns false on setupUI, you'd think IA would catch this and display "install" on the second to last panel....

    A workaround is to put the disableCancelButtonPanel before Pre-installation summary.

    ~Chris.
    Last edited by ckanywhere529; 02-05-2008 at 04:25 PM. Reason: Fixed it.

  3. #23
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    Dear ckanywhere529,

    The X box cannot be disabled as far as I know. If you find something I would be pleased to know! However it should not work...

    You can try to put the CustomCodePanel earlier in the pre-install tasks. This might solve the Next <-> Install problem. You can also try to return true.

    Best Regards,
    Yves

  4. #24
    Join Date
    Aug 2007
    Posts
    42
    Hi all,
    i followed Yves advice but it doesn't work

    I have these classes:

    Code:
    public class MyPanel extends CustomCodePanel {
    
    	CustomCodePanelProxy panelProxy = null;
    	public static GUIAccess gui = null;
    
    	public A() {
    	}
    
    	public boolean setupUI(CustomCodePanelProxy customCodePanelProxy) {
    		panelProxy = customCodePanelProxy;
    		GUIAccess gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
    		return false;
    	}
    
    	@Override
    	public void panelIsDisplayed() {
    
    	}
    
    	@Override
    	public String getTitle() {
    		return "Installing...";
    	}
    
    	@Override
    	public boolean okToContinue() {
    		return true;
    	}
    
    	@Override
    	public boolean okToGoPrevious() {
    		return false;
    	}
    }
    and

    Code:
    public class DisableCancelDuringInstallAction extends CustomCodeAction {
    
    	/**
    	 * 
    	 */
    	public DisableCancelDuringInstallAction() {
    		// TODO Auto-generated constructor stub
    	}
    
    	/* (non-Javadoc)
    	 * @see com.zerog.ia.api.pub.CustomCodeAction#getInstallStatusMessage()
    	 */
    	@Override
    	public String getInstallStatusMessage() {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	/* (non-Javadoc)
    	 * @see com.zerog.ia.api.pub.CustomCodeAction#getUninstallStatusMessage()
    	 */
    	@Override
    	public String getUninstallStatusMessage() {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	/* (non-Javadoc)
    	 * @see com.zerog.ia.api.pub.CustomCodeAction#install(com.zerog.ia.api.pub.InstallerProxy)
    	 */
    	@Override
    	public void install(InstallerProxy arg0) throws InstallException {
    		try {
    			MyPanel.gui.setExitButtonEnabled(false);
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    
    
    	}
    
    	/* (non-Javadoc)
    	 * @see com.zerog.ia.api.pub.CustomCodeAction#uninstall(com.zerog.ia.api.pub.UninstallerProxy)
    	 */
    	@Override
    	public void uninstall(UninstallerProxy arg0) throws InstallException {
    		// TODO Auto-generated method stub
    
    	}
    
    }
    I put MyPanel just before Pre-Installation Summary and DisableCancelDuringInstallAction as first action in Install section... can you help me?

    Thanks

  5. #25
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    In class A, method setupUI you create a second variable gui, i.e. you don't assign the result to the static one!

    Best Regards,
    Yves

Page 5 of 8 FirstFirst ... 34567 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •