cancel
Showing results for 
Search instead for 
Did you mean: 
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

Try the following:
ckanywhere529 wrote:


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.");
}

}
0 Kudos

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

Yves Kreis wrote:
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.
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

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
0 Kudos
genleo
Pilgrim

Re: How to disable the Cancel button

Hi all,
i followed Yves advice but it doesn't work Smiley Sad Smiley Sad Smiley Sad

I have these classes:


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


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
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

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
0 Kudos
genleo
Pilgrim

Re: How to disable the Cancel button

Sorry,
I have no class A, constructor public A() {} is public MyPanel() {}.

It doesn't work yet.
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

Class MyPanel then instead of class A.
0 Kudos
genleo
Pilgrim

Re: How to disable the Cancel button

Yves Kreis wrote:
Class MyPanel then instead of class A.


I think I'm going crazy... could you post me some piece of code???

Thanks a lot
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button


(...)

public boolean setupUI(CustomCodePanelProxy customCodePanelProxy) {
gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
}
(...)


Best Regards,
Yves
0 Kudos
genleo
Pilgrim

Re: How to disable the Cancel button

Thank you Yves,
finally I understood what the problem was. Now it works.

Best Regards
0 Kudos