mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[fix] SystemConnectionForm not verified
This commit is contained in:
parent
21b5047b8c
commit
b0b2620fe7
2 changed files with 158 additions and 181 deletions
|
@ -121,7 +121,6 @@ public class SystemConnectionForm
|
||||||
protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog, callerInstanceOfPropertyPage;
|
protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog, callerInstanceOfPropertyPage;
|
||||||
protected boolean userIdFromSystemTypeDefault;
|
protected boolean userIdFromSystemTypeDefault;
|
||||||
protected boolean updateMode = false;
|
protected boolean updateMode = false;
|
||||||
protected boolean initDone = false;
|
|
||||||
protected boolean contentsCreated = false;
|
protected boolean contentsCreated = false;
|
||||||
protected boolean connectionNameEmpty = false;
|
protected boolean connectionNameEmpty = false;
|
||||||
protected boolean connectionNameListen = true;
|
protected boolean connectionNameListen = true;
|
||||||
|
@ -609,8 +608,7 @@ public class SystemConnectionForm
|
||||||
* @param parent The parent composite
|
* @param parent The parent composite
|
||||||
* @param updateMode true if we are in update mode versus create mode.
|
* @param updateMode true if we are in update mode versus create mode.
|
||||||
*/
|
*/
|
||||||
public Control createContents(Composite parent, boolean updateMode, String parentHelpId)
|
public Control createContents(Composite parent, boolean updateMode, String parentHelpId) {
|
||||||
{
|
|
||||||
contentsCreated = true;
|
contentsCreated = true;
|
||||||
Label labelSystemType = null;
|
Label labelSystemType = null;
|
||||||
String temp = null;
|
String temp = null;
|
||||||
|
@ -621,189 +619,168 @@ public class SystemConnectionForm
|
||||||
SystemWidgetHelpers.setCompositeHelp(composite_prompts, parentHelpId);
|
SystemWidgetHelpers.setCompositeHelp(composite_prompts, parentHelpId);
|
||||||
|
|
||||||
// Type display
|
// Type display
|
||||||
if (updateMode)
|
if (updateMode) {
|
||||||
{
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_TYPE_LABEL);
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_TYPE_LABEL);
|
labelType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelTypeValue = SystemWidgetHelpers.createLabel(composite_prompts, SystemResources.RESID_CONNECTION_TYPE_VALUE);
|
||||||
labelTypeValue = SystemWidgetHelpers.createLabel(
|
|
||||||
composite_prompts, SystemResources.RESID_CONNECTION_TYPE_VALUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PROFILE SELECTION
|
// PROFILE SELECTION
|
||||||
if (updateMode)
|
if (updateMode) {
|
||||||
{
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
|
labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
|
||||||
labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
|
labelProfileValue = SystemWidgetHelpers.createLabel(composite_prompts, ""); //$NON-NLS-1$
|
||||||
labelProfileValue = SystemWidgetHelpers.createLabel(composite_prompts, ""); //$NON-NLS-1$
|
labelProfileValue.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
|
||||||
labelProfileValue.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
|
} else // if (!updateMode)
|
||||||
}
|
{
|
||||||
else //if (!updateMode)
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
|
||||||
{
|
labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
|
labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_TIP);
|
||||||
labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
if (!updateMode) {
|
||||||
labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_TIP);
|
profileCombo = SystemWidgetHelpers.createReadonlyCombo(composite_prompts, null, SystemResources.RESID_CONNECTION_PROFILE_TIP);
|
||||||
if (!updateMode)
|
SystemWidgetHelpers.setHelp(profileCombo, RSEUIPlugin.HELPPREFIX + "ccon0001"); //$NON-NLS-1$
|
||||||
{
|
}
|
||||||
profileCombo = SystemWidgetHelpers.createReadonlyCombo(
|
}
|
||||||
composite_prompts,null,SystemResources.RESID_CONNECTION_PROFILE_TIP);
|
|
||||||
if (defaultProfileNames != null) profileCombo.setItems(defaultProfileNames);
|
if (!updateMode)
|
||||||
if (defaultProfile != null) setProfileNamePreSelection(defaultProfile);
|
SystemWidgetHelpers.createLabel(composite_prompts, " ", 2); // filler //$NON-NLS-1$
|
||||||
SystemWidgetHelpers.setHelp(profileCombo, RSEUIPlugin.HELPPREFIX + "ccon0001"); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!updateMode)
|
|
||||||
SystemWidgetHelpers.createLabel(composite_prompts, " ", 2); // filler //$NON-NLS-1$
|
|
||||||
|
|
||||||
// SYSTEMTYPE PROMPT IN UPDATE MODE OR RESTRICTED MODE
|
// SYSTEMTYPE PROMPT IN UPDATE MODE OR RESTRICTED MODE
|
||||||
if (updateMode || ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length==1)) )
|
if (updateMode || ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length == 1))) {
|
||||||
{
|
if (updateMode) {
|
||||||
if (updateMode)
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
|
||||||
{
|
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
|
labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
|
||||||
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
textSystemTypeReadOnly = SystemWidgetHelpers.createLabel(composite_prompts, ""); //$NON-NLS-1$
|
||||||
labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
|
textSystemTypeReadOnly.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
|
||||||
textSystemTypeReadOnly = SystemWidgetHelpers.createLabel(composite_prompts,""); //$NON-NLS-1$
|
} else
|
||||||
textSystemTypeReadOnly.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
|
singleTypeMode = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
singleTypeMode = true;
|
if (updateMode)
|
||||||
}
|
SystemWidgetHelpers.createLabel(composite_prompts, " ", nbrColumns); // filler //$NON-NLS-1$
|
||||||
|
|
||||||
if (updateMode)
|
|
||||||
SystemWidgetHelpers.createLabel(composite_prompts, " ", nbrColumns); // filler //$NON-NLS-1$
|
|
||||||
|
|
||||||
// CONNECTION NAME PROMPT
|
// CONNECTION NAME PROMPT
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_CONNECTIONNAME_LABEL);
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_CONNECTIONNAME_LABEL);
|
||||||
labelConnectionName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelConnectionName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelConnectionName.setToolTipText(SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
|
labelConnectionName.setToolTipText(SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
|
||||||
textConnectionName = SystemWidgetHelpers.createTextField(
|
textConnectionName = SystemWidgetHelpers.createTextField(composite_prompts, null, SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
|
||||||
composite_prompts,null,SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
|
SystemWidgetHelpers.setHelp(textConnectionName, RSEUIPlugin.HELPPREFIX + "ccon0002"); //$NON-NLS-1$
|
||||||
SystemWidgetHelpers.setHelp(textConnectionName, RSEUIPlugin.HELPPREFIX + "ccon0002"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
// SYSTEMTYPE PROMPT IN CREATE MODE
|
// SYSTEMTYPE PROMPT IN CREATE MODE
|
||||||
//if (!updateMode)
|
// if (!updateMode)
|
||||||
if ((labelSystemType == null) && !singleTypeMode)
|
if ((labelSystemType == null) && !singleTypeMode) {
|
||||||
{
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
|
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
||||||
labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
textSystemType = SystemWidgetHelpers.createSystemTypeCombo(composite_prompts, null, restrictSystemTypesTo);
|
||||||
textSystemType = SystemWidgetHelpers.createSystemTypeCombo(composite_prompts,null,restrictSystemTypesTo);
|
textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
||||||
textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$
|
||||||
SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// HOSTNAME PROMPT
|
// HOSTNAME PROMPT
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_HOSTNAME_LABEL);
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_HOSTNAME_LABEL);
|
||||||
labelHostName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelHostName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
|
labelHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
|
||||||
|
|
||||||
if (!updateMode && (defaultSystemType==null))
|
if (!updateMode && (defaultSystemType == null)) {
|
||||||
{
|
defaultSystemType = RSEPreferencesManager.getSystemType();
|
||||||
defaultSystemType = RSEPreferencesManager.getSystemType();
|
if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
|
||||||
if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
|
defaultSystemType = lastSystemType;
|
||||||
defaultSystemType = lastSystemType;
|
if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
|
||||||
if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
|
defaultSystemType = textSystemType.getItem(0);
|
||||||
defaultSystemType = textSystemType.getItem(0);
|
}
|
||||||
}
|
|
||||||
|
textHostName = SystemWidgetHelpers.createHostNameCombo(composite_prompts, null, defaultSystemType);
|
||||||
textHostName = SystemWidgetHelpers.createHostNameCombo(composite_prompts,null,defaultSystemType);
|
textHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
|
||||||
textHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
|
SystemWidgetHelpers.setHelp(textHostName, RSEUIPlugin.HELPPREFIX + "ccon0004"); //$NON-NLS-1$
|
||||||
SystemWidgetHelpers.setHelp(textHostName, RSEUIPlugin.HELPPREFIX + "ccon0004"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
// USERID PROMPT
|
// USERID PROMPT
|
||||||
/* We are testing the usability of not prompting for the user ID, so that the
|
/*
|
||||||
* user has less to think about when creating a new connection. Phil.
|
* We are testing the usability of not prompting for the user ID, so that the user has less to think about when
|
||||||
|
* creating a new connection. Phil.
|
||||||
*/
|
*/
|
||||||
if (updateMode) // added for this experiment
|
if (updateMode) // added for this experiment
|
||||||
{
|
{
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DEFAULTUSERID_LABEL);
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DEFAULTUSERID_LABEL);
|
||||||
labelUserId = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelUserId = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelUserId.setToolTipText(SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
|
labelUserId.setToolTipText(SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
|
||||||
textUserId = SystemWidgetHelpers.createInheritableTextField(
|
textUserId = SystemWidgetHelpers.createInheritableTextField(composite_prompts, SystemResources.RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP,
|
||||||
composite_prompts,SystemResources.RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP,SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
|
SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
|
||||||
SystemWidgetHelpers.setHelp(textUserId, RSEUIPlugin.HELPPREFIX + "ccon0005"); //$NON-NLS-1$
|
SystemWidgetHelpers.setHelp(textUserId, RSEUIPlugin.HELPPREFIX + "ccon0005"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
// DESCRIPTION PROMPT
|
// DESCRIPTION PROMPT
|
||||||
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DESCRIPTION_LABEL);
|
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DESCRIPTION_LABEL);
|
||||||
labelDescription = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
labelDescription = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||||
labelDescription.setToolTipText(SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
|
labelDescription.setToolTipText(SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
|
||||||
textDescription = SystemWidgetHelpers.createTextField(
|
textDescription = SystemWidgetHelpers.createTextField(composite_prompts, null, SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
|
||||||
composite_prompts,null,SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
|
SystemWidgetHelpers.setHelp(textDescription, RSEUIPlugin.HELPPREFIX + "ccon0006"); //$NON-NLS-1$
|
||||||
SystemWidgetHelpers.setHelp(textDescription, RSEUIPlugin.HELPPREFIX + "ccon0006"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
// VERIFY HOST NAME CHECKBOX
|
// VERIFY HOST NAME CHECKBOX
|
||||||
SystemWidgetHelpers.createLabel(composite_prompts, " ", nbrColumns); // filler //$NON-NLS-1$
|
SystemWidgetHelpers.createLabel(composite_prompts, " ", nbrColumns); // filler //$NON-NLS-1$
|
||||||
verifyHostNameCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, null, SystemResources.RESID_CONNECTION_VERIFYHOSTNAME_LABEL, SystemResources.RESID_CONNECTION_VERIFYHOSTNAME_TOOLTIP);
|
verifyHostNameCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, null, SystemResources.RESID_CONNECTION_VERIFYHOSTNAME_LABEL,
|
||||||
if (updateMode)
|
SystemResources.RESID_CONNECTION_VERIFYHOSTNAME_TOOLTIP);
|
||||||
verifyHostNameCB.setSelection(false);
|
if (updateMode)
|
||||||
else
|
verifyHostNameCB.setSelection(false);
|
||||||
verifyHostNameCB.setSelection(SystemPreferencesManager.getVerifyConnection());
|
else
|
||||||
|
verifyHostNameCB.setSelection(SystemPreferencesManager.getVerifyConnection());
|
||||||
// yantzi: artemis 6.0, work offline
|
|
||||||
if (enableOfflineCB())
|
|
||||||
{
|
|
||||||
workOfflineCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, null, SystemResources.RESID_OFFLINE_WORKOFFLINE_LABEL, SystemResources.RESID_OFFLINE_WORKOFFLINE_TOOLTIP);
|
|
||||||
SystemWidgetHelpers.setHelp(workOfflineCB, RSEUIPlugin.HELPPREFIX + "wofp0000"); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!initDone)
|
// yantzi: artemis 6.0, work offline
|
||||||
doInitializeFields();
|
if (enableOfflineCB()) {
|
||||||
|
workOfflineCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, null, SystemResources.RESID_OFFLINE_WORKOFFLINE_LABEL,
|
||||||
connectionNameEmpty = (textConnectionName.getText().trim().length() == 0); // d43191
|
SystemResources.RESID_OFFLINE_WORKOFFLINE_TOOLTIP);
|
||||||
|
SystemWidgetHelpers.setHelp(workOfflineCB, RSEUIPlugin.HELPPREFIX + "wofp0000"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
connectionNameEmpty = (textConnectionName.getText().trim().length() == 0); // d43191
|
||||||
|
|
||||||
textConnectionName.setFocus();
|
textConnectionName.setFocus();
|
||||||
|
|
||||||
|
|
||||||
// add keystroke listeners...
|
// add keystroke listeners...
|
||||||
textConnectionName.addModifyListener(
|
textConnectionName.addModifyListener(new ModifyListener() {
|
||||||
new ModifyListener() {
|
public void modifyText(ModifyEvent e) {
|
||||||
public void modifyText(ModifyEvent e) {
|
validateConnectionNameInput(true);
|
||||||
validateConnectionNameInput(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
textHostName.addModifyListener(
|
textHostName.addModifyListener(new ModifyListener() {
|
||||||
new ModifyListener() {
|
public void modifyText(ModifyEvent e) {
|
||||||
public void modifyText(ModifyEvent e) {
|
validateHostNameInput();
|
||||||
validateHostNameInput();
|
validateConnectionNameInput(false);
|
||||||
validateConnectionNameInput(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
if (textUserId!=null)
|
if (textUserId != null)
|
||||||
textUserId.addModifyListener(
|
textUserId.addModifyListener(new ModifyListener() {
|
||||||
new ModifyListener()
|
public void modifyText(ModifyEvent e) {
|
||||||
{
|
|
||||||
public void modifyText(ModifyEvent e)
|
|
||||||
{
|
|
||||||
validateUserIdInput();
|
validateUserIdInput();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (profileCombo != null) {
|
|
||||||
profileCombo.addSelectionListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (textSystemType != null) {
|
|
||||||
originalHostName = textHostName.getText();
|
|
||||||
textSystemType.addSelectionListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verifyHostNameCB != null) {
|
|
||||||
verifyHostNameCB.addSelectionListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((textSystemType!=null) && (textSystemType.getText()!=null))
|
if (profileCombo != null) {
|
||||||
caller.systemTypeSelected(textSystemType.getText(), true);
|
profileCombo.addSelectionListener(this);
|
||||||
else if ((restrictSystemTypesTo!=null) && (restrictSystemTypesTo.length==1))
|
}
|
||||||
caller.systemTypeSelected(restrictSystemTypesTo[0], true);
|
|
||||||
|
if (textSystemType != null) {
|
||||||
if (textUserId == null)
|
originalHostName = textHostName.getText();
|
||||||
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET;
|
textSystemType.addSelectionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (verifyHostNameCB != null) {
|
||||||
|
verifyHostNameCB.addSelectionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((textSystemType != null) && (textSystemType.getText() != null))
|
||||||
|
caller.systemTypeSelected(textSystemType.getText(), true);
|
||||||
|
else if ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length == 1))
|
||||||
|
caller.systemTypeSelected(restrictSystemTypesTo[0], true);
|
||||||
|
|
||||||
|
if (textUserId == null)
|
||||||
|
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET;
|
||||||
|
|
||||||
|
doInitializeFields();
|
||||||
|
|
||||||
return composite_prompts; // composite;
|
return composite_prompts; // composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1050,7 +1027,7 @@ public class SystemConnectionForm
|
||||||
workOfflineCB.setSelection(defaultWorkOffline);
|
workOfflineCB.setSelection(defaultWorkOffline);
|
||||||
}
|
}
|
||||||
|
|
||||||
initDone = true;
|
verify(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,9 +42,9 @@ import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardPage implements ISystemConnectionFormCaller {
|
public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardPage implements ISystemConnectionFormCaller {
|
||||||
|
|
||||||
protected String[] restrictSystemTypesTo;
|
private String[] restrictSystemTypesTo;
|
||||||
protected final SystemConnectionForm form;
|
private SystemConnectionForm form;
|
||||||
protected String parentHelpId;
|
private String parentHelpId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Use this when you want to supply your own title and
|
* Constructor. Use this when you want to supply your own title and
|
||||||
|
@ -55,7 +55,6 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
|
|
||||||
parentHelpId = RSEUIPlugin.HELPPREFIX + "wncc0000"; //$NON-NLS-1$
|
parentHelpId = RSEUIPlugin.HELPPREFIX + "wncc0000"; //$NON-NLS-1$
|
||||||
setHelp(parentHelpId);
|
setHelp(parentHelpId);
|
||||||
form = new SystemConnectionForm(this, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +65,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
public void restrictSystemType(String systemType) {
|
public void restrictSystemType(String systemType) {
|
||||||
assert systemType != null;
|
assert systemType != null;
|
||||||
restrictSystemTypesTo = new String[] { systemType };
|
restrictSystemTypesTo = new String[] { systemType };
|
||||||
form.restrictSystemTypes(restrictSystemTypesTo);
|
getForm().restrictSystemTypes(restrictSystemTypesTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,6 +75,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* @see org.eclipse.rse.ui.SystemConnectionForm
|
* @see org.eclipse.rse.ui.SystemConnectionForm
|
||||||
*/
|
*/
|
||||||
public SystemConnectionForm getForm() {
|
public SystemConnectionForm getForm() {
|
||||||
|
if (form == null) form = new SystemConnectionForm(this, this);
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,21 +83,21 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this to specify a validator for the connection name. It will be called per keystroke.
|
* Call this to specify a validator for the connection name. It will be called per keystroke.
|
||||||
*/
|
*/
|
||||||
public void setConnectionNameValidators(ISystemValidator[] v) {
|
public void setConnectionNameValidators(ISystemValidator[] v) {
|
||||||
form.setConnectionNameValidators(v);
|
getForm().setConnectionNameValidators(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call this to specify a validator for the hostname. It will be called per keystroke.
|
* Call this to specify a validator for the hostname. It will be called per keystroke.
|
||||||
*/
|
*/
|
||||||
public void setHostNameValidator(ISystemValidator v) {
|
public void setHostNameValidator(ISystemValidator v) {
|
||||||
form.setHostNameValidator(v);
|
getForm().setHostNameValidator(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call this to specify a validator for the userId. It will be called per keystroke.
|
* Call this to specify a validator for the userId. It will be called per keystroke.
|
||||||
*/
|
*/
|
||||||
public void setUserIdValidator(ISystemValidator v) {
|
public void setUserIdValidator(ISystemValidator v) {
|
||||||
form.setUserIdValidator(v);
|
getForm().setUserIdValidator(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,42 +106,42 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* it and set it here by calling this.
|
* it and set it here by calling this.
|
||||||
*/
|
*/
|
||||||
public void setUserId(String userId) {
|
public void setUserId(String userId) {
|
||||||
form.setUserId(userId);
|
getForm().setUserId(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the profile names to show in the combo
|
* Set the profile names to show in the combo
|
||||||
*/
|
*/
|
||||||
public void setProfileNames(String[] names) {
|
public void setProfileNames(String[] names) {
|
||||||
form.setProfileNames(names);
|
getForm().setProfileNames(names);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the profile name to preselect
|
* Set the profile name to preselect
|
||||||
*/
|
*/
|
||||||
public void setProfileNamePreSelection(String name) {
|
public void setProfileNamePreSelection(String name) {
|
||||||
form.setProfileNamePreSelection(name);
|
getForm().setProfileNamePreSelection(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the currently selected connection so as to better initialize input fields
|
* Set the currently selected connection so as to better initialize input fields
|
||||||
*/
|
*/
|
||||||
public void setCurrentlySelectedConnection(IHost connection) {
|
public void setCurrentlySelectedConnection(IHost connection) {
|
||||||
form.setCurrentlySelectedConnection(connection);
|
getForm().setCurrentlySelectedConnection(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preset the connection name
|
* Preset the connection name
|
||||||
*/
|
*/
|
||||||
public void setConnectionName(String name) {
|
public void setConnectionName(String name) {
|
||||||
form.setConnectionName(name);
|
getForm().setConnectionName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preset the host name
|
* Preset the host name
|
||||||
*/
|
*/
|
||||||
public void setHostName(String name) {
|
public void setHostName(String name) {
|
||||||
form.setHostName(name);
|
getForm().setHostName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,7 +150,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* to the caller (JFace). This is used as the contents of this page.
|
* to the caller (JFace). This is used as the contents of this page.
|
||||||
*/
|
*/
|
||||||
public Control createContents(Composite parent) {
|
public Control createContents(Composite parent) {
|
||||||
return form.createContents(parent, SystemConnectionForm.CREATE_MODE, parentHelpId);
|
return getForm().createContents(parent, SystemConnectionForm.CREATE_MODE, parentHelpId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -158,7 +158,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Override from parent. Return control to be given initial focus.
|
* Override from parent. Return control to be given initial focus.
|
||||||
*/
|
*/
|
||||||
protected Control getInitialFocusControl() {
|
protected Control getInitialFocusControl() {
|
||||||
return form.getInitialFocusControl();
|
return getForm().getInitialFocusControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,7 +170,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* @return whether the wizard finished successfully
|
* @return whether the wizard finished successfully
|
||||||
*/
|
*/
|
||||||
public boolean performFinish() {
|
public boolean performFinish() {
|
||||||
return form.verify(true);
|
return getForm().verify(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------- //
|
// --------------------------------- //
|
||||||
|
@ -182,7 +182,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this after finish ends successfully.
|
* Call this after finish ends successfully.
|
||||||
*/
|
*/
|
||||||
public String getConnectionName() {
|
public String getConnectionName() {
|
||||||
return form.getConnectionName();
|
return getForm().getConnectionName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,7 +190,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this after finish ends successfully.
|
* Call this after finish ends successfully.
|
||||||
*/
|
*/
|
||||||
public String getHostName() {
|
public String getHostName() {
|
||||||
return form.getHostName();
|
return getForm().getHostName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +198,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this after finish ends successfully.
|
* Call this after finish ends successfully.
|
||||||
*/
|
*/
|
||||||
public String getDefaultUserId() {
|
public String getDefaultUserId() {
|
||||||
return form.getDefaultUserId();
|
return getForm().getDefaultUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,7 +206,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* @see org.eclipse.rse.core.IRSEUserIdConstants
|
* @see org.eclipse.rse.core.IRSEUserIdConstants
|
||||||
*/
|
*/
|
||||||
public int getDefaultUserIdLocation() {
|
public int getDefaultUserIdLocation() {
|
||||||
return form.getUserIdLocation();
|
return getForm().getUserIdLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,7 +214,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this after finish ends successfully.
|
* Call this after finish ends successfully.
|
||||||
*/
|
*/
|
||||||
public String getConnectionDescription() {
|
public String getConnectionDescription() {
|
||||||
return form.getConnectionDescription();
|
return getForm().getConnectionDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -222,7 +222,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
* Call this after finish ends successfully.
|
* Call this after finish ends successfully.
|
||||||
*/
|
*/
|
||||||
public String getProfileName() {
|
public String getProfileName() {
|
||||||
return form.getProfileName();
|
return getForm().getProfileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,8 +232,8 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
*/
|
*/
|
||||||
public boolean isPageComplete() {
|
public boolean isPageComplete() {
|
||||||
//System.out.println("Inside isPageComplete. " + form.isPageComplete());
|
//System.out.println("Inside isPageComplete. " + form.isPageComplete());
|
||||||
if (form != null)
|
if (getForm() != null)
|
||||||
return form.isPageComplete() && form.isConnectionUnique();
|
return getForm().isPageComplete() && getForm().isConnectionUnique();
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
// verify contents of page before going to main page
|
// verify contents of page before going to main page
|
||||||
// this is done because the main page may have input that is not valid, but can
|
// this is done because the main page may have input that is not valid, but can
|
||||||
// only be verified when next is pressed since it requires a long running operation
|
// only be verified when next is pressed since it requires a long running operation
|
||||||
boolean verify = form.verify(true);
|
boolean verify = getForm().verify(true);
|
||||||
|
|
||||||
if (!verify) {
|
if (!verify) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -271,7 +271,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends AbstractSystemWizardP
|
||||||
|
|
||||||
RSEDefaultNewConnectionWizard newConnWizard = getWizard() instanceof RSEDefaultNewConnectionWizard ? (RSEDefaultNewConnectionWizard)getWizard() : null;
|
RSEDefaultNewConnectionWizard newConnWizard = getWizard() instanceof RSEDefaultNewConnectionWizard ? (RSEDefaultNewConnectionWizard)getWizard() : null;
|
||||||
if (newConnWizard != null) {
|
if (newConnWizard != null) {
|
||||||
return (isPageComplete() && newConnWizard.hasAdditionalPages() && form.isConnectionUnique());
|
return (isPageComplete() && newConnWizard.hasAdditionalPages() && getForm().isConnectionUnique());
|
||||||
} else
|
} else
|
||||||
return super.canFlipToNextPage();
|
return super.canFlipToNextPage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue