Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'rse/plugins/org.eclipse.rse.ui/UI/org')
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java5051
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/AbstractElement.java39
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.java75
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.properties58
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEAdapter.java39
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEUIRegistry.java20
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRemoteSelectionAddListener.java67
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemConnectionFormCaller.java38
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemContextMenuConstants.java296
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemDeleteTarget.java43
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemIconConstants.java401
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMassager.java38
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java460
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPageCompleteListener.java35
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPreferencesConstants.java101
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemRenameTarget.java41
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemStringsInputAction.java28
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemThemeConstants.java37
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemVerifyListener.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerAddQuotes.java86
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCase.java110
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseOutsideQuotes.java197
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseUnlessQuoted.java95
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerRemoveQuotes.java192
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/Mnemonics.java577
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEAdapter.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java261
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java1226
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemBaseForm.java303
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java1309
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemMenuManager.java359
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemProfileForm.java264
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.java51
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.properties34
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.java1248
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.properties1432
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemSortableSelection.java132
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemTabFolderLayout.java61
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemWidgetHelpers.java1467
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayDialogAction.java60
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayHidableSystemMessageAction.java47
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplaySystemMessageAction.java64
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemAction.java111
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemCopyTargetSelectionCallback.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDialogAction.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtension.java44
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtensionManager.java23
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemWizardAction.java25
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.java389
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseAction.java818
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseCopyAction.java435
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDialogAction.java360
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDummyAction.java29
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseSubMenuAction.java475
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseWizardAction.java280
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingBrowseWithAction.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingCompareWithAction.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingExpandToAction.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGoToAction.java81
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGotoActionOLD.java48
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingNewAction.java48
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingOpenWithAction.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPreferencesAction.java85
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPulldownMenuAction.java105
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServerBaseAction.java138
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServersAction.java96
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingReplaceWithAction.java49
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingViewAction.java47
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingWorkWithAction.java48
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearAllPasswordsAction.java115
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java83
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java83
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java69
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonDeleteAction.java205
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonRenameAction.java236
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonSelectAllAction.java72
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java73
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java108
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyConnectionAction.java247
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyToClipboardAction.java233
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java69
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAllSubSystemsAction.java72
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDynamicPopupMenuExtensionManager.java73
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java86
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveConnectionAction.java255
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveDownConnectionAction.java108
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveUpConnectionAction.java109
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java208
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java41
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewProfileAction.java112
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenExplorerPerspectiveAction.java129
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenRSEPerspectiveAction.java42
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPasteFromClipboardAction.java352
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceQualifyConnectionNamesAction.java73
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceRestoreStateAction.java70
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceShowFilterPoolsAction.java72
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameCopyAction.java219
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameSelectAction.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAction.java99
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAllAction.java103
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemotePropertiesAction.java162
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStartAction.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStopAction.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemResolveFilterStringAction.java76
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRunAction.java94
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSelectConnectionAction.java187
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSeparatorAction.java58
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInMonitorAction.java103
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInTableAction.java102
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowPreferencesPageAction.java214
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStartCommunicationsDaemonAction.java92
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStringPromptAction.java97
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManager.java403
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManagerForTesting.java180
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTablePrintAction.java523
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTeamReloadAction.java76
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTestFilterStringAction.java102
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemUpdateConnectionAction.java75
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToAllAction.java52
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToBaseAction.java98
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java129
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkWithProfilesAction.java55
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/TestPopupMenuAction1.java43
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/EnvironmentVariablesPromptDialog.java248
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISignonValidator.java48
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPasswordPromptDialog.java100
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPromptDialog.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemTypedObject.java42
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemChangePasswordDialog.java233
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemControlEnableState.java155
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemCopyProfileDialog.java284
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteDialog.java294
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableProvider.java172
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableRow.java202
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemFilterTableDialog.java417
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPersistencePrompt.java338
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java487
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java1849
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java269
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameDialog.java688
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameSingleDialog.java713
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableProvider.java215
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableRow.java213
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemResolveFilterStringDialog.java111
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectAnythingDialog.java91
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectConnectionDialog.java361
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectFileTypesDialog.java468
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentElement.java331
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentProvider.java163
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleCopyDialog.java275
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleSelectDialog.java489
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemTestFilterStringDialog.java211
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemUpdateConnectionDialog.java141
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java193
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWorkWithHistoryDialog.java345
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemChangeFilterPaneEditPaneSupplier.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemFilterStringEditPaneListener.java44
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemChangeFilterPane.java1437
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInputs.java31
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInterface.java35
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogOutputs.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInputs.java44
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInterface.java40
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogOutputs.java36
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolManagerUIProvider.java26
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java704
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterUIHelpers.java170
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterWorkWithFilterPoolsTreeViewer.java190
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/ISystemNewFilterActionConfigurator.java40
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterAction.java252
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionCopyString.java68
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionDeleteString.java69
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringDown.java68
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringUp.java68
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionPasteString.java67
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterAction.java232
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolAction.java494
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolWizardAction.java87
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterWizardAction.java85
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceAction.java135
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceFPMgrAction.java127
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterAction.java362
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterPoolAction.java323
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterStringAction.java494
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterAction.java153
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterPoolReferenceAction.java141
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterAction.java370
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterPoolAction.java369
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterStringAction.java485
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterAction.java157
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterPoolReferenceAction.java141
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterNewFilterPoolAction.java174
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterPoolReferenceSelectAction.java85
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterRemoveFilterPoolReferenceAction.java94
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterSelectFilterPoolsAction.java268
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsAction.java199
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsRefreshAllAction.java81
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemNewFilterAction.java492
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemFilterWizard.java26
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemNewFilterWizardConfigurator.java121
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemChangeFilterDialog.java365
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizard.java197
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardDefaultMainPage.java373
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardMainPageInterface.java71
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardDialog.java83
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardInterface.java27
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWizardDialog.java75
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWorkWithFilterPoolsDialog.java651
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizard.java664
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardConfigurator.java240
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardInfoPage.java114
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardMainPage.java258
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardNamePage.java481
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemUnNamedFilterDialog.java214
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSESystemTypeAdapterFactory.java42
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSEUIRegistry.java51
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLine.java94
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLineTarget.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/StatusLineManagerAdapter.java123
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemDialogPageMessageLine.java391
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java804
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageLine.java624
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageStatus.java153
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessage.java93
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessageFile.java86
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPage.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPageContainer.java46
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemOpenQuickOpenDialogAction.java126
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenDialog.java801
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenPageDescriptor.java186
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUI.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUtil.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/ISystemRunnableContext.java41
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java389
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemJobRunnableContext.java283
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemProgressDialogRunnableContext.java200
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemSchedulingRule.java46
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/AbstractSystemSubSystemPropertyPageCoreForm.java220
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardErrorUpdater.java28
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java32
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemSubSystemPropertyPageCoreForm.java48
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java699
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerConnectionSecurityPropertyPage.java126
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerLauncherPropertyPage.java184
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServicesPropertyPage.java137
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SignonPreferencePage.java399
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemAbstractPropertyPageExtensionAction.java249
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBasePropertyPage.java532
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBooleanFieldEditor.java133
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemChangeFilterPropertyPage.java313
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemComboBoxFieldEditor.java497
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemCommunicationsPreferencePage.java134
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java168
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionSubSystemsPropertyPage.java396
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectorServicesPropertyPage.java88
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolPropertyPage.java126
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolReferencePropertyPage.java117
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPropertyPage.java135
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterStringPropertyPage.java340
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemIntegerFieldEditor.java100
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemKeyValueFieldEditor.java640
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemLoggingPreferencePage.java35
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemPreferenceInitializer.java41
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemRemotePropertyPageNode.java89
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemStringFieldEditor.java371
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCore.java88
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java412
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewCategoryPropertyPage.java110
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewProfilePropertyPage.java114
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewSubSystemConfigurationPropertyPage.java143
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java545
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidator.java52
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidatorUniqueString.java45
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/IValidatorRemoteSelection.java40
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/SystemNumericVerifyListener.java74
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorArchiveName.java73
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java131
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java97
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFileName.java141
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java101
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java98
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterString.java155
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFolderName.java143
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerInput.java163
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerRangeInput.java115
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLocalPath.java95
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongInput.java162
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongRangeInput.java113
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPathName.java125
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPortInput.java79
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorProfileName.java89
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorRemoteSelection.java39
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorServerPortInput.java65
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSourceType.java110
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSpecialChar.java206
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSystemName.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUniqueString.java365
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java133
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserId.java51
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java106
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java120
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemRemoteAdapterFactory.java47
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemViewAdapter.java1808
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/IRSEViewPart.java24
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemDragDropAdapter.java114
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemEditableRemoteObject.java165
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemLongRunningRequestListener.java33
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemMementoConstants.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java107
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoteElementAdapter.java160
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoveElementAdapter.java42
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectAllTarget.java43
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectRemoteObjectAPIProviderCaller.java39
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemShellProvider.java27
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemTree.java119
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewActionFilter.java52
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewDropDestination.java34
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java346
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewInputProvider.java113
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewRunnableObject.java29
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java1475
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapterFactory.java59
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAbstractAPIProvider.java215
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemActionViewerFilter.java190
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxCellEditor.java226
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxPropertyDescriptor.java89
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java704
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDecoratingLabelProvider.java58
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDeferredTableTreeContentManager.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDropActionDelegate.java277
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemEmptyListAPIProviderImpl.java111
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritablePropertyData.java173
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextCellEditor.java517
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextPropertyDescriptor.java113
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemLongRunningRequestEvent.java34
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPerspectiveLayout.java90
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPropertySheetForm.java227
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResolveFilterStringAPIProviderImpl.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionForm.java616
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java126
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java633
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeView.java1901
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeViewProvider.java449
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableView.java1909
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewColumnManager.java146
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewFilter.java105
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewPart.java1838
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewProvider.java354
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewSorter.java184
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java175
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java5051
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForConnections.java106
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterPools.java128
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java201
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java258
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForSubSystems.java107
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAdapterFactory.java324
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewCompositeActionGroup.java104
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionAdapter.java656
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionSelectionInputProvider.java151
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDragAdapter.java342
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDropAdapter.java348
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDummyObject.java47
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java560
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolAdapter.java286
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolReferenceAdapter.java379
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java953
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterStringAdapter.java282
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewForm.java579
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java474
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMenuListener.java152
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMessageAdapter.java195
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewNewConnectionPromptAdapter.java38
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java1909
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartFrameSource.java55
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartGotoActionGroup.java106
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPromptableAdapter.java198
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.java243
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.properties206
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewRootInputAdapter.java226
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewScratchpadAdapter.java274
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java734
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/BrowseAction.java54
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearAction.java52
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearSelectedAction.java58
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewPage.java596
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewWorkbook.java277
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorUI.java78
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorViewPart.java1039
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/TabFolderLayout.java61
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/BrowseAction.java53
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearAction.java57
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearSelectedAction.java86
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadView.java1448
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewPart.java389
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewProvider.java243
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchClearHistoryAction.java52
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchCopyToClipboardAction.java56
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchHistoryAction.java63
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveAllMatchesAction.java53
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveSelectedMatchesAction.java53
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableView.java376
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableViewProvider.java45
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchUI.java73
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewContentProvider.java183
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewLabelProvider.java94
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewPart.java1281
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemResourceAdaptableProfile.java35
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamView.java267
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewActiveProfileAction.java88
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryAdapter.java272
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryNode.java152
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewContentProvider.java233
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewInputProvider.java169
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewLabelProvider.java212
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeActiveProfileAction.java91
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeInActiveProfileAction.java93
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewPart.java1540
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewProfileAdapter.java412
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewRefreshAllAction.java76
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewResourceAdapterFactory.java68
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationAdapter.java305
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationNode.java193
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/EnvironmentVariablesForm.java608
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/GridUtil.java68
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IInheritableEntryFieldStateChangeListener.java31
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IServerLauncherForm.java61
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemAddListener.java47
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCollapsableSectionListener.java31
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCombo.java96
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemEditPaneStates.java53
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritButton.java266
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControl.java216
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControlLayout.java44
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritableEntryField.java390
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteBaseServerLauncherForm.java114
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java630
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SSLForm.java117
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ServerConnectionSecurityForm.java94
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemCollapsableSection.java441
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemEditPaneStateMachine.java451
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHistoryCombo.java715
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java1121
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemPortPrompt.java398
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemSelectConnectionForm.java507
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServiceElement.java109
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServicesForm.java175
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/FactoryServiceElement.java138
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertyElement.java114
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertySetServiceElement.java218
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java149
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RootServiceElement.java106
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java79
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceElement.java103
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceServiceElement.java103
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableContentProvider.java65
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableLabelProvider.java91
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServicesForm.java310
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java154
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizard.java454
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizardPage.java518
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java50
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java51
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISubSystemPropertiesWizardPage.java24
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemNewConnectionWizardMainPage.java84
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizard.java105
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizardPage.java53
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java557
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizard.java283
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDefaultDelegateMainPage.java373
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDelegate.java106
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardMainPage.java166
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java249
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizard.java522
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardDefaultMainPage.java355
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java158
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizard.java103
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java205
-rw-r--r--rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java293
482 files changed, 0 insertions, 123271 deletions
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java
deleted file mode 100644
index 5e088faba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java
+++ /dev/null
@@ -1,5051 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berber (IBM) - Patch to remove non-standard expand/collapse from menu.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemElapsedTimer;
-import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterContainerReference;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemRemoteElementResourceSet;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCascadingGoToAction;
-import org.eclipse.rse.ui.actions.SystemCollapseAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemExpandAction;
-import org.eclipse.rse.ui.actions.SystemNewConnectionAction;
-import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
-import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
-import org.eclipse.rse.ui.actions.SystemShowInTableAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.TreeEvent;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.views.framelist.GoIntoAction;
-
-/**
- * This subclass of the standard JFace tree viewer is used to show a tree
- * view of connections to remote systems, which can be manipulated and expanded
- * to access remote objects in the remote system.
- */
-/*
- * At one time implemented the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
- */
-public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
- ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
-{
-
- protected Shell shell; // shell hosting this viewer
- protected ISystemViewInputProvider inputProvider; // who is supplying our tree root elements?
- protected ISystemViewInputProvider previousInputProvider; // who is supplying our tree root elements?
- protected Object previousInput;
- protected IHost previousInputConnection;
- // protected actions
- protected SystemNewConnectionAction newConnectionAction;
- protected SystemRefreshAction refreshAction;
- protected PropertyDialogAction propertyDialogAction;
- protected SystemRemotePropertiesAction remotePropertyDialogAction;
- protected SystemCollapseAction collapseAction; // defect 41203
- protected SystemExpandAction expandAction; // defect 41203
- protected SystemOpenExplorerPerspectiveAction openToPerspectiveAction;
-
- protected SystemShowInTableAction showInTableAction;
- protected SystemShowInMonitorAction showInMonitorAction;
- protected GoIntoAction goIntoAction;
- protected SystemCascadingGoToAction gotoActions;
- // global actions
- // Note the Edit menu actions are set in SystemViewPart. Here we use these
- // actions from our own popup menu actions.
- protected SystemCommonDeleteAction deleteAction; // for global delete menu item
- protected SystemCommonRenameAction renameAction; // for common rename menu item
- protected SystemCommonSelectAllAction selectAllAction; // for common Ctrl+A select-all
- // special flags needed when building popup menu, set after examining selections
- protected boolean selectionShowRefreshAction;
- protected boolean selectionShowOpenViewActions;
- protected boolean selectionShowGenericShowInTableAction;
- protected boolean selectionShowDeleteAction;
- protected boolean selectionShowRenameAction;
- protected boolean selectionEnableDeleteAction;
- protected boolean selectionEnableRenameAction;
- protected boolean selectionIsRemoteObject;
- protected boolean selectionHasAncestorRelation;
- protected boolean selectionFlagsUpdated = false;
- // misc
- protected MenuManager menuMgr;
- protected boolean showActions = true;
- protected boolean hardCodedConnectionSelected = false;
- protected boolean mixedSelection = false;
- protected boolean specialMode = false;
- protected boolean menuListenerAdded = false;
- protected boolean fromSystemViewPart = false;
- protected boolean areAnyRemote = false;
- protected boolean enabledMode = true;
- protected Widget previousItem = null;
- protected int searchDepth = 0;
- //protected Vector remoteItemsToSkip = null;
- protected Cursor busyCursor;
- protected TreeItem inputTreeItem = null;
- protected static final int SEARCH_INFINITE = 10; // that's far enough down to search!
- public boolean debug = false;
- public boolean debugRemote = false;
- public boolean debugProperties = debug && false;
- public boolean doTimings = false;
- public SystemElapsedTimer elapsedTime = new SystemElapsedTimer();
- // for support of Expand To actions ... transient filters really.
- // we need to record these per tree node they are applied to.
- protected Hashtable expandToFiltersByObject; // most efficient way to find these is by binary object
- protected Hashtable expandToFiltersByTreePath; // however, we lose that after a refresh so we also record by tree path
-
- // message line
- protected ISystemMessageLine messageLine = null;
- // button pressed
- protected static final int LEFT_BUTTON = 1;
- protected int mouseButtonPressed = LEFT_BUTTON; //d40615
- protected boolean expandingTreeOnly = false; //d40615
- protected ViewerFilter[] initViewerFilters = null;
-
- protected List _setList;
-
- /**
- * Constructor
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Composite parent, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(parent);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Constructor to use when you want to specify styles for the tree widget
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param style The style to give the tree widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(parent, style);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Constructor to use when you want to specify styles for the tree widget
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param style The style to give the tree widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- * @param initViewerFilters the initial viewer filters to apply.
- */
- public SystemView(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine, ViewerFilter[] initViewerFilters) {
- super(parent, style);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- this.initViewerFilters = initViewerFilters;
- init();
- }
-
- /**
- * Constructor to use when you create your own tree widget.
- * @param shell The shell hosting this tree viewer widget
- * @param tree The Tree widget you created.
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Tree tree, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(tree);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Set the input provider. Sometimes this is delayed, or can change.
- * @param inputProvider the input provider for this view.
- */
- public void setInputProvider(ISystemViewInputProvider inputProvider) {
- this.inputProvider = inputProvider;
- inputProvider.setViewer(this);
- inputProvider.setShell(getShell()); // DY: Defect 44544, shell was not being set for Test dialogs, when they
- // tried to connect there was not shell for the password prompt
- // and an error message (expand failed) occured.
- setInput(inputProvider);
- }
-
- /**
- * Get the SystemViewPart that encapsulates us.
- * Will be null unless fromSystemViewPart is true.
- */
- public SystemViewPart getSystemViewPart() {
- if (fromSystemViewPart)
- return ((SystemViewPart) messageLine);
- else
- return null;
- }
-
- /**
- * Get the workbench window containing this view part. Will only be non-null for the explorer view part,
- * not when used within, say, a dialog
- */
- protected IWorkbenchWindow getWorkbenchWindow() {
- if (fromSystemViewPart)
- return getSystemViewPart().getSite().getWorkbenchWindow();
- else
- return null;
- }
-
- /**
- * Get the workbench part containing this view. Will only be non-null for the explorer view part,
- * not when used within, say, a dialog
- */
- protected IWorkbenchPart getWorkbenchPart() {
- return getSystemViewPart();
- }
-
- /**
- * Disable/Enable the viewer. We do this by blocking keystrokes without visually greying out
- */
- public void setEnabled(boolean enabled) {
- enabledMode = enabled;
- }
-
- /**
- * Sets the label and content provider for the system view.
- * This can be called externally if a custom RSE label and content provider is desired
- * @param lcProvider the provider
- */
- public void setLabelAndContentProvider(SystemViewLabelAndContentProvider lcProvider) {
- ILabelDecorator decorator = null;
- if (PlatformUI.isWorkbenchRunning()) {
- IWorkbench wb = PlatformUI.getWorkbench();
- decorator = wb.getDecoratorManager().getLabelDecorator();
- }
- setLabelProvider(new DecoratingLabelProvider(lcProvider, decorator));
- setContentProvider(lcProvider);
- }
-
- protected void init() {
- _setList = new ArrayList();
- busyCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
- setUseHashlookup(true); // new for our 2nd release. Attempt to fix 38 minutes to refresh for 15K elements
-
- // set content provider
- SystemViewLabelAndContentProvider lcProvider = new SystemViewLabelAndContentProvider();
- setLabelAndContentProvider(lcProvider);
-
- // set initial viewer filters
- if (initViewerFilters != null) {
-
- for (int i = 0; i < initViewerFilters.length; i++) {
- addFilter(initViewerFilters[i]);
- }
- }
-
- fromSystemViewPart = ((messageLine != null) && (messageLine instanceof SystemViewPart));
-
- // set the tree's input. Provides initial roots.
- if (inputProvider != null) {
- inputProvider.setViewer(this);
- setInput(inputProvider);
- if (fromSystemViewPart) {
- previousInputConnection = getInputConnection(getWorkbenchPart().getSite().getPage().getInput());
- }
- }
- //addDoubleClickListener(this);
- addSelectionChangedListener(this);
- addTreeListener(this);
- // ----------------------------------------
- // register with system registry for events
- // ----------------------------------------
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().addSystemRemoteChangeListener(this);
- // -----------------------------
- // Enable right-click popup menu
- // -----------------------------
- menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- Menu menu = menuMgr.createContextMenu(getTree());
- getTree().setMenu(menu);
- // -------------------------------------------
- // Enable specific keys: dbl-click, Delete, F5
- // -------------------------------------------
- addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleDoubleClick(event);
- }
- });
- getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- getControl().addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- mouseButtonPressed = e.button; //d40615
- if (!enabledMode) {
- //e.doit = false;
- return;
- }
- }
- });
-
- initRefreshKey();
-
- // initialize drag and drop
- initDragAndDrop();
- }
-
- /**
- * Create the KeyListener for doing the refresh on the viewer.
- */
- protected void initRefreshKey() {
- /* DKM - no need for explicit key listener since we
- * have global action
- getControl().addKeyListener(new KeyAdapter()
- {
- public void keyReleased(KeyEvent event)
- {
- if (!enabledMode)
- return;
- if (event.keyCode == SWT.F5)
- {
- //if (debug)
- // System.out.println("F5 pressed");
- refreshAll();
- }
- }
- });
- */
- }
-
- /**
- * Handles double clicks in viewer.
- * Opens editor if file double-clicked.
- */
- protected void handleDoubleClick(DoubleClickEvent event) {
- if (!enabledMode) {
- //event.doit = false;
- return;
- }
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
- if (element == null) return;
- ISystemViewElementAdapter adapter = getAdapter(element);
- boolean alreadyHandled = false;
- if (adapter != null) alreadyHandled = adapter.handleDoubleClick(element);
- if (!alreadyHandled && isExpandable(element)) {
- boolean expandedState = getExpandedState(element);
- setExpandedState(element, !expandedState);
- // DY: fire collapse / expand event
- if (expandedState) {
- fireTreeCollapsed(new TreeExpansionEvent(this, element));
- } else {
- fireTreeExpanded(new TreeExpansionEvent(this, element));
- }
- return;
- }
- }
-
- /**
- * Handles key events in viewer.
- */
- void handleKeyPressed(KeyEvent event) {
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection) getSelection()).size() > 0)) {
- scanSelections("handleKeyPressed");
- /* DKM - 53694
- if (showDelete() && canDelete())
- {
-
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction)getDeleteAction();
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(this);
- dltAction.run();
-
- }
- */
- } else if ((event.character == '-') && (event.stateMask == SWT.CTRL)) {
- collapseAll();
- } else if ((event.character == 1) && // for some reason Ctrl+A comes in as Ctrl plus the number 1!
- (event.stateMask == SWT.CTRL) && !fromSystemViewPart) {
- //System.out.println("Inside Ctrl+A processing");
- if (enableSelectAll(null)) doSelectAll(null);
- } else if ((event.character == '-') && (((IStructuredSelection) getSelection()).size() > 0)) {
- //System.out.println("Inside Ctrl+- processing");
- collapseSelected();
- } else if ((event.character == '+') && (((IStructuredSelection) getSelection()).size() > 0)) {
- //System.out.println("Inside Ctrl++ processing");
- expandSelected();
- }
-
- }
-
- /**
- * Handles a collapse-selected request
- */
- public void collapseSelected() {
- TreeItem[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- for (int idx = 0; idx < selectedItems.length; idx++)
- selectedItems[idx].setExpanded(false);
- }
- }
-
- /**
- * Handles an expand-selected request
- */
- public void expandSelected() {
- TreeItem[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- for (int idx = 0; idx < selectedItems.length; idx++) {
- if (!selectedItems[idx].getExpanded()) {
- createChildren(selectedItems[idx]);
- }
- selectedItems[idx].setExpanded(true);
- }
- }
- }
-
- /**
- * Display a message/status on the message/status line
- */
- public void displayMessage(String msg) {
- if (messageLine != null) messageLine.setMessage(msg);
- }
-
- /**
- * Clear message/status shown on the message/status line
- */
- public void clearMessage() {
- if (messageLine != null) messageLine.clearMessage();
- }
-
- /**
- * Turn off right-click actions
- */
- public void setShowActions(boolean show) {
- this.showActions = show;
- }
-
- /**
- * Return the input provider
- */
- public ISystemViewInputProvider getInputProvider() {
- inputProvider.setViewer(this); // just in case. Added by Phil in V5.0
- inputProvider.setShell(getShell()); // just in case. Added by Phil
- return inputProvider;
- }
-
- /**
- * Return the popup menu for the tree
- */
- public Menu getContextMenu() {
- return getTree().getMenu();
- }
-
- /**
- * Return the popup menu for the tree
- */
- public MenuManager getContextMenuManager() {
- return menuMgr;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getNewConnectionAction() {
- if (newConnectionAction == null) newConnectionAction = new SystemNewConnectionAction(getShell(), true, this); // true=>from popup menu
- return newConnectionAction;
- }
-
- /**
- * Return the refresh action
- */
- public IAction getRefreshAction() {
- if (refreshAction == null) refreshAction = new SystemRefreshAction(getShell());
- return refreshAction;
- }
-
- /**
- * @return the collapse action. Lazily creates it.
- */
- public IAction getCollapseAction() {
- if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
- return collapseAction;
- }
-
- /**
- * @return the expand action. Lazily creates it.
- */
- public IAction getExpandAction() {
- if (expandAction == null) expandAction = new SystemExpandAction(getShell());
- return expandAction;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public PropertyDialogAction getPropertyDialogAction() {
- if (propertyDialogAction == null) {
- propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this);
- //propertyDialogAction.setToolTipText(" ");
- }
- propertyDialogAction.selectionChanged(getSelection());
- return propertyDialogAction;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public SystemRemotePropertiesAction getRemotePropertyDialogAction() {
- if (remotePropertyDialogAction == null) {
- remotePropertyDialogAction = new SystemRemotePropertiesAction(getShell());
- }
- remotePropertyDialogAction.setSelection(getSelection());
- return remotePropertyDialogAction;
- }
-
- /**
- * Return the select All action
- */
- public IAction getSelectAllAction() {
- if (selectAllAction == null) selectAllAction = new SystemCommonSelectAllAction(getShell(), this, this);
- return selectAllAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getRenameAction() {
- if (renameAction == null) renameAction = new SystemCommonRenameAction(getShell(), this);
- return renameAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getDeleteAction() {
- if (deleteAction == null) deleteAction = new SystemCommonDeleteAction(getShell(), this);
- return deleteAction;
- }
-
- /*
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- *
- protected SystemCascadingOpenToAction getOpenToAction()
- {
- if (openToAction == null)
- openToAction = new SystemCascadingOpenToAction(getShell(),getWorkbenchWindow());
- return openToAction;
- } NOT USED YET */
-
- /**
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- public SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction() {
- if (openToPerspectiveAction == null) openToPerspectiveAction = new SystemOpenExplorerPerspectiveAction(getShell(), getWorkbenchWindow());
- return openToPerspectiveAction;
- }
-
- public SystemShowInTableAction getShowInTableAction() {
- if (showInTableAction == null) showInTableAction = new SystemShowInTableAction(getShell());
- return showInTableAction;
- }
-
- public SystemShowInMonitorAction getShowInMonitorAction() {
- if (showInMonitorAction == null) showInMonitorAction = new SystemShowInMonitorAction(getShell());
- return showInMonitorAction;
- }
-
- /**
- * Get the common "Go Into" action for drilling down in the Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- public GoIntoAction getGoIntoAction() {
- if (goIntoAction == null) {
- goIntoAction = new GoIntoAction(getSystemViewPart().getFrameList());
- goIntoAction.setText(SystemResources.ACTION_CASCADING_GOINTO_LABEL);
- goIntoAction.setToolTipText(SystemResources.ACTION_CASCADING_GOINTO_TOOLTIP);
- }
- return goIntoAction;
- }
-
- /**
- * Get the common "Go To->" cascading menu action for navigating the frame list.
- */
- public SystemCascadingGoToAction getGoToActions() {
- if (gotoActions == null) gotoActions = new SystemCascadingGoToAction(getShell(), getSystemViewPart());
- return gotoActions;
- }
-
- /**
- * Helper method to collapse a node in the tree.
- * Called when a currently expanded subsystem is disconnected.
- * @param forceRefresh true if children should be deleted from memory so re-expand forces refresh.
- */
- public void collapseNode(Object element, boolean forceRefresh) {
- // First, collapse this element and all its children.
- collapseToLevel(element, ALL_LEVELS);
-
- // Collapsed just changes expanded state but leaves existing child
- // widgets in memory so they are re-shown on next expansion.
- // To force the next expand to re-get the children, we have to delete the
- // children.
- if (forceRefresh) {
- refresh(element); // look at AbstractTreeViewer.updateChildren which this
- // will call. If the element is collapsed (which we just
- // did) then its children are simply disposed of, and
- // not re-queried. Just what we want!
- }
- }
-
- /**
- * This is method is called to populate the popup menu
- */
- public void fillContextMenu(IMenuManager menu) {
- if (!showActions) return;
- //SystemViewPlugin.getDefault().logMessage("inside fillContextMenu");
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- boolean allSelectionsFromSameParent = true;
- int selectionCount = selection.size();
-
- if (selectionCount == 0) // nothing selected
- {
- menu.add(getNewConnectionAction());
- } else {
- if (selectionCount > 1) {
- allSelectionsFromSameParent = sameParent();
- if (!allSelectionsFromSameParent) {
- if (selectionHasAncestryRelationship()) {
- // don't show the menu because actions with
- // multiple select on objects that are ancestors
- // of each other is problematic
- // still create the standard groups
- createStandardGroups(menu);
- return;
- }
- }
- }
- // Partition into groups...
- createStandardGroups(menu);
-
- // PRESET INSTANCE VARIABLES ABOUT WHAT COMMON ACTIONS ARE TO BE SHOWN...
- // PERFORMANCE TWEAK: OUR GLOBAL DELETE ACTION LISTENS FOR SELECTION CHANGES, AND
- // WHEN THAT CHANGES, WILL CALL CANDELETE() HERE. THAT IN TURN WILL CALL SCANSELECTIONS.
- // THIS MEANS SCAN SELECTIONS GETS CALL TWICE ON MOST RIGHT CLICK ACTIONS.
- if (!selectionFlagsUpdated) // might already be called by the global delete action wh
- scanSelections("fillContextMenu");
-
- // ADD COMMON ACTIONS...
-
- // COMMON REFRESH ACTION...
- if (showRefresh()) {
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getRefreshAction());
-
- // MJB: Removed as per bugzilla entry # 145843
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getExpandAction()); // defect 41203
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getCollapseAction()); // defect 41203
- }
-
- // COMMON RENAME ACTION...
- if (showRename()) {
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getRenameAction());
- ((ISystemAction) getRenameAction()).setInputs(getShell(), this, selection);
- }
-
- // ADAPTER SPECIFIC ACTIONS
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- // yantzi:artemis 6.0 (defect 53970), do not show adapter specific actions when
- // there is not a common adapter for all selected elements (i.e. there are 2 or
- // more selected elements that have different adapters
- Iterator elements = selection.iterator();
- //Hashtable adapters = new Hashtable();
- ISystemViewElementAdapter adapter = null;
- boolean skipAdapterActions = false;
-
- while (elements.hasNext() && !skipAdapterActions) {
- Object element = elements.next();
- if (adapter == null) {
- adapter = getAdapter(element);
- } else if (adapter != getAdapter(element)) {
- // selected elements have different adapters
- skipAdapterActions = true;
- }
- //if (adapter != null)
- // adapters.put(adapter,element); // want only unique adapters
- }
-
- //Enumeration uniqueAdapters = adapters.keys();
- if (!skipAdapterActions && adapter != null) {
- Shell shell = getShell();
-
- //while (uniqueAdapters.hasMoreElements())
- //{
- // ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter)uniqueAdapters.nextElement();
- adapter.addActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
- if (adapter instanceof AbstractSystemViewAdapter) {
-
- AbstractSystemViewAdapter aVA = (AbstractSystemViewAdapter) adapter;
- // add remote actions
- aVA.addCommonRemoteActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- // add dynamic menu popups
- aVA.addDynamicPopupMenuActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADDITIONS);
- }
- //}
- }
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx = 0; idx < items.length; idx++) {
- if ((items[idx] instanceof ActionContributionItem) && (((ActionContributionItem) items[idx]).getAction() instanceof ISystemAction)) {
- ISystemAction item = (ISystemAction) (((ActionContributionItem) items[idx]).getAction());
- try {
- item.setInputs(getShell(), this, selection);
- } catch (Exception e) {
- SystemBasePlugin.logError("Error configuring action " + item.getClass().getName(), e);
- }
- } else if (items[idx] instanceof SystemSubMenuManager) {
- SystemSubMenuManager item = (SystemSubMenuManager) items[idx];
- item.setInputs(getShell(), this, selection);
- }
- }
-
- // COMMON DELETE ACTION...
- if (showDelete()) {
- //menu.add(getDeleteAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getDeleteAction());
- ((ISystemAction) getDeleteAction()).setInputs(getShell(), this, selection);
- menu.add(new Separator());
- }
-
- // PROPERTIES ACTION...
- // This is supplied by the system, so we pretty much get it for free. It finds the
- // registered propertyPages extension points registered for the selected object's class type.
- //propertyDialogAction.selectionChanged(selection);
-
- if (!selectionIsRemoteObject) // is not a remote object
- {
- PropertyDialogAction pdAction = getPropertyDialogAction();
- if (pdAction.isApplicableForSelection()) menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- // GO INTO ACTION...
- // OPEN IN NEW WINDOW ACTION...
- if (fromSystemViewPart && showOpenViewActions()) {
- GoIntoAction goIntoAction = getGoIntoAction();
- goIntoAction.setEnabled(selection.size() == 1);
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
-
- SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
- openToPerspectiveAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), openToPerspectiveAction);
-
- if (showGenericShowInTableAction()) {
- SystemShowInTableAction showInTableAction = getShowInTableAction();
- showInTableAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), showInTableAction);
-
- SystemShowInMonitorAction showInMonitorAction = getShowInMonitorAction();
- showInMonitorAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), showInMonitorAction);
-
- }
- }
- } else // is a remote object
- {
- //Object firstSelection = selection.getFirstElement();
- //ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(firstSelection);
- //logMyDebugMessage(this.getClass().getName(), ": there is a remote adapter");
- SystemRemotePropertiesAction pdAction = getRemotePropertyDialogAction();
- if (pdAction.isApplicableForSelection()) menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- //else
- //logMyDebugMessage(this.getClass().getName(), ": but it is not applicable for selection");
- // --------------------------------------------------------------------------------------------------------------------
- // look for and add any popup menu actions registered via our org.eclipse.rse.core.popupMenus extension point...
- // --------------------------------------------------------------------------------------------------------------------
- if (fromSystemViewPart) // these require an IWorkbenchPart as a parameter, so we can't support them from within dialogs
- addObjectActions(ourMenu);
- }
- // GO TO CASCADING ACTIONS...
- if (fromSystemViewPart && (selectionIsRemoteObject || showOpenViewActions())) {
- SystemCascadingGoToAction gotoActions = getGoToActions();
- gotoActions.setSelection(selection);
- menu.appendToGroup(gotoActions.getContextMenuGroup(), gotoActions.getSubMenu());
- }
- }
- }
-
- /**
- * Contributes popup menu actions and submenus registered for the object type(s) in the current selection.
- * Patterned after addObjectActions in PopupMenuExtender class supplied by Eclipse.
- */
- protected void addObjectActions(SystemMenuManager menu) {
- if (SystemPopupMenuActionContributorManager.getManager().contributeObjectActions(getWorkbenchPart(), menu, this, null)) {
- //menu.add(new Separator());
- }
- }
-
- /**
- * Called when the context menu is about to open.
- * Calls {@link #fillContextMenu(IMenuManager)}
- */
- public void menuAboutToShow(IMenuManager menu) {
- if (!enabledMode) return;
- fillContextMenu(menu);
- if (!menuListenerAdded) {
- if (menu instanceof MenuManager) {
- Menu m = ((MenuManager) menu).getMenu();
- if (m != null) {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- if (messageLine != null) ml.setShowToolTipText(true, messageLine);
- m.addMenuListener(ml);
- }
- }
- }
- //System.out.println("Inside menuAboutToShow: menu null? "+( ((MenuManager)menu).getMenu()==null));
- }
-
- /**
- * Creates the Systems plugin standard groups in a context menu.
- */
- public static IMenuManager createStandardGroups(IMenuManager menu) {
- if (!menu.isEmpty()) return menu;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand to->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND)); // expand, collapse
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH)); // open with->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH)); // work with->
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_SHOW)); // show->type hierarchy, in-navigator
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // connection-related actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_STARTSERVER)); // start/stop remote server actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM)); // Team
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_COMPAREWITH));
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_REPLACEWITH));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
-
- return menu;
- }
-
- /**
- * protected helper method to add an Action to a given menu.
- * To give the action the opportunity to grey out, we call selectionChanged, but
- * only if the action implements ISelectionChangedListener
- */
- protected void menuAdd(MenuManager menu, IAction action) {
- if (action instanceof ISelectionChangedListener) ((ISelectionChangedListener) action).selectionChanged(new SelectionChangedEvent(this, getSelection()));
- }
-
- /**
- * Determines whether the view has an ancestor relation selection so
- * that actions can be enable/disabled appropriately.
- * For example, delete needs to be disabled when a parent and it's child
- * are both selected.
- * @return true if the selection has one or more ancestor relations
- */
- protected boolean hasAncestorRelationSelection() {
-
- Item[] elements = getSelection(getControl());
- for (int i = 0; i < elements.length; i++) {
- TreeItem parentItem = (TreeItem) elements[i];
- for (int j = 0; j < elements.length; j++) {
- if (j != i) {
- if (isAncestorOf(parentItem, (TreeItem) elements[j])) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Handles selection changed in viewer.
- * Updates global actions.
- * Links to editor (if option enabled)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- selectionFlagsUpdated = false;
- _setList = new ArrayList();
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null) return;
-
- // added by Phil. Noticed Edit->Delete not enabled when it should be
- boolean enableDelete = true;
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (enableDelete && elements.hasNext()) {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter == null) continue;
- if (enableDelete) enableDelete = adapter.showDelete(element) && adapter.canDelete(element);
- }
- //System.out.println("Enabling delete action: "+enableDelete);
- //System.out.println("Enabling selectAll action: "+enableSelectAll(sel));
- ((SystemCommonDeleteAction) getDeleteAction()).setEnabled(enableDelete);
- ((SystemCommonSelectAllAction) getSelectAllAction()).setEnabled(enableSelectAll(sel)); // added by Phil. Noticed Edit->Select All not enabled when it should be
-
- ISystemViewElementAdapter adapter = getAdapter(firstSelection);
- if (adapter != null) {
- displayMessage(adapter.getStatusLineText(firstSelection));
- if ((mouseButtonPressed == LEFT_BUTTON) && (!expandingTreeOnly)) //d40615
- adapter.selectionChanged(firstSelection); //d40615
- } else
- clearMessage();
- //System.out.println("Inside selectionChanged in SystemView");
- expandingTreeOnly = false; //d40615
- if (debugProperties) {
- ISystemRemoteElementAdapter element = getRemoteAdapter(firstSelection);
- if (element == null)
- return;
- else {
- logMyDebugMessage(this.getClass().getName(), ": -----------------------------------------------------------");
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SSFID.......: " + element.getSubSystemConfigurationId(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE NAME........: " + element.getName(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE TYPECATEGORY: " + element.getRemoteTypeCategory(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE TYPE........: " + element.getRemoteType(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SUBTYPE.....: " + element.getRemoteSubType(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SUBSUBTYPE..: " + element.getRemoteSubSubType(firstSelection));
- }
- }
- }
-
- protected void logMyDebugMessage(String prefix, String msg) {
- if (!debugProperties) return;
- //RSEUIPlugin.logDebugMessage(prefix, msg);
- System.out.println(prefix + " " + msg);
- }
-
- /**
- * Convenience method for returning the shell of this viewer.
- */
- public Shell getShell() {
- //return shell;
- return getTree().getShell();
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object element) {
- return isSelected(element, (IStructuredSelection) getSelection());
- }
-
- /**
- * Helper method to determine if a given tree item is currently selected.
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isTreeItemSelected(Widget w) {
- boolean match = false;
- TreeItem[] items = getTree().getSelection();
- if ((items != null) && (items.length > 0)) {
- for (int idx = 0; !match && (idx < items.length); idx++)
- if (items[idx] == w) match = true;
- }
- return match;
- }
-
- /**
- * Helper method to determine if any of a given array of objects is currently selected
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object[] elementArray) {
- return isSelected(elementArray, (IStructuredSelection) getSelection());
- }
-
- /**
- * Helper method to determine if a given object is in given selection
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object element, IStructuredSelection selection) {
- boolean isSelected = false;
- Iterator elements = selection.iterator();
- while (!isSelected && elements.hasNext()) {
- if (element.equals(elements.next())) isSelected = true;
- }
- return isSelected;
- }
-
- /**
- * Helper method to determine if any of a given array of objects is in given selection
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object[] elementArray, IStructuredSelection selection) {
- boolean isSelected = false;
- Iterator elements = selection.iterator();
- while (!isSelected && elements.hasNext()) {
- Object nextSelection = elements.next();
- for (int idx = 0; !isSelected && (idx < elementArray.length); idx++) {
- if (elementArray[idx].equals(nextSelection)) isSelected = true;
- }
- }
- return isSelected;
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does consider if a child node of the given object is currently selected.
- */
- protected boolean isSelectedOrChildSelected(Object[] parentElements) {
- boolean isSelected = false;
- if ((parentElements == null) || (parentElements.length == 0)) return false;
- for (int idx = 0; !isSelected && (idx < parentElements.length); idx++)
- isSelected = isSelectedOrChildSelected(parentElements[idx]);
- return isSelected;
- }
-
- protected boolean searchToRoot(TreeItem selectedItem, TreeItem searchItem) {
- boolean found = false;
- boolean done = false;
- while (!found && !done) {
- if (selectedItem == searchItem)
- found = true;
- else {
- selectedItem = selectedItem.getParentItem();
- if (selectedItem == null) done = true;
- }
- }
- return found;
- }
-
- /**
- * Called after tree item collapsed. Updates the children of the tree item being
- * collapsed by removing the widgets associated with any transient message objects
- * that were in the tree.
- * @param event the event that caused the collapse. The event data will include the
- * tree element being collapsed.
- */
- public void treeCollapsed(TreeExpansionEvent event) {
- final Object element = event.getElement(); // get parent node being collapsed
- // we always allow adapters opportunity to show a different icon depending on collapsed state
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- String[] allProps = {IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE};
- update(element, allProps); // for refreshing non-structural properties in viewer when model changes
- }
- });
- }
-
- /**
- * Called after tree item expanded.
- * We need this hook to potentially undo user expand request.
- * @param event the SWT TreeExpansionEvent that caused the expansion.
- */
- public void treeExpanded(TreeExpansionEvent event) {
- expandingTreeOnly = true;
- final Object element = event.getElement();
- // we always allow adapters opportunity to show a different icon depending on expanded state
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- updatePropertySheet();
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- update(element, allProps); // for refreshing non-structural properties in viewer when model changes
- }
- });
- }
-
- /* (non-Javadoc)
- * Here only for observability.
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeCollapse(org.eclipse.swt.events.TreeEvent)
- */
- protected void handleTreeCollapse(TreeEvent event) {
- super.handleTreeCollapse(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeExpand(org.eclipse.swt.events.TreeEvent)
- */
- protected void handleTreeExpand(TreeEvent event) {
- TreeItem item = (TreeItem) event.item;
- // Remove any transient messages prior to finding children. They will be regenerated if they are needed.
- Item[] children = getItems(item);
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- Item child = children[i];
- Object data = child.getData();
- if (data instanceof ISystemMessageObject) {
- ISystemMessageObject message = (ISystemMessageObject) data;
- if (message.isTransient()) {
- remove(message);
- }
- }
- }
- }
- Shell shell = getShell();
- Object data = item.getData();
- boolean isTiming = (data != null) && doTimings;
- boolean showBusy = (data instanceof IHost) && ((IHost)data).isOffline();
- if (isTiming) elapsedTime.setStartTime();
- if (showBusy) SystemPromptDialog.setDisplayCursor(shell, busyCursor);
- super.handleTreeExpand(event);
- if (showBusy) SystemPromptDialog.setDisplayCursor(shell, null);
- if (isTiming) {
- elapsedTime.setEndTime();
- System.out.println("Time to expand for " + item.getItemCount() + " items: " + elapsedTime);
- }
- }
-
- /**
- * Clear current selection. Ignore widget disposed message.
- */
- protected void clearSelection() {
- try {
- setSelection((ISelection) null);
- } catch (Exception exc) {
- }
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o) {
-
- ISystemViewInputProvider provider = getInputProvider();
-
- // should never be null, but we check just to be safe
- // the input provider should be set because for things like connections, the select
- // dialogs may set a different input provider for the connection adapter which is subsequently
- // not updated when selecting a connection in the Remote Systems view.
- // This ensures that the input provider for the Remote Systems view is set for the adapter.
- if (provider != null) {
- return SystemAdapterHelpers.getAdapter(o, this, provider);
- } else {
- return SystemAdapterHelpers.getAdapter(o, this);
- }
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o) {
- return SystemAdapterHelpers.getRemoteAdapter(o, this);
- }
-
- /**
- *
- */
- public void handleDispose(DisposeEvent event) {
- //if (debug)
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Inside handleDispose for SystemView");
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemRemoteChangeListener(this);
- busyCursor.dispose();
- super.handleDispose(event);
- }
-
- /**
- * Return the connection of the selected object, whatever it is.
- */
- public IHost getSelectedConnection() {
- Object firstSelection = ((StructuredSelection) getSelection()).getFirstElement();
- if (firstSelection == null)
- return null;
- else if (firstSelection instanceof IHost)
- return (IHost) firstSelection;
- else if (firstSelection instanceof ISubSystem)
- return ((ISubSystem) firstSelection).getHost();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- return ((ISubSystem) (((ISystemFilterPoolReference) firstSelection).getProvider())).getHost();
- else if (firstSelection instanceof ISystemFilterReference)
- return ((ISubSystem) (((ISystemFilterReference) firstSelection).getProvider())).getHost();
- else if (getRemoteAdapter(firstSelection) != null) {
- ISubSystem ss = getRemoteAdapter(firstSelection).getSubSystem(firstSelection);
- if (ss != null)
- return ss.getHost();
- else
- return null;
- } else
- return null;
- }
-
- /**
- * We override getSelection(Control) so that a list of items
- * under the same parent always gets returned in the order in which
- * they appear in the tree view. Otherwise, after a "move up" or
- * "move down", the order of selection can come back wrong.
- */
- protected Item[] getSelection(Control widget) {
- Tree tree = (Tree) widget;
- Item[] oldResult = tree.getSelection();
- if (oldResult != null && oldResult.length > 0) {
- if (oldResult[0] instanceof TreeItem) {
- Widget parentItem = ((TreeItem) oldResult[0]).getParentItem();
- if (parentItem == null) {
- parentItem = tree;
- }
- if (itemsShareParent(parentItem, oldResult)) {
- Item[] newResult = sortSelection(parentItem, oldResult);
- return newResult;
- }
- }
- }
- return oldResult;
- }
-
- protected boolean itemsShareParent(Widget parentItem, Item[] items) {
- for (int i = 0; i < items.length; i++) {
- Widget itemParent = ((TreeItem) items[i]).getParentItem();
- if (parentItem instanceof TreeItem) {
- if (itemParent != parentItem) {
- return false;
- }
- } else if (itemParent != null) {
- return false;
- }
- }
-
- return true;
- }
-
- protected Item[] sortSelection(Widget parentItem, Item[] oldResult) {
- Item[] newResult = new Item[oldResult.length];
- for (int i = 0; i < oldResult.length; i++) {
- Item first = removeFirstItem(parentItem, oldResult);
- newResult[i] = first;
- }
-
- return newResult;
- }
-
- protected Item removeFirstItem(Widget parentItem, Item[] items) {
- int firstIndex = 0;
- Item firstItem = null;
- int firstItemPosition = 0;
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null) {
- Item current = items[i];
- int position = getTreeItemPosition(parentItem, current, items);
-
- if (firstItem == null || position < firstItemPosition) {
- firstItem = current;
- firstItemPosition = position;
- firstIndex = i;
- }
- }
- }
-
- items[firstIndex] = null;
- return firstItem;
- }
-
- /**
- * Move one tree item to a new location
- */
- protected void moveTreeItem(Widget parentItem, Item item, Object src, int newPosition) {
- if (getExpanded(item)) {
- setExpanded(item, false);
- refresh(src); // flush items from memory
- }
-
- createTreeItem(parentItem, src, newPosition);
-
- //createTreeItem(parentItem, (new String("New")), newPosition);
- //remove(src);
-
- disassociate(item);
- item.dispose();
- // TODO: make this work so the selection order doesn't get screwed up!
- }
-
- /**
- * Move existing items a given number of positions within the same node.
- * If the delta is negative, they are all moved up by the given amount. If
- * positive, they are all moved down by the given amount.<p>
- */
- protected void moveTreeItems(Widget parentItem, Object[] src, int delta) {
- int[] oldPositions = new int[src.length];
- Item[] oldItems = new Item[src.length];
-
- for (int idx = 0; idx < src.length; idx++)
- oldItems[idx] = (Item) internalFindRelativeItem(parentItem, src[idx], 1);
- for (int idx = 0; idx < src.length; idx++) {
- oldPositions[idx] = getTreeItemPosition(parentItem, oldItems[idx]) + 1;
- }
-
- if (delta > 0) // moving down, process backwards
- {
- for (int idx = src.length - 1; idx >= 0; idx--) {
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta);
- }
- } else // moving up, process forewards
- {
- for (int idx = 0; idx < src.length; idx++) {
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta - 1);
- }
- }
- }
-
- protected int getTreeItemPosition(Widget parentItem, Item childItem) {
- return getTreeItemPosition(parentItem, childItem, null);
- }
-
- /**
- * Get the position of a tree item within its parent
- */
- protected int getTreeItemPosition(Widget parentItem, Item childItem, Item[] items) {
- int pos = -1;
- Item[] children = null;
- if (parentItem instanceof Item) {
- if (items == null)
- children = getItems((Item) parentItem);
- else
- children = items;
- } else
- children = getChildren(parentItem);
- for (int idx = 0; (pos == -1) && (idx < children.length); idx++) {
- if (children[idx] == childItem) pos = idx;
- }
- return pos;
- }
-
- /**
- * Expand a given filter, given a subsystem that contains a reference to the filter's pool.
- * This will expand down to the filter if needed
- * @param parentSubSystem - the subsystem containing a reference to the filter's parent pool
- * @param filter - the filter to find, reveal, and expand within the subsystem context
- * @return the filter reference to the filter if found and expanded. This is a unique binary address
- * within the object's in this tree, so can be used in the viewer methods to affect this particular
- * node.
- */
- public ISystemFilterReference revealAndExpand(ISubSystem parentSubSystem, ISystemFilter filter) {
- setExpandedState(parentSubSystem.getHost(), true); // expand the connection
- setExpandedState(parentSubSystem, true); // expand the subsystem
- Object filterParentInTree = parentSubSystem; // will be case unless in show filter pool mode
- // if showing filter pools, expand parent filter pool reference...
- if (SystemPreferencesManager.getPreferencesManager().getShowFilterPools()) {
- ISystemFilterPoolReference poolRef = parentSubSystem.getFilterPoolReferenceManager().getReferenceToSystemFilterPool(filter.getParentFilterPool());
- setExpandedState(poolRef, true);
- filterParentInTree = poolRef;
- }
- // now, find the filter reference, and expand it...
- Widget parentItem = findItem(filterParentInTree); // find tree widget of parent
- if ((parentItem == null) || !(parentItem instanceof Item)) return null;
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, filter, 1);
- if (child == null) return null;
- // found it! Now expand it...
- setExpandedState(child.getData(), true);
- return (ISystemFilterReference) child.getData();
- }
-
- // ------------------------------------
- // ISYSTEMRESOURCEChangeListener METHOD
- // ------------------------------------
-
- /**
- * Called when something changes in the model
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event) {
- ResourceChangedJob job = new ResourceChangedJob(event, this);
- job.setPriority(Job.INTERACTIVE);
- //job.setUser(true);
- job.schedule();
- /*
- Display display = Display.getCurrent();
- try {
- while (job.getResult() == null) {
- while (display != null && display.readAndDispatch()) {
- //Process everything on event queue
- }
- if (job.getResult() == null) Thread.sleep(200);
- }
- } catch (InterruptedException e) {
- }
- */
- }
-
- /**
- * Inner class which extends UIJob to connect this connection
- * on the UI Thread when no Shell is available from
- * the caller
- */
- public class ResourceChangedJob extends UIJob {
-
- protected ISystemResourceChangeEvent _event;
- protected SystemView _originatingViewer;
-
- public ResourceChangedJob(ISystemResourceChangeEvent event, SystemView originatingViewer) {
- super("Resource Changed...");
- _originatingViewer = originatingViewer;
- _event = event;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- int type = _event.getType();
- Object src = _event.getSource();
- Object parent = _event.getParent();
- String[] properties = new String[1];
- if (parent == RSEUIPlugin.getTheSystemRegistry()) parent = inputProvider;
- ISubSystem ss = null;
- Widget item = null;
- Widget parentItem = null;
- Object[] multiSource = null;
- Object previous = null;
- if (_event.getViewerItem() instanceof TreeItem)
- inputTreeItem = (TreeItem) _event.getViewerItem();
- else
- inputTreeItem = null;
- boolean wasSelected = false;
- boolean originatedHere = (_event.getOriginatingViewer() == null) || (_event.getOriginatingViewer() == _originatingViewer);
-
- //logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
- switch (type) {
- // SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
- case EVENT_RENAME_FILTER_REFERENCE:
- case EVENT_CHANGE_FILTER_REFERENCE:
- findAndUpdateFilter(_event, type);
- break;
- case EVENT_CHANGE_FILTERSTRING_REFERENCE:
- findAndUpdateFilterString(_event, type);
- break;
-
- case EVENT_ADD_FILTERSTRING_REFERENCE:
- case EVENT_DELETE_FILTERSTRING_REFERENCE:
- case EVENT_MOVE_FILTERSTRING_REFERENCES:
- //findAndUpdateFilterStringParent(event, type);
- //break;
- case EVENT_ADD_FILTER_REFERENCE:
- case EVENT_DELETE_FILTER_REFERENCE:
- case EVENT_MOVE_FILTER_REFERENCES:
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (((type == EVENT_DELETE_FILTERSTRING_REFERENCE) || (type == EVENT_DELETE_FILTER_REFERENCE)) && affectsInput(src)) {
- close();
- return Status.OK_STATUS;
- }
-
- findAndUpdateFilterParent(_event, type);
- break;
-
- case EVENT_ADD:
- case EVENT_ADD_RELATIVE:
- if (debug) {
- logDebugMsg("SV event: EVENT_ADD ");
- }
- clearSelection();
- //refresh(parent);
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- refresh(parent); // flush cached stuff so next call will show new item
- } else if ((parentItem instanceof Item) || // regular node
- (parent == inputProvider)) // root node. Hmm, hope this is going to work in all cases
- {
- boolean addingConnection = (src instanceof IHost);
- //System.out.println("ADDING CONNECTIONS.........................: " + addingConnection);
- //System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
- //System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
- if ((parent == inputProvider) && addingConnection && (_event.getParent() instanceof ISystemRegistry) && !inputProvider.showingConnections()) return Status.OK_STATUS; // only reflect new connections in main perspective. pc42742
- int pos = -1;
- if (type == EVENT_ADD_RELATIVE) {
- previous = _event.getRelativePrevious();
- if (previous != null) pos = getItemIndex(parentItem, previous);
- if (pos >= 0) pos++; // want to add after previous
- } else
- pos = _event.getPosition();
- //logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
- createTreeItem(parentItem, src, pos);
- setSelection(new StructuredSelection(src), true);
- }
- break;
- case EVENT_ADD_MANY:
- if (debug) {
- logDebugMsg("SV event: EVENT_ADD_MANY");
- }
- multiSource = _event.getMultiSource();
- clearSelection();
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- refresh(parent); // flush cached stuff so next call will show new items
- } else if (multiSource.length > 0) {
- boolean addingConnections = (multiSource[0] instanceof IHost);
- // are we restoring connections previously removed due to making a profile inactive,
- // and is one of these connections the one we were opened with?
- if (addingConnections && (_event.getParent() instanceof ISystemRegistry) && (inputProvider instanceof SystemEmptyListAPIProviderImpl)) {
- boolean done = false;
- for (int idx = 0; !done && (idx < multiSource.length); idx++) {
- if (multiSource[idx] == previousInputConnection) {
- done = true;
- setInputProvider(previousInputProvider);
- previousInput = null;
- previousInputProvider = null;
- }
- }
- if (done) return Status.OK_STATUS;
- }
- // are we adding connections and yet we are not a secondary perspective?
- // If so, this event does not apply to us.
- else if (addingConnections && (_event.getParent() instanceof ISystemRegistry) && !inputProvider.showingConnections()) return Status.OK_STATUS;
-
- for (int idx = 0; idx < multiSource.length; idx++) {
- if (debug && addingConnections) logDebugMsg("... new connection " + ((IHost) multiSource[idx]).getAliasName());
- createTreeItem(parentItem, multiSource[idx], -1);
- }
- setSelection(new StructuredSelection(multiSource), true);
- }
- break;
- case EVENT_REPLACE_CHILDREN:
- if (debug) {
- logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
- }
- multiSource = _event.getMultiSource();
- //logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
- clearSelection();
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if (multiSource.length > 0 && parentItem instanceof Item) {
- getControl().setRedraw(false);
- collapseNode(parent, true); // collapse and flush gui widgets from memory
- //setExpandedState(parent, true); // expand the parent
- setExpanded((Item) parentItem, true); // expand the parent without calling resolveFilterString
- TreeItem[] kids = ((TreeItem) parentItem).getItems(); // any kids? Like a dummy node?
- if (kids != null) for (int idx = 0; idx < kids.length; idx++)
- kids[idx].dispose();
- //boolean addingConnections = (multiSource[0] instanceof SystemConnection);
- for (int idx = 0; idx < multiSource.length; idx++) {
- //if (debug && addingConnections)
- // logDebugMsg("... new connection " + ((SystemConnection)multiSource[idx]).getAliasName());
- createTreeItem(parentItem, multiSource[idx], -1);
- }
- getControl().setRedraw(true);
- //setSelection(new StructuredSelection(multiSource),true);
- }
- break;
- case EVENT_CHANGE_CHILDREN:
- if (debug) {
- logDebugMsg("SV event: EVENT_CHANGE_CHILDREN. src=" + src + ", parent=" + parent);
- //Exception e = new Exception();
- //e.fillInStackTrace();
- //e.printStackTrace();
- }
- // I HAVE DECIDED TO CHANGE THE SELECTION ALGO TO ONLY RESELECT IF THE CURRENT
- // SELECTION IS A CHILD OF THE PARENT... PHIL
- boolean wasSrcSelected = false;
- if (src != null) {
- wasSrcSelected = isSelectedOrChildSelected(src);
- //System.out.println("WAS SELECTED? " + wasSrcSelected);
- }
- item = findItem(parent);
- //logDebugMsg(" parent = " + parent);
- //logDebugMsg(" item = " + item);
- // INTERESTING BUG HERE. GETEXPANDED WILL RETURN TRUE IF THE TREE ITEM HAS EVER BEEN
- // EXPANDED BUT IS NOW COLLAPSED! I CANNOT FIND ANY API IN TreeItem or TreeViewer THAT
- // WILL TELL ME IF A TREE ITEM IS SHOWING OR NOT!
- if ((item != null) && (item instanceof TreeItem) && ((TreeItem) item).getExpanded()) {
- if (wasSrcSelected) {
- //System.out.println("...Clearing selection");
- clearSelection();
- }
- //refresh(parent);
- if (debug) System.out.println("Found item and it was expanded for " + parent);
- getControl().setRedraw(false);
- collapseNode(parent, true); // collapse and flush gui widgets from memory
- setExpandedState(parent, true); // expand the parent
- getControl().setRedraw(true);
- if (wasSrcSelected) {
- //System.out.println("Setting selection to " + src);
- setSelection(new StructuredSelection(src), true);
- }
- } else
- collapseNode(parent, true);
- break;
- case EVENT_DELETE:
- if (debug) logDebugMsg("SV event: EVENT_DELETE ");
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (affectsInput(src)) {
- close();
- return Status.OK_STATUS;
- }
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else {
- wasSelected = isSelectedOrChildSelected(src);
- if (wasSelected) clearSelection();
- _originatingViewer.remove(src);
- if (wasSelected) setSelection(new StructuredSelection(parent), true);
- }
- break;
-
- case EVENT_DELETE_MANY:
- if (debug) logDebugMsg("SV event: EVENT_DELETE_MANY ");
- multiSource = _event.getMultiSource();
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (affectsInput(multiSource)) {
- close();
- return Status.OK_STATUS;
- }
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else if (parentItem instanceof Tree) {
- refresh();
- } else {
- wasSelected = isSelectedOrChildSelected(multiSource);
- if (wasSelected) clearSelection();
- if (_originatingViewer != null) _originatingViewer.remove(multiSource);
- if (wasSelected) setSelection(new StructuredSelection(parent), true);
- }
- break;
- /* Now done below in systemRemoteResourceChanged
- case EVENT_DELETE_REMOTE:
- if (debug)
- logDebugMsg("SV event: EVENT_DELETE_REMOTE ");
- deleteRemoteObject(src);
- break;
-
- case EVENT_DELETE_REMOTE_MANY:
- // multi-source: array of objects to delete
- if (debug)
- logDebugMsg("SV event: EVENT_DELETE_REMOTE_MANY ");
- multiSource = event.getMultiSource();
- //remoteItemsToSkip = null; // reset
- if ((multiSource == null) || (multiSource.length==0))
- return;
- for (int idx=0; idx<multiSource.length; idx++)
- deleteRemoteObject(multiSource[idx]);
- break;
- */
- case EVENT_RENAME:
- if (debug) logDebugMsg("SV event: EVENT_RENAME ");
- properties[0] = IBasicPropertyConstants.P_TEXT;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- break;
- /* Now done below in systemRemoteResourceChanged
- case EVENT_RENAME_REMOTE:
- // SRC: the updated remote object, after the rename
- // PARENT: the String from calling getAbsoluteName() on the remote adapter BEFORE updating the remote object's name
- if (debug)
- logDebugMsg("SV event: EVENT_RENAME_REMOTE ");
-
- renameRemoteObject(src, (String)parent);
- break;
- */
- case EVENT_ICON_CHANGE:
- if (debug) logDebugMsg("SV event: EVENT_ICON_CHANGE ");
-
- if (initViewerFilters != null && initViewerFilters.length > 0) {
- Widget w = findItem(src);
- if (w == null) {
- refresh(parent);
- } else {
- properties[0] = IBasicPropertyConstants.P_IMAGE;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
-
- }
- } else {
- properties[0] = IBasicPropertyConstants.P_IMAGE;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
- }
-
- //updatePropertySheet();
- break;
- //case EVENT_CHANGE:
- //if (debug)
- //logDebugMsg("SV event: EVENT_CHANGE ");
- //refresh(src); THIS IS AN EVIL OPERATION: CAUSES ALL EXPANDED NODES TO RE-REQUEST THEIR CHILDREN. OUCH!
- //updatePropertySheet();
- //break;
- case EVENT_REFRESH:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH ");
- //if (src != null)
- // refresh(src); // ONLY VALID WHEN USER TRULY WANTS TO REQUERY CHILDREN FROM HOST
- //else
- // refresh(); // refresh entire tree
- if ((src == null) || (src == RSEUIPlugin.getTheSystemRegistry()))
- refreshAll();
- else {
- //smartRefresh(src, false);
- smartRefresh(src, true);
- }
- updatePropertySheet();
- break;
- // refresh the parent of the currently selected items.
- // todo: intelligently re-select previous selections
- case EVENT_REFRESH_SELECTED_PARENT:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED_PARENT ");
- TreeItem[] items = getTree().getSelection();
- if ((items != null) && (items.length > 0) && (items[0] != null)) {
- //System.out.println("Selection not empty");
- parentItem = getParentItem(items[0]); // get parent of first selection. Only allowed to select items of same parent.
- if ((parentItem != null) && (parentItem instanceof Item)) {
- //System.out.println("parent of selection not empty: "+parentItem.getData());
- smartRefresh(new TreeItem[] { (TreeItem) parentItem });
- }
- //else
- //System.out.println("parent of selection is empty");
- }
- //else
- //System.out.println("Selection is empty");
- break;
- case EVENT_REFRESH_SELECTED:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED ");
- IStructuredSelection selected = (IStructuredSelection) getSelection();
- Iterator i = selected.iterator();
- // the following is a tweak. Refresh only re-queries the children. If the selected item has no
- // childen, then refresh does nothing. Instead of that outcome, we re-define it to mean refresh
- // the parent. The tricky part is to prevent multiple refreshes on multiple selections so we have
- // to pre-scan for this scenario.
- // We also want to re-select any remote objects currently selected. They lose their selection as their
- // memory address changes.
- Item parentElementItem = null;
- Vector selectedRemoteObjects = new Vector();
- ss = null;
- items = getTree().getSelection();
- int itemIdx = 0;
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- //System.out.println("Inside EVENT_REFRESH_SELECTED. FIRST SELECTED OBJECT = " + items[0].handle);
- while (i.hasNext()) {
-
- Object element = i.next();
- ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
- if ((parentElementItem == null) && (adapter != null) && (!adapter.hasChildren(element))) {
- //parentItem = getParentItem((Item)findItem(element));
- parentItem = getParentItem(items[itemIdx]);
- if ((parentItem != null) && (parentItem instanceof Item)) parentElementItem = (Item) parentItem; //.getData();
- }
- if (getRemoteAdapter(element) != null) {
- selectedRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- itemIdx++;
- }
- if (parentElementItem != null) {
- //refresh(parentElement);
- smartRefresh(new TreeItem[] { (TreeItem) parentElementItem });
- if (selectedRemoteObjects.size() > 0) {
- selectRemoteObjects(selectedRemoteObjects, ss, parentElementItem);
- }
- }
- // the following is another tweak. If an expanded object is selected for refresh, which has remote children,
- // and any of those children are expanded, then on refresh the resulting list may be in a different
- // order and the silly algorithm inside tree viewer will simply re-expand the children at the previous
- // relative position. If that position has changed, the wrong children are re-expanded!
- // How to fix this? Ugly code to get the query the list of expanded child elements prior to refresh,
- // collapse them, do the refresh, then re-expand them based on absolute name versus tree position.
- // Actually, to do this right we need to test if the children of the selected item are remote objects
- // versus just the selected items because they may have selected a filter!
- // We go straight the TreeItem level for performance and ease of programming.
- else {
- smartRefresh(getTree().getSelection());
- }
- if (doTimings) {
- timer.setEndTime();
- System.out.println("Time to refresh selected: " + timer);
- }
- //else
- //{
- //i = selected.iterator();
- //while (i.hasNext())
- //refresh(i.next());
- //}
-
- updatePropertySheet();
- break;
- case EVENT_REFRESH_SELECTED_FILTER:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED_FILTER ");
- IStructuredSelection selectedItems = (IStructuredSelection) getSelection();
- Iterator j = selectedItems.iterator();
- // We climb up the tree here until we find a SystemFilterReference data member in the tree.
- // If we do find a reference of SystemFilterReference we refresh on it.
- // If we do not find a reference of SystemFilterReference we.....TODO: WHAT DO WE DO???
- // We also want to re-select any remote objects currently selected. They lose their selection as their
- // memory address changes.
- Item parentElemItem = null;
- Vector selRemoteObjects = new Vector();
- ss = null;
- if (j.hasNext()) {
- Object element = j.next();
- ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
- if ((parentElemItem == null) && (adapter != null)) {
- Item parItem = getParentItem((Item) findItem(element));
-
- if (parItem != null) parentElemItem = parItem; //.getData();
-
- while (parItem != null && !(parItem.getData() instanceof ISystemFilterReference)) {
- parItem = getParentItem(parItem);
-
- if (parItem != null) parentElemItem = parItem; //.getData();
- }
- }
- if (getRemoteAdapter(element) != null) {
- selRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- }
-
- if (parentElemItem != null && (parentElemItem.getData() instanceof ISystemFilterReference)) {
- smartRefresh(new TreeItem[] { (TreeItem) parentElemItem });
- if (selRemoteObjects.size() > 0) {
- selectRemoteObjects(selRemoteObjects, ss, parentElemItem);
- }
-
- updatePropertySheet();
- } else {
- // if we cannot find a parent element that has a system filter reference then we refresh
- // everything since the explorer must be within a filter
- _event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
- systemResourceChanged(_event);
- }
- break;
- case EVENT_REFRESH_REMOTE:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = " + src);
- refreshRemoteObject(src, parent, originatedHere);
- break;
- case EVENT_SELECT_REMOTE:
- if (debug) logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = " + src);
- //remoteItemsToSkip = null; // reset
- selectRemoteObjects(src, (ISubSystem) null, parent);
- break;
-
- case EVENT_MOVE_MANY:
- if (debug) logDebugMsg("SV event: EVENT_MOVE_MANY ");
- multiSource = _event.getMultiSource();
- if ((multiSource == null) || (multiSource.length == 0)) return Status.OK_STATUS;
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else {
- clearSelection();
- moveTreeItems(parentItem, multiSource, _event.getPosition());
- setSelection(new StructuredSelection(multiSource), true);
- }
- break;
- case EVENT_PROPERTY_CHANGE:
- if (debug) logDebugMsg("SV event: EVENT_PROPERTY_CHANGE ");
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- ISystemRemoteElementAdapter ra = getRemoteAdapter(src);
- if (ra != null) {
- updateRemoteObjectProperties(src);
- } else
- update(src, allProps); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- break;
- case EVENT_PROPERTYSHEET_UPDATE:
- if (debug) logDebugMsg("SV event: EVENT_PROPERTYSHEET_UPDATE ");
- updatePropertySheet();
- break;
- case EVENT_MUST_COLLAPSE:
- if (debug) logDebugMsg("SV event: EVENT_MUST_COLLAPSE ");
- collapseNode(src, true); // collapse and flush gui widgets from memory
- break;
- case EVENT_COLLAPSE_ALL:
- if (debug) logDebugMsg("SV event: EVENT_COLLAPSE_ALL ");
- collapseAll(); // collapse all
- if ((src != null) && (src instanceof String) && ((String) src).equals("false")) // defect 41203
- {
- } else
- refresh(); // flush gui widgets from memory
- break;
- case EVENT_COLLAPSE_SELECTED: // defect 41203
- if (debug) logDebugMsg("SV event: EVENT_COLLAPSE_SELECTED ");
- collapseSelected();
- break;
- case EVENT_EXPAND_SELECTED: // defect 41203
- if (debug) logDebugMsg("SV event: EVENT_EXPAND_SELECTED ");
- expandSelected();
- break;
-
- case EVENT_REVEAL_AND_SELECT:
- if (debug) logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- setExpandedState(parent, true);
- Object toSelect = src;
- //if (event.getMultiSource() != null)
- //toSelect = event.getMultiSource();
- //clearSelection();
- if (toSelect != null) {
- if (parent instanceof IRSEBaseReferencingObject) {
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, toSelect, 1);
- if (child != null) toSelect = child.getData();
- } else if ((parent instanceof ISystemFilterPoolReferenceManagerProvider) && !(src instanceof IRSEBaseReferencingObject)) {
- // we are in "don't show filter pools" mode and a new filter was created
- // (we get the actual filter, vs on pool ref creation when we get the pool ref)
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, toSelect, 1);
- if (child != null) toSelect = child.getData();
- }
- setSelection(new StructuredSelection(toSelect), true);
- }
- }
- break;
- case EVENT_SELECT:
- if (debug) logDebugMsg("SV event: EVENT_SELECT ");
- item = findItem(src);
- if (item == null) // if not showing item, this is a no-op
- return Status.OK_STATUS;
- setSelection(new StructuredSelection(src), true);
- break;
- case EVENT_SELECT_EXPAND:
- if (debug) logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
- item = findItem(src);
- if (item == null) // if not showing item, this is a no-op
- return Status.OK_STATUS;
- if (!getExpanded((Item) item)) setExpandedState(src, true);
- setSelection(new StructuredSelection(src), true);
- break;
-
- }
- return Status.OK_STATUS;
- }
- }
-
- // ------------------------------------
- // ISYSTEMREMOTEChangeListener METHOD
- // ------------------------------------
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event) {
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
- boolean originatedHere = (event.getOriginatingViewer() == this);
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector) {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- getRemoteResourceAbsoluteName(remoteResourceParent); // DWD may not be necessary
- String remoteResourceName = getRemoteResourceAbsoluteName(remoteResource);
- if (remoteResourceName == null) return;
-
- ISubSystem ss = getSubSystem(event, remoteResource, remoteResourceParent);
-
- Vector filterMatches = null;
-
- switch (eventType) {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED:
- updatePropertySheet(); // just in case
- break;
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED:
- // we can easily lose our original selection so we need save and restore it if needed
- Vector prevSelection = null;
- TreeItem parentSelectionItem = null;
- if (originatedHere) {
- prevSelection = getRemoteSelection();
- parentSelectionItem = getSelectedParentItem();
- }
-
- // when a new remote resource is created, we need to interrogate all filters
- // within connections to the same hostname, to see if the filter results are
- // affected by this change. If so, we refresh the filter.
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- ArrayList selectedFilters = null;
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (isTreeItemSelected(filterItem)) // if this filter is currently selected, we will lose that selection!
- {
- if (selectedFilters == null) selectedFilters = new ArrayList();
- selectedFilters.add(filterItem);
- }
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- // now, refresh all occurrences of the remote parent object.
- refreshRemoteObject(remoteResourceParent, null, false);
- // restore selected filters...
- if (selectedFilters != null) setSelection(selectedFilters);
- // if the create event originated here, then expand the selected node and
- // select the new resource under it.
- if (originatedHere) {
- // first, restore previous selection...
- if (prevSelection != null) selectRemoteObjects(prevSelection, ss, parentSelectionItem);
- TreeItem selectedItem = getFirstSelectedTreeItem();
- if (selectedItem != null) {
- if (!selectedItem.getExpanded()) // if the filter is expanded, then we already refreshed it...
- {
- createChildren(selectedItem);
- selectedItem.setExpanded(true);
- }
- if (remoteResourceNames != null)
- selectRemoteObjects(remoteResourceNames, ss, selectedItem);
- else
- selectRemoteObjects(remoteResourceName, ss, selectedItem);
- }
- //else
- //System.out.println("Hmm, nothing selected");
- }
- break;
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED:
- // delete all existing references to the remote object(s)...
- if (remoteResourceNames != null) {
- for (int idx = 0; idx < remoteResourceNames.size(); idx++)
- deleteRemoteObject(remoteResourceNames.elementAt(idx), ss);
- } else
- deleteRemoteObject(remoteResourceName, ss);
-
- // now, find all filters that either list this remote resource or list the contents of it,
- // if it is a container... for expediency we only test for the first resource, even if given
- // a list of them...
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElement()) {
- // if the filter is expanded, we are ok. If not, we need to flush its memory...
- if (!getExpanded(filterItem)) refresh(filterItem.getData());
- } else // else this filter lists the contents of the deleted container element, so refresh it:
- {
- // if the filter is not expanded, we need to flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // if the filter is expanded, we need to refresh it
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
-
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED:
- // we can easily lose our original selection so we need save and restore it if needed
- prevSelection = null;
- parentSelectionItem = null;
- if (originatedHere) {
- prevSelection = getRemoteSelection();
- parentSelectionItem = getSelectedParentItem();
- }
-
- // rename all existing references to the remote object...
- renameRemoteObject(remoteResource, event.getOldName(), ss);
-
- // now, find all filters that list the contents of the OLD name container.
- filterMatches = findAllRemoteItemFilterReferences(event.getOldName(), ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElementContents()) // this filter lists the contents of the renamed container element, so refresh it:
- {
- // if the filter is not expanded, we need only flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // the filter is expanded, so refresh its contents. This will likely result in an empty list
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
- // now, find all filters that list the contents of the NEW name container.
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElementContents()) // this filter lists the contents of the renamed container element, so refresh it:
- {
- // if the filter is not expanded, we need only flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // the filter is expanded, so refresh its contents. This will likely result in an empty list
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
-
- // restore selection
- if (originatedHere && (prevSelection != null)) {
- selectRemoteObjects(prevSelection, ss, parentSelectionItem);
- updatePropertySheet(); // just in case
- }
- break;
- }
- }
-
- /**
- * Turn selection into an array of remote object names
- */
- protected Vector getRemoteSelection() {
- Vector prevSelection = null;
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator i = selection.iterator();
- while (i.hasNext()) {
- Object element = i.next();
- ISystemRemoteElementAdapter ra = getRemoteAdapter(element);
- if (ra != null) {
- if (prevSelection == null) prevSelection = new Vector();
- prevSelection.addElement(ra.getAbsoluteName(element));
- }
- }
- return prevSelection;
- }
-
- /**
- * Turn a given remote object reference into a fully qualified absolute name
- */
- protected String getRemoteResourceAbsoluteName(Object remoteResource) {
- if (remoteResource == null) return null;
- String remoteResourceName = null;
- if (remoteResource instanceof String)
- remoteResourceName = (String) remoteResource;
- else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra == null) return null;
- remoteResourceName = ra.getAbsoluteName(remoteResource);
- }
- return remoteResourceName;
- }
-
- /**
- * Deduce the subsystem from the event or remote object
- */
- protected ISubSystem getSubSystem(ISystemRemoteChangeEvent event, Object remoteResource, Object remoteParent) {
- if (event.getSubSystem() != null) return event.getSubSystem();
- ISubSystem ss = null;
- if ((remoteResource != null) && !(remoteResource instanceof String)) {
- if (remoteResource instanceof Vector) {
- Vector v = (Vector) remoteResource;
- if (v.size() > 0) ss = getSubSystem(event, v.elementAt(0), null);
- } else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra != null) ss = ra.getSubSystem(remoteResource);
- }
- }
- if ((ss == null) && (remoteParent != null) && !(remoteParent instanceof String)) {
- if (remoteParent instanceof Vector) {
- Vector v = (Vector) remoteParent;
- if (v.size() > 0) ss = getSubSystem(event, null, v.elementAt(0));
- } else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteParent);
- if (ra != null) ss = ra.getSubSystem(remoteParent);
- }
- }
- return ss;
- }
-
- // ------------------------------------
- // MISCELLANEOUS METHODS...
- // ------------------------------------
-
- /**
- * Close us!
- */
- protected void close() {
- previousInputProvider = inputProvider;
- previousInput = getWorkbenchPart().getSite().getPage().getInput();
- ISystemViewInputProvider ip = new SystemEmptyListAPIProviderImpl();
- setInputProvider(ip);
- }
-
- /**
- * Test if the given input is our view's input object. This is designed to only
- * consider instances of ourself in non-primary perspectives.
- */
- protected boolean affectsInput(Object[] elements) {
- boolean affected = false;
- IWorkbenchPart viewPart = getWorkbenchPart();
- if ((viewPart != null) && (getInput() != RSEUIPlugin.getTheSystemRegistry()) && !(getInput() instanceof SystemEmptyListAPIProviderImpl)) {
- for (int idx = 0; !affected && (idx < elements.length); idx++)
- affected = affectsInput(elements[idx]);
- }
- return affected;
- }
-
- /**
- * Test if the given input is our view's input object. This is designed to only
- * consider instances of ourself in non-primary perspectives.
- */
- protected boolean affectsInput(Object element) {
- boolean affected = false;
- IWorkbenchPart viewPart = getWorkbenchPart();
- if ((viewPart != null) && (getInput() != RSEUIPlugin.getTheSystemRegistry()) && !(getInput() instanceof SystemEmptyListAPIProviderImpl)) {
-
- Object input = viewPart.getSite().getPage().getInput();
- if (input != null) {
- Object referencedElement = getReferencedObject(element);
- Object referencedInput = getReferencedObject(input);
- //System.out.println("TESTING1 " + input + " vs " + element);
- //System.out.println("TESTING2 " + referencedInput + " vs " + referencedElement);
- if ((input == element) || (referencedInput == referencedElement))
- affected = true;
- else {
- while (!affected && (input != null)) {
- input = getElementParent(input);
- if (input != null) {
- referencedInput = getReferencedObject(input);
- //System.out.println("...TESTING1 " + input + " vs " + element);
- //System.out.println("...TESTING2 " + referencedInput + " vs " + referencedElement);
- affected = ((input == element) || (referencedInput == referencedElement));
- }
- }
- }
- }
- }
- return affected;
- }
-
- protected Object getReferencedObject(Object inputObj) {
- if (inputObj instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference) inputObj).getReferencedFilterPool();
- else if (inputObj instanceof ISystemFilterReference)
- return ((ISystemFilterReference) inputObj).getReferencedFilter();
- else if (inputObj instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference) inputObj).getReferencedFilterString();
- else
- return inputObj;
- }
-
- protected Object getElementParent(Object inputObj) {
- if (inputObj instanceof IHost)
- return ((IHost) inputObj).getSystemProfile();
- else if (inputObj instanceof ISubSystem)
- return ((ISubSystem) inputObj).getHost();
- else if (inputObj instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference) inputObj).getProvider(); // will be a subsystem
- else if (inputObj instanceof ISystemFilterPool)
- return ((ISystemFilterPool) inputObj).getProvider(); // will be a subsystem factory. Hmm!
- else if (inputObj instanceof ISystemFilterReference)
- return ((ISystemFilterReference) inputObj).getParent(); // will be filter reference or filter pool reference
- else if (inputObj instanceof ISystemFilter) {
- ISystemFilter filter = (ISystemFilter) inputObj;
- if (filter.getParentFilter() != null)
- return filter.getParentFilter();
- else
- return filter.getParentFilterPool();
- } else if (inputObj instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference) inputObj).getParent(); // will be a SystemFilterReference
- else if (inputObj instanceof ISystemFilterString)
- return ((ISystemFilterString) inputObj).getParentSystemFilter();
- else
- return null;
- }
-
- protected IHost getInputConnection(Object inputObj) {
- if (inputObj instanceof IHost)
- return (IHost) inputObj;
- else if (inputObj instanceof ISubSystem)
- return ((ISubSystem) inputObj).getHost();
- else if (inputObj instanceof ISystemFilterPoolReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterPoolReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else if (inputObj instanceof ISystemFilterReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else if (inputObj instanceof ISystemFilterStringReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterStringReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else
- return null;
- }
-
- /**
- * Handy debug method to print a tree item
- */
- protected String printTreeItem(Item item) {
- if (item == null)
- return "";
- else if (item instanceof TreeItem) {
- TreeItem ti = (TreeItem) item;
- return printTreeItem(ti.getParentItem()) + "/" + ti.getText();
- } else
- return item.toString();
- }
-
- /**
- * Delete all occurrences of a given remote object
- */
- protected void deleteRemoteObject(Object deleteObject, ISubSystem subsystem) {
- Vector matches = null;
- String oldElementName = null;
-
- // STEP 1: get the object's remote adapter and subsystem
- if (deleteObject instanceof String)
- oldElementName = (String) deleteObject;
- else {
- ISystemRemoteElementAdapter rmtAdapter = getRemoteAdapter(deleteObject);
- if (rmtAdapter == null) return;
- oldElementName = rmtAdapter.getAbsoluteName(deleteObject);
- subsystem = rmtAdapter.getSubSystem(deleteObject);
- }
- // STEP 2: find all references to the object
- matches = findAllRemoteItemReferences(oldElementName, deleteObject, subsystem, matches);
- if (matches == null) {
- //System.out.println("matches is null");
- return;
- }
-
- boolean wasSelected = false;
- Item parentItem = null;
-
- boolean dupes = false;
- Object prevData = null;
- for (int idx = 0; !dupes && (idx < matches.size()); idx++) {
- Item match = (Item) matches.elementAt(idx);
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- if (match.getData() == prevData)
- dupes = true;
- else
- prevData = match.getData();
- }
- }
- //System.out.println("matches size = " + matches.size() + ", any binary duplicates? " + dupes);
-
- // STEP 3: process all references to the object
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- //System.out.println("...match " + idx + ": TreeItem? " + (match instanceof TreeItem) + ", disposed? " + ((TreeItem)match).isDisposed());
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- ((TreeItem) match).getParentItem(); // DWD may not be necessary
- Object data = match.getData();
- if (!wasSelected) {
- //wasSelected = isSelectedOrChildSelected(data);
- wasSelected = isTreeItemSelectedOrChildSelected(match);
- if (wasSelected) {
- clearSelection();
- parentItem = ((TreeItem) match).getParentItem();
- //System.out.println("...current item was selected");
- }
- }
- if (dupes) // defect 46818
- { // if there are multiple references to the same binary object, ...
- //System.out.println(".....calling refresh(data) on this match");
- /*
- if (pItem!=null)
- smartRefresh(new TreeItem[] {pItem}); // just refresh the parent node
- else
- refreshAll();
- */
- disassociate(match);
- match.dispose();
- } else {
- //System.out.println(".....calling remove(data) on this match");
- remove(data); // remove this item from the tree
- }
- }
- }
-
- // STEP 4: if we removed a selected item, select its parent
- if (wasSelected && (parentItem != null) && (parentItem instanceof TreeItem) && (parentItem.getData() != null)) {
- //System.out.println("Resetting selection to parent");
- setSelection(new StructuredSelection(parentItem.getData()), true);
- }
- return;
- }
-
- /**
- * Rename a remote object. Renames all references to it currently displayed in this tree.
- */
- protected void renameRemoteObject(Object renameObject, String oldElementName, ISubSystem subsystem) {
- String[] properties = new String[1];
- properties[0] = IBasicPropertyConstants.P_TEXT;
-
- // STEP 0: do we have the physical remote object that has been renamed? If so, update it directly
- /*
- Item item = (Item)findItem(renameObject);
- if (item != null)
- {
- update(renameObject, properties); // for refreshing non-structural properties in viewer when model changes
- if (item instanceof TreeItem)
- smartRefresh(new TreeItem[] {(TreeItem)item}); // we update the kids because they typically store references to their parent
- }
- */
-
- Vector matches = null;
-
- // STEP 1: get the object's remote adapter and subsystem
- //String newElementName = null;
- ISystemRemoteElementAdapter rmtAdapter = null;
- if (renameObject instanceof String) {
- //FIXME How to get the adapter based on the String name?
- //newElementName = (String)renameObject;
- } else {
- rmtAdapter = getRemoteAdapter(renameObject);
- subsystem = rmtAdapter.getSubSystem(renameObject);
- }
-
- // STEP 2: find all references to the old name object
- matches = findAllRemoteItemReferences(oldElementName, renameObject, subsystem, matches);
- if (matches == null) return;
-
- TreeItem[] selected = getTree().getSelection();
- getTree().deselectAll();
-
- boolean refresh = false;
- // STEP 3: process all references to the old name object
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
-
- if (data != renameObject) // not a binary match
- {
- if (rmtAdapter == null) rmtAdapter = getRemoteAdapter(data);
- refresh = rmtAdapter.refreshRemoteObject(data, renameObject); // old, new
- } else {
- refresh = true;
- }
-
-
- internalUpdate(match, data, properties);
-
- //update(data, properties); // for refreshing non-structural properties in viewer when model changes
- //System.out.println("Match found. refresh required? " + refresh);
-// if (refresh)
- //refreshRemoteObject(data,null,false);
- // smartRefresh(new TreeItem[] { (TreeItem) match });
- }
- }
-
- if (refresh)
- {
- smartRefresh((TreeItem[])matches.toArray(new TreeItem[matches.size()]));
- getTree().setSelection(selected);
- }
-
- // STEP 4: update property sheet, just in case.
- updatePropertySheet();
-
- return;
- }
-
- /**
- * Update properties of remote object. Update all references to this object
- */
- protected void updateRemoteObjectProperties(Object remoteObject) {
- Vector matches = new Vector();
-
- // STEP 1: get the object's remote adapter and subsystem
- ISystemRemoteElementAdapter rmtAdapter = getRemoteAdapter(remoteObject);
- ISubSystem subsystem = rmtAdapter.getSubSystem(remoteObject);
-
- // STEP 2: find all references to the object
- String oldElementName = rmtAdapter.getAbsoluteName(remoteObject);
- findAllRemoteItemReferences(oldElementName, remoteObject, subsystem, matches);
-
- // STEP 3: process all references to the object
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
- if (data == remoteObject) // same binary object as given?
- update(data, allProps); // for refreshing non-structural properties in viewer when model changes
- else // match by name
- {
- rmtAdapter.refreshRemoteObject(data, remoteObject); // old, new
- update(data, allProps);
- }
- }
- }
-
- // STEP 4: update the property sheet in case we changed properties of first selected item
- updatePropertySheet();
- return;
- }
-
- /**
- * Refresh contents of remote container. Refreshes all references to this container including filters that
- * display the contents of this container.
- * @param remoteObject - either an actual remote object, or the absolute name of a remote object
- * @param toSelect - the child object to select after refreshing the given object. This will force the
- * object to be expanded, and then select this object which can be a remote object or absolute name of a
- * remote object. To simply force an expand of the remote object, without bothering to select a child,
- * pass an instance of SystemViewDummyObject.
- * @return true if a refresh done, false if given a non-remote object.
- */
- protected boolean refreshRemoteObject(Object remoteObject, Object toSelect, boolean originatedHere) {
- if (remoteObject == null) return false;
-
- // STEP 1: get the object's remote adapter and subsystem, or use its name if only given that
- ISystemRemoteElementAdapter rmtAdapter = null;
- ISubSystem subsystem = null;
- String oldElementName = null;
- if (!(remoteObject instanceof String)) {
- rmtAdapter = getRemoteAdapter(remoteObject);
- if (rmtAdapter == null) return false;
- subsystem = rmtAdapter.getSubSystem(remoteObject);
- oldElementName = rmtAdapter.getAbsoluteName(remoteObject);
- } else
- oldElementName = (String) remoteObject;
-
- Vector matches = new Vector();
- // STEP 2: find all references to the object
- findAllRemoteItemReferences(oldElementName, remoteObject, subsystem, matches);
- if (remoteObject instanceof String) remoteObject = getFirstRemoteObject(matches);
-
- if (remoteObject instanceof ISystemContainer) {
- ((ISystemContainer) remoteObject).markStale(true);
- }
-
- // STEP 3: process all references to the object
- boolean firstSelection = true;
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
- smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object
- if (firstSelection && // for now, we just select the first binary occurrence we find
- (data == remoteObject)) // same binary object as given?
- {
- firstSelection = false;
- if ((toSelect != null) && originatedHere) {
- if (!getExpanded(match)) // assume if callers wants to select kids that they want to expand parent
- {
- createChildren(match);
- setExpanded(match, true);
- }
- // todo: handle cumulative selections.
- // STEP 4: If requested, select the kids in the newly refreshed object.
- // If the same binary object appears multiple times, select the kids in the first occurrence.
- // ... what else to do?
- if (!(toSelect instanceof SystemViewDummyObject)) selectRemoteObjects(toSelect, null, match); // select the given kids in this parent
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Given the result of findAllRemoteItemReferences, scan for first non-filter object
- */
- protected Object getFirstRemoteObject(Vector matches) {
- if ((matches == null) || (matches.size() == 0)) return null;
- Object firstRemote = matches.elementAt(0);
- if (firstRemote != null) firstRemote = ((Item) firstRemote).getData();
- return firstRemote;
- }
-
- /**
- * Refreshes the tree starting at the given widget.
- *
- * @param widget the widget
- * @param element the element
- * @param doStruct <code>true</code> if structural changes are to be picked up,
- * and <code>false</code> if only label provider changes are of interest
- */
- protected void ourInternalRefresh(Widget widget, Object element, boolean doStruct, boolean forceRemote, boolean doTimings) {
- final Widget fWidget = widget;
- final Object fElement = element;
- final boolean fDoStruct = doStruct;
-
- // we have to take special care if one of our kids are selected and it is a remote object...
- if (forceRemote || (isSelectionRemote() && isTreeItemSelectedOrChildSelected(widget))) {
- if (!isTreeItemSelected(widget)) // it is one of our kids that is selected
- {
- clearSelection(); // there is nothing much else we can do. Calling code will restore it anyway hopefully
- doOurInternalRefresh(fWidget, fElement, fDoStruct, doTimings);
- } else // it is us that is selected. This might be a refresh selected operation. TreeItem address won't change
- {
- doOurInternalRefresh(fWidget, fElement, fDoStruct, doTimings);
- }
- } else {
- final boolean finalDoTimings = doTimings;
- preservingSelection(new Runnable() {
- public void run() {
- doOurInternalRefresh(fWidget, fElement, fDoStruct, finalDoTimings);
- }
- });
- }
- }
-
- protected boolean isSelectionRemote() {
- ISelection s = getSelection();
- if ((s != null) && (s instanceof IStructuredSelection)) {
- IStructuredSelection ss = (IStructuredSelection) s;
- Object firstSel = ss.getFirstElement();
- if ((firstSel != null) && (getRemoteAdapter(firstSel) != null)) return true;
- }
- return false;
- }
-
- protected void doOurInternalRefresh(Widget widget, Object element, boolean doStruct, boolean doTimings) {
- if (debug) {
- logDebugMsg("in doOurInternalRefresh on " + getAdapter(element).getName(element));
- logDebugMsg("...current selection is " + getFirstSelectionName(getSelection()));
- }
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- if (widget instanceof Item) {
- //System.out.println("Inside doOurInternalRefresh. widget = " + ((TreeItem)widget).handle);
- if (doStruct) {
- updatePlus((Item) widget, element);
- }
- updateItem(widget, element);
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 1: time to updatePlus and updateItem:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- if (doStruct) {
- // pass null for children, to allow updateChildren to get them only if needed
- // Object[] newChildren = null;
- if ((widget instanceof Item) && getExpanded((Item) widget)) {
- // DKM - get raw children does a query but so does internalRefresh()
- // newChildren = getRawChildren(widget);
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 2: time to getRawChildren:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
- // DKM - without the else we get duplicate queries on expanded folder
- // uncommented - seems new results after query aren't showing up
- //else
- {
- internalRefresh(element);
- }
-
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 3: time to updateChildren:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
- // recurse
- Item[] children = getChildren(widget);
- if (children != null) {
- //SystemElapsedTimer timer2 = null;
- //int intervalCount = 0;
- //if (doTimings)
- //timer2 = new SystemElapsedTimer();
- for (int i = 0; i < children.length; i++) {
- Widget item = children[i];
- Object data = item.getData();
- if (data != null) doOurInternalRefresh(item, data, doStruct, false);
- /*
- if (doTimings)
- {
- ++intervalCount;
- if (intervalCount == 1000)
- {
- System.out.println("...time to recurse next 1000 children: " + timer2.setEndTime());
- intervalCount = 0;
- timer2.setStartTime();
- }
- }*/
- }
- }
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 4: time to recurse children:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- protected Object[] getRawChildren(Widget w) {
- Object parent = w.getData();
- if (w != null) {
- if (parent.equals(getRoot())) return super.getRawChildren(parent);
- Object[] result = ((ITreeContentProvider) getContentProvider()).getChildren(parent);
- if (result != null) return result;
- }
- return new Object[0];
- }
-
- /*
- protected void preservingSelection(Runnable updateCode)
- {
- super.preservingSelection(updateCode);
- System.out.println("After preservingSelection: new selection = "+getFirstSelectionName(getSelection()));
- }
- protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection)
- {
- System.out.println("Inside handleInvalidSelection: old = "+getFirstSelectionName(invalidSelection)+", new = "+getFirstSelectionName(newSelection));
- updateSelection(newSelection);
- }
- */
- protected String getFirstSelectionName(ISelection s) {
- if ((s != null) && (s instanceof IStructuredSelection)) {
- IStructuredSelection ss = (IStructuredSelection) s;
- Object firstSel = ss.getFirstElement();
- String name = null;
- if (firstSel != null) {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(firstSel);
- if (ra != null)
- name = ra.getAbsoluteName(firstSel);
- else
- name = getAdapter(firstSel).getName(firstSel);
- }
- return name;
- } else
- return null;
- }
-
- /**
- * Expand a remote object within the tree. Must be given its parent element within the tree,
- * in order to uniquely find it. If not given this, we expand the first occurrence we find!
- * @param remoteObject - either a remote object or a remote object absolute name
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentObject - the parent that owns the remote objects, to optimize searches. Can
- * be an object or the absolute name of a remote object.
- * @return the tree item of the remote object if found and expanded, else null
- */
- public Item expandRemoteObject(Object remoteObject, ISubSystem subsystem, Object parentObject) {
- // given the parent? Should be easy
- Item remoteItem = null;
- if (parentObject != null) {
- Item parentItem = null;
- if (parentObject instanceof Item)
- parentItem = (Item) parentObject;
- else if (parentObject instanceof String) // given absolute name of remote object
- parentItem = findFirstRemoteItemReference((String) parentObject, subsystem, (Item) null); // search all roots for the parent
- else // given actual remote object
- {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(parentObject);
- if (ra != null) {
- if (subsystem == null) subsystem = ra.getSubSystem(parentObject);
- parentItem = findFirstRemoteItemReference(ra.getAbsoluteName(parentObject), subsystem, (Item) null); // search all roots for the parent
- } else // else parent is not a remote object. Probably its a filter
- {
- Widget parentWidget = findItem(parentObject);
- if (parentWidget instanceof Item) parentItem = (Item) parentWidget;
- }
- }
- // ok, we have the parent item! Hopefully!
- if (remoteObject instanceof String)
- remoteItem = findFirstRemoteItemReference((String) remoteObject, subsystem, parentItem);
- else
- remoteItem = findFirstRemoteItemReference(remoteObject, parentItem);
- if (remoteItem == null) return null;
- setExpandedState(remoteItem.getData(), true);
- } else // not given a parent to refine search with. Better have a subsystem!!
- {
- if (remoteObject instanceof String)
- remoteItem = findFirstRemoteItemReference((String) remoteObject, subsystem, (Item) null);
- else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteObject);
- if (ra != null) {
- if (subsystem == null) subsystem = ra.getSubSystem(remoteObject);
- remoteItem = findFirstRemoteItemReference(ra.getAbsoluteName(remoteObject), subsystem, (Item) null);
- }
- }
- if (remoteItem == null) return null;
- setExpandedState(remoteItem.getData(), true);
- }
- return remoteItem;
- }
-
- /**
- * Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null)
- * @param src - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute names
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentObject - the parent that owns the remote objects, to optimize searches.
- * @return true if found and selected
- */
- public boolean selectRemoteObjects(Object src, ISubSystem subsystem, Object parentObject) {
- //String parentName = null;
- // given a parent object? That makes it easy...
- if (parentObject != null) {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(parentObject);
- if (ra != null) {
- //parentName = ra.getAbsoluteName(parentObject);
- if (subsystem == null) subsystem = ra.getSubSystem(parentObject);
- Item parentItem = findFirstRemoteItemReference(parentObject, (Item) null); // search all roots for the parent
- return selectRemoteObjects(src, subsystem, parentItem);
- } else // else parent is not a remote object. Probably its a filter
- {
- Item parentItem = null;
- if (parentObject instanceof Item)
- parentItem = (Item) parentObject;
- else {
- Widget parentWidget = findItem(parentObject);
- if (parentWidget instanceof Item) parentItem = (Item) parentWidget;
- }
- if (parentItem != null)
- return selectRemoteObjects(src, (ISubSystem) null, parentItem);
- else
- return false;
- }
- } else
- //return selectRemoteObjects(src, (SubSystem)null, (Item)null); // Phil test
- return selectRemoteObjects(src, subsystem, (Item) null);
- }
-
- /**
- * Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null) and parent TreeItem to
- * start the search at (can be null)
- * @param src - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute names
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentItem - the parent at which to start the search to find the remote objects. Else, starts at the roots.
- * @return true if found and selected
- */
- protected boolean selectRemoteObjects(Object src, ISubSystem subsystem, Item parentItem) {
- clearSelection();
- Item selItem = null;
-
- if (parentItem != null && parentItem.isDisposed()) {
- return false;
- }
-
- if ((parentItem != null) && !getExpanded(parentItem))
- //setExpanded(parentItem, true);
- setExpandedState(parentItem.getData(), true);
-
- //System.out.println("SELECT_REMOTE: PARENT = " + parent + ", PARENTITEM = " + parentItem);
- if (src instanceof Vector) {
- //String elementName = null;
- Vector selVector = (Vector) src;
- ArrayList selItems = new ArrayList();
- // our goal here is to turn the vector of names or remote objects into a collection of
- // actual TreeItems we matched them on...
- for (int idx = 0; idx < selVector.size(); idx++) {
- Object o = selVector.elementAt(idx);
- //elementName = null;
- if (o instanceof String)
- selItem = findFirstRemoteItemReference((String) o, subsystem, parentItem);
- else
- selItem = findFirstRemoteItemReference(o, parentItem);
-
- if (selItem != null) {
- selItems.add(selItem);
- // when selecting multiple items, we optimize by assuming they have the same parent...
- if ((parentItem == null) && (selItem instanceof TreeItem)) parentItem = ((TreeItem) selItem).getParentItem();
- }
- }
- if (selItems.size() > 0) {
- setSelection(selItems);
- updatePropertySheet();
- return true;
- }
- } else {
- if (src instanceof String)
- //selItem = (Item)findFirstRemoteItemReference((String)src, (SubSystem)null, parentItem); Phil test
- selItem = findFirstRemoteItemReference((String) src, subsystem, parentItem);
- else
- selItem = findFirstRemoteItemReference(src, parentItem);
-
- if (selItem != null) {
- ArrayList selItems = new ArrayList();
- selItems.add(selItem);
- setSelection(selItems);
- updatePropertySheet();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Refresh the whole tree. We have special code to reselect remote objects after the refresh
- */
- public void refreshAll() {
- IStructuredSelection selected = (IStructuredSelection) getSelection();
- Iterator i = selected.iterator();
- Object parentElement = null;
- Vector selectedRemoteObjects = new Vector();
- Widget parentItem = null;
- ISubSystem ss = null;
- while (i.hasNext()) {
- Object element = i.next();
- if (parentElement == null) {
- parentItem = getParentItem((Item) findItem(element));
- if ((parentItem != null) && (parentItem instanceof Item)) parentElement = ((Item) parentItem).getData();
- }
- if (getRemoteAdapter(element) != null) {
- selectedRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- }
-
- //super.refresh();
- smartRefresh((Object) null, (selectedRemoteObjects.size() > 0));
-
- if (selectedRemoteObjects.size() > 0) {
- selectRemoteObjects(selectedRemoteObjects, ss, parentElement);
- }
- }
-
- /**
- * Do an intelligent refresh of an expanded item. The inherited algorithm for refresh is stupid,
- * in that it reexpands children based on their original ordinal position which can change after a
- * refresh, resulting in the wrong children being expanded. Currently this only truly comes to light
- * for remote objects, where refresh really can change the resulting list and hence each child's
- * ordinal position. So, to be safe we only override the inherited algorithm if any nested child
- * is a remote object
- */
- protected void smartRefresh(TreeItem[] itemsToRefresh) {
- smartRefresh(itemsToRefresh, null, false);
- }
-
- protected void smartRefresh(TreeItem[] itemsToRefresh, ArrayList expandedChildren, boolean forceRemote) {
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- areAnyRemote = false; // set in ExpandedItem constructor
- boolean fullRefresh = false;
- // for each selected tree item gather a list of expanded child nodes...
- if (expandedChildren == null)
- expandedChildren = new ArrayList();
- else
- fullRefresh = true;
- boolean[] wasExpanded = new boolean[itemsToRefresh.length];
- //boolean anyGivenItemsRemote = false;
- for (int idx = 0; idx < itemsToRefresh.length; idx++) {
- TreeItem currItem = itemsToRefresh[idx];
- // ...if this selected item is expanded, recursively gather up all its expanded descendents
- Object data = currItem.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- //if (adapter instanceof ISystemRemoteElementAdapter) {
- // anyGivenItemsRemote = true;
- //}
- if (currItem.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false); // collapse temp expansion of prompts
- else if (currItem.getExpanded()) {
- //expandedChildren.add(new ExpandedItem(currItem)); we don't need special processing for given items themselves as they will not be refreshed, only their kids
- if (doTimings) timer.setStartTime();
- gatherExpandedChildren((fullRefresh ? null : currItem), currItem, expandedChildren);
- wasExpanded[idx] = true;
- if (doTimings) System.out.println("Refresh Timer 1: time to gatherExpandedChildren: " + timer.setEndTime());
- } else
- wasExpanded[idx] = false;
- }
- // ok, we have found all expanded descendents of all selected items.
-
- // If none of the expanded sub-nodes are remote simply use the inherited algorithm for refresh
- if (!areAnyRemote) {
- for (int idx = 0; idx < itemsToRefresh.length; idx++)
- //ourInternalRefresh(itemsToRefresh[idx], itemsToRefresh[idx].getData(), wasExpanded[idx]);
- ourInternalRefresh(itemsToRefresh[idx], itemsToRefresh[idx].getData(), true, forceRemote, doTimings); // defect 42321
- return;
- }
- getControl().setRedraw(false);
- // If any selected nodes are remote use our own algorithm:
- // 1. collapse each given node and refresh it to remove the children from memory, then
- // expand it again. It doesn't matter if it is remote or not since its own memory
- // address won't change, only that of its children.
- for (int idx = 0; idx < itemsToRefresh.length; idx++) {
- TreeItem currItem = itemsToRefresh[idx];
- if (doTimings) timer.setStartTime();
- setExpanded(currItem, false); // collapse node
- if (doTimings) {
- System.out.println("Refresh Timer 2: time to setExpanded(false): " + timer.setEndTime());
- timer.setStartTime();
- }
- ourInternalRefresh(currItem, currItem.getData(), true, true, doTimings); // dispose of children, update plus
- if (doTimings) {
- System.out.println("Refresh Timer 3: time to do ourInternalRefresh(...): " + timer.setEndTime());
- timer.setStartTime();
- }
- if (wasExpanded[idx]) {
- createChildren(currItem); // re-expand
- if (doTimings) {
- System.out.println("Refresh Timer 4: time to createChildren(...): " + timer.setEndTime());
- timer.setStartTime();
- }
- currItem.setExpanded(true);
- if (doTimings) {
- System.out.println("Refresh Timer 5: time to setExpanded(true): " + timer.setEndTime());
- timer.setStartTime();
- }
- } else // hmm, item was not expanded so just flush its memory
- {
-
- }
- }
- // 2. expand each previously expanded sub-node, recursively
- for (int idx = 0; idx < expandedChildren.size(); idx++) {
- ExpandedItem itemToExpand = (ExpandedItem) expandedChildren.get(idx);
- if (itemToExpand.isRemote()) {
- // find remote item based on its original name and unchanged root parent
- Item item = null;
- //if (itemToExpand.parentItem != null)
- //item = (Item)recursiveFindRemoteItem(itemToExpand.parentItem, itemToExpand.remoteName, itemToExpand.subsystem);
- //else
- //item = (Item)findRemoteItem(itemToExpand.remoteName, itemToExpand.subsystem);
- item = findFirstRemoteItemReference(itemToExpand.remoteName, itemToExpand.subsystem, itemToExpand.parentItem);
- // if found, re-expand it
- if (item != null) {
- //setExpanded(item, true);
- createChildren(item);
- ((TreeItem) item).setExpanded(true);
- if (debug) System.out.println("Re-Expanded RemoteItem: " + itemToExpand.remoteName);
- } else if (debug) System.out.println("Re-Expand of RemoteItem '" + itemToExpand.remoteName + "' failed. Not found");
- } else {
- setExpandedState(itemToExpand.data, true);
- if (debug) System.out.println("Re-Expanded non-remote Item: " + itemToExpand.data);
- }
- }
- if (doTimings) {
- System.out.println("Refresh Timer 6: time to reExpanded expanded subnodes: " + timer.setEndTime());
- timer.setStartTime();
- }
- getControl().setRedraw(true);
- if (doTimings) {
- System.out.println("Refresh Timer 7: time to setRedraw(true): " + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- /**
- * Do an intelligent refresh of the given element. Can be null for full refresh
- */
- protected void smartRefresh(Object element, boolean forceRemote) {
- if ((element == null) || (element == getInput())) {
- // fullRefresh
- Tree tree = getTree();
- TreeItem[] roots = tree.getItems();
- boolean anyExpanded = false;
- areAnyRemote = false; // set in ExpandedItem constructor
- ArrayList expandedChildren = new ArrayList();
- if (roots != null) {
- for (int idx = 0; idx < roots.length; idx++) {
- TreeItem currItem = roots[idx];
- Object data = currItem.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- if (currItem.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false);
- else if (currItem.getExpanded()) {
- //setExpanded(roots[idx], false);
- expandedChildren.add(new ExpandedItem(null, currItem));
- anyExpanded = true;
- //gatherExpandedChildren(currItem, currItem, expandedChildren);
- }
- }
- }
- if (!anyExpanded)
- super.refresh();
- else {
- internalRefresh(getInput());
- roots = tree.getItems(); // re-query roots
- smartRefresh(roots, expandedChildren, forceRemote);
- }
- } else if (getRemoteAdapter(element) != null) {
-
- Item item = null;
- if (element instanceof String) {
- item = findFirstRemoteItemReference((String) element, (ISubSystem) null, (Item) null);
- if (item != null) {
- smartRefresh(new TreeItem[] { (TreeItem) item });
- }
- } else {
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(element);
- String elementName = adapter.getName(element);
- ISubSystem subSystem = adapter.getSubSystem(element);
-
- Vector matches = new Vector();
- findAllRemoteItemReferences(elementName, element, subSystem, matches);
- if (matches.size() > 0) {
- for (int i = 0; i < matches.size(); i++) {
- Item match = (Item) matches.get(i);
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- smartRefresh(new TreeItem[] { (TreeItem) match });
- }
- }
- }
- }
-
- /*
- Item item = null;
- if (element instanceof String)
- item = findFirstRemoteItemReference((String)element, (SubSystem)null, (Item)null);
- else
- item = findFirstRemoteItemReference(element, (Item)null);
- if (item != null)
- smartRefresh(new TreeItem[] {(TreeItem)item});
-
- */
- } else {
- Item item = (Item) findItem(element);
- //System.out.println("Inside SV smartRefresh for "+element+". Item found? " + (item!=null));
- if (item != null) smartRefresh(new TreeItem[] { (TreeItem) item });
- }
- }
-
- class ExpandedItem {
- TreeItem item, parentItem;
- Object data;
- String remoteName;
- ISystemRemoteElementAdapter remoteAdapter;
- ISubSystem subsystem;
-
- ExpandedItem(TreeItem parentItem, TreeItem item) {
- this.parentItem = parentItem;
- this.item = item;
- this.data = item.getData();
- if (data != null) {
- remoteAdapter = getRemoteAdapter(data);
- if (remoteAdapter != null) {
- remoteName = remoteAdapter.getAbsoluteName(data);
- subsystem = remoteAdapter.getSubSystem(data);
- areAnyRemote = true;
- if (debug) System.out.println("ExpandedRemoteItem added. remoteName = " + remoteName);
- } else if (debug) System.out.println("ExpandedItem added. Data = " + data);
- } else if (debug) System.out.println("ExpandedItem added. Data = null");
- }
-
- boolean isRemote() {
- return (remoteAdapter != null);
- }
- }
-
- /**
- * Gather up all expanded children of the given tree item into a list that can be used later to
- * reexpand.
- * @param parentItem The root parent which will not be refreshed itself (only its kids) and hence will remain valid after refresh.
- * In a full refresh this will be null.
- * @param startingItem The starting item for this search. Usually same as parentItem, but changes via recursion
- * @param listToPopulate An array list that will be populated with instances of our inner class ExpandedItem
- */
- protected void gatherExpandedChildren(TreeItem parentItem, TreeItem startingItem, ArrayList listToPopulate) {
- TreeItem[] itemChildren = startingItem.getItems();
- if (itemChildren != null) {
- for (int idx = 0; idx < itemChildren.length; idx++) {
- TreeItem currChild = itemChildren[idx];
- Object data = currChild.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- if (currChild.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false);
- else if (currChild.getExpanded()) {
- listToPopulate.add(new ExpandedItem(parentItem, currChild));
- gatherExpandedChildren(parentItem, currChild, listToPopulate);
- }
- }
- }
- }
-
- /**
- * Get index of item given its data element
- */
- protected int getItemIndex(Widget parent, Object element) {
- int index = -1;
- Item[] kids = getChildren(parent);
- if (kids != null) for (int idx = 0; idx < kids.length; idx++)
- if (kids[idx].getData() == element) index = idx;
- return index;
- }
-
- /**
- * We don't show actual filters, only filter references that are unique generated
- * for each subtree of each subsystem. Yet, each event is relative to the filter,
- * not our special filter references. Hence, all this code!!
- * <p>
- * Special case handling for updates to filters which affect the filter
- * but not the filter parent:
- * 1. Existing filter renamed (RENAME)
- * 2. Existing filter's filter strings changed (CHANGE)
- * <p>
- * Assumption:
- * 1. event.getGrandParent() == subsystem (one event fired per affected subsystem)
- * 2. event.getSource() == filter or filter string (not the reference, the real filter or string)
- * 3. event.getParent() == parent of filter or filter string. One of:
- * a. filterPool reference or filter reference (nested)
- * b. filterPool for non-nested filters when showing filter pools
- * c. subsystem for non-nested filters when not showing filter pools
- * d. filter for nested filters
- * <p>
- * Our job here:
- * 1. Determine if we are even showing the given subsystem
- * 2. Find the reference to the updated filter in that subsystem's subtree
- * 3. Ask that parent to either update its name or collapse and refresh its children
- * 4. Forget selecting something ... the original item remains selected!
- */
- protected void findAndUpdateFilter(ISystemResourceChangeEvent event, int type) {
- ISystemFilter filter = (ISystemFilter) event.getSource();
- //Object parent = event.getParent();
- if (debug) {
- String eventType = null;
- switch (type) {
- case EVENT_RENAME_FILTER_REFERENCE:
- eventType = "EVENT_RENAME_FILTER_REFERENCE";
- break;
- case EVENT_CHANGE_FILTER_REFERENCE:
- eventType = "EVENT_CHANGE_FILTER_REFERENCE";
- break;
- }
- logDebugMsg("SV event: " + eventType);
- }
-
- // STEP 1. ARE WE EVEN SHOWING THE GIVEN SUBSYSTEM?
- ISubSystem ss = (ISubSystem) event.getGrandParent();
- Widget widget = findItem(ss);
-
- if (widget != null) {
-
- // STEP 2: ARE WE SHOWING A REFERENCE TO RENAMED OR UPDATED FILTER?
- Widget item = null;
-
- Control c = getControl();
-
- // KM: defect 53008.
- // Yes we are showing the subsystem, so widget is the subsystem item
- if (widget != c && widget instanceof Item) {
-
- if (debug) logDebugMsg("...Found ss " + ss);
-
- item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE);
- }
- // No, we are not showing the subsystem, so widget is the control
- else if (widget == c) {
-
- if (debug) logDebugMsg("...Din not find ss " + ss);
-
- item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE);
- }
-
- if (item == null)
- logDebugMsg("......didn't find renamed/updated filter's reference!");
- else {
- // STEP 3: UPDATE THAT FILTER...
- if (type == EVENT_RENAME_FILTER_REFERENCE) {
- String[] rproperties = { IBasicPropertyConstants.P_TEXT };
- update(item.getData(), rproperties); // for refreshing non-structural properties in viewer when model changes
- } else if (type == EVENT_CHANGE_FILTER_REFERENCE) {
- //if (((TreeItem)item).getExpanded())
- //refresh(item.getData());
- smartRefresh(new TreeItem[] { (TreeItem) item });
- /*
- Object data = item.getData();
- boolean wasExpanded = getExpanded((Item)item);
- setExpandedState(data, false); // collapse node
- refresh(data); // clear all cached widgets
- if (wasExpanded)
- setExpandedState(data, true); // by doing this all subnodes that were expanded are now collapsed
- */
- }
- updatePropertySheet();
- }
- }
- }
-
- protected void findAndUpdateFilterString(ISystemResourceChangeEvent event, int type) {
- ISystemFilterString filterString = (ISystemFilterString) event.getSource();
- // STEP 1. ARE WE EVEN SHOWING THE GIVEN SUBSYSTEM?
- ISubSystem ss = (ISubSystem) event.getGrandParent();
- Widget item = findItem(ss);
- if (item != null && item != getControl()) {
- Item ssItem = (Item) item;
- if (debug) logDebugMsg("...Found ss " + ss);
- // STEP 2: ARE WE SHOWING A REFERENCE TO THE UPDATED FILTER STRING?
- item = internalFindReferencedItem(ssItem, filterString, SEARCH_INFINITE);
- if (item == null)
- logDebugMsg("......didn't find updated filter string's reference!");
- else {
- // STEP 3: UPDATE THAT FILTER STRING...
- if (type == EVENT_CHANGE_FILTERSTRING_REFERENCE) // HAD BETTER!
- {
- //if (((TreeItem)item).getExpanded())
- //refresh(item.getData());
- // boolean wasExpanded = getExpanded((Item)item);
- Object data = item.getData();
- setExpandedState(data, false); // collapse node
- refresh(data); // clear all cached widgets
- //if (wasExpanded)
- //setExpandedState(data, true); // hmm, should we?
- String properties[] = { IBasicPropertyConstants.P_TEXT };
- update(item.getData(), properties); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- }
- }
- }
- }
-
- /**
- * We don't show actual filters, only filter references that are unique generated
- * for each subtree of each subsystem. Yet, each event is relative to the filter,
- * not our special filter references. Hence, all this code!!
- * <p>
- * Special case handling for updates to filters which affect the parent of the
- * filter, such that the parent's children must be re-generated:
- * 1. New filter created (ADD)
- * 2. Existing filter deleted (DELETE)
- * 3. Existing filters reordered (MOVE)
- * <p>
- * Assumption:
- * 1. event.getGrandParent() == subsystem (one event fired per affected subsystem)
- * 2. event.getSource() == filter (not the reference, the real filter)
- * 3. event.getParent() == parent of filter. One of:
- * a. filterPool reference or filter reference (nested)
- * b. filterPool for non-nested filters when showing filter pools
- * c. subsystem for non-nested filters when not showing filter pools
- * d. filter for nested filters
- * <p>
- * Our job here:
- * 1. Determine if we are even showing the given subsystem
- * 2. Find the parent to the given filter: filterPool or subsystem
- * 3. Ask that parent to refresh its children (causes re-gen of filter references)
- * 4. Select something: QUESTION: is this subsystem the origin of this action??
- * a. For ADD, select the newly created filter reference for the new filter
- * ANSWER: IF PARENT OF NEW FILTER IS WITHIN THIS SUBSYSTEM, AND WAS SELECTED PREVIOUSLY
- * b. For DELETE, select the parent of the filter?
- * ANSWER: IF DELETED FILTER IS WITHING THIS SUBSYSTEM AND WAS SELECTED PREVIOUSLY
- * c. For MOVE, select the moved filters
- * ANSWER: IF MOVED FILTERS ARE WITHIN THIS SUBSYSTEM, AND WERE SELECTED PREVIOUSLY
- */
- protected void findAndUpdateFilterParent(ISystemResourceChangeEvent event, int type) {
- ISubSystem ss = (ISubSystem) event.getGrandParent();
-
-
- boolean add = false, move = false, delete = false;
- boolean afilterstring = false;
- //if (debug)
- //{
- String eventType = null;
- switch (type) {
- case EVENT_ADD_FILTER_REFERENCE:
- add = true;
- if (debug) eventType = "EVENT_ADD_FILTER_REFERENCE";
- break;
- case EVENT_DELETE_FILTER_REFERENCE:
- delete = true;
- if (debug) eventType = "EVENT_DELETE_FILTER_REFERENCE";
- break;
- case EVENT_MOVE_FILTER_REFERENCES:
- move = true;
- if (debug) eventType = "EVENT_MOVE_FILTER_REFERENCES";
- break;
- case EVENT_ADD_FILTERSTRING_REFERENCE:
- add = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_ADD_FILTERSTRING_REFERENCE";
- break;
- case EVENT_DELETE_FILTERSTRING_REFERENCE:
- delete = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_DELETE_FILTERSTRING_REFERENCE";
- break;
- case EVENT_MOVE_FILTERSTRING_REFERENCES:
- move = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_MOVE_FILTERSTRING_REFERENCES";
- break;
-
- }
- if (debug) logDebugMsg("SV event: " + eventType);
- //}
- //clearSelection();
-
- ISystemFilter filter = null;
- ISystemFilterString filterstring = null;
- if (!afilterstring)
- filter = (ISystemFilter) event.getSource(); // for multi-source move, gets first filter
- else
- filterstring = (ISystemFilterString) event.getSource();
-
- boolean multiSource = move;
- // STEP 1: ARE WE SHOWING THE SUBSYSTEM GRANDPARENT OF CURRENT REFRESH?
- Widget item = findItem(ss);
-
- if (item == null) {
- refresh();
-
- if (debug) logDebugMsg("...Did not find ss " + ss.getName());
- return;
- }
- Item ssItem = (Item) item;
- boolean wasSelected = false;
- IStructuredSelection oldSelections = (IStructuredSelection) getSelection();
-
- Object parent = event.getParent();
- if (debug) logDebugMsg("...Found ss " + ss);
-
- // STEP 2: ARE WE SHOWING A REFERENCE TO THE FILTER's PARENT POOL?
- Item parentRefItem = null;
- ISystemFilterContainer refdParent = null;
- // 3a (reference to filter pool or filter)
- if (parent instanceof ISystemFilterContainerReference) // given a reference to parent?
- {
- refdParent = ((ISystemFilterContainerReference) parent).getReferencedSystemFilterContainer();
- parentRefItem = (Item) internalFindReferencedItem(ssItem, refdParent, SEARCH_INFINITE);
- }
- // 3b and 3d. (filter pool or filter)
- else if (parent instanceof ISystemFilterContainer) {
- refdParent = (ISystemFilterContainer) parent;
- parentRefItem = (Item) internalFindReferencedItem(ssItem, refdParent, SEARCH_INFINITE);
- }
- // 3c (subsystem)
- else {
- parentRefItem = ssItem;
- }
- if (parentRefItem != null) {
- if (debug) logDebugMsg("......We are showing reference to parent");
- // STEP 3... YES, SO REFRESH PARENT... IT WILL RE-GEN THE FILTER REFERENCES FOR EACH CHILD FILTER
- // ... actually, call off the whole show if that parent is currently not expanded!!
- // HMMM... WE NEED TO REFRESH EVEN IF NOT EXPANDED IF ADDING FIRST CHILD
- if (!add) // move or delete
- {
- if (!(((TreeItem) parentRefItem).getExpanded())) {
- refresh(parentRefItem.getData()); // flush cached widgets so next expand is fresh
- return;
- }
- // move or delete and parent is expanded...
- Item oldItem = (Item) internalFindReferencedItem(parentRefItem, afilterstring ? (Object) filterstring : (Object) filter, 1);
- //if (debug)
- //logDebugMsg("oldItem null? " + (oldItem==null));
- if (oldItem != null) // found moved or deleted filter in our subtree
- {
- wasSelected = isSelected(oldItem.getData(), oldSelections); // was it selected before?
- //if (debug)
- //logDebugMsg("was selected? " + wasSelected);
- } else {
- // else interesting case ... we are showing the parent, but can't find the child!
- }
- if (move) {
- Object[] srcObjects = null;
- if (multiSource)
- srcObjects = event.getMultiSource();
- else {
- srcObjects = new Object[1];
- srcObjects[0] = event.getSource();
- }
- moveReferencedTreeItems(parentRefItem, srcObjects, event.getPosition());
- //refresh(parentRefItem.getData());
- } else // remove
- {
- remove(oldItem.getData());
- }
- } else // add operation
- {
- if (!(((TreeItem) parentRefItem).getExpanded())) {
- refresh(parentRefItem.getData()); // delete cached GUIs
- //setExpandedState(parentRefItem,true); // not our job to expand here.
- } else if (afilterstring) {
- ISystemFilterReference fr = (ISystemFilterReference) parentRefItem.getData();
- ISystemFilterStringReference fsr = fr.getSystemFilterStringReference(filterstring);
- createTreeItem(parentRefItem, fsr, event.getPosition());
- //setSelection(new StructuredSelection(fsr),true);
- } else {
- Object data = parentRefItem.getData();
- if (data instanceof ISystemFilterContainerReference) {
- ISystemFilterContainerReference sfcr = (ISystemFilterContainerReference) data;
- ISystemFilterReference sfr = sfcr.getSystemFilterReference(ss, filter);
- createTreeItem(parentRefItem, sfr, event.getPosition());
- } else // hmm, could be parent is a subsystem, child is a filter in no-show-filter-pools mode
- {
- if (data instanceof ISystemFilterPoolReferenceManagerProvider) // that's a subsystem!
- {
- ISystemFilterPoolReferenceManagerProvider sfprmp = (ISystemFilterPoolReferenceManagerProvider) data;
- ISystemFilterPoolReferenceManager sfprm = sfprmp.getSystemFilterPoolReferenceManager();
- ISystemFilterReference sfr = sfprm.getSystemFilterReference(ss, filter);
- createTreeItem(parentRefItem, sfr, sfprm.getSystemFilterReferencePosition(sfr));
- }
- }
- }
- //refresh(parentRefItem.getData());
- }
-
- // STEP 4: DECIDE WHAT TO SELECT:
-
- // 4a. ADD ... only select if parent of new filter was previously selected...
- if (add && isSelected(parentRefItem.getData(), oldSelections)) {
- if (debug) logDebugMsg(".........that parent was previously selected");
- // .... YES, SO SELECT NEW FILTER'S REFERENCE
- Item filterItem = (Item) internalFindReferencedItem(parentRefItem, afilterstring ? (Object) filterstring : (Object) filter, 1); // start at filter's parent, search for filter
- if (filterItem == null) {
- if (debug) logDebugMsg("Hmm, didn't find new filter's reference!");
- } else {
- if (debug) logDebugMsg(".........Trying to set selection to " + filterItem.getData());
- setSelection(new StructuredSelection(filterItem.getData()), true);
- }
- }
- // 4b. DELETE ... select parent if deleted filter was previously selected
- else if (delete && wasSelected) {
- setSelection(new StructuredSelection(parentRefItem.getData())); // select parent
- }
- // 4c. MOVE ... only select if any of moved references were previously selected...
- else if (move && wasSelected && !afilterstring) {
- ISystemFilter[] filters = (ISystemFilter[]) event.getMultiSource();
- if (filters != null) {
- ISystemFilterReference[] newRefs = new ISystemFilterReference[filters.length];
- for (int idx = 0; idx < newRefs.length; idx++) {
- Widget w = internalFindReferencedItem(parentRefItem, filters[idx], 1);
- newRefs[idx] = (ISystemFilterReference) ((Item) w).getData();
- }
- setSelection(new StructuredSelection(newRefs), true);
- }
- } else if (move && wasSelected && afilterstring) {
- ISystemFilterString[] filterStrings = (ISystemFilterString[]) event.getMultiSource();
- if (filterStrings != null) {
- ISystemFilterStringReference[] newRefs = new ISystemFilterStringReference[filterStrings.length];
- for (int idx = 0; idx < newRefs.length; idx++) {
- Widget w = internalFindReferencedItem(parentRefItem, filterStrings[idx], 1);
- newRefs[idx] = (ISystemFilterStringReference) ((Item) w).getData();
- }
- setSelection(new StructuredSelection(newRefs), true);
- }
- }
-
- } else if (debug) logDebugMsg("Did not find parent ref " + parent);
- }
-
- /**
- * Move existing items a given number of positions within the same node.
- * If the delta is negative, they are all moved up by the given amount. If
- * positive, they are all moved down by the given amount.<p>
- */
- protected void moveReferencedTreeItems(Widget parentItem, Object[] masterSrc, int delta) {
- int[] oldPositions = new int[masterSrc.length];
- Item[] oldItems = new Item[masterSrc.length];
- Object[] src = new Object[masterSrc.length];
-
- for (int idx = 0; idx < src.length; idx++) {
- oldItems[idx] = (Item) internalFindReferencedItem(parentItem, masterSrc[idx], 1);
- src[idx] = oldItems[idx].getData();
- }
- for (int idx = 0; idx < src.length; idx++) {
- oldPositions[idx] = getTreeItemPosition(parentItem, oldItems[idx]) + 1;
- //logDebugMsg("::: Old position : " + oldPositions[idx]);
- }
-
- if (delta > 0) // moving down, process backwards
- {
- for (int idx = src.length - 1; idx >= 0; idx--) {
- //logDebugMsg("DN: Old position : " + oldPositions[idx] + ", new position : " + (oldPositions[idx]+delta));
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta);
- }
- } else // moving up, process forewards
- {
- for (int idx = 0; idx < src.length; idx++) {
- //logDebugMsg("UP: Old position : " + oldPositions[idx] + ", new position : " + (oldPositions[idx]+delta-1));
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta - 1);
- }
- }
- }
-
- /**
- * Recursively tries to find a reference to the given referenced item
- *
- * @param parent the parent item at which to start the search.
- * @param element the master element to which we want to find a tree item which references it
- * @param searchLimit how deep to search
- */
- protected Widget internalFindReferencedItem(Widget parent, Object element, int searchLimit) {
- previousItem = null;
- searchDepth = 0;
- return recursiveInternalFindReferencedItem(parent, element, searchLimit);
- }
-
- /**
- * Recursively tries to find a reference the given filtercontainer
- * Limits search depth to when we find an item that is not a connection,
- * subsystem, filter pool, filter or filter string.
- * @param parent the parent item at which to start the search.
- * @param element the master element to which we want to find a tree item which references it
- * @param searchLimit how deep to search
- */
- protected Widget recursiveInternalFindReferencedItem(Widget parent, Object element, int searchLimit) {
- // compare with node
- Object data = parent.getData();
- if ((data != null) && (data instanceof IRSEBaseReferencingObject)) {
- IRSEBaseReferencingObject refingData = (IRSEBaseReferencingObject) data;
- Object refedData = refingData.getReferencedObject();
- //logDebugMsg("data is a refing obj to " + refingData);
- if (refedData == element)
- //if (refedData.equals(element))
- return parent;
- else
- previousItem = parent;
- }
- // recurse over children if we are listing a subsystem or connection or
- // filter framework reference object, and nesting limit not reached.
- if (((data instanceof ISubSystem) || (data instanceof IHost) || (data instanceof ISystemFilterContainer) || (data instanceof ISystemFilterContainerReference) || (data instanceof ISystemFilterStringReference))
- && (searchDepth < searchLimit)) {
- ++searchDepth;
- int oldDepth = searchDepth;
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- Widget o = recursiveInternalFindReferencedItem(items[i], element, searchLimit);
- if (o != null) return o;
- searchDepth = oldDepth;
- }
- }
- return null;
- }
-
- /**
- * Recursively tries to find an item starting at the given item.
- * (base viewer classes do not offer a relative search!)
- *
- * @param parent the parent item at which to start the search.
- * @param element the element to match on. Matches on "==" versus equals()
- */
- protected Widget internalFindRelativeItem(Widget parent, Object element, int searchLimit) {
- searchDepth = 0;
- return recursiveInternalFindRelativeItem(parent, element, searchLimit);
- }
-
- /**
- * Recursively tries to find an item starting at the given item.
- * (base viewer classes do not offer a relative search!)
- *
- * @param parent the parent item at which to start the search.
- * @param element the element to match on. Matches on "==" versus equals()
- */
- protected Widget recursiveInternalFindRelativeItem(Widget parent, Object element, int searchLimit) {
- // compare with node
- Object data = parent.getData();
- if ((data != null) && (data == element)) return parent;
- // recurse over children
- if (searchDepth < searchLimit) {
- ++searchDepth;
- int oldDepth = searchDepth;
- Item[] items = getChildren(parent);
- for (int i = 0; i < items.length; i++) {
- Widget o = recursiveInternalFindRelativeItem(items[i], element, searchLimit);
- if (o != null) return o;
- searchDepth = oldDepth;
- }
- }
- return null;
- }
-
- protected ISystemRemoteElementAdapter getRemoteData(Item item, Object rawData) {
- if (rawData != null)
- return getRemoteAdapter(rawData);
- else
- return null;
- }
-
- /**
- * Find the first binary-match or name-match of remote object, given its absolute name.
- * @param remoteObjectName The absolute name of the remote object to find.
- * @param subsystem The subsystem of the remote object to find. Optional.
- * @param parentItem The parent item at which to start the search. Optional.
- * @return TreeItem hit if found
- */
- public Item findFirstRemoteItemReference(String remoteObjectName, ISubSystem subsystem, Item parentItem) {
- //Vector matches = new Vector();
- Item match = null;
- if (parentItem == null)
- //findAllRemoteItemReferences(remoteObjectName, null, subsystem, matches);
- match = internalFindFirstRemoteItemReference(remoteObjectName, null, subsystem);
- else {
- //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, null, subsystem, matches);
- match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, null, subsystem);
- if (debugRemote) System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2,3)");
- }
- //if (matches.size() > 0)
- // return (Item)matches.elementAt(0);
- //else
- // return null;
- return match;
- }
-
- /**
- * Find the first binary-match or name-match of a remote object, given its binary object.
- * @param remoteObject - The remote object to find.
- * @param parentItem - Optionally, the parent item to start the search at
- * @return TreeItem hit if found
- */
- public Item findFirstRemoteItemReference(Object remoteObject, Item parentItem) {
- //Vector matches = new Vector();
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(remoteObject);
- if (adapter == null) return null;
- Item match = null;
- ISubSystem subsystem = adapter.getSubSystem(remoteObject);
- String remoteObjectName = adapter.getAbsoluteName(remoteObject);
- if (parentItem == null)
- //findAllRemoteItemReferences(remoteObjectName, remoteObject, subsystem, matches);
- match = internalFindFirstRemoteItemReference(remoteObjectName, remoteObject, subsystem);
- else {
- //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, remoteObject, subsystem, matches);
- match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, remoteObject, subsystem);
- if (debugRemote) System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2)");
- }
-
- //if (matches.size() > 0)
- // return (Item)matches.elementAt(0);
- //else
- // return null;
- return match;
- }
-
- /**
- * Recursively tries to find a given remote object. Since the object memory object
- * for a remote object is not dependable we call getAbsoluteName() on the adapter to
- * do the comparisons. Note this does not take into account the parent connection or
- * subsystem or filter, hence you must know where to start the search, else you risk
- * finding the wrong one.
- *
- * @param element the remote object to which we want to find a tree item which references it. Can be a string or an object
- * @param elementObject the actual remote element to find, for binary matching, optionally for cases when element is a string
- * @param matches the vector to populate with hits
- */
- protected Vector findAllRemoteItemReferences(Object element, Object elementObject, Vector matches) {
- String searchString = null;
- ISubSystem subsystem = null;
- if (element instanceof String)
- searchString = (String) element;
- else {
- if (elementObject == null) elementObject = element;
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(element);
- if (adapter == null) return matches;
- subsystem = adapter.getSubSystem(element);
- searchString = adapter.getAbsoluteName(element);
- }
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++) {
- matches = recursiveFindAllRemoteItemReferences(roots[idx], searchString, elementObject, subsystem, matches);
- }
- return matches;
- }
-
- /**
- * Recursively tries to find all occurrences of a given remote object, starting at the tree root.
- * Since the object memory object for a remote object is not dependable we call getAbsoluteName()
- * on the adapter to do the comparisons.
- * <p>
- * This overload takes a string and a subsystem.
- *
- * @param searchString the absolute name of the remote object to which we want to find a tree item which references it.
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param matches the vector to populate with hits
- */
- protected Vector findAllRemoteItemReferences(String searchString, Object elementObject, ISubSystem subsystem, Vector matches) {
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++)
- matches = recursiveFindAllRemoteItemReferences(roots[idx], searchString, elementObject, subsystem, matches);
- return matches;
- }
-
- /**
- * Recursively tries to find the first occurrence of a given remote object, starting at the tree root.
- * Optionally scoped to a specific subsystem.
- * Since the object memory object for a remote object is not dependable we call getAbsoluteName()
- * on the adapter to do the comparisons.
- * <p>
- * This overload takes a string and a subsystem.
- *
- * @param searchString the absolute name of the remote object to which we want to find a tree item which references it.
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param matches the vector to populate with hits
- * @return TreeItem hit if found
- */
- protected Item internalFindFirstRemoteItemReference(String searchString, Object elementObject, ISubSystem subsystem) {
- Item[] roots = getTree().getItems();
- if ((roots == null) || (roots.length == 0)) return null;
- Item match = null;
- if (debugRemote) {
- System.out.println("Inside internalFindFirstRemoteItemReference for searchString: " + searchString + ", subsystem null? " + (subsystem == null) + ", nbr roots = " + roots.length);
- }
- for (int idx = 0; (match == null) && (idx < roots.length); idx++) {
- match = recursiveFindFirstRemoteItemReference(roots[idx], searchString, elementObject, subsystem);
- if (debugRemote) System.out.println("...Inside internalFindFirstRemoteItemReference. Result of searching root " + idx + ": " + roots[idx].getText() + ": " + match);
- }
- if (debugRemote) {
- System.out.println("...Inside internalFindFirstRemoteItemReference. Returning " + match);
- if (match != null) System.out.println("......set bp here");
- }
- return match;
- }
-
- /**
- * Recursively tries to find all references to a remote object.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element to find
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param occurrences the vector to populate with hits
- */
- protected Vector recursiveFindAllRemoteItemReferences(Item parent, String elementName, Object elementObject, ISubSystem subsystem, Vector occurrences) {
- Object rawData = parent.getData();
- ISystemRemoteElementAdapter remoteAdapter = null;
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
- if (rawData != null) remoteAdapter = getRemoteAdapter(rawData);
- // -----------------------------------------------------------------------
- // if this is a remote object, test if it is the one we are looking for...
- // -----------------------------------------------------------------------
- if (remoteAdapter != null) {
- // first test for binary match
- if (elementObject == rawData) {
- occurrences.addElement(parent); // found a match!
- if (debugRemote) System.out.println("Find All: Remote item binary match found");
- return occurrences; // no point in checking the kids
- }
- // now test for absolute name match
- String fqn = remoteAdapter.getAbsoluteName(rawData);
- if (debugRemote) System.out.println("TESTING FINDALL: '" + fqn + "' vs '" + elementName + "'");
- if ((fqn != null) && fqn.equals(elementName)) {
- occurrences.addElement(parent); // found a match!
- if (debugRemote) System.out.println("...and remote item name match found");
- return occurrences; // no point in checking the kids
- }
- }
- // -------------------------------------------------------------------------
- // if we have been given a subsystem to restrict to, that is a hint to us...
- // -------------------------------------------------------------------------
- else if ((rawData != null) && (subsystem != null)) // test for hints we are in the wrong place
- {
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- if ((rawData instanceof ISubSystem) && (((ISubSystem) rawData).getSubSystemConfiguration() != subsystem.getSubSystemConfiguration())) {
- return occurrences; // they don't match, so don't bother checking the kids
- }
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- else if ((rawData instanceof IHost) && (!((IHost) rawData).getHostName().equals(subsystem.getHost().getHostName()))) {
- return occurrences; // they don't match, so don't bother checking the kids
- }
- }
- // recurse over children
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- if (!items[i].isDisposed()) occurrences = recursiveFindAllRemoteItemReferences(items[i], elementName, elementObject, subsystem, occurrences);
- }
- return occurrences;
- }
-
- /**
- * Recursively tries to find the first references to a remote object.
- * This search is restricted to the given subsystem, if given.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element to find
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @return TreeItem match if found, null if not found.
- */
- protected Item recursiveFindFirstRemoteItemReference(Item parent, String elementName, Object elementObject, ISubSystem subsystem) {
- Object rawData = parent.getData();
- ISystemRemoteElementAdapter remoteAdapter = null;
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
- if (rawData != null) remoteAdapter = getRemoteAdapter(rawData);
- // -----------------------------------------------------------------------
- // if this is a remote object, test if it is the one we are looking for...
- // -----------------------------------------------------------------------
- if (remoteAdapter != null) {
- // first test for binary match
- if (elementObject == rawData) {
- if (debugRemote) System.out.println("Remote item binary match found");
- return parent; // return the match
- }
- // now test for absolute name match
- String fqn = remoteAdapter.getAbsoluteName(rawData);
- if (debugRemote) System.out.println("TESTING FINDFIRST: '" + fqn + "' vs '" + elementName + "'");
- if ((fqn != null) && fqn.equals(elementName)) {
- if ((subsystem != null) && (subsystem == remoteAdapter.getSubSystem(rawData))) {
- if (debugRemote) System.out.println("Remote item name match found and subsystems matched");
- return parent; // return the match
- } else if (subsystem == null) {
- if (debugRemote) System.out.println("Remote item name match found and subsystem null");
- return parent;
- } else if (debugRemote) System.out.println("Remote item name match found but subsystem mismatch");
- }
- }
- // -------------------------------------------------------------------------
- // if we have been given a subsystem to restrict to, that is a hint to us...
- // -------------------------------------------------------------------------
- else if ((rawData != null) && (subsystem != null)) // test for hints we are in the wrong place
- {
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- if ((rawData instanceof ISubSystem) && (rawData != subsystem)) {
- return null; // they don't match, so don't bother checking the kids
- }
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- else if ((rawData instanceof IHost) && !((IHost) rawData).getHostName().equals(subsystem.getHost().getHostName())) {
- return null; // they don't match, so don't bother checking the kids
- }
- }
- // recurse over children
- Item[] items = getChildren(parent);
- Item match = null;
- for (int i = 0; (match == null) && (i < items.length); i++) {
- if (!items[i].isDisposed()) match = recursiveFindFirstRemoteItemReference(items[i], elementName, elementObject, subsystem);
- }
- return match;
- }
-
- /**
- * Recursively tries to find all filters affected by a given remote object.
- *
- * @param elementName the absolute name of the remote object to which we want to find a filters which result in it.
- * @param subsystem The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.
- * @param matches the vector to populate with hits. Can be null, in which case a new vector is created.
- *
- * @return Vector of FilterMatch objects for each affected filter
- */
- protected Vector findAllRemoteItemFilterReferences(String elementName, ISubSystem subsystem, Vector matches) {
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++)
- matches = recursiveFindAllRemoteItemFilterReferences(roots[idx], elementName, subsystem, matches);
- return matches;
-
- }
-
- /**
- * Recursively tries to find all filters which are affected by a given remote object, such that we can subsequently refresh that filter
- * after a remote resource change.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element that has been created, changed, deleted or renamed.
- * @param subsystem The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.
- * @param occurrences the vector to populate with hits
- *
- * @return Vector of FilterMatch objects for each affected filter
- */
- protected Vector recursiveFindAllRemoteItemFilterReferences(Item parent, String elementName, ISubSystem subsystem, Vector occurrences) {
- Object rawData = parent.getData();
-
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
-
- // ---------------------------------------------------------------------
- // if this is a filter object, test for two things:
- // #1. does this filter list this remote object if expanded/refreshed?
- // #2. does this filter list the contents of this remote object?
- // ---------------------------------------------------------------------
- if (rawData instanceof ISystemFilterReference) {
- ISystemFilterReference filterRef = (ISystemFilterReference) rawData;
- if (filterRef.getReferencedFilter().isPromptable()) return occurrences;
- if (debugRemote) System.out.println("Testing filter: " + filterRef.getReferencedFilter().getName());
- ISubSystem fss = (ISubSystem) filterRef.getProvider();
- if (fss != null) // should never happen!!
- {
- // #1
- if (fss.doesFilterMatch(filterRef.getReferencedFilter(), elementName)) {
- occurrences.addElement(new FilterMatch((TreeItem) parent, true)); // found a match!
- if (debugRemote) System.out.println("...Filter match found for " + elementName + ": " + filterRef.getReferencedFilter().getName());
- return occurrences; // no point in checking the kids
- }
- // #2
- else if (fss.doesFilterListContentsOf(filterRef.getReferencedFilter(), elementName)) {
- occurrences.addElement(new FilterMatch((TreeItem) parent, false)); // found a match!
- if (debugRemote) System.out.println("...Filter content match found for " + elementName + ": " + filterRef.getReferencedFilter().getName());
- return occurrences; // no point in checking the kids
- } else if (debugRemote) System.out.println("... no match on the filter for element name " + elementName);
- }
- }
- // ----------------------------------------------------------------------
- // if this is not a filter, then before recursing on its kids, check for
- // hints that such recursion is a waste of time, for performance reasons
- // ----------------------------------------------------------------------
- else if (rawData != null) {
- // ---------------------------------------------------------------------------------
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- // ---------------------------------------------------------------------------------
- if ((rawData instanceof ISubSystem) && (subsystem != null)) {
- ISubSystem currSS = (ISubSystem) rawData;
- if (currSS.getSubSystemConfiguration() != subsystem.getSubSystemConfiguration()) return occurrences; // they don't match, so don't bother checking the kids
- }
- // -----------------------------------------------------------------------------------------
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- // -----------------------------------------------------------------------------------------
- else if (rawData instanceof IHost) {
- IHost currConn = (IHost) rawData;
- if (!currConn.getHostName().equals(subsystem.getHost().getHostName())) return occurrences; // they don't match, so don't bother checking the kids
- }
- // skip the new connection prompts...
- else if (rawData instanceof ISystemPromptableObject)
- return occurrences;
- // ------------------------------------------------------------------------
- // if this is a remote object, we are too deep into this branch of the tree
- // for filters, so stop here
- // ------------------------------------------------------------------------
- else if (getRemoteAdapter(rawData) != null) return occurrences;
- }
- // recurse over children
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- occurrences = recursiveFindAllRemoteItemFilterReferences(items[i], elementName, subsystem, occurrences);
- }
- return occurrences;
- }
-
- /**
- * Inner class to ensapsulate what is put in the vector for the recursiveFindAllRemoteItemFilterReferences() method.
- */
- protected class FilterMatch {
- protected boolean filterListsElement;
- protected boolean filterListsElementContents;
- protected TreeItem match;
-
- FilterMatch(TreeItem match, boolean filterListsElement) {
- this.match = match;
- this.filterListsElement = filterListsElement;
- this.filterListsElementContents = !filterListsElement;
- }
-
- boolean listsElement() {
- return filterListsElement;
- }
-
- boolean listsElementContents() {
- return filterListsElementContents;
- }
-
- TreeItem getTreeItem() {
- return match;
- }
- }
-
- /**
- * --------------------------------------------------------------------------------
- * For many actions we have to walk the selection list and examine each selected
- * object to decide if a given common action is supported or not.
- * <p>
- * Walking this list multiple times while building the popup menu is a performance
- * hit, so we have this common method that does it only once, setting instance
- * variables for all of the decisions we are in interested in.
- * --------------------------------------------------------------------------------
- */
- protected void scanSelections(String whereFrom) {
- //System.out.println("inside scanSelections. Called from " + whereFrom);
- // here are the instance variables we set...
- // protected boolean selectionShowRefreshAction;
- // protected boolean selectionShowOpenViewActions;
- // protected boolean selectionShowDeleteAction;
- // protected boolean selectionShowRenameAction;
- // protected boolean selectionIsRemoteObject;
- // protected boolean selectionEnableDeleteAction;
- // protected boolean selectionEnableRenameAction;
-
- // initial these variables to true. Then if set to false even once, leave as false always...
- selectionShowRefreshAction = true;
- selectionShowOpenViewActions = true;
- selectionShowGenericShowInTableAction = true;
- selectionShowDeleteAction = true;
- selectionShowRenameAction = true;
- selectionEnableDeleteAction = true;
- selectionEnableRenameAction = true;
- selectionIsRemoteObject = true;
- selectionHasAncestorRelation = hasAncestorRelationSelection();
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (elements.hasNext()) {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter == null) continue;
-
- if (selectionShowRefreshAction) selectionShowRefreshAction = adapter.showRefresh(element);
-
- if (selectionShowOpenViewActions) selectionShowOpenViewActions = adapter.showOpenViewActions(element);
-
- if (selectionShowGenericShowInTableAction) selectionShowGenericShowInTableAction = adapter.showGenericShowInTableAction(element);
-
- if (selectionShowDeleteAction) selectionShowDeleteAction = adapter.showDelete(element);
-
- if (selectionShowRenameAction) selectionShowRenameAction = adapter.showRename(element);
-
- if (selectionEnableDeleteAction) selectionEnableDeleteAction = selectionShowDeleteAction && adapter.canDelete(element) && !selectionHasAncestorRelation;
- //System.out.println("ENABLE DELETE SET TO " + selectionEnableDeleteAction);
-
- if (selectionEnableRenameAction) selectionEnableRenameAction = selectionShowRenameAction && adapter.canRename(element);
-
- if (selectionIsRemoteObject) selectionIsRemoteObject = (getRemoteAdapter(element) != null);
-
- if (selectionIsRemoteObject && !selectionFlagsUpdated) {
- ISubSystem srcSubSystem = adapter.getSubSystem(element);
- if (srcSubSystem.isConnected() || element instanceof ISystemFilterReference || element instanceof ISubSystem) {
- SystemRemoteElementResourceSet set = getSetFor(srcSubSystem, adapter);
- set.addResource(element);
- }
- }
- }
- selectionFlagsUpdated = true;
- //System.out.println("Inside scan selections: selectionShowOpenViewActions = " + selectionShowOpenViewActions);
- }
-
- /**
- * Decides whether to even show the refresh menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showRefresh() {
- return selectionShowRefreshAction;
- /*
- boolean ok = true;
- IStructuredSelection selection= (IStructuredSelection)getSelection();
- Iterator elements= selection.iterator();
- int count = 0;
- while (ok && elements.hasNext())
- {
- Object element= elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (!adapter.showRefresh(element))
- ok = false;
- }
- return ok;
- */
- }
-
- /**
- * Decides whether to even show the "open in new perspective" menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showOpenViewActions() {
- return selectionShowOpenViewActions;
- }
-
- /**
- * Decides whether to even show the generic "show in table" menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showGenericShowInTableAction() {
- return selectionShowGenericShowInTableAction;
- }
-
- /**
- * Decides whether all the selected objects are remote objects or not
- * Assumes scanSelections() has already been called
- */
- protected boolean areSelectionsRemote() {
- return selectionIsRemoteObject;
- }
-
- // ---------------------------
- // ISYSTEMDELETETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemDeleteTarget.
- * Decides whether to even show the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showDelete() {
- if (!selectionFlagsUpdated) {
- //System.out.println("Inside showDelete. selectFlagsUpdated = false");
- scanSelections("showDelete");
- }
- return selectionShowDeleteAction;
- }
-
- /**
- * Required method from ISystemDeleteTarget
- * Decides whether to enable the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canDelete() {
- if (!selectionFlagsUpdated) {
- //System.out.println("Inside canDelete. selectFlagsUpdated = false");
- scanSelections("canDelete");
- }
- return selectionEnableDeleteAction;
- }
-
- /**
- * Required method from ISystemDeleteTarget
- */
- public boolean doDelete(IProgressMonitor monitor) {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- //Object multiSource[] = new Object[selectedCount];
- //int idx = 0;
- Object element = null;
- //Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- boolean ok = true;
- boolean anyOk = false;
- Vector deletedVector = new Vector();
- try {
- while (ok && elements.hasNext()) {
- element = elements.next();
- //multiSource[idx++] = element;
- adapter = getAdapter(element);
- if (getRemoteAdapter(element) != null) continue;
- ok = adapter.doDelete(getShell(), element, monitor);
- if (ok) {
- anyOk = true;
- deletedVector.addElement(element);
- }
- }
- // now we have things divided into sets
- // delete 1 set at a time
- for (int s = 0; s < _setList.size() && ok; s++) {
- SystemRemoteElementResourceSet set = (SystemRemoteElementResourceSet) _setList.get(s);
- ISubSystem srcSubSystem = set.getSubSystem();
- ISystemViewElementAdapter srcAdapter = set.getAdapter();
-
- if (srcSubSystem != null) {
- ok = srcAdapter.doDeleteBatch(getShell(), set.getResourceSet(), monitor);
- if (ok) {
- anyOk = true;
- deletedVector.addAll(set.getResourceSet());
- }
- }
- }
- } catch (SystemMessageException exc) {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- } catch (Exception exc) {
- exc.printStackTrace();
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException)) msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(element, msg));
- ok = false;
- }
- //System.out.println("in doDelete. Any ok? " + anyOk + ", selectionIsRemoteObject? " + selectionIsRemoteObject);
- if (anyOk) {
- if (selectionIsRemoteObject)
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, deletedVector, null, null, null, this);
- else {
- Object[] deleted = new Object[deletedVector.size()];
- for (int idx = 0; idx < deleted.length; idx++)
- deleted[idx] = deletedVector.elementAt(idx);
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(deleted, ISystemResourceChangeEvents.EVENT_DELETE_MANY, getSelectedParent()));
- }
- }
- return ok;
- }
-
- // ---------------------------
- // ISYSTEMRENAMETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemRenameTarget.
- * Decides whether to even show the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showRename() {
- return selectionShowRenameAction;
- }
-
- /**
- * Required method from ISystemRenameTarget
- * Decides whether to enable the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canRename() {
- if (!selectionFlagsUpdated) scanSelections("canRename");
- return selectionEnableRenameAction;
- }
-
- /**
- * Required method from ISystemRenameTarget
- */
- public boolean doRename(String[] newNames) {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- Object element = null;
- Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- ISystemRemoteElementAdapter remoteAdapter = null;
- String oldFullName = null;
- boolean ok = true;
- try {
- int nameIdx = 0;
- while (ok && elements.hasNext()) {
- element = elements.next();
- adapter = getAdapter(element);
- remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter != null) oldFullName = remoteAdapter.getAbsoluteName(element); // pre-rename
- ok = adapter.doRename(getShell(), element, newNames[nameIdx++]);
- if (ok) {
- if (remoteAdapter != null)
- {
- ISubSystem ss = adapter.getSubSystem(element);
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, ss, oldFullName, this);
- }
-
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement));
- }
- }
- } catch (SystemMessageException exc) {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- } catch (Exception exc) {
- //String msg = exc.getMessage();
- //if ((msg == null) || (exc instanceof ClassCastException))
- // msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(element, exc), //msg),
- exc);
- ok = false;
- }
- return ok;
- }
-
- protected void logDebugMsg(String msg) {
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),msg);
- msg = this.getClass().getName() + ": " + msg;
- SystemBasePlugin.logInfo(msg);
- System.out.println(msg);
- }
-
- // -----------------------------------------------------------------
- // ISystemSelectAllTarget methods to facilitate the global action...
- // -----------------------------------------------------------------
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection) {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length != 1)) // only allow for single selections
- return false;
-
- TreeItem ti = items[0];
- int count = getItemCount(ti);
- if (count == 1) // is it a dummy?
- {
- if ((getItems(ti)[0]).getData() == null) count = 0; // assume a dummy
- }
- return (count > 0);
- }
-
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection) {
- Tree tree = getTree();
- TreeItem[] currSel = tree.getSelection();
- TreeItem[] childItems = currSel[0].getItems();
- if (childItems.length == 0) return;
- tree.setSelection(childItems);
- Object[] childObjects = new Object[childItems.length];
- for (int idx = 0; idx < childObjects.length; idx++)
- childObjects[idx] = childItems[idx].getData();
- fireSelectionChanged(new SelectionChangedEvent(this, new StructuredSelection(childObjects)));
- }
-
- // --------------------------------------------
- // ISystemTree methods to facilitate our GUI...
- // --------------------------------------------
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent() {
- boolean same = true;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) return true;
- TreeItem prevParent = null;
- TreeItem currParent = null;
- for (int idx = 0; same && (idx < items.length); idx++) {
- currParent = items[idx].getParentItem();
- if ((idx > 0) && (currParent != prevParent))
- same = false;
- else {
- prevParent = currParent;
- }
- }
- return same;
- }
-
- protected boolean selectionHasAncestryRelationship() {
- if (selectionFlagsUpdated) return selectionHasAncestorRelation;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
-
- for (int idx = 0; idx < items.length; idx++) {
- TreeItem item = items[idx];
- for (int c = 0; c < items.length; c++) {
- if (item != items[c]) {
- if (isAncestorOf(item, items[c])) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- protected boolean isAncestorOf(TreeItem container, TreeItem item) {
- TreeItem[] children = container.getItems();
- for (int i = 0; i < children.length; i++) {
- TreeItem child = children[i];
- if (child == item) {
- return true;
- } else if (child.getItemCount() > 0) {
- if (isAncestorOf(child, item)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * This is called to accurately get the parent object for the current selection
- * for this viewer.
- * <p>
- * The getParent() method in the adapter is very unreliable... adapters can't be sure
- * of the context which can change via filtering and view options.
- */
- public Object getSelectedParent() {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) {
- return tree.getData();
- } else {
- TreeItem parentItem = items[0].getParentItem();
- if (parentItem != null)
- return parentItem.getData();
- else
- return tree.getData();
- }
- }
-
- /**
- * Return the TreeItem of the parent of the selected node. Or null if a root is selected.
- */
- public TreeItem getSelectedParentItem() {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) {
- return null;
- } else {
- return items[0].getParentItem();
- }
- }
-
- /**
- * This returns the element immediately before the first selected element in this tree level.
- * Often needed for enablement decisions for move up actions.
- */
- public Object getPreviousElement() {
- Object prevElement = null;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items != null) && (items.length > 0)) {
- TreeItem item1 = items[0];
- TreeItem[] parentItems = null;
- TreeItem parentItem = item1.getParentItem();
- if (parentItem != null)
- parentItems = parentItem.getItems();
- else
- parentItems = item1.getParent().getItems();
- if (parentItems != null) {
- TreeItem prevItem = null;
- for (int idx = 0; (prevItem == null) && (idx < parentItems.length); idx++)
- if ((parentItems[idx] == item1) && (idx > 0)) prevItem = parentItems[idx - 1];
- if (prevItem != null) prevElement = prevItem.getData();
- }
- }
- return prevElement;
- }
-
- /**
- * This returns the element immediately after the last selected element in this tree level
- * Often needed for enablement decisions for move down actions.
- */
- public Object getNextElement() {
- Object nextElement = null;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items != null) && (items.length > 0)) {
- TreeItem itemN = items[items.length - 1];
- TreeItem[] parentItems = null;
- TreeItem parentItem = itemN.getParentItem();
- if (parentItem != null)
- parentItems = parentItem.getItems();
- else
- parentItems = itemN.getParent().getItems();
- if (parentItems != null) {
- TreeItem nextItem = null;
- for (int idx = 0; (nextItem == null) && (idx < parentItems.length); idx++)
- if ((parentItems[idx] == itemN) && (idx < (parentItems.length - 1))) nextItem = parentItems[idx + 1];
- if (nextItem != null) nextElement = nextItem.getData();
- }
- }
- return nextElement;
- }
-
- /**
- * This is called to walk the tree back up to the roots and return the visible root
- * node for the first selected object.
- */
- public Object getRootParent() {
- Tree tree = getTree();
- TreeItem[] selectedItems = tree.getSelection();
- Object rootElement = null;
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- TreeItem item = selectedItems[0];
- TreeItem parentItem = item.getParentItem();
- if (parentItem == null) // item is a root element
- rootElement = item.getData();
- else
- while (rootElement == null) {
- item = parentItem;
- parentItem = item.getParentItem();
- if (parentItem == null) // item is a root element
- rootElement = item.getData();
- }
- }
- //logDebugMsg("getRootParent returned: "+rootElement);
- return rootElement;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- */
- public Object[] getElementNodes(Object element) {
- Widget w = findItem(element);
- if ((w != null) && (w instanceof TreeItem)) return getElementNodes((TreeItem) w);
- return null;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * This flavour is optimized for the case when you have the tree item directly.
- */
- public Object[] getElementNodes(TreeItem item) {
- Vector v = new Vector();
- v.addElement(item.getData());
- while (item != null) {
- item = item.getParentItem();
- if (item != null) v.addElement(item.getData());
- }
- Object[] nodes = new Object[v.size()];
- for (int idx = 0; idx < nodes.length; idx++)
- nodes[idx] = v.elementAt(idx);
- return nodes;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * This flavour returns a vector of TreeItem objects versus element objects.
- */
- public TreeItem[] getItemNodes(TreeItem item) {
- Vector v = new Vector();
- v.addElement(item);
- while (item != null) {
- item = item.getParentItem();
- if (item != null) v.addElement(item);
- }
- TreeItem[] nodes = new TreeItem[v.size()];
- for (int idx = 0; idx < nodes.length; idx++)
- nodes[idx] = (TreeItem) v.elementAt(idx);
- return nodes;
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does consider if a child node of the given object is currently selected.
- */
- public boolean isSelectedOrChildSelected(Object parentElement) {
- boolean isSelected = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- Widget w = findItem(parentElement);
- if (!(w instanceof TreeItem)) return true; // assume we have been given the root, which means any selection is a child
- TreeItem item = (TreeItem) w;
- // for every selected tree item, scan upwards to the root to see if
- // it or any of its parents are the given element.
- for (int idx = 0; !isSelected && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (selectedItems[idx] == item)
- isSelected = true;
- else
- isSelected = searchToRoot((TreeItem) selectedItems[idx], item);
- }
- }
- }
- return isSelected;
- //return isSelected(element, (IStructuredSelection)getSelection());
- }
-
- /**
- * Override that takes a widget.
- */
- public boolean isTreeItemSelectedOrChildSelected(Widget w) {
- boolean isSelected = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- if (!(w instanceof TreeItem)) return true; // assume we have been given the root, which means any selection is a child
- TreeItem item = (TreeItem) w;
- // for every selected tree item, scan upwards to the root to see if
- // it or any of its parents are the given element.
- for (int idx = 0; !isSelected && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (selectedItems[idx] == item)
- isSelected = true;
- else
- isSelected = searchToRoot((TreeItem) selectedItems[idx], item);
- }
- }
- }
- return isSelected;
- //return isSelected(element, (IStructuredSelection)getSelection());
- }
-
- /**
- * Return the number of immediate children in the tree, for the given tree node
- */
- public int getChildCount(Object element) {
- if (getTree().isDisposed()) return 0;
- Widget w = findItem(element);
- if (w == null)
- return 0;
- else {
- if (w instanceof TreeItem) {
- TreeItem ti = (TreeItem) w;
- int count = getItemCount((Item) w);
- if (count == 1) // is it a dummy?
- {
- Item[] items = getItems(ti);
- if (items[0].getData() == null) count = 0; // assume a dummy
- }
- return count;
- } else
- return getItemCount((Control) w);
- }
- }
-
- /**
- * Return the tree item of the first selected object
- */
- protected TreeItem getFirstSelectedTreeItem() {
- // find the selected tree item...
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems == null) || (selectedItems.length == 0) || !(selectedItems[0] instanceof TreeItem)) return null;
- return (TreeItem) selectedItems[0];
- }
-
- /**
- * Refresh the given tree item node
- */
- protected void refreshTreeItem(TreeItem item) {
- // if we are already expanded, collapse and refresh to clear memory
- if (getExpanded(item)) {
- collapseNode(item.getData(), true);
- //setExpanded(selectedItem, false);
- //refreshItem(selectedItem, selectedItem.getData());
- }
- // ok, now time to force an expand...
- createChildren(item); // re-expand. this calls the content provider, which calls the getChildren() method in the adapter. That will call us back.
- item.setExpanded(true);
- }
-
- /**
- * Called when a property is updated and we need to inform the Property Sheet viewer.
- * There is no formal mechanism for this so we simulate a selection changed event as
- * this is the only event the property sheet listens for.
- */
- public void updatePropertySheet() {
- ISelection selection = getSelection();
- if (selection == null) return;
- // create an event
- SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection());
- // fire the event
- fireSelectionChanged(event);
- }
-
- /**
- * Called to select an object within the tree, and optionally expand it
- */
- public void select(Object element, boolean expand) {
- setSelection(new StructuredSelection(element), true); // true => reveal
- if (expand) setExpandedState(element, true);
- }
-
- /**
- * Returns the tree item of the first selected object. Used for setViewerItem in a resource
- * change event.
- */
- public Item getViewerItem() {
- TreeItem[] selectedItems = getTree().getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0))
- return selectedItems[0];
- else
- return null;
- }
-
- /**
- * Returns true if any of the selected items are currently expanded
- */
- public boolean areAnySelectedItemsExpanded() {
- boolean expanded = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- // for every selected tree item, see if it is currently expanded...
- for (int idx = 0; !expanded && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (((TreeItem) selectedItems[idx]).getExpanded()) expanded = true;
- }
- }
- }
- return expanded;
- }
-
- /**
- * Returns true if any of the selected items are expandable but not yet expanded
- */
- public boolean areAnySelectedItemsExpandable() {
- boolean expandable = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- // for every selected tree item, see if needs expanding...
- for (int idx = 0; !expandable && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if ((((TreeItem) selectedItems[idx]).getItemCount() > 0) && !((TreeItem) selectedItems[idx]).getExpanded()) expandable = true;
- }
- }
- }
- return expandable;
- }
-
- /**
- * Initialize drag and drop support for this view.
- *
- */
- protected void initDragAndDrop() {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] { PluginTransfer.getInstance(),
- /*ResourceTransfer.getInstance(),*/
- FileTransfer.getInstance(), EditorInputTransfer.getInstance() };
- addDragSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDragAdapter(this));
- addDropSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDropAdapter(this));
- }
-
- // ----------------------------------
- // Support for EXPAND TO-> ACTIONS...
- // ----------------------------------
- /**
- * Called when user selects an Expand To action to expand the selected remote object with a quick filter
- */
- public void expandTo(String filterString) {
- SystemViewPart svp = getSystemViewPart();
- if (svp == null) return;
- // find the selected tree item...
- TreeItem selectedItem = getFirstSelectedTreeItem();
- if (selectedItem == null) return;
- Object element = selectedItem.getData();
- ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter == null) return;
- // update our hashtables, keyed by object address and tree path...
- if (expandToFiltersByObject == null) expandToFiltersByObject = new Hashtable();
- if (expandToFiltersByTreePath == null) expandToFiltersByTreePath = new Hashtable();
- if (filterString != null)
- expandToFiltersByObject.put(selectedItem.getData(), filterString);
- else
- expandToFiltersByObject.remove(selectedItem.getData());
- if (filterString != null)
- expandToFiltersByTreePath.put(getItemPath(selectedItem), filterString);
- else
- expandToFiltersByTreePath.remove(getItemPath(selectedItem));
-
- // now refresh this tree item node...
- refreshTreeItem(selectedItem);
- }
-
- /**
- * Return the fully-qualified path up to the given item, expressible as a string
- */
- protected String getItemPath(TreeItem item) {
- StringBuffer idBuffer = new StringBuffer(getItemNodeID(item));
- TreeItem[] elementNodes = getItemNodes(item);
- if (elementNodes != null) {
- for (int idx = elementNodes.length - 1; idx >= 0; idx--) {
- item = elementNodes[idx];
- idBuffer.append(SystemViewPart.MEMENTO_DELIM + getItemNodeID(item));
- }
- }
- //System.out.println("MEMENTO HANDLE: " + idBuffer.toString());
- return idBuffer.toString();
- }
-
- /**
- * Return the string identifying this node in the tree
- */
- protected String getItemNodeID(TreeItem item) {
- //ISystemViewElementAdapter adapter = getAdapter(item.getData());
- //return adapter.getMementoHandle(item.getData());
- return item.getText();
- }
-
- /**
- * Callback from the input provider to test if the given node has expand-to filtering criteria
- */
- public String getExpandToFilter(Object element) {
- String filter = null;
- // for performance reasons, we first test for a binary match...
- if (expandToFiltersByObject != null) {
- filter = (String) expandToFiltersByObject.get(element);
- }
- // if binary match fails, look for tree path match...
- if ((filter == null) && (expandToFiltersByTreePath != null)) {
- Widget item = findItem(element);
- if ((item != null) && (item instanceof TreeItem)) {
- filter = (String) expandToFiltersByTreePath.get(getItemPath((TreeItem) item));
- if (filter != null) {
- if (expandToFiltersByObject == null) expandToFiltersByObject = new Hashtable();
- expandToFiltersByObject.put(element, filter); // so next time it will be faster
- }
- }
- }
- return filter;
- }
-
- /**
- * To support restoring state we need to write out to disk out current table that maps
- * tree items to their current expand-to filter. That means we need access to the table.
- */
- public Hashtable getExpandToFilterTable() {
- return expandToFiltersByTreePath;
- }
-
- /**
- * To support restoring state we need to write out to disk out current table that maps
- * tree items to their current expand-to filter. That means we need to be able to set the table.
- */
- public void setExpandToFilterTable(Hashtable ht) {
- expandToFiltersByTreePath = ht;
- }
-
- protected SystemRemoteElementResourceSet getSetFor(ISubSystem subSystem, ISystemViewElementAdapter adapter) {
- for (int i = 0; i < _setList.size(); i++) {
- SystemRemoteElementResourceSet set = (SystemRemoteElementResourceSet) _setList.get(i);
- if (set.getAdapter() == adapter && set.getSubSystem() == subSystem) {
- return set;
- }
- }
-
- // no existing set - create one
- SystemRemoteElementResourceSet newSet = new SystemRemoteElementResourceSet(subSystem, adapter);
- _setList.add(newSet);
- return newSet;
- }
-
- protected boolean usingElementMap() {
- return false;
- }
-
- public void add(Object parentElementOrTreePath, Object[] childElements) {
- Assert.isNotNull(parentElementOrTreePath);
- assertElementsNotNull(childElements);
-
- Vector matches = new Vector();
- matches = findAllRemoteItemReferences(parentElementOrTreePath, parentElementOrTreePath, matches);
-
-
-
- //Widget[] widgets = internalFindItems(parentElementOrTreePath);
- // If parent hasn't been realized yet, just ignore the add.
- if (matches.size() == 0) {
- super.add(parentElementOrTreePath, childElements);
- }
- else
- {
- for (int i = 0; i < matches.size(); i++) {
- Widget match = (Widget) matches.get(i);
- internalAdd(match, parentElementOrTreePath, childElements);
- }
- }
-
- TreeItem item = getFirstSelectedTreeItem();
- if (item != null)
- {
- if (item.getData() == parentElementOrTreePath)
- {
- updatePropertySheet();
- }
- }
-
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/AbstractElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/AbstractElement.java
deleted file mode 100644
index f7d64d7f9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/AbstractElement.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * In order to populate the PropertySheet, an object must implement the
- * IAdaptable interface. Thus, this is the minimum requirement for any
- * object that we wish to represent in a tree or table viewer. We simply
- * defer the request for an adapter to the platform, assuming that the
- * adapter has been registered with it.
- */
-public class AbstractElement implements IAdaptable
-{
-
- /**
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.java
deleted file mode 100644
index 42501af5f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-public class GenericMessages extends NLS
-{
- private static String BUNDLE_NAME = "org.eclipse.rse.ui.GenericMessages";//$NON-NLS-1$
-
- public static String ResourceNavigator_goto;
-
- public static String RefreshAction_text;
- public static String RefreshAction_toolTip;
- public static String RefreshAction_progressMessage;
- public static String RefreshAction_problemTitle;
- public static String RefreshAction_problemMessage;
- public static String RefreshAction_locationDeletedMessage;
- public static String RefreshAction_dialogTitle;
-
- public static String TransferOperation_message;
- public static String RSESubSystemOperation_message;
- public static String RSESubSystemOperation_Connect_message;
- public static String RSESubSystemOperation_Disconnect_message;
- public static String RSESubSystemOperation_Get_properties_message;
- public static String RSESubSystemOperation_Get_property_message;
- public static String RSESubSystemOperation_Resolve_filter_strings_message;
- public static String RSESubSystemOperation_Set_properties_message;
- public static String RSESubSystemOperation_Set_property_message;
- public static String RSESubSystemOperation_Notifying_registry_message;
-
- // ==============================================================================
- // Property Pages
- // ==============================================================================
- public static String PropertyDialog_messageTitle;
- public static String PropertyDialog_noPropertyMessage;
- public static String PropertyDialog_propertyMessage;
-
- // ==============================================================================
- // Editor Framework
- // ==============================================================================
- public static String EditorManager_saveResourcesMessage;
- public static String EditorManager_saveResourcesTitle;
-
- public static String TypesFiltering_title;
- public static String TypesFiltering_message;
- public static String TypesFiltering_otherExtensions;
- public static String TypesFiltering_typeDelimiter;
-
-
- public static String FileExtension_extensionEmptyMessage;
- public static String FileExtension_fileNameInvalidMessage;
- public static String FilteredPreferenceDialog_PreferenceSaveFailed;
-
- public static String RSEQuery_task;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, GenericMessages.class);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.properties
deleted file mode 100644
index 79c868391..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/GenericMessages.properties
+++ /dev/null
@@ -1,58 +0,0 @@
-################################################################################
-# Copyright (c) 2006 IBM Corporation. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Initial Contributors:
-# The following IBM employees contributed to the Remote System Explorer
-# component that contains this file: David McKnight, Kushal Munir,
-# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
-# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
-#
-# Contributors:
-# {Name} (company) - description of contribution.
-################################################################################
-
-ResourceNavigator_goto = Goto
-
-RefreshAction_text = Re&fresh
-RefreshAction_toolTip = Refresh
-RefreshAction_progressMessage = Refreshing...
-RefreshAction_problemTitle = Refresh Problems
-RefreshAction_problemMessage = Problems occurred refreshing the selected resources.
-RefreshAction_locationDeletedMessage = The location for project ''{0}'' ({1}) has been deleted.\n Delete ''{0}'' from the workspace?
-RefreshAction_dialogTitle = Project location has been deleted
-
-EditorManager_saveResourcesMessage = Select the &resources to save:
-EditorManager_saveResourcesTitle = Save Resources
-
-# ==============================================================================
-# Editors
-# ==============================================================================
-
-TypesFiltering_title = Select Types
-TypesFiltering_message = Reduce selection to only files of &type(s):
-TypesFiltering_otherExtensions = &Other Extensions:
-TypesFiltering_typeDelimiter = ,
-
-FileExtension_extensionEmptyMessage = The file extension cannot be empty
-FileExtension_fileNameInvalidMessage = The file name cannot include the wild card character (*) in the current location
-FilteredPreferenceDialog_PreferenceSaveFailed=Preferences save failed.
-
-TransferOperation_message = Transfer Operation
-RSESubSystemOperation_message = RSE SubSystem Operation:
-RSESubSystemOperation_Connect_message = Connect
-RSESubSystemOperation_Disconnect_message = Disconnect
-RSESubSystemOperation_Get_properties_message = Get properties
-RSESubSystemOperation_Get_property_message = Get property
-RSESubSystemOperation_Resolve_filter_strings_message = Resolve filter strings
-RSESubSystemOperation_Set_properties_message = Set properties
-RSESubSystemOperation_Set_property_message = Set property
-RSESubSystemOperation_Notifying_registry_message = Notifying registry of connection status change...
-
-PropertyDialog_messageTitle = Properties
-PropertyDialog_noPropertyMessage Properties
-PropertyDialog_propertyMessage = Properties for {0}
-
-RSEQuery_task = RSE Query \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEAdapter.java
deleted file mode 100644
index 9644c54fd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEAdapter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.ui;
-
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-/**
- * Base interface for all RSE adapters.
- */
-public interface IRSEAdapter extends IWorkbenchAdapter, IWorkbenchAdapter2 {
-
- /**
- * Returns the description text for this element. This is typically used to show the description of an object
- * when displayed in the UI. Returns an empty string if there is no appropriate description text for this object.
- * @param o the object to get the description text for
- * @return the description text for the given object
- */
- public String getDescription(Object o);
-
- /**
- * Returns the RSE UI registry.
- * @return the RSE UI registry
- */
- public IRSEUIRegistry getRegistry();
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEUIRegistry.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEUIRegistry.java
deleted file mode 100644
index dce401ddb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRSEUIRegistry.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kushal Munir (IBM) - Initial API and implementation
- ********************************************************************************/
-package org.eclipse.rse.ui;
-
-/**
- * Interface for RSE UI registry. Clients should use this interface as the starting point for querying and
- * manipulating UI elements in the RSE framework, such as adapters.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface IRSEUIRegistry {
-
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRemoteSelectionAddListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRemoteSelectionAddListener.java
deleted file mode 100644
index c608ca516..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/IRemoteSelectionAddListener.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.rse.core.model.IHost;
-
-/**
- * <p>
- * This interface is used by the remote object selection dialogs when Add mode is enabled.
- * <p>
- * This interface allows you to listen generically for selection events on any remote object,
- * and be called when the user selects something or presses. You can use instanceof to
- * decide what was selected.
- * <p>
- * If you call the enableAddButton method you must pass an object that implements this interface.
- * The dialog will call you back when the user presses the Add button, so you can take
- * appropriate action.
- */
-public interface IRemoteSelectionAddListener
-{
-
-
- /**
- * The user has selected a remote object. Is this object valid to be added?
- * If so, return null. If not, return a string to display on the
- * message line indicating why it is not valid, such as it already has
- * been added.
- *
- * @param selectedConnection The connection the object was selected in
- * @param selectedObjects Will be a list of objects such as AS400Library or IRemoteFile. They are
- * resolved so that the remote adapter is not required.
- *
- * @return A String or SystemMessage object that will be displayed if the
- * action fails, null if the action was successfull
- */
- public Object okToEnableAddButton(IHost selectedConnection, Object[] selectedObjects);
-
- /**
- * The user has pressed the Add button.
- * Do something appropriate with the request.
- * If this action fails for some reason, or you wish to display a completion
- * message, return message text that will be displayed in the dialog's message
- * line. Else, return null.
- *
- * @param selectedConnection The connection the object was selected in
- * @param selectedObjects Will be a list of objects such as AS400Library or IRemoteFile. They are
- * resolved so that the remote adapter is not required.
- *
- * @return A String or SystemMessage object that will be displayed if the
- * action fails, null if the action was successfull
- */
- public Object addButtonPressed(IHost selectedConnection, Object[] selectedObjects);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemConnectionFormCaller.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemConnectionFormCaller.java
deleted file mode 100644
index a35ea42cf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemConnectionFormCaller.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Interface that any UI that uses the SystemConnectionForm must implement
- */
-public interface ISystemConnectionFormCaller
-{
-
-
- /**
- * Event: the user has selected a system type.
- * @param systemType the type of system selected
- * @param duringInitialization true if this is being set at page initialization time versus selected by the user
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization);
- /**
- * Return the shell hosting this form
- */
- public Shell getShell();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemContextMenuConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemContextMenuConstants.java
deleted file mode 100644
index fa1c048fc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemContextMenuConstants.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.ui.IWorkbenchActionConstants;
-/**
- * Constants defining our groups inside our right-click popup menu in the system view.
- * <pre><code>
- * // simply sets partitions in the menu, into which actions can be directed.
- * // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand to->
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND)); // expand, collapse
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH)); // open with->
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH)); // work with->
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- * menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // connection-related actions
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM)); // Team
- * menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
- * </code></pre>
- */
-public interface ISystemContextMenuConstants
-{
- /**
- * Pop-up menu: name of group for goto actions (value <code>"group.goto"</code>).
- * <p>
- * Examples for open actions are:
- * <ul>
- * <li>Go Into</li>
- * <li>Go To</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_GOTO= "group.goto";
- /**
- * ID of the submenu for "Go To->"
- */
- public static final String MENU_GOTO= "menu.goto";
- /**
- * ID of the submenu for "Preferences->"
- */
- public static final String MENU_PREFERENCES= "menu.preferences";
-
- /**
- * Pop-up menu: name of group for open-with actions (value <code>"group.openwith"</code>).
- * <p>
- * Examples for open-with actions are:
- * <ul>
- * <li>Open With->Editor</li>
- * <li>Open With->Designer</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_OPENWITH= "group.openwith";
- /**
- * ID of the submenu for "Open With->"
- */
- public static final String MENU_OPENWITH= "menu.openwith";
-
- /**
- * Group name for the "Browse With" submenu
- */
- public static final String GROUP_BROWSEWITH= "group.browsewith";
-
- /**
- * Group name for the "Compare With" submenu
- */
- public static final String GROUP_COMPAREWITH= "group.comparewith";
-
- /**
- * Group name for the "Replace With" submenu
- */
- public static final String GROUP_REPLACEWITH= "group.replacewith";
-
- /**
- * ID for "Browse With" submenu
- */
- public static final String MENU_BROWSEWITH = "menu.browsewith";
-
- /**
- * ID for "Compare With" submenu
- */
- public static final String MENU_COMPAREWITH = "menu.comparewith";
-
- /**
- * ID for "Compare With" submenu
- */
- public static final String MENU_REPLACEWITH = "menu.replacewith";
-
- /**
- * Pop-up menu: name of group for expand actions (value <code>"group.expand"</code>).
- */
- public static final String GROUP_EXPAND = "group.expand";
-
- /**
- * Pop-up menu: name of group for expand-to cascading actions (value <code>"group.expandto"</code>).
- */
- public static final String GROUP_EXPANDTO= "group.expandto";
- /**
- * ID of the submenu for "Expand to->"
- */
- public static final String MENU_EXPANDTO= "menu.expandto";
-
- /**
- * Pop-up menu: name of group for open-to actions (value <code>"group.opento"</code>).
- * <p>
- * Examples for open-to actions are:
- * <ul>
- * <li>Open To->Navigator</li>
- * <li>Open To->iSeries Navigator</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_OPENTO= "group.opento";
- /**
- * ID of the submenu for "Open To->"
- */
- public static final String MENU_OPENTO= "menu.opento";
-
- /**
- * Pop-up menu: name of group for work-with actions (value <code>"group.workwith"</code>).
- * <p>
- * Examples for work-with actions are:
- * <ul>
- * <li>Work with->Filter Pools...</li>
- * <li>Work with->User Actions...</li>
- * <li>Work with->File Types...</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_WORKWITH= "group.workwith";
- /**
- * ID of the submenu for "Work Work->"
- */
- public static final String MENU_WORKWITH= "menu.workwith";
- /**
- * Pop-up menu: name of group for open actions (value <code>"group.open"</code>).
- * <p>
- * Examples for open actions are:
- * <ul>
- * <li>Open To</li>
- * <li>Open With</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_OPEN= "group.open";
- /**
- * Pop-up menu: name of group for show actions (value <code>"group.show"</code>).
- * <p>
- * Examples for show actions are:
- * <ul>
- * <li>Show in Navigator</li>
- * <li>Show in Type Hierarchy</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_SHOW= "group.show";
-
- /**
- * Pop-up menu: name of group for new actions (value <code>"group.new"</code>).
- * This is a cascading group.
- * <p>
- * Examples for new actions are:
- * <ul>
- * <li>Create new filter</li>
- * <li>Create new folder</li>
- * </ul>
- * </p>
- */
- public static final String GROUP_NEW= "group.new";
- /**
- * ID of the submenu for "New->"
- */
- public static final String MENU_NEW= "menu.new";
-
- /**
- * Pop-up menu: name of group for new actions (value <code>"group.new.noncascade"</code>).
- * This is a non-cascading group.
- * <p>
- * This is used in the Team view
- * </p>
- */
- public static final String GROUP_NEW_NONCASCADING="group.new.noncascade";
-
- /**
- * Pop-up menu: name of group for build actions (value <code>"group.build"</code>).
- */
- public static final String GROUP_BUILD= "group.build";
-
- /**
- * Pop-up menu: name of group for reorganize actions (value <code>"group.reorganize"</code>).
- */
- public static final String GROUP_REORGANIZE= "group.reorganize";
- /**
- * Pop-up menu: name of group for reorder actions like move up/down(value <code>"group.reorder"</code>).
- */
- public static final String GROUP_REORDER= "group.reorder";
- /**
- * Pop-up menu: name of group for CHANGE actions. (value <code>"group.change"</code>).
- * <p>
- * Examples for change actions are:
- * <ul>
- * <li>Change...</li>
- * <li>Update...</li>
- * </ul>
- * SHould you even have a change action? Maybe it should be a PropertyPage instead!
- * </p>
- */
- public static final String GROUP_CHANGE = "group.change";
-
- /**
- * Pop-up menu: name of group for code generation or refactoring actions (
- * value <code>"group.generate"</code>).
- */
- public static final String GROUP_GENERATE= "group.generate";
-
- /**
- * Pop-up menu: name of group for search actions (value <code>"group.search"</code>).
- */
- public static final String GROUP_SEARCH= "group.search";
-
- /**
- * Pop-up menu: name of group for additional actions (value <code>"group.additions"</code>).
- */
- public static final String GROUP_ADDITIONS= IWorkbenchActionConstants.MB_ADDITIONS; //"additions";
-
- /**
- * Pop-up menu: name of group for viewer setup actions (value <code>"group.viewerSetup"</code>).
- */
- public static final String GROUP_VIEWER_SETUP= "group.viewerSetup";
-
- /**
- * Pop-up menu: name of group for properties actions (value <code>"group.properties"</code>).
- */
- public static final String GROUP_PROPERTIES= "group.properties";
- /**
- * Pop-up menu: name of group for actions contributed by the adaptors for the selected object, which
- * are related to the live connection.
- */
- public static final String GROUP_CONNECTION= "group.connection";
- /**
- * Pop-up menu: name of group for actions related to getting and putting the selected object.
- */
- public static final String GROUP_IMPORTEXPORT= "group.importexport";
- /**
- * Pop-up menu: name of group for actions contributed by the adaptors for the selected object
- */
- public static final String GROUP_ADAPTERS= "group.adapters";
- /**
- * Pop-up menu: name of group for team actions
- */
- public static final String GROUP_TEAM= "group.team";
-
-
- /**
- * ID of the submenu for "Compile->"
- */
- public static final String MENU_COMPILE= "menu.compile";
- /**
- * ID of the submenu for "User Actions->"
- */
- public static final String MENU_USERACTIONS= "menu.useractions";
-
- /**
- * Group for "Start Server->"
- */
- public static final String GROUP_STARTSERVER= "group.remoteservers";
- /**
- * ID of the submenu for "Start Server->"
- */
- public static final String MENU_STARTSERVER= "menu.remoteservers";
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemDeleteTarget.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemDeleteTarget.java
deleted file mode 100644
index fa90538d5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemDeleteTarget.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-
-/**
- * Any UI part that supports global deletion can implement
- * this to enable the Edit menu's delete item.
- */
-public interface ISystemDeleteTarget extends ISelectionProvider
-{
- /**
- * Return true if delete should even be shown in the popup menu
- */
- public boolean showDelete();
- /**
- * Return true if delete should be enabled based on your current selection.
- */
- public boolean canDelete();
- /**
- * Actually do the delete of currently selected items.
- * Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)
- */
- public boolean doDelete(IProgressMonitor monitor);
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemIconConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemIconConstants.java
deleted file mode 100644
index 915fdb4f5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemIconConstants.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-/**
- * Constants used throughout the System plugin.
- */
-public interface ISystemIconConstants
-{
- public static final String PLUGIN_ID ="org.eclipse.rse.ui";
- public static final String PREFIX = PLUGIN_ID + ".";
-
- // Icons
- public static final String ICON_SUFFIX = "Icon";
- public static final String ICON_BANNER_SUFFIX = "BannerIcon";
- public static final String ICON_EXT = ".gif";
-
- // WIZARD ICONS...
- public static final String ICON_WIZARD_DIR = "full/wizban/";
- public static final String ICON_SYSTEM_NEWPROFILEWIZARD_ROOT = "newprofile_wiz";
- public static final String ICON_SYSTEM_NEWPROFILEWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWPROFILEWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWPROFILEWIZARD_ID = PREFIX + ICON_SYSTEM_NEWPROFILEWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT = "newconnection_wiz";
- public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD_ID = PREFIX + ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILTERWIZARD_ROOT = "newfilter_wiz";
- public static final String ICON_SYSTEM_NEWFILTERWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILTERWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILTERWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILTERWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT = "newfilterpool_wiz";
- public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILEWIZARD_ROOT = "newfile_wiz";
- public static final String ICON_SYSTEM_NEWFILEWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILEWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILEWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILEWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFOLDERWIZARD_ROOT = "newfolder_wiz";
- public static final String ICON_SYSTEM_NEWFOLDERWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFOLDERWIZARD_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_NEWFOLDERWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFOLDERWIZARD_ROOT + ICON_BANNER_SUFFIX;
-
-
- // THING ICONS...
- public static final String ICON_MODEL_DIR = "full/obj16/";
-
- public static final String ICON_SYSTEM_PROFILE_ROOT = "systemprofile";
- public static final String ICON_SYSTEM_PROFILE = ICON_MODEL_DIR + ICON_SYSTEM_PROFILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_PROFILE_ID = PREFIX+ICON_SYSTEM_PROFILE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_PROFILE_ACTIVE_ROOT = "systemprofile_active";
- public static final String ICON_SYSTEM_PROFILE_ACTIVE = ICON_MODEL_DIR + ICON_SYSTEM_PROFILE_ACTIVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_PROFILE_ACTIVE_ID = PREFIX+ICON_SYSTEM_PROFILE_ACTIVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CONNECTION_ROOT = "systemconnection";
- public static final String ICON_SYSTEM_CONNECTION = ICON_MODEL_DIR + ICON_SYSTEM_CONNECTION_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CONNECTION_ID = PREFIX+ICON_SYSTEM_CONNECTION_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CONNECTIONLIVE_ROOT = "systemconnectionlive"; // not currently used
- public static final String ICON_SYSTEM_CONNECTIONLIVE = ICON_MODEL_DIR + ICON_SYSTEM_CONNECTIONLIVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CONNECTIONLIVE_ID = PREFIX+ICON_SYSTEM_CONNECTIONLIVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_FILTERPOOL_ROOT = "systemfilterpool";
- public static final String ICON_SYSTEM_FILTERPOOL = ICON_MODEL_DIR + ICON_SYSTEM_FILTERPOOL_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_FILTERPOOL_ID = PREFIX+ICON_SYSTEM_FILTERPOOL_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_FILTER_ROOT = "systemfilter";
- public static final String ICON_SYSTEM_FILTER_ID = PREFIX + ICON_SYSTEM_FILTER_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_FILTER = ICON_MODEL_DIR + ICON_SYSTEM_FILTER_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_FILTERSTRING_ROOT = "systemfilterstring";
- public static final String ICON_SYSTEM_FILTERSTRING_ID = PREFIX + ICON_SYSTEM_FILTERSTRING_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_FILTERSTRING = ICON_MODEL_DIR + ICON_SYSTEM_FILTERSTRING_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_ROOTDRIVE_ROOT = "systemrootdrive";
- public static final String ICON_SYSTEM_ROOTDRIVE = ICON_MODEL_DIR + ICON_SYSTEM_ROOTDRIVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ROOTDRIVE_ID = PREFIX+ICON_SYSTEM_ROOTDRIVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_ROOTDRIVEOPEN_ROOT = "systemrootdriveopen";
- public static final String ICON_SYSTEM_ROOTDRIVEOPEN = ICON_MODEL_DIR + ICON_SYSTEM_ROOTDRIVEOPEN_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ROOTDRIVEOPEN_ID = PREFIX+ICON_SYSTEM_ROOTDRIVEOPEN_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_FOLDER_ROOT = "systemfolder";
- public static final String ICON_SYSTEM_FOLDER = ICON_MODEL_DIR + ICON_SYSTEM_FOLDER_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_FOLDER_ID = PREFIX+ICON_SYSTEM_FOLDER_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_ENVVAR_ROOT = "systemenvvar";
- public static final String ICON_SYSTEM_ENVVAR = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ENVVAR_ID = PREFIX+ICON_SYSTEM_ENVVAR+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_ENVVAR_LIBPATH_ROOT = "systemenvvarlibpath";
- public static final String ICON_SYSTEM_ENVVAR_LIBPATH = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_LIBPATH_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ENVVAR_LIBPATH_ID = PREFIX+ICON_SYSTEM_ENVVAR_LIBPATH+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_ENVVAR_PATH_ROOT = "systemenvvarpath";
- public static final String ICON_SYSTEM_ENVVAR_PATH = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_PATH_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ENVVAR_PATH_ID = PREFIX+ICON_SYSTEM_ENVVAR_PATH+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_PROCESS_ROOT = "systemprocess";
- public static final String ICON_SYSTEM_PROCESS = ICON_MODEL_DIR + ICON_SYSTEM_PROCESS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_PROCESS_ID = PREFIX+ICON_SYSTEM_PROCESS+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_TARGET_ROOT = "systemTarget";
- public static final String ICON_SYSTEM_TARGET = ICON_MODEL_DIR + ICON_SYSTEM_TARGET_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_TARGET_ID = PREFIX+ICON_SYSTEM_TARGET_ROOT+ICON_SUFFIX;
-
- // NEW ACTION ICONS...
- public static final String ICON_NEWACTIONS_DIR = "full/ctool16/";
-
- public static final String ICON_SYSTEM_NEW_ROOT = "new";
- public static final String ICON_SYSTEM_NEW = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEW_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEW_ID = PREFIX+ICON_SYSTEM_NEW_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWPROFILE_ROOT = "newprofile_wiz";
- public static final String ICON_SYSTEM_NEWPROFILE = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWPROFILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWPROFILE_ID = PREFIX+ICON_SYSTEM_NEWPROFILE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWCONNECTION_ROOT = "newconnection_wiz";
- public static final String ICON_SYSTEM_NEWCONNECTION = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWCONNECTION_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWCONNECTION_ID = PREFIX+ICON_SYSTEM_NEWCONNECTION_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILTERPOOL_ROOT = "newfilterpool_wiz";
- public static final String ICON_SYSTEM_NEWFILTERPOOL = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTERPOOL_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILTERPOOL_ID = PREFIX+ICON_SYSTEM_NEWFILTERPOOL_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILTERPOOLREF_ROOT = "newfilterpoolref_wiz";
- public static final String ICON_SYSTEM_NEWFILTERPOOLREF = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTERPOOLREF_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILTERPOOLREF_ID = PREFIX+ICON_SYSTEM_NEWFILTERPOOLREF_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILTER_ROOT = "newfilter_wiz";
- public static final String ICON_SYSTEM_NEWFILTER = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTER_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILTER_ID = PREFIX+ICON_SYSTEM_NEWFILTER_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFILE_ROOT = "newfile_wiz";
- public static final String ICON_SYSTEM_NEWFILE = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWFILE_ID = PREFIX+ICON_SYSTEM_NEWFILE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_NEWFOLDER_ROOT = "newfolder_wiz";
- public static final String ICON_SYSTEM_NEWFOLDER = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFOLDER_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_NEWFOLDER_ID = PREFIX+ICON_SYSTEM_NEWFOLDER_ROOT+ICON_SUFFIX;
-
-
- // OTHER ACTION ICONS...
- public static final String ICON_ACTIONS_DIR = "full/elcl16/";
-
- public static final String ICON_SYSTEM_COMPILE_ROOT = "compile";
- public static final String ICON_SYSTEM_COMPILE = ICON_ACTIONS_DIR + ICON_SYSTEM_COMPILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_COMPILE_ID = PREFIX+ICON_SYSTEM_COMPILE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_LOCK_ROOT = "lock";
- public static final String ICON_SYSTEM_LOCK = ICON_ACTIONS_DIR + ICON_SYSTEM_LOCK_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_LOCK_ID = PREFIX+ICON_SYSTEM_LOCK_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_MOVEUP_ROOT = "up";
- public static final String ICON_SYSTEM_MOVEUP = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVEUP_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_MOVEUP_ID = PREFIX+ICON_SYSTEM_MOVEUP_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_MOVEDOWN_ROOT = "down";
- public static final String ICON_SYSTEM_MOVEDOWN = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVEDOWN_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_MOVEDOWN_ID = PREFIX+ICON_SYSTEM_MOVEDOWN_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_MOVE_ROOT = "move";
- public static final String ICON_SYSTEM_MOVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_MOVE_ID = PREFIX+ICON_SYSTEM_MOVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CLEAR_ROOT = "clear";
- public static final String ICON_SYSTEM_CLEAR = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CLEAR_ID = PREFIX+ICON_SYSTEM_CLEAR_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CLEAR_ALL_ROOT = "clearall";
- public static final String ICON_SYSTEM_CLEAR_ALL = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_ALL_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CLEAR_ALL_ID = PREFIX+ICON_SYSTEM_CLEAR_ALL_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CLEAR_SELECTED_ROOT = "clearselected";
- public static final String ICON_SYSTEM_CLEAR_SELECTED = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_SELECTED_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CLEAR_SELECTED_ID = PREFIX+ICON_SYSTEM_CLEAR_SELECTED_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_DELETEREF_ROOT = "deletereference";
- public static final String ICON_SYSTEM_DELETEREF = ICON_ACTIONS_DIR + ICON_SYSTEM_DELETEREF_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_DELETEREF_ID = PREFIX+ICON_SYSTEM_DELETEREF_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_RUN_ROOT = "run";
- public static final String ICON_SYSTEM_RUN = ICON_ACTIONS_DIR + ICON_SYSTEM_RUN_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_RUN_ID = PREFIX+ICON_SYSTEM_RUN_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_STOP_ROOT = "stop";
- public static final String ICON_SYSTEM_STOP = ICON_ACTIONS_DIR + ICON_SYSTEM_STOP_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_STOP_ID = PREFIX+ICON_SYSTEM_STOP_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_RENAME_ROOT = "rename";
- public static final String ICON_SYSTEM_RENAME = ICON_ACTIONS_DIR + ICON_SYSTEM_RENAME_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_RENAME_ID = PREFIX+ICON_SYSTEM_RENAME_ROOT+ICON_SUFFIX;
-
- public static final String ICON_IDE_REFRESH_ID = "elcl16/refresh_nav.gif";
- public static final String ICON_IDE_COLLAPSEALL_ID = "elcl16/collapseall.gif";
- public static final String ICON_IDE_LINKTOEDITOR_ID = "elcl16/synced.gif";
- public static final String ICON_IDE_FILTER_ID = "elcl16/filter_ps.gif";
-
- public static final String ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT = "makeprofileactive";
- public static final String ICON_SYSTEM_MAKEPROFILEACTIVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_MAKEPROFILEACTIVE_ID = PREFIX+ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT = "makeprofileinactive";
- public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE_ID = PREFIX+ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CHANGEFILTER_ROOT = "editfilter";
- public static final String ICON_SYSTEM_CHANGEFILTER = ICON_ACTIONS_DIR + ICON_SYSTEM_CHANGEFILTER_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CHANGEFILTER_ID = PREFIX+ICON_SYSTEM_CHANGEFILTER_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SELECTPROFILE_ROOT = "selectprofile";
- public static final String ICON_SYSTEM_SELECTPROFILE = ICON_ACTIONS_DIR + ICON_SYSTEM_SELECTPROFILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_SELECTPROFILE_ID = PREFIX+ICON_SYSTEM_SELECTPROFILE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SELECTFILTERPOOLS_ROOT = "selectpool";
- public static final String ICON_SYSTEM_SELECTFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_SELECTFILTERPOOLS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_SELECTFILTERPOOLS_ID = PREFIX+ICON_SYSTEM_SELECTFILTERPOOLS_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT = "workwithfilterpools";
- public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS_ID = PREFIX+ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT = "workwithuseractions";
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ID = PREFIX+ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT = "workwithnamedtypes";
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ID = PREFIX+ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT = "workwithcompilecmds";
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ID = PREFIX+ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_REMOVE_SHELL_ROOT = "removeshell";
- public static final String ICON_SYSTEM_REMOVE_SHELL_ID = PREFIX + ICON_SYSTEM_REMOVE_SHELL_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_REMOVE_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_REMOVE_SHELL_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_CANCEL_SHELL_ROOT = "cancelshell";
- public static final String ICON_SYSTEM_CANCEL_SHELL_ID = PREFIX + ICON_SYSTEM_CANCEL_SHELL_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_CANCEL_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_CANCEL_SHELL_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_EXTRACT_ROOT = "xtrctarchv_tsk";
- public static final String ICON_SYSTEM_EXTRACT = ICON_ACTIONS_DIR + ICON_SYSTEM_EXTRACT_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_EXTRACT_ID = PREFIX+ICON_SYSTEM_EXTRACT_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_EXTRACTTO_ROOT = "xtrctarchvto_tsk";
- public static final String ICON_SYSTEM_EXTRACTTO = ICON_ACTIONS_DIR + ICON_SYSTEM_EXTRACTTO_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_EXTRACTTO_ID = PREFIX+ICON_SYSTEM_EXTRACTTO_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_CONVERT_ROOT = "convertarchive_tsk";
- public static final String ICON_SYSTEM_CONVERT = ICON_ACTIONS_DIR + ICON_SYSTEM_CONVERT_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CONVERT_ID = PREFIX+ICON_SYSTEM_CONVERT_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_COMBINE_ROOT = "combine_tsk";
- public static final String ICON_SYSTEM_COMBINE = ICON_ACTIONS_DIR + ICON_SYSTEM_COMBINE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_COMBINE_ID = PREFIX+ICON_SYSTEM_COMBINE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SHOW_TABLE_ROOT = "systemshowintable";
- public static final String ICON_SYSTEM_SHOW_TABLE = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_SHOW_TABLE_ID = PREFIX + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SHOW_MONITOR_ROOT = "monitor_view";
- public static final String ICON_SYSTEM_SHOW_MONITOR = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_MONITOR_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_SHOW_MONITOR_ID = PREFIX + ICON_SYSTEM_SHOW_MONITOR_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SHOW_SHELL_ROOT = "systemshell";
- public static final String ICON_SYSTEM_SHOW_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_SHELL_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_SHOW_SHELL_ID = PREFIX + ICON_SYSTEM_SHOW_SHELL_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT = "exportshelloutput";
- public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT = ICON_ACTIONS_DIR + ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ID = PREFIX + ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT = "exportshellhistory";
- public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY = ICON_ACTIONS_DIR + ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY_ID = PREFIX + ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_REFRESH_ROOT = "refresh_nav";
- public static final String ICON_SYSTEM_REFRESH = ICON_ACTIONS_DIR + ICON_SYSTEM_REFRESH_ROOT + ICON_EXT;
- public static final String ICON_SYSTEM_REFRESH_ID = PREFIX + ICON_SYSTEM_REFRESH_ROOT + ICON_SUFFIX;
-
- // SPECIAL MODEL OBJECT ICONS...
- public static final String ICON_OBJS_DIR = "full/obj16/";
- public static final String ICON_SYSTEM_ERROR_ROOT = "error";
- public static final String ICON_SYSTEM_ERROR_ID = PREFIX + ICON_SYSTEM_ERROR_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_ERROR = ICON_OBJS_DIR + ICON_SYSTEM_ERROR_ROOT + ICON_EXT;
-
- // info is to be used in dialogs
- public static final String ICON_SYSTEM_INFO_ROOT = "info";
- public static final String ICON_SYSTEM_INFO_ID = PREFIX + ICON_SYSTEM_INFO_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_INFO = ICON_OBJS_DIR + ICON_SYSTEM_INFO_ROOT + ICON_EXT;
-
- // systeminfo is to be used in tree view
- public static final String ICON_SYSTEM_INFO_TREE_ROOT = "systeminfo";
- public static final String ICON_SYSTEM_INFO_TREE_ID = PREFIX + ICON_SYSTEM_INFO_TREE_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_INFO_TREE = ICON_OBJS_DIR + ICON_SYSTEM_INFO_TREE_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_HELP_ROOT = "systemhelp";
- public static final String ICON_SYSTEM_HELP_ID = PREFIX + ICON_SYSTEM_HELP_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_HELP = ICON_OBJS_DIR + ICON_SYSTEM_HELP_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_CANCEL_ROOT = "systemcancel";
- public static final String ICON_SYSTEM_CANCEL_ID = PREFIX + ICON_SYSTEM_CANCEL_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_CANCEL = ICON_OBJS_DIR + ICON_SYSTEM_CANCEL_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_EMPTY_ROOT = "systemempty";
- public static final String ICON_SYSTEM_EMPTY_ID = PREFIX + ICON_SYSTEM_EMPTY_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_EMPTY = ICON_OBJS_DIR + ICON_SYSTEM_EMPTY_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_OK_ROOT = "systemok";
- public static final String ICON_SYSTEM_OK_ID = PREFIX + ICON_SYSTEM_OK_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_OK = ICON_OBJS_DIR + ICON_SYSTEM_OK_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_WARNING_ROOT = "warning";
- public static final String ICON_SYSTEM_WARNING_ID = PREFIX + ICON_SYSTEM_WARNING_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_WARNING = ICON_OBJS_DIR + ICON_SYSTEM_WARNING_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_FAILED_ROOT = "systemfailed"; // not used yet
- public static final String ICON_SYSTEM_FAILED_ID = PREFIX + ICON_SYSTEM_FAILED_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_FAILED = ICON_OBJS_DIR + ICON_SYSTEM_FAILED_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_BLANK_ROOT = "systemblank"; // not used yet
- public static final String ICON_SYSTEM_BLANK_ID = PREFIX + ICON_SYSTEM_BLANK_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_BLANK = ICON_OBJS_DIR + ICON_SYSTEM_BLANK_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_SEARCH_ROOT = "system_search";
- public static final String ICON_SYSTEM_SEARCH_ID = PREFIX + ICON_SYSTEM_SEARCH_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_SEARCH = ICON_OBJS_DIR + ICON_SYSTEM_SEARCH_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_SEARCH_RESULT_ROOT = "systemsearchresult";
- public static final String ICON_SYSTEM_SEARCH_RESULT_ID = PREFIX + ICON_SYSTEM_SEARCH_RESULT_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_SEARCH_RESULT = ICON_OBJS_DIR + ICON_SYSTEM_SEARCH_RESULT_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_SHELL_ROOT = "systemshell"; // not used yet
- public static final String ICON_SYSTEM_SHELL_ID = PREFIX + ICON_SYSTEM_SHELL_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_SHELL = ICON_OBJS_DIR + ICON_SYSTEM_SHELL_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_SHELLLIVE_ROOT = "systemshelllive"; // not used yet
- public static final String ICON_SYSTEM_SHELLLIVE_ID = PREFIX + ICON_SYSTEM_SHELLLIVE_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_SHELLLIVE = ICON_OBJS_DIR + ICON_SYSTEM_SHELLLIVE_ROOT + ICON_EXT;
-
- public static final String ICON_SYSTEM_PERSPECTIVE_ROOT ="system_persp";
- public static final String ICON_SYSTEM_PERSPECTIVE_ID = PREFIX + ICON_SYSTEM_PERSPECTIVE_ROOT + ICON_SUFFIX;
- public static final String ICON_SYSTEM_PERSPECTIVE = ICON_OBJS_DIR + ICON_SYSTEM_PERSPECTIVE_ROOT + ICON_EXT;
-
-
-
- public static final String ICON_SYSTEM_ARROW_UP_ROOT = "arrowup_obj";
- public static final String ICON_SYSTEM_ARROW_UP = ICON_OBJS_DIR + ICON_SYSTEM_ARROW_UP_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ARROW_UP_ID = PREFIX+ICON_SYSTEM_ARROW_UP_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_ARROW_DOWN_ROOT = "arrowdown_obj";
- public static final String ICON_SYSTEM_ARROW_DOWN = ICON_OBJS_DIR + ICON_SYSTEM_ARROW_DOWN_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_ARROW_DOWN_ID = PREFIX+ICON_SYSTEM_ARROW_DOWN_ROOT+ICON_SUFFIX;
-
-
- public static final String ICON_SYSTEM_CONNECTOR_SERVICE_ROOT = "connectorservice_obj";
- public static final String ICON_SYSTEM_CONNECTOR_SERVICE = ICON_OBJS_DIR + ICON_SYSTEM_CONNECTOR_SERVICE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_CONNECTOR_SERVICE_ID = PREFIX+ICON_SYSTEM_CONNECTOR_SERVICE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_SERVICE_ROOT = "service_obj";
- public static final String ICON_SYSTEM_SERVICE = ICON_OBJS_DIR + ICON_SYSTEM_SERVICE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_SERVICE_ID = PREFIX+ICON_SYSTEM_SERVICE_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT = "launcher_config_obj";
- public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION = ICON_OBJS_DIR + ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID = PREFIX+ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_PROPERTIES_ROOT = "properties_obj";
- public static final String ICON_SYSTEM_PROPERTIES = ICON_OBJS_DIR + ICON_SYSTEM_PROPERTIES_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_PROPERTIES_ID = PREFIX+ICON_SYSTEM_PROPERTIES_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT = "searchremoveselected";
- public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES = ICON_ACTIONS_DIR + ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT + ICON_EXT;
- public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID = PREFIX + ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT + ICON_SUFFIX;
-
- public static final String ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT = "searchremoveall";
- public static final String ICON_SEARCH_REMOVE_ALL_MATCHES = ICON_ACTIONS_DIR + ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT + ICON_EXT;
- public static final String ICON_SEARCH_REMOVE_ALL_MATCHES_ID = PREFIX + ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT + ICON_SUFFIX;
-
- // we reuse the Remove all matches action icon
- public static final String ICON_SEARCH_CLEAR_HISTORY_ROOT = ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT;
- public static final String ICON_SEARCH_CLEAR_HISTORY = ICON_ACTIONS_DIR + ICON_SEARCH_CLEAR_HISTORY_ROOT + ICON_EXT;
- public static final String ICON_SEARCH_CLEAR_HISTORY_ID = PREFIX + ICON_SEARCH_CLEAR_HISTORY_ROOT + ICON_SUFFIX;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMassager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMassager.java
deleted file mode 100644
index 354ee1eaa..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMassager.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-//import org.eclipse.jface.dialogs.*;
-//import org.eclipse.jface.viewers.*;
-
-/**
- * This interface is used to identify objects whose job is to massage user-entered
- * text before saving it to a model. Eg, the text, while valid, may need to be folded
- * to uppercase or trimmed of blanks, or resolved if it has a substitution variable.
- * <p>
- * This interface, like IInputValidator, allows this work to be abstracted such that one
- * object that does it can be used in various dialogs or wizards or property sheets.
- */
-public interface ISystemMassager
-{
-
-
- /**
- * Given the user-entered input, return the massaged version of it.
- * If no massaging required, return the input as is.
- */
- public String massage(String text);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java
deleted file mode 100644
index 0612ba7e8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-/**
- * Message IDs
- */
-public interface ISystemMessages
-{
- //public static final String PLUGIN_ID ="org.eclipse.rse.ui";
- //public static final String PREFIX = PLUGIN_ID+".";
- // Resource Bundle ids
- //public static final String RESID_PREFIX = PREFIX+"ui.";
- // Messages
- //public static final String MSG_PREFIX = RESID_PREFIX+"msg.";
- //public static final String MSG_TITLE = MSG_PREFIX + "Title";
- //public static final String MSG_TITLEWARNING = MSG_PREFIX + "TitleWarning";
- //public static final String MSG_TITLEINFORMATION = MSG_PREFIX + "TitleInformation";
- //public static final String MSG_TITLECONFIRMATION = MSG_PREFIX + "TitleConfirmation";
-
- //public static final String MSG_CREATE_PROJECT_ERROR = "RSEG1002"; //MSG_PREFIX + "CreateProjectFailed";
-
- //public static final String MSG_VALIDATE_PREFIX = MSG_PREFIX + "Validate.";
- //public static final String MSG_UNDERCONSTRUCTION = "RSEG1001";
-
- public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002"; //$NON-NLS-1$
-
- public static final String MSG_CONFIRM_ENABLE_CLASSIC_HELP = "RSEG1400"; //$NON-NLS-1$
- public static final String MSG_ERROR_ENABLE_CLASSIC_HELP = "RSEG1401"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_RENAME_EMPTY = "RSEG1012"; //MSG_VALIDATE_PREFIX + "ReName.Required"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_RENAME_NOTVALID = "RSEG1011"; //MSG_VALIDATE_PREFIX + "ReName.NotValid"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FOLDERNAME_NOTVALID = "RSEG1018"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILENAME_NOTVALID = "RSEG1019"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_CONNECTIONNAME_NOTVALID = "RSEG1023"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_ENTRY_EMPTY = "RSEG1029"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_ENTRY_NOTUNIQUE= "RSEG1030"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_ENTRY_NOTVALID = "RSEG1031"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTVALID = "RSEG1039"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERNAME_NOTVALID = "RSEG1044"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PASSWORD_EXPIRED = "RSEG1036"; //MSG_VALIDATE_PREFIX + "PasswordExpired"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PASSWORD_INVALID = "RSEG1297"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERSTRING_NOTUNIQUE= "RSEG1046"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERSTRING_NOTVALID = "RSEG1047"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERSTRING_DUPLICATES = "RSEG1048"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS = "RSEG1049"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172"; //$NON-NLS-1$
-
- public static final String MSG_CONFIRM_DELETE = "RSEG1052"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_DELETEREMOTE = "RSEG1130"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_DELETEPROFILE = "RSEG1053"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_CHANGES = "RSEG1201"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_CHANGES_CANCELABLE = "RSEG1202"; //$NON-NLS-1$
-
- //public static final String MSG_CONNECT_PREFIX = MSG_PREFIX + "Connect.";
- public static final String MSG_CONNECT_PROGRESS = "RSEG1054"; //MSG_CONNECT_PREFIX + "Connecting"; //$NON-NLS-1$
- public static final String MSG_CONNECTWITHPORT_PROGRESS = "RSEG1055"; //MSG_CONNECT_PREFIX + "ConnectingWithPort"; //$NON-NLS-1$
- public static final String MSG_CONNECT_FAILED = "RSEG1056"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECT_UNKNOWNHOST = "RSEG1057"; //MSG_CONNECT_PREFIX + "UnknownHost"; //$NON-NLS-1$
- public static final String MSG_CONNECT_CANCELLED = "RSEG1058"; //MSG_CONNECT_PREFIX + "Cancelled"; //$NON-NLS-1$
-
-
- public static final String MSG_CONNECT_DAEMON_FAILED = "RSEG1242"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECT_DAEMON_FAILED_EXCEPTION = "RSEG1243"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECT_SSL_EXCEPTION = "RSEC2307"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
-
- public static final String MSG_STARTING_SERVER_VIA_REXEC = "RSEC2310"; //$NON-NLS-1$
- public static final String MSG_STARTING_SERVER_VIA_DAEMON = "RSEC2311"; //$NON-NLS-1$
- public static final String MSG_CONNECTING_TO_SERVER= "RSEC2312"; //$NON-NLS-1$
- public static final String MSG_INITIALIZING_SERVER= "RSEC2313"; //$NON-NLS-1$
- public static final String MSG_PORT_OUT_RANGE = "RSEC2316"; //$NON-NLS-1$
-
- //public static final String MSG_DISCONNECT_PREFIX = MSG_PREFIX + "Disconnect.";
- public static final String MSG_DISCONNECT_PROGRESS = "RSEG1059"; //MSG_DISCONNECT_PREFIX + "Disconnecting"; //$NON-NLS-1$
- public static final String MSG_DISCONNECTWITHPORT_PROGRESS = "RSEG1060"; //MSG_DISCONNECT_PREFIX + "DisconnectingWithPort"; //$NON-NLS-1$
- public static final String MSG_DISCONNECT_FAILED = "RSEG1061"; // MSG_DISCONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_DISCONNECT_CANCELLED = "RSEG1062"; //MSG_DISCONNECT_PREFIX + "Cancelled"; //$NON-NLS-1$
-
- //public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save.";
- public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_RESTORE_FAILED = "RSEG1051"; //$NON-NLS-1$
- public static final String MSG_SAVE_CHANGES_PENDING = "RSEG1201"; //$NON-NLS-1$
-
- //public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception.";
- public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$
- public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$
- public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$
- public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving"; //$NON-NLS-1$
-
- //public static final String MSG_RESOLVE_PREFIX = MSG_PREFIX + "Resolve.";
- public static final String MSG_RESOLVE_PROGRESS = "RSEG1070"; //$NON-NLS-1$
-
- //public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query.";
- public static final String MSG_QUERY_PROGRESS = "RSEG1095"; //$NON-NLS-1$
- public static final String MSG_QUERY_PROPERTIES_PROGRESS = "RSEG1096"; //$NON-NLS-1$
-
- //public static final String MSG_SET_PREFIX = MSG_PREFIX + "Set.";
- public static final String MSG_SET_PROGRESS = "RSEG1093"; //$NON-NLS-1$
- public static final String MSG_SET_PROPERTIES_PROGRESS = "RSEG1094"; //$NON-NLS-1$
-
- //public static final String MSG_RUN_PREFIX = MSG_PREFIX + "Run.";
- public static final String MSG_RUN_PROGRESS = "RSEG1071"; //$NON-NLS-1$
-
- //public static final String MSG_COPY_PREFIX = MSG_PREFIX + "Copy.";
- public static final String MSG_COPY_PROGRESS = "RSEG1072"; //$NON-NLS-1$
- public static final String MSG_COPYCONNECTION_PROGRESS = "RSEG1073"; //$NON-NLS-1$
- public static final String MSG_COPYCONNECTIONS_PROGRESS = "RSEG1074"; //$NON-NLS-1$
- public static final String MSG_COPYFILTERPOOLS_PROGRESS = "RSEG1075"; //$NON-NLS-1$
- public static final String MSG_COPYFILTERPOOL_PROGRESS = "RSEG1076"; //$NON-NLS-1$
- public static final String MSG_COPYFILTERS_PROGRESS = "RSEG1077"; //$NON-NLS-1$
- public static final String MSG_COPYFILTER_PROGRESS = "RSEG1078"; //$NON-NLS-1$
- public static final String MSG_COPYFILTERSTRINGS_PROGRESS="RSEG1079"; //$NON-NLS-1$
- public static final String MSG_COPYFILTERSTRING_PROGRESS ="RSEG1080"; //$NON-NLS-1$
- public static final String MSG_COPYSUBSYSTEMS_PROGRESS = "RSEG1081"; //$NON-NLS-1$
-
- public static final String MSG_DOWNLOAD_PROGRESS = "RSEG1280"; //$NON-NLS-1$
- public static final String MSG_UPLOAD_PROGRESS = "RSEG1281"; //$NON-NLS-1$
- public static final String MSG_SYNCHRONIZE_PROGRESS = "RSEG1282"; //$NON-NLS-1$
- public static final String MSG_EXTRACT_PROGRESS = "RSEG1285"; //$NON-NLS-1$
- public static final String MSG_PERCENT_DONE = "RSEG1290"; //$NON-NLS-1$
- public static final String MSG_DOWNLOADING_PROGRESS = "RSEG1295"; //$NON-NLS-1$
- public static final String MSG_UPLOADING_PROGRESS = "RSEG1296"; //$NON-NLS-1$
-
- public static final String MSG_COPYFILTERPOOL_COMPLETE = "RSEG1082"; //$NON-NLS-1$
-
- //public static final String MSG_MOVE_PREFIX = MSG_PREFIX + "Move.";
- public static final String MSG_MOVE_PROGRESS = "RSEG1083"; // "moving %1 to %2" //$NON-NLS-1$
- public static final String MSG_MOVECONNECTION_PROGRESS = "RSEG1084"; //$NON-NLS-1$
- public static final String MSG_MOVECONNECTIONS_PROGRESS = "RSEG1085"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERPOOLS_PROGRESS = "RSEG1086"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERPOOL_PROGRESS = "RSEG1087"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERS_PROGRESS = "RSEG1088"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTER_PROGRESS = "RSEG1089"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091"; //$NON-NLS-1$
- public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092"; //$NON-NLS-1$
-
- public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115"; //$NON-NLS-1$
- public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116"; //$NON-NLS-1$
- public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117"; //$NON-NLS-1$
- public static final String MSG_MOVETHINGGENERIC_PROGRESS = "RSEG1118"; //$NON-NLS-1$
-
- public static final String MSG_SAVING_PROGRESS = "RSEG1119"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDANAME_EMPTY = "RSEG1180"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDANAME_NOTUNIQUE= "RSEG1181"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDANAME_NOTVALID = "RSEG1182"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDACMT_EMPTY = "RSEG1183"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDACMT_NOTVALID = "RSEG1184"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDACMD_EMPTY = "RSEG1185"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDACMD_NOTVALID = "RSEG1186"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDTNAME_EMPTY = "RSEG1187"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTNAME_NOTUNIQUE= "RSEG1188"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTNAME_NOTVALID = "RSEG1189"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDTTYPES_EMPTY = "RSEG1190"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTTYPES_NOTVALID = "RSEG1191"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_COMPILELABEL_EMPTY = "RSEG1195"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILELABEL_NOTUNIQUE= "RSEG1196"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILELABEL_NOTVALID = "RSEG1197"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILESTRING_EMPTY = "RSEG1198"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILESTRING_NOTVALID = "RSEG1199"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$
- public static final String MSG_COMBINETO_VIRTUAL_DEST = "RSEG1121"; //$NON-NLS-1$
- public static final String MSG_CONVERTTO_VIRTUAL_DEST = "RSEG1127"; //$NON-NLS-1$
- public static final String MSG_ADDTO_VIRTUAL_DEST = "RSEG1128"; //$NON-NLS-1$
- public static final String MSG_DEST_NOT_IN_SOURCE = "RSEG1129"; //$NON-NLS-1$
- public static final String MSG_DEST_TARGET_READONLY = "RSEF1313"; //$NON-NLS-1$
-
- public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122"; //$NON-NLS-1$
- public static final String MSG_FOLDER_INUSE = "RSEG1150"; // defect 42138 //$NON-NLS-1$
- public static final String MSG_FILE_INUSE = "RSEG1151"; // defect 42332 //$NON-NLS-1$
-
- public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503 //$NON-NLS-1$
- public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161"; //$NON-NLS-1$
- public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162"; //$NON-NLS-1$
-
- //public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation.";
- public static final String MSG_OPERATION_FAILED = "RSEG1066"; //$NON-NLS-1$
- public static final String MSG_OPERATION_CANCELLED = "RSEG1067"; //$NON-NLS-1$
-
-
- //public static final String MSG_LOADING_PREFIX = MSG_PREFIX + "Loading.";
- public static final String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = "RSEG1068"; //$NON-NLS-1$
- public static final String MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED = "RSEG1069"; //$NON-NLS-1$
-
- public static final String MSG_UDA_LOAD_ERROR = "RSEG1140"; //$NON-NLS-1$
- public static final String MSG_UDA_ROOTTAG_ERROR = "RSEG1141"; //$NON-NLS-1$
-
- public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$
- public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$
-
- public static final String MSG_CONFIRM_DELETE_USERACTION = "RSEG1230"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_DELETE_USERTYPE = "RSEG1231"; //$NON-NLS-1$
-
- public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$
-
- // universal find files
- public static final String MSG_UFF_PATTERN_EMPTY = "RSEG1250"; //$NON-NLS-1$
- public static final String MSG_UFF_PATTERN_INVALID_REGEX = "RSEG1251"; //$NON-NLS-1$
-
- // universal commands
- public static final String MSG_UCMD_INVOCATION_EMPTY = "RSEG1260"; //$NON-NLS-1$
-
- // operation status
- public static final String MSG_OPERATION_RUNNING = "RSEG1255"; //$NON-NLS-1$
- public static final String MSG_OPERATION_FINISHED = "RSEG1256"; //$NON-NLS-1$
- public static final String MSG_OPERTION_STOPPED = "RSEG1257"; //$NON-NLS-1$
- public static final String MSG_OPERATION_DISCONNECTED = "RSEG1258"; //$NON-NLS-1$
-
-
-
- // --------------------------
- // UNIVERSAL FILE MESSAGES...
- // --------------------------
- public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY = "RSEF1011"; //$NON-NLS-1$
- public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE= "RSEF1007"; //$NON-NLS-1$
- public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID = "RSEF1008"; //$NON-NLS-1$
- public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES = "RSEF1009"; //$NON-NLS-1$
- public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300"; //$NON-NLS-1$
- public static final String FILEMSG_RENAME_FILE_FAILED = "RSEF1301"; //$NON-NLS-1$
- public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302"; //$NON-NLS-1$
- public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303"; //$NON-NLS-1$
- public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304"; //$NON-NLS-1$
- public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309"; //$NON-NLS-1$
- public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310"; //$NON-NLS-1$
- public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311"; //$NON-NLS-1$
- public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010"; //$NON-NLS-1$
- public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306"; //$NON-NLS-1$
- public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307"; //$NON-NLS-1$
- public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308"; //$NON-NLS-1$
- public static final String FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOUCE = "RSEF1312"; //$NON-NLS-1$
- public static final String FILEMSG_DELETING = "RSEF1315"; //$NON-NLS-1$
-
- // -------------------------
- // IMPORT/EXPORT MESSAGES...
- // -------------------------
- public static final String FILEMSG_COPY_ROOT = "RSEF8050"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_ERROR = "RSEF8052"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_PROBLEMS = "RSEF8054"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_SELF = "RSEF8056"; //$NON-NLS-1$
- public static final String FILEMSG_EXPORT_ERROR = "RSEF8057"; //$NON-NLS-1$
- public static final String FILEMSG_EXPORT_PROBLEMS = "RSEF8058"; //$NON-NLS-1$
- public static final String FILEMSG_NOT_WRITABLE = "RSEF8059"; //$NON-NLS-1$
-
- public static final String FILEMSG_TARGET_EXISTS = "RSEF8060"; //$NON-NLS-1$
- public static final String FILEMSG_FOLDER_IS_FILE = "RSEF8061"; //$NON-NLS-1$
- public static final String FILEMSG_DESTINATION_CONFLICTING = "RSEF8062"; //$NON-NLS-1$
- public static final String FILEMSG_SOURCE_IS_FILE = "RSEF8063"; //$NON-NLS-1$
- public static final String FILEMSG_SOURCE_EMPTY = "RSEF8066"; //$NON-NLS-1$
- public static final String FILEMSG_EXPORT_FAILED = "RSEF8067"; //$NON-NLS-1$
- public static final String FILEMSG_EXPORT_NONE_SELECTED = "RSEF8068"; //$NON-NLS-1$
- public static final String FILEMSG_DESTINATION_EMPTY = "RSEF8069"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_FAILED = "RSEF8070"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_NONE_SELECTED = "RSEF8071"; //$NON-NLS-1$
- public static final String FILEMSG_IMPORT_FILTERING = "RSEF8072"; //$NON-NLS-1$
-
- // --------------------------------
- // INFO-POPS FOR UNIVERSAL FILE
- // -------------------------------
-
- public static final String NEW_FILE_WIZARD = "ufwf0000"; //$NON-NLS-1$
- public static final String NEW_FOLDER_WIZARD = "ufwr0000"; //$NON-NLS-1$
- public static final String NEW_FILE_ACTION = "ufaf0000"; //$NON-NLS-1$
- public static final String NEW_FOLDER_ACTION = "ufar0000"; //$NON-NLS-1$
-
-
- // Remote File Exception Messages
- public static final String FILEMSG_SECURITY_ERROR = "RSEF1001"; //$NON-NLS-1$
- public static final String FILEMSG_IO_ERROR = "RSEF1002"; //$NON-NLS-1$
-
- public static final String FILEMSG_FOLDER_NOTEMPTY = "RSEF1003"; //$NON-NLS-1$
- public static final String FILEMSG_FOLDER_NOTFOUND = "RSEF1004"; //$NON-NLS-1$
- public static final String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE = "RSEF1005"; //$NON-NLS-1$
- public static final String FILEMSG_FILE_NOTFOUND = "RSEF1006"; //$NON-NLS-1$
-
- // --------------------------
- // SYSTEM VIEW MESSAGES...
- // --------------------------
- //public static final String MSG_EXPAND_PREFIX = MSG_PREFIX + "Expand.";
- public static final String MSG_EXPAND_FAILED = "RSEG1098"; //MSG_EXPAND_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_EXPAND_CANCELLED = "RSEG1067"; //MSG_EXPAND_PREFIX + "Cancelled"; //$NON-NLS-1$
- // Message vetoed by UCD
- //public static final String MSG_EXPAND_CANCELLED = "RSEG1099"; //MSG_EXPAND_PREFIX + "Cancelled";
- public static final String MSG_EXPAND_EMPTY = "RSEG1100"; //MSG_EXPAND_PREFIX + "Empty"; //$NON-NLS-1$
- public static final String MSG_EXPAND_FILTERCREATED = "RSEG1102"; //MSG_EXPAND_PREFIX + "FilterCreated"; //$NON-NLS-1$
- public static final String MSG_EXPAND_CONNECTIONCREATED = "RSEG1108"; //MSG_EXPAND_PREFIX + "ConnectionCreated"; //$NON-NLS-1$
-
- //public static final String MSG_LIST_PREFIX = MSG_PREFIX + "List.";
- public static final String MSG_LIST_CANCELLED = "RSEG1101"; //MSG_LIST_PREFIX + "Cancelled"; //$NON-NLS-1$
-
- // ----------------------------------
- // GENERIC ERROR CHECKING MESSAGES...
- // ----------------------------------
- public static final String MSG_ERROR_CONNECTION_NOTFOUND = "RSEG1103"; //$NON-NLS-1$
- public static final String MSG_ERROR_PROFILE_NOTFOUND = "RSEG1104"; //$NON-NLS-1$
- public static final String MSG_ERROR_FOLDER_NOTFOUND = "RSEG1105"; //$NON-NLS-1$
- public static final String MSG_ERROR_FILE_NOTFOUND = "RSEG1106"; //$NON-NLS-1$
- public static final String MSG_ERROR_FOLDERORFILE_NOTFOUND = "RSEG1107"; //$NON-NLS-1$
- public static final String MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED = "RSEG1304"; //$NON-NLS-1$
-
- // --------------------------
- // Generic messages, must substitute in values...
- // --------------------------
- public static final String MSG_GENERIC_I = "RSEO1010"; //$NON-NLS-1$
- public static final String MSG_GENERIC_W = "RSEO1011"; //$NON-NLS-1$
- public static final String MSG_GENERIC_E = "RSEO1012"; //$NON-NLS-1$
- public static final String MSG_GENERIC_U = "RSEO1013"; //$NON-NLS-1$
- public static final String MSG_GENERIC_Q = "RSEO1014"; //$NON-NLS-1$
- public static final String MSG_GENERIC_I_HELP = "RSEO1000"; //$NON-NLS-1$
- public static final String MSG_GENERIC_W_HELP = "RSEO1001"; //$NON-NLS-1$
- public static final String MSG_GENERIC_E_HELP = "RSEO1002"; //$NON-NLS-1$
- public static final String MSG_GENERIC_U_HELP = "RSEO1003"; //$NON-NLS-1$
- public static final String MSG_GENERIC_Q_HELP = "RSEO1004"; //$NON-NLS-1$
- public static final String MSG_GENERIC_I_TWOPARMS_HELP = "RSEO1005"; //$NON-NLS-1$
- public static final String MSG_GENERIC_W_TWOPARMS_HELP = "RSEO1006"; //$NON-NLS-1$
- public static final String MSG_GENERIC_E_TWOPARMS_HELP = "RSEO1007"; //$NON-NLS-1$
- public static final String MSG_GENERIC_U_TWOPARMS_HELP = "RSEO1008"; //$NON-NLS-1$
- public static final String MSG_GENERIC_Q_TWOPARMS_HELP = "RSEO1009"; //$NON-NLS-1$
-
- // ----------------------------------
- // COMMUNICATIONS ERROR CHECKING MESSAGES...
- // ----------------------------------
- public static final String MSG_COMM_CONNECT_FAILED = "RSEC1001"; //$NON-NLS-1$
- public static final String MSG_COMM_AUTH_FAILED = "RSEC1002"; //$NON-NLS-1$
- public static final String MSG_COMM_PWD_INVALID = "RSEC1004"; //$NON-NLS-1$
-
- public static final String MSG_COMM_PWD_EXISTS = "RSEC2101"; //$NON-NLS-1$
- public static final String MSG_COMM_PWD_MISMATCH = "RSEC2102"; //$NON-NLS-1$
- public static final String MSG_COMM_PWD_BLANKFIELD = "RSEC2103"; //$NON-NLS-1$
-
- public static final String MSG_COMM_ENVVAR_DUPLICATE = "RSEC2001"; //$NON-NLS-1$
- public static final String MSG_COMM_ENVVAR_NONAME = "RSEC2002"; //$NON-NLS-1$
- public static final String MSG_COMM_ENVVAR_INVALIDCHAR = "RSEC2004"; //$NON-NLS-1$
-
- public static final String MSG_COMM_DAEMON_NOTSTARTED = "RSEC2201"; //$NON-NLS-1$
-
- public static final String MSG_COMM_SERVER_NOTSTARTED = "RSEC2301"; //$NON-NLS-1$
- public static final String MSG_COMM_INVALID_LOGIN = "RSEC2302"; //$NON-NLS-1$
-
- public static final String MSG_COMM_INCOMPATIBLE_PROTOCOL = "RSEC2303"; //$NON-NLS-1$
- public static final String MSG_COMM_INCOMPATIBLE_UPDATE = "RSEC2304"; //$NON-NLS-1$
-
-
- public static final String MSG_COMM_REXEC_NOTSTARTED = "RSEC2305"; //$NON-NLS-1$
-
- public static final String MSG_COMM_PORT_WARNING = "RSEC2306"; //$NON-NLS-1$
-
- public static final String MSG_COMM_SERVER_OLDER_WARNING = "RSEC2308"; //$NON-NLS-1$
- public static final String MSG_COMM_CLIENT_OLDER_WARNING = "RSEC2309"; //$NON-NLS-1$
-
- public static final String MSG_COMM_USING_SSL = "RSEC2314"; //$NON-NLS-1$
- public static final String MSG_COMM_NOT_USING_SSL = "RSEC2315"; //$NON-NLS-1$
-
- // Unexpected error message
- public static final String MSG_ERROR_UNEXPECTED = "RSEF8002"; //$NON-NLS-1$
-
- // Connection doesn't exist
- public static final String MSG_CONNECTION_DELETED = "RSEF5011"; //$NON-NLS-1$
-
- // Remote editing messages
- public static final String MSG_DOWNLOAD_NO_WRITE = "RSEF5002"; //$NON-NLS-1$
- public static final String MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR = "RSEF5009"; //$NON-NLS-1$
- public static final String MSG_UPLOAD_FILE_EXISTS = "RSEF5012"; //$NON-NLS-1$
-
- public static final String MSG_FOLDER_UNREADABLE = "RSEF5020";
-
- // General error message
- public static final String MSG_ERROR_GENERAL = "RSEO1002"; //$NON-NLS-1$
-
- // file transfer message
- public static final String MSG_TRANSFER_INVALID = "RSEG1270"; //$NON-NLS-1$
-
-
- // remote error list title message
- public static final String MSG_ERROR_LIST_TITLE = "RSEG1500"; //$NON-NLS-1$
-
- // name validation
- public static final String MSG_ERROR_EXTENSION_EMPTY = "RSEF6001"; //$NON-NLS-1$
- public static final String MSG_ERROR_FILENAME_INVALID = "RSEF6002"; //$NON-NLS-1$
-
- // cache preferences
- public static final String MSG_CACHE_UPLOAD_BEFORE_DELETE = "RSEF6101"; //$NON-NLS-1$
- public static final String MSG_CACHE_UNABLE_TO_SYNCH = "RSEF6102"; //$NON-NLS-1$
-
- // remote search messages
- public static final String MSG_REMOTE_SEARCH_INVALID_REGEX = "RSEG1601"; //$NON-NLS-1$
-
- // yantzi: artemis 6.0, offline messages
- public static final String MSG_OFFLINE_CANT_CONNECT = "RSEC3001"; //$NON-NLS-1$
-
- // file import/export messages
- public static final String MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION = "RSEF5101"; //$NON-NLS-1$
- public static final String MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION = "RSEF5102"; //$NON-NLS-1$
-
- // jar export messages
- public static final String MSG_REMOTE_JAR_EXPORT_OVERWRITE_FILE = "RSEF5103"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPageCompleteListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPageCompleteListener.java
deleted file mode 100644
index 15055ba96..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPageCompleteListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * This is used in forms that are used within dialogs and pages, and
- * specifically with {@link org.eclipse.rse.ui.SystemBaseForm}.
- * It allows the dialog or page to be called back when the form code calls
- * setPageComplete, a method within the form class. This way the diaog or
- * page can themselves call their own setPageComplete method.
- */
-public interface ISystemPageCompleteListener
-{
- /**
- * The callback method.
- * This is called whenever setPageComplete is called by the form code.
- * @param complete complete indicator as set by the caller
- * @see SystemBaseForm#addPageCompleteListener(ISystemPageCompleteListener)
- */
- public void setPageComplete(boolean complete);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPreferencesConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPreferencesConstants.java
deleted file mode 100644
index 664cd7d7e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemPreferencesConstants.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * Keys into preferences bundle.
- */
-public interface ISystemPreferencesConstants
-{
-
- // root
- public static final String ROOT = "org.eclipse.rse.preferences.";
-
- // keys
- public static final String SYSTEMTYPE = ROOT + "systemtype";
- public static final String SYSTEMTYPE_VALUES = ROOT + "systemtype.info";
- public static final String USERIDPERKEY = ROOT + "useridperkey";
- public static final String USERIDKEYS = ROOT + "userid.keys";
- public static final String SHOWFILTERPOOLS = ROOT + "filterpools.show";
- public static final String ACTIVEUSERPROFILES = ROOT + "activeuserprofiles";
- public static final String QUALIFY_CONNECTION_NAMES= ROOT + "qualifyconnectionnames";
- public static final String ORDER_CONNECTIONS = ROOT + "order.connections";
- public static final String HISTORY_FOLDER = ROOT + "history.folder";
- public static final String HISTORY_QUALIFIED_FOLDER= ROOT + "history.qualified.folder";
- public static final String SHOWHIDDEN = ROOT + "showhidden";
- public static final String SHOWNEWCONNECTIONPROMPT = ROOT + "shownewconnection";
- public static final String REMEMBER_STATE = ROOT + "rememberState";
- public static final String USE_DEFERRED_QUERIES = ROOT + "useDeferredQueries";
- public static final String RESTORE_STATE_FROM_CACHE = ROOT + "restoreStateFromCache";
- public static final String CASCADE_UDAS_BYPROFILE = ROOT + "uda.cascade";
- public static final String FILETRANSFERMODEDEFAULT = ROOT + "filetransfermodedefault";
- public static final String DAEMON_AUTOSTART = ROOT + "daemon.autostart";
- public static final String DAEMON_PORT = ROOT + "daemon.port";
-
- public static final String LIMIT_CACHE = ROOT + "limit.cache";
- public static final String MAX_CACHE_SIZE = ROOT + "max.cache.size";
-
- public static final String DOSUPERTRANSFER = ROOT + "dosupertransfer";
- public static final String SUPERTRANSFER_ARC_TYPE = ROOT + "supertransfer.archivetype";
-
- public static final String DOWNLOAD_BUFFER_SIZE = ROOT + "download.buffer.size";
- public static final String UPLOAD_BUFFER_SIZE = ROOT + "upload.buffer.size";
-
- public static final String VERIFY_CONNECTION = ROOT + "verify.connection";
-
- public static final String ALERT_SSL = ROOT + "alert.ssl";
- public static final String ALERT_NONSSL = ROOT + "alert.nonssl";
-
- // DEFAULTS
- public static final boolean DEFAULT_SHOWFILTERPOOLS = false;
- public static final boolean DEFAULT_QUALIFY_CONNECTION_NAMES = false;
- public static final String DEFAULT_SYSTEMTYPE = "";
- public static final String DEFAULT_USERID = "";
- //DKM public static final String DEFAULT_ACTIVEUSERPROFILES = "Team;Private";
- public static final String DEFAULT_ACTIVEUSERPROFILES = "Team";
-
- public static final String DEFAULT_ORDER_CONNECTIONS = "";
- public static final String DEFAULT_HISTORY_FOLDER = "";
- public static final boolean DEFAULT_SHOW_HIDDEN = true;
- public static final boolean DEFAULT_SHOWNEWCONNECTIONPROMPT = false;
- public static final boolean DEFAULT_REMEMBER_STATE = true; // changed in R2. Phil
- public static final boolean DEFAULT_RESTORE_STATE_FROM_CACHE = true; // yantzi: artemis 6.0
- public static final boolean DEFAULT_CASCADE_UDAS_BYPROFILE = false;
- public static final int DEFAULT_FILETRANSFERMODE = 0;
- public static final boolean DEFAULT_USE_DEFERRED_QUERIES = true;
-
- public static final String DEFAULT_TEAMPROFILE = "Team";
-
- public static final int FILETRANSFERMODE_BINARY = 0;
- public static final int FILETRANSFERMODE_TEXT = 1;
-
- public static final boolean DEFAULT_DAEMON_AUTOSTART = false;
- public static final int DEFAULT_DAEMON_PORT = 4035;
-
- public static final boolean DEFAULT_LIMIT_CACHE = false;
- public static final String DEFAULT_MAX_CACHE_SIZE = "512";
-
- public static final String DEFAULT_SUPERTRANSFER_ARCHIVE_TYPE = "zip";
- public static final boolean DEFAULT_DOSUPERTRANSFER = true;
-
- public static final int DEFAULT_DOWNLOAD_BUFFER_SIZE = 40;
-
- public static final boolean DEFAULT_VERIFY_CONNECTION = true;
-
- public static final boolean DEFAULT_ALERT_SSL = true;
- public static final boolean DEFAULT_ALERT_NON_SSL = true;
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemRenameTarget.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemRenameTarget.java
deleted file mode 100644
index f02c0eb56..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemRenameTarget.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-
-/**
- * Any UI part that supports the common rename action can implement
- * this to enable the rename popup menu action, supplied by the system explorer view.
- */
-public interface ISystemRenameTarget extends ISelectionProvider
-{
- /**
- * Return true if rename should even be shown in the popup menu
- */
- public boolean showRename();
- /**
- * Return true if rename should be enabled based on your current selection.
- */
- public boolean canRename();
- /**
- * Actually do the rename of currently selected items.
- * The array of new names matches the currently selected items.
- * Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)
- */
- public boolean doRename(String[] newNames);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemStringsInputAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemStringsInputAction.java
deleted file mode 100644
index 4137d6916..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemStringsInputAction.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- *
- */
-public interface ISystemStringsInputAction
-{
- /**
- * Set the list of existing filter strings to help with validation.
- * Called when launched from WorkWithList widget
- */
- public void setExistingStrings(String[] existingStrings, boolean caseSensitive);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemThemeConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemThemeConstants.java
deleted file mode 100644
index 54afdfa3f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemThemeConstants.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-/**
- * This interface should be used to maintain all constants related to colors and fonts
- * that are settable by the user through preferences
- */
-public interface ISystemThemeConstants {
-
- // color constants used for messages
- public static final String MESSAGE_ERROR_COLOR = "MESSAGE_ERROR_COLOR";
- public static final String MESSAGE_WARNING_COLOR = "MESSAGE_WARNING_COLOR" ;
- public static final String MESSAGE_INFORMATION_COLOR = "MESSAGE_INFORMATION_COLOR";
-
- // color constants used by Remote Commnds view
- public static final String REMOTE_COMMANDS_VIEW_BG_COLOR = "REMOTE_COMMANDS_VIEW_BG_COLOR";
- public static final String REMOTE_COMMANDS_VIEW_FG_COLOR = "REMOTE_COMMANDS_VIEW_FG_COLOR";
- public static final String REMOTE_COMMANDS_VIEW_PROMPT_COLOR = "REMOTE_COMMANDS_VIEW_PROMPT_COLOR";
-
- // font constant used by Remote Commands view
- public static final String REMOTE_COMMANDS_VIEW_FONT = "REMOTE_COMMANDS_VIEW_FONT";
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemVerifyListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemVerifyListener.java
deleted file mode 100644
index 6e46f787f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemVerifyListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * @author mjberger
- * This is used in forms that are used within dialogs and pages, and
- * specifically with {@link org.eclipse.rse.ui.RemoteBaseServerLauncherForm}.
- * It allows the dialog or page to be called back when the form code calls
- * verify, a method within the form class. This way the diaog or
- * page can update their error messages if there are any.
- */
-public interface ISystemVerifyListener
-{
- /**
- * The callback method.
- * This is called whenever verify is called by the form code.
- */
- public void handleVerifyComplete();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerAddQuotes.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerAddQuotes.java
deleted file mode 100644
index 93006be85..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerAddQuotes.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-/**
- * This massager will take a string an add quotes to it by
- * wrapping the string in the quote character and doubling
- * any interior instances of the quote character.
- */
-public class MassagerAddQuotes implements ISystemMassager {
-
-
-
- private char quote = '\'';
-
- /**
- * Construct a new instance of the massager. This instance
- * assumes the quote character is the apostrophe '\''.
- */
- public MassagerAddQuotes() {
- super();
- }
-
- /**
- * Construct a new instance of the massager. This instance
- * uses the supplied character as the quoting character.
- *
- * @param quote the quote character to use in quoting strings
- */
- public MassagerAddQuotes(char quote) {
- this.quote = quote;
- }
-
- /**
- * Quotes the string by surround the original string with
- * the quote character and doubling any internal occurences of
- * the character.
- *
- * @param text the string to be quoted
- * @return the quoted string
- * @see org.eclipse.rse.ui.ISystemMassager#massage(String)
- */
- public String massage(String text) {
-
- char[] chars = text.toCharArray();
-
- /* determine the number of extra quotes needed */
- int n = 0;
- for (int i = 0; i < chars.length; i++) {
- if (chars[i] == quote) {
- n++;
- }
- }
- n += 2;
-
- /* Allocate and move the characters into the buffer */
- StringBuffer buf = new StringBuffer(chars.length + n);
- buf.append(quote);
- for (int i = 0; i < chars.length; i++) {
- if (chars[i] == quote) {
- buf.append(quote);
- }
- buf.append(chars[i]);
- }
- buf.append(quote);
-
- return buf.toString();
- }
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCase.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCase.java
deleted file mode 100644
index 761b4ad25..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCase.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * This massager folds the input text into either uppercase or lowercase,
- * depending on the value pass to the constructor or setter.
- * <p>
- * Note by default this also trims the
- */
-public class MassagerFoldCase implements ISystemMassager
-{
-
- private boolean uppercase;
- private boolean trim;
-
- /**
- * Constructor using uppercase as the case direction
- */
- public MassagerFoldCase()
- {
- this(true);
- }
- /**
- * Constructor using given case direction
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- */
- public MassagerFoldCase(boolean foldToUpperCase)
- {
- super();
- setFoldToUpperCase(foldToUpperCase);
- setTrimBlanks(true);
- }
-
- /**
- * Toggle whether to fold to uppercase or lowercase
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- */
- public void setFoldToUpperCase(boolean foldToUpperCase)
- {
- this.uppercase = foldToUpperCase;
- }
- /**
- * Toggle whether to trim blanks for not
- * @param trimBlanks - whether to trim blanks (true) or leave them (false).
- */
- public void setTrimBlanks(boolean trimBlanks)
- {
- this.trim = trimBlanks;
- }
-
- /**
- * Return property about whether to fold to uppercase or lowercase
- * @return true if folder to uppercase, false if folded to lowercaese
- */
- public boolean getFoldToUpperCase()
- {
- return uppercase;
- }
- /**
- * Return property about whether to trim blanks for not
- * @return true if blanks are trimmed
- */
- public boolean getTrimBlanks()
- {
- return trim;
- }
- /**
- * @see org.eclipse.rse.ui.ISystemMassager#massage(String)
- */
- public String massage(String text)
- {
- if (text == null)
- return null;
- if (trim)
- text = text.trim();
- if (uppercase)
- return toUpperCase(text);
- else
- return toLowerCase(text);
- }
-
- /**
- * Overrridable method that actually does the uppercasing
- */
- protected String toUpperCase(String input)
- {
- return input.toUpperCase();
- }
- /**
- * Overrridable method that actually does the lowercasing
- */
- protected String toLowerCase(String input)
- {
- return input.toLowerCase();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseOutsideQuotes.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseOutsideQuotes.java
deleted file mode 100644
index f87d2773b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseOutsideQuotes.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * This massager folds the input text into either uppercase or lowercase,
- * but ONLY for those portions of the string that are not inside delimiters.
- * <p>
- * The default delimiter characters checked for are single or double quote characters, but this
- * can be changed by a setter method. When any of the delimiter characters are
- * first found we enter delimited (non-folding) mode, until the same
- * non-escaped delimiter character is found.
- * <p>
- * This massager assumes an imbedded delimiter is denoted by a doubled up
- * delimiter. If this is not the case, a setter can be used for the escape
- * character.
- * <p>
- * This massager takes more time than the MassageFoldCaseUnlessQuoted massager,
- * as that one just checks if the entire string is delimited, while this one
- * attempts to check for ranges of delimiting.
- */
-public class MassagerFoldCaseOutsideQuotes extends MassagerFoldCase
-{
-
- private static final char[] DEFAULT_DELIMITERS = {'\"', '\''};
- private char[] delimiters;
- private char escape = ' ';
-
- /**
- * Constructor using uppercase and using single and double quotes as delimiters
- */
- public MassagerFoldCaseOutsideQuotes()
- {
- this(true, DEFAULT_DELIMITERS);
- }
- /**
- * Constructor using given case direction, using single and double quotes as delimiters
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- */
- public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase)
- {
- this(foldToUpperCase, DEFAULT_DELIMITERS);
- }
- /**
- * Constructor using given case direction, using given delimiters
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- * @param delimiters - chars to trigger delimited mode. Delimited sections are not folded.
- */
- public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase, char[] delimiters)
- {
- super(foldToUpperCase);
- setDelimiters(delimiters);
- }
-
- /**
- * Set the delimiter characters
- * @param delimiters - chars to trigger delimited mode. Delimited sections are not folded.
- */
- public void setDelimiters(char[] delimiters)
- {
- this.delimiters = delimiters;
- }
- /**
- * Set the escape character used for denoted an imbedded delimiter. By default, it is assumed
- * a doubled up delimiter is used for this.
- * @param escapeChar - char that escapes the delimiter. Eg '\'
- */
- public void setEscapeCharacter(char escapeChar)
- {
- this.escape = escapeChar;
- }
-
- /**
- * Get the delimiter characters
- */
- public char[] getDelimiters()
- {
- return delimiters;
- }
- /**
- * Get the escape character
- */
- public char getEscapeCharacter()
- {
- return escape;
- }
-
- /**
- * Overrridable method that actually does the uppercasing
- */
- protected String toUpperCase(String input)
- {
- if ((input==null) || (input.length() == 0))
- return input;
- else if (!hasAnyDelimiters(input)) // no delimit characters?
- return input.toUpperCase(); // fold it all!
- else
- return doFolding(input, true);
- }
- /**
- * Overrridable method that actually does the lowercasing
- */
- protected String toLowerCase(String input)
- {
- if ((input==null) || (input.length() == 0))
- return input;
- else if (!hasAnyDelimiters(input)) // no delimit characters?
- return input.toLowerCase(); // fold it all!
- else
- return doFolding(input, false);
- }
- /**
- * Check for existence of any delimiters
- */
- protected boolean hasAnyDelimiters(String input)
- {
- boolean hasAny = false;
- for (int idx=0; !hasAny && (idx<delimiters.length); idx++)
- if (input.indexOf(delimiters[idx]) != -1)
- hasAny = true;
- return hasAny;
- }
-
- /**
- * Method that actually walks the given string, character by character,
- * folding all those which are not inside delimiters
- */
- protected String doFolding(String input, boolean upperCase)
- {
- StringBuffer buffer = new StringBuffer(input.length());
- boolean insideDelimiters = false;
- boolean checkForEscape = (escape != ' ');
- char currDelimiter = ' ';
- char prevChar = ' ';
- char currChar = ' ';
- for (int idx=0; idx<input.length(); idx++)
- {
- prevChar = currChar;
- currChar = input.charAt(idx);
- // ------------------------
- // outside of delimiters...
- // ------------------------
- if (!insideDelimiters)
- {
- // append folded
- if (upperCase)
- buffer.append(Character.toUpperCase(currChar));
- else
- buffer.append(Character.toLowerCase(currChar));
- // check if this is the start of delimiting...
- if (isDelimiter(currChar))
- {
- currDelimiter = currChar;
- insideDelimiters = true; // enter delimited mode
- }
- }
- // -----------------------
- // inside of delimiters...
- // -----------------------
- else
- {
- buffer.append(currChar); // append as is
- // check if this is the end of delimiting...
- if (currChar == currDelimiter)
- {
- // ensure this isn't an escaped delimiter
- if (!checkForEscape || (prevChar != escape))
- insideDelimiters = false; // exit delimited mode
- }
- }
- }
- return buffer.toString();
- }
- /**
- * Check if given character is one of the delimiters
- */
- protected boolean isDelimiter(char currChar)
- {
- for (int idx=0; idx<delimiters.length; idx++)
- if (currChar == delimiters[idx])
- return true;
- return false;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseUnlessQuoted.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseUnlessQuoted.java
deleted file mode 100644
index 6dcbbbf8b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerFoldCaseUnlessQuoted.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-/**
- * This massager folds the input text into either uppercase or lowercase,
- * but ONLY if the given input is not delimited. The default delimiter checked
- * for is the double quote character, but this can be changed by a setter method.
- */
-public class MassagerFoldCaseUnlessQuoted extends MassagerFoldCase
-{
-
- private char delimiter;
-
- /**
- * Constructor using uppercase and using a double quote as delimiter
- */
- public MassagerFoldCaseUnlessQuoted()
- {
- this(true, '\"');
- }
- /**
- * Constructor using given case direction, using a double quote as delimiter
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- */
- public MassagerFoldCaseUnlessQuoted(boolean foldToUpperCase)
- {
- this(foldToUpperCase, '\"');
- }
- /**
- * Constructor using given case direction, using given delimiter
- * @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
- * @param delimiter - char to check if text is enclosed with. If it is, then no folding is done.
- */
- public MassagerFoldCaseUnlessQuoted(boolean foldToUpperCase, char delimiter)
- {
- super(foldToUpperCase);
- setDelimiter(delimiter);
- }
-
- /**
- * Set the delimiter character
- * @param delimiter - char to check if text is enclosed with. If it is, then no folding is done.
- */
- public void setDelimiter(char delimiter)
- {
- this.delimiter = delimiter;
- }
-
- /**
- * Get the delimiter character
- */
- public char getDelimiter()
- {
- return delimiter;
- }
-
- /**
- * Overrridable method that actually does the uppercasing
- */
- protected String toUpperCase(String input)
- {
- if ((input.length() >= 2) &&
- (input.charAt(0) == delimiter) && // start with delimiter?
- (input.charAt(input.length()-1) == delimiter)) // end with delimiter?
- return input; // do nothing
- else
- return input.toUpperCase(); // fold
- }
- /**
- * Overrridable method that actually does the lowercasing
- */
- protected String toLowerCase(String input)
- {
- if ((input.length() >= 2) &&
- (input.charAt(0) == delimiter) && // start with delimiter?
- (input.charAt(input.length()-1) == delimiter)) // end with delimiter?
- return input; // do nothing
- else
- return input.toLowerCase(); // fold
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerRemoveQuotes.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerRemoveQuotes.java
deleted file mode 100644
index 92e614a3e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/MassagerRemoveQuotes.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-/**
- * Utility class used by UI widgets to format a srcpf or member Description string.<br>
- * It checks to see if the string is legally quoted, and if not, it returns it as is. A legally quoted
- * string is one which begins and ends with single quotes, and where all single quotes inside the
- * string are escaped with another single quote. If the string is legally quoted, it de-quotes it
- * (hence the name). Dequoting means remove the single quotes, and remove any escape quotes
- * from the inside of the string.
- * There is also a general constructor that takes in the quoting character, the character to escape,
- * and the character to use as an escape charcter. It also takes n a boolean flag that decides wether
- * or not the string has to be quoted before this massager actually does the job.
- */
-public class MassagerRemoveQuotes implements ISystemMassager {
-
-
-
- private String quoteChar;
- private String charToEscape;
- private String escapeChar;
- private boolean mustBeQuoted;
-
- /**
- * Default constructor for MassagerRemoveQuotes.<br>
- * Assumes that a legal string is one where the string is quoted with single quotes,
- * and all inner quotes are escaped with a single quote.
- */
- public MassagerRemoveQuotes() {
- this('\'', '\'', '\'', true);
- }
-
- /**
- * Generic constructor. A valid string is one where every charToEscape is actually
- * escaped with an escapeChar before it. If mustBeQuoted is true, then the string
- * is only valid if it is quoted with the quoteChar, and the characters inside the
- * string itself are properly escaped. If the string is determined to be a valid string,
- * this massager returns the string with the quotes and escape characters stripped out.
- * if not, the string is returned as is.
- */
- public MassagerRemoveQuotes(
- char quoteChar,
- char charToEscape,
- char escapeChar,
- boolean mustBeQuoted) {
-
- this.quoteChar = String.valueOf(quoteChar);
- this.charToEscape = String.valueOf(charToEscape);
- this.escapeChar = String.valueOf(escapeChar);
- this.mustBeQuoted = mustBeQuoted;
- }
-
- public String massage(String text) {
- String strippedText = text;
-
- if (mustBeQuoted) {
- if (!isQuoted(text))
- // String is not quoted, when it should be, return it as is.
- // No need to de-quote since it is not a legal string.
- return text;
- else
- strippedText = stripQuotes(text);
- }
-
- // check to see if string is a legal string, and if it is, de-quote it.
- boolean islegal = isLegalString(strippedText);
- if (islegal)
- return deQuote(strippedText);
- else
- return text;
- }
-
- /**
- * Returns true if string is single quoted.
- */
- protected boolean isQuoted(String text) {
- if (text.startsWith(quoteChar) && text.endsWith(quoteChar))
- return true;
- else
- return false;
- }
-
- /**
- * Checks to see if we have a valid string. A valid string is one where all
- * quotes are escaped with another quote.
- */
- protected boolean isLegalString(String text) {
- if (charToEscape.equals(escapeChar))
- return doForwardChecking(text);
- else
- return doBackwardChecking(text);
- }
-
- private boolean doForwardChecking(String text) {
- int index = text.indexOf(charToEscape);
- while (index != -1) {
- // check the char AFTER the escape char since they are both the
- // same. . Be careful if it is the last char.
- if ((index == text.length() - 1)
- || (text.charAt(index + 1) != escapeChar.charAt(0)))
- // we have a quote that is not escaped => not a legal string.
- return false;
-
- // search for another quote *after* the escaped one.
- index = text.indexOf(charToEscape, index + 2);
- }
-
- // all quotes are escaped, legal string.
- return true;
-
- }
-
- private boolean doBackwardChecking(String text) {
- int index = text.indexOf(charToEscape);
- while (index != -1) {
- // check the char before the character to escape. Be careful if it is the first char.
- if ((index == 0)
- || (text.charAt(index - 1) != escapeChar.charAt(0)))
- // we have a quote that is not escaped => not a legal string.
- return false;
-
- // search for another quote *after* the escaped one.
- index = text.indexOf(charToEscape, index + 1);
- }
-
- // all quotes are escaped, legal string.
- return true;
-
- }
-
- /**
- * Removes first and last chars if they are single quotes, otherwise
- * returns the string as is.
- */
- private String stripQuotes(String text) {
- if (isQuoted(text)) {
- text = text.substring(1, text.length() - 1);
- }
- return text;
- }
-
- /**
- * This method assumes that the passed string is a legal string, and it does
- * the qe-quoting.
- */
- private String deQuote(String text) {
- if (charToEscape.equals(escapeChar))
- return doForwardDeQuote(text);
- else
- return doBackwardDeQuote(text);
- }
-
- private String doForwardDeQuote(String text) {
- int index = text.indexOf(charToEscape);
- while (index != -1) {
- // strip the escape char.
- text = text.substring(0, index) + text.substring(index + 1);
-
- // search for another quote *after* the escaped one.
- index = text.indexOf(charToEscape, index + 2);
- }
- return text;
- }
-
- private String doBackwardDeQuote(String text) {
- int index = text.indexOf(charToEscape);
- while (index != -1) {
- // strip the escape char.
- text = text.substring(0, index - 1) + text.substring(index);
-
- // search for another quote *after* the escaped one.
- index = text.indexOf(charToEscape, index + 1);
- }
- return text;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/Mnemonics.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/Mnemonics.java
deleted file mode 100644
index 95624f0c3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/Mnemonics.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.rse.ui.widgets.InheritableEntryField;
-import org.eclipse.swt.events.ArmListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Text;
-
-
-
-/**
- * A class for creating unique mnemonics per control per window.
- */
-public class Mnemonics
-{
- private static final String[] TransparentEndings = { // endings that should appear after a mnemonic
- "...", // ellipsis
- ">>", // standard "more"
- "<<", // standard "less"
- ">", // "more" -- non-standard usage, must appear in list after >>
- "<", // "less" -- non-standard usage, must appear in list after <<
- ":", // colon
- "\uff0e\uff0e\uff0e", // wide ellipsis
- "\uff1e\uff1e", // wide standard "more"
- "\uff1c\uff1c", // wide standard "less"
- "\uff1e", // wide non-standard "more"
- "\uff1c", // wide non-standard "less"
- "\uff1a" // wide colon
- };
-
- private StringBuffer mnemonics = new StringBuffer(); // mnemonics used so far
- private static final String candidateChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- private String preferencePageMnemonics = null; // mnemonics used by Eclipse on preference pages
- private String wizardPageMnemonics = null; // mnemonics used by Eclipse on wizard pages
- // private static String preferencePageMnemonics = "AD"; // mnemonics used by Eclipse on preference pages
- // private static String wizardPageMnemonics = "FBN"; // mnemonics used by Eclipse on wizard pages
- public static final char MNEMONIC_CHAR = '&';
- private boolean onPrefPage = false;
- private boolean onWizardPage = false;
- private boolean applyMnemonicsToPrecedingLabels = true;
-
- /**
- * Clear the list for re-use
- */
- public void clear()
- {
- mnemonics = new StringBuffer();
- }
-
- /**
- * Inserts an added mnemonic of the form (&x) into a StringBuffer at the correct point.
- * Checks for transparent endings and trailing spaces.
- * @param label the label to check
- */
- private static void insertMnemonic(StringBuffer label, String mnemonic) {
- int p = label.length();
- // check for trailing spaces #1
- while (p > 0 && label.charAt(p - 1) == ' ') {
- p--;
- }
- // check for transparent endings
- for (int i = 0; i < TransparentEndings.length; i++) {
- String transparentEnding = TransparentEndings[i];
- int l = transparentEnding.length();
- int n = p - l;
- if (n >= 0) {
- String labelEnding = label.substring(n, n + l);
- if (labelEnding.equals(transparentEnding)) {
- p = n;
- break;
- }
- }
- }
- // check for trailing spaces #2
- while (p > 0 && label.charAt(p - 1) == ' ') {
- p--;
- }
- // make sure there is something left to attach a mnemonic to
- if (p > 0) {
- label.insert(p, mnemonic);
- }
- }
-
- /**
- * Given a string, this starts at the first character and iterates until
- * it finds a character not previously used as a mnemonic on this page.
- * Not normally called from other classes, but rather by the setMnemonic
- * methods in this class.
- * @param label String to which to generate and apply the mnemonic
- * @return input String with '&' inserted in front of the unique character
- */
- public String setUniqueMnemonic(String label)
- {
-
- // Kludge for now
- // If there is already a mnemonic, remove it
- label = removeMnemonic(label);
- //int iMnemonic = label.indexOf( MNEMONIC_CHAR );
- //if( iMnemonic >= 0 && iMnemonic < label.length() - 1 ){
- //mnemonics.append( label.charAt( iMnemonic + 1 ) );
- //return label;
- //}
-
- int labelLen = label.length();
- if (labelLen == 0)
- return label;
- else if ((labelLen == 1) && label.equals("?"))
- return label;
- StringBuffer newLabel = new StringBuffer(label);
- int mcharPos = findUniqueMnemonic(label);
- if (mcharPos != -1)
- newLabel.insert(mcharPos,MNEMONIC_CHAR);
- // if no unique character found, then
- // find a new arbitrary one from the alphabet...
- else
- {
- mcharPos = findUniqueMnemonic(candidateChars);
- if (mcharPos != -1)
- {
- String addedMnemonic = "(" + MNEMONIC_CHAR + candidateChars.charAt(mcharPos) + ")";
- insertMnemonic(newLabel, addedMnemonic);
- }
- }
- return newLabel.toString();
- } // end getUniqueMnemonic
- /**
- * Given a label and mnemonic, this applies that mnemonic to the label.
- * Not normally called from other classes, but rather by the setUniqueMnemonic
- * methods in this class.
- * @param label String to which to apply the mnemonic
- * @param mnemonicChar the character that is to be the mnemonic character
- * @return input String with '&' inserted in front of the given character
- */
- public static String applyMnemonic(String label, char mnemonicChar)
- {
- int labelLen = label.length();
- if (labelLen == 0)
- return label;
- StringBuffer newLabel = new StringBuffer(label);
- int mcharPos = findCharPos(label, mnemonicChar);
- if (mcharPos != -1)
- newLabel.insert(mcharPos,MNEMONIC_CHAR);
- else
- {
- String addedMnemonic = new String("("+MNEMONIC_CHAR + mnemonicChar + ")");
- insertMnemonic(newLabel, addedMnemonic);
- }
- return newLabel.toString();
- } // end getUniqueMnemonic
- /**
- * Given a char, find its position in the given string
- */
- private static int findCharPos(String label, char charToFind)
- {
- int pos = -1;
- for (int idx=0; (pos==-1) && (idx<label.length()); idx++)
- if (label.charAt(idx) == charToFind)
- pos = idx;
- return pos;
- }
-
- /**
- * Determine if given char is a unique mnemonic
- */
- public boolean isUniqueMnemonic(char currchar)
- {
- boolean isUnique = true;
- for (int idx=0; isUnique && (idx < mnemonics.length()); idx++)
- if (mnemonics.charAt(idx) == currchar)
- isUnique = false;
- return isUnique;
- }
- /**
- * Find a uniqe mnemonic char in given string.
- * Note if one is found, it is added to the list of currently used mnemonics!
- *
- * @param string to search each char for unique candidate
- * @return index position of unique character in input string, or -1 if none found.
- */
- public int findUniqueMnemonic(String label)
- {
- int labelLen = label.length();
- if (labelLen == 0)
- return -1;
- int retcharPos = -1;
- label = label.toUpperCase();
- char currchar = label.charAt(0);
- boolean isUnique = false;
-
- // if we're on a preference page, get the preference page mnemonics
- if (onPrefPage) {
-
- if (preferencePageMnemonics == null) {
- preferencePageMnemonics = getPreferencePageMnemonics();
- }
- }
-
- // if we're on a wizard page, get the wizard page mnemonics
- if (onWizardPage) {
-
- if (wizardPageMnemonics == null) {
- wizardPageMnemonics = getWizardPageMnemonics();
- }
- }
-
- // attempt to find the first character in the given
- // string that has not already been used as a mnemonic
- for (int idx=0; (idx<labelLen) && (retcharPos==-1); idx++)
- {
- currchar = label.charAt(idx);
-
- if ( !(onPrefPage && preferencePageMnemonics.indexOf( currchar ) != -1)
- && !(onWizardPage && wizardPageMnemonics.indexOf( currchar ) != -1)
- && candidateChars.indexOf( currchar ) != -1 )
- {
- isUnique = isUniqueMnemonic(currchar);
- if (isUnique)
- {
- mnemonics.append(currchar);
- retcharPos = idx;
- }
- }
- }
- return retcharPos;
- }
-
- /**
- * Returns a string containing the mnemonics for a preference page.
- * @return the mnemonics.
- */
- private String getPreferencePageMnemonics() {
- String[] labels = JFaceResources.getStrings(new String[] { "defaults", "apply" });
- return getMnemonicsFromStrings(labels).toUpperCase();
- }
-
- /**
- * Returns a string containing the mnemonics for a wizard page.
- * @return the mnemonics.
- */
- private String getWizardPageMnemonics() {
- String[] labels = new String[] {IDialogConstants.BACK_LABEL, IDialogConstants.NEXT_LABEL, IDialogConstants.FINISH_LABEL};
- return getMnemonicsFromStrings(labels).toUpperCase();
- }
-
- /**
- * Returns a string with the mnemonics for a given array of strings.
- * @param strings the array of strings.
- * @return a string containing the mnemonics.
- */
- private String getMnemonicsFromStrings(String[] strings) {
-
- StringBuffer result = new StringBuffer();
-
- for (int i = 0; i < strings.length; i++) {
- int idx = strings[i].indexOf(MNEMONIC_CHAR);
-
- if (idx != -1) {
- result.append(strings[i].charAt(idx+1));
- }
- }
-
- return result.toString();
- }
-
- /**
- * Adds a mnemonic to an SWT Button such that the user can select it via Ctrl/Alt+mnemonic.
- * Note a mnemonic unique to this window is chosen
- */
- public void setMnemonic(Button button)
- {
- removeMnemonic(button); // just in case it already has a mnemonic
- String text = button.getText();
- if ((text != null) && (text.trim().length() > 0))
- button.setText(setUniqueMnemonic(text));
- }
- /**
- * If a button is removed from a dialog window, call this method to remove its mnemonic from the list for this dialog.
- * This frees it up for another button to use.
- */
- public void removeMnemonic(Button button)
- {
- String text = button.getText();
- if (text == null)
- return;
- int idx = text.indexOf(MNEMONIC_CHAR);
- if (idx >= 0)
- {
- StringBuffer buffer = new StringBuffer(text);
- char mchar = buffer.charAt(idx+1); // the char after the &
- buffer.deleteCharAt(idx); // delete the &
- boolean found = false;
- for (int mdx=0; !found && (mdx < mnemonics.length()); mdx++)
- if (mnemonics.charAt(mdx) == mchar)
- {
- found = true;
- mnemonics.deleteCharAt(mdx);
- }
-
- button.setText(buffer.toString());
- }
- }
- /**
- * Helper method to strip the mnemonic from a string.
- * Useful if using Eclipse supplied labels
- */
- public static String removeMnemonic(String text)
- {
- int idx = text.indexOf(MNEMONIC_CHAR);
- if (idx >= 0)
- {
- StringBuffer buffer = new StringBuffer(text);
- char mchar = buffer.charAt(idx+1); // the char after the &
- buffer.deleteCharAt(idx); // delete the &
-
- // in case of already appended (&X), remove the remaining (X)
- if ( buffer.length() > (1 + idx) && idx > 1 && buffer.charAt(idx+1) == ')' && buffer.charAt(idx-1) == '(' )
- buffer.delete(idx - 1, idx + 2);
- return buffer.toString();
- }
- else
- return text;
- }
- /**
- * Remove and free up mnemonic
- */
- public String removeAndFreeMnemonic(String text)
- {
- int idx = text.indexOf(MNEMONIC_CHAR);
- if (idx >= 0)
- {
- StringBuffer buffer = new StringBuffer(text);
- char mchar = buffer.charAt(idx+1); // the char after the &
- buffer.deleteCharAt(idx); // delete the &
- boolean found = false;
- for (int mdx=0; !found && (mdx < mnemonics.length()); mdx++)
- if (mnemonics.charAt(mdx) == mchar)
- {
- found = true;
- mnemonics.deleteCharAt(mdx);
- }
- return buffer.toString();
- }
- else
- return text;
- }
-
- /**
- * Helper method to return the mnemonic from a string.
- * Helpful when it is necessary to know the mnemonic assigned so it can be reassigned,
- * such as is necessary for buttons which toggle their text.
- * @return the mnemonic if assigned, else a blank character.
- */
- public static char getMnemonic(String text)
- {
- int idx = text.indexOf(MNEMONIC_CHAR);
- if (idx >= 0)
- return text.charAt(idx+1);
- else
- return ' ';
- }
-
- /**
- * Given a Composite, this method walks all the children recursively and
- * and sets the mnemonics uniquely for each child control where a
- * mnemonic makes sense (eg, buttons).
- * The letter/digit chosen for the mnemonic is unique for this Composite,
- * so you should call this on as high a level of a composite as possible
- * per Window.
- * Call this after populating your controls.
- */
- public void setMnemonics(Composite parent)
- {
- Control children[] = parent.getChildren();
- if (children != null)
- {
- Control currChild = null;
- boolean bSetText = false;
- for (int idx=0; idx < children.length; idx++)
- {
- currChild = children[idx];
- // composite? Recurse
- // d54732: but do not recurse if it is a combo! For a combo, we want to check
- // if there is a preceding label. It's meaningless for a combo to
- // have children anyway (KM)
- if ((currChild instanceof Composite) &&
- (!applyMnemonicsToPrecedingLabels || (applyMnemonicsToPrecedingLabels &&
- !(currChild instanceof Combo) && !(currChild instanceof InheritableEntryField))))
- setMnemonics((Composite)currChild);
- // button? select and apply unique mnemonic...
- else if (currChild instanceof Button)
- {
- Button currButton = (Button)currChild;
- String text = currButton.getText();
- if ((text!=null) && (text.trim().length()>0))
- {
- currButton.setText(setUniqueMnemonic(text));
- bSetText = true;
- }
- }
- // entry field or combo box? select and apply unique mnemonic to preceding label...
- else if (applyMnemonicsToPrecedingLabels && (idx>0) && ((currChild instanceof Text) || (currChild instanceof Combo) || (currChild instanceof InheritableEntryField)) &&
- (children[idx-1] instanceof Label))
- {
- Label currLabel = (Label)children[idx-1];
- String text = currLabel.getText();
- if ((text!=null) && (text.trim().length()>0))
- {
- currLabel.setText(setUniqueMnemonic(text));
- bSetText = true;
- }
- }
- }
- if ( bSetText == true )
- parent.layout(true); // in case a (x) was appended, we need to layout the controls again
- }
- }
-
- /**
- * Given a menu, this method walks all the items and assigns each a unique
- * memnonic. Also handles casdading submenus.
- * Call this after populating the menu.
- */
- public void setMnemonics(Menu menu)
- {
- MenuItem[] children = menu.getItems();
- if ((children != null) && (children.length>0))
- {
- MenuItem currChild = null;
- for (int idx=0; idx < children.length; idx++)
- {
- currChild = children[idx];
- String text = currChild.getText();
- if ((text!=null)&&(text.length()>0))
- {
- if (text.indexOf(MNEMONIC_CHAR) < 0) // bad things happen when setting mnemonics twice!
- {
- Image image = currChild.getImage();
- currChild.setText(setUniqueMnemonic(text));
- if (image != null)
- currChild.setImage(image);
- }
- }
- }
- }
- }
-
- /**
- * Given a menu, this method walks all the items and assigns each a unique
- * memnonic. Also handles casdading submenus.
- * <p>
- * Also, since while we are at it, this overloaded method also sets a given ArmListener
- * to each menu item, perhaps for the purpose of displaying tooltip text.
- * It makes sense to do this when doing mnemonics because both must be done for every menu item
- * with text and must be done exactly once for each.
- * <p>
- * Call this after populating the menu.
- */
- public void setMnemonicsAndArmListener(Menu menu, ArmListener listener)
- {
- MenuItem[] children = menu.getItems();
- if ((children != null) && (children.length>0))
- {
- MenuItem currChild = null;
- for (int idx=0; idx < children.length; idx++)
- {
- currChild = children[idx];
- String text = currChild.getText();
- if ((text!=null)&&(text.length()>0))
- {
- int mnemonicIndex = text.indexOf(MNEMONIC_CHAR);
- if (mnemonicIndex < 0) // bad things happen when setting mnemonics twice!
- {
- Image image = currChild.getImage();
- currChild.setText(setUniqueMnemonic(text));
- if (image != null)
- currChild.setImage(image);
- currChild.addArmListener(listener);
- }
- else
- // hmm, already has a mnemonic char. Either it is an Eclipse/BP-supplied action, or we have been here before.
- // The distinction is important as want to add an Arm listener, but only once!
- {
- // for now we do the brute force ugly thing...
- Image image = currChild.getImage();
-
- // need to adjust any action that already has this mnemonic
- char c = text.charAt(mnemonicIndex + 1);
-
- // anything already have this?
- if (!isUniqueMnemonic(c))
- {
- // if so, we need to adjust existing action
- for (int n = 0; n < idx; n++)
- {
- MenuItem oChild = children[n];
- String oText = oChild.getText();
- char oldN = getMnemonic(oText);
- if (oldN == c)
- {
- // this one now needs to change
- String cleanText = removeMnemonic(oText);
- oChild.setText(setUniqueMnemonic(cleanText));
- }
- }
- }
-
- text = removeAndFreeMnemonic(text);
- currChild.setText(setUniqueMnemonic(text));
- if (image != null)
- currChild.setImage(image);
- currChild.removeArmListener(listener); // just in case
- currChild.addArmListener(listener);
- }
- }
- }
- }
- }
-
- /**
- * Set if the mnemonics are for a preference page
- * Preference pages already have a few buttons with mnemonics set by Eclipse
- * We have to make sure we do not use the ones they use
- */
- public Mnemonics setOnPreferencePage(boolean page)
- {
- this.onPrefPage = page;
- return this;
- }
-
- /**
- * Set if the mnemonics are for a wizard page
- * Wizard pages already have a few buttons with mnemonics set by Eclipse
- * We have to make sure we do not use the ones they use
- */
- public Mnemonics setOnWizardPage(boolean page)
- {
- this.onWizardPage = page;
- return this;
- }
-
- /**
- * Set whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
- * This is for consistency with Eclipse. Only set to <code>false</code> if it does not work
- * in your dialog, wizard, preference or property page, i.e. you have labels preceding these
- * widgets that do not necessarily refer to them.
- * @param apply <code>true</code> to apply mnemonic to preceding labels, <code>false</code> otherwise.
- * @return this instance, for convenience
- */
- public Mnemonics setApplyMnemonicsToPrecedingLabels(boolean apply) {
- this.applyMnemonicsToPrecedingLabels = apply;
- return this;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEAdapter.java
deleted file mode 100644
index 48c5abd37..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.ui;
-
-import org.eclipse.ui.model.WorkbenchAdapter;
-
-/**
- * Abstract base class with basic implementations of the <code>IRSEAdapter</code> interface.
- * Intended to be subclassed.
- */
-public abstract class RSEAdapter extends WorkbenchAdapter implements IRSEAdapter {
-
- /**
- * Constructor.
- */
- public RSEAdapter() {
- super();
- }
-
- /**
- * The default implementation of this <code>IRSEAdapter<code> method returns the empty string.
- * Subclasses may override.
- * @see org.eclipse.rse.ui.IRSEAdapter#getDescription(java.lang.Object)
- */
- public String getDescription(Object object) {
- return "";
- }
-
- /**
- * Returns the RSE UI registry.
- * @see org.eclipse.rse.ui.IRSEAdapter#getRegistry()
- */
- public IRSEUIRegistry getRegistry() {
- return RSEUIPlugin.getDefault().getRegistry();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java
deleted file mode 100644
index d6f126bba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.IRSEPreferenceNames;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.IRSESystemTypeConstants;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.osgi.framework.Bundle;
-
-/**
- * Adapter for RSE system types.
- */
-public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeConstants {
-
- public RSESystemTypeAdapter() {
- super();
- }
-
- /**
- * Returns the image descriptor for the icon of this system type.
- * Returns the default live connection image descriptor if no icon has been configured.
- * @see org.eclipse.ui.model.WorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- ImageDescriptor img = getImage(object, ICON);
- if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTION_ID);
- return img;
- }
-
- /**
- * Returns the "live" image descriptor for this system type.
- *
- * If no "live" icon is found, but a non-live icon was specified,
- * the non-live icon is returned instead. If a non-live icon also
- * was not specified, the default live connection image descriptor
- * is returned.
- *
- * @param object The object to get an image descriptor for.
- * @return ImageDescriptor
- */
- public ImageDescriptor getLiveImageDescriptor(Object object) {
- ImageDescriptor img = getImage(object, ICON_LIVE);
- if (img==null) img = getImage(object, ICON);
- if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID);
- return img;
- }
-
- private ImageDescriptor getImage(Object object, String propertyKey) {
-
- if ((object != null) && (object instanceof IRSESystemType)) {
- IRSESystemType sysType = (IRSESystemType)object;
-
- String property = sysType.getProperty(propertyKey);
-
- if (property != null) {
- return getImage(property, sysType.getDefiningBundle());
- }
- else {
- return null;
- }
- }
- else {
- return null;
- }
- }
-
- /**
- * Create a descriptor from the argument absolute or relative path to an
- * image file. bundle parameter is used as the base for relative paths and
- * is allowed to be null.
- *
- * @param value
- * the absolute or relative path
- * @param definingBundle
- * bundle to be used for relative paths (may be null)
- * @return ImageDescriptor
- */
- public static ImageDescriptor getImage(String value, Bundle definingBundle) {
- URL url = getUrl(value, definingBundle);
- return url == null ? null : ImageDescriptor.createFromURL(url);
- }
-
- /**
- * Create a URL from the argument absolute or relative path. The bundle parameter is
- * used as the base for relative paths and may be null.
- *
- * @param value
- * the absolute or relative path
- * @param definingBundle
- * bundle to be used for relative paths (may be null)
- * @return the URL to the resource
- */
- public static URL getUrl(String value, Bundle definingBundle) {
- URL result = null;
- try {
- if (value != null) {
- result = new URL(value);
- }
- } catch (MalformedURLException e) {
- if (definingBundle != null) {
- IPath path = new Path(value);
- result = FileLocator.find(definingBundle, path, null);
- }
- }
- return result;
- }
-
- /**
- * Returns the name of the system type if the object passed in is of type <code>IRSESystemType</code>. Otherwise, returns the value of the parent implementation.
- *
- * @see org.eclipse.ui.model.WorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object object) {
-
- if ((object != null) && (object instanceof IRSESystemType)) {
- return ((IRSESystemType)object).getName();
- }
- else {
- return super.getLabel(object);
- }
- }
-
- /**
- * Returns the description of the system type if the object passed in is of type <code>IRSESystemType</code>.
- * Otherwise, returns the value of the parent implementation.
- * @see org.eclipse.rse.ui.RSEAdapter#getDescription(java.lang.Object)
- */
- public String getDescription(Object object) {
-
- if ((object != null) && (object instanceof IRSESystemType)) {
- return ((IRSESystemType)object).getDescription();
- }
- else {
- return super.getDescription(object);
- }
- }
-
- public boolean isEnableOffline(Object object) {
- if ((object != null) && (object instanceof IRSESystemType)) {
- String property = ((IRSESystemType)object).getProperty(ENABLE_OFFLINE);
- if (property != null) {
- return Boolean.valueOf(property).booleanValue();
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- }
-
- /**
- * Returns the enabled state of a particular system type.
- * @param object the object being adapted, usually a system type.
- * @return true if that system type is enabled. false if the object is
- * not a system type or if it is not enabled.
- */
- public boolean isEnabled(Object object) {
- boolean result = false;
- IRSESystemType systemType = getSystemType(object);
- if ( systemType != null) {
- Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
- String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_ENABLED);
- if (!prefs.contains(key)) {
- prefs.setDefault(key, true);
- }
- result = prefs.getBoolean(key);
- }
- return result;
- }
-
- /**
- * Sets the enabled state of a particular system type.
- * @param object The system type being adapted.
- * @param isEnabled true if the system type is enabled. false if it is not.
- */
- public void setIsEnabled(Object object, boolean isEnabled) {
- IRSESystemType systemType = getSystemType(object);
- if ( systemType != null) {
- Plugin core = RSECorePlugin.getDefault();
- Preferences prefs = core.getPluginPreferences();
- String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_ENABLED);
- prefs.setValue(key, isEnabled);
- core.savePluginPreferences();
- }
- }
-
- /**
- * Return the default user id for a particular system type. If none
- * is defined then the "user.name" system property is used.
- * @param object The system type being adapted.
- * @return The default user id. Will be null if the object is not a system type
- */
- public String getDefaultUserId(Object object) {
- String result = null;
- IRSESystemType systemType = getSystemType(object);
- if ( systemType != null) {
- Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
- String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
- if (!prefs.contains(key)) {
- prefs.setDefault(key, System.getProperty("user.name")); //$NON-NLS-1$
- }
- result = prefs.getString(key);
- }
- return result;
- }
-
- /**
- * Set the default user id for this system type. Stored in the RSE core preferences.
- * @param object the system type that we are adapting
- * @param defaultUserId the id to set for this system type
- */
- public void setDefaultUserId(Object object, String defaultUserId) {
- IRSESystemType systemType = getSystemType(object);
- if ( systemType != null) {
- Plugin core = RSECorePlugin.getDefault();
- Preferences prefs = core.getPluginPreferences();
- String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
- prefs.setValue(key, defaultUserId);
- core.savePluginPreferences();
- }
- }
-
- private String getPreferencesKey(IRSESystemType systemType, String preference) {
- String key = systemType.getName() + "." + preference; //$NON-NLS-1$
- return key;
- }
-
- private IRSESystemType getSystemType(Object systemTypeCandidate) {
- IRSESystemType result = null;
- if (systemTypeCandidate instanceof IRSESystemType) {
- result = (IRSESystemType) systemTypeCandidate;
- }
- return result;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java
deleted file mode 100644
index d8de8a2a2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java
+++ /dev/null
@@ -1,1226 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.ISystemViewSupplier;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPropertyPageExtension;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.comm.ISystemKeystoreProvider;
-import org.eclipse.rse.core.comm.SystemCommunicationsDaemon;
-import org.eclipse.rse.core.comm.SystemKeystoreProviderManager;
-import org.eclipse.rse.core.internal.subsystems.SubSystemConfigurationProxy;
-import org.eclipse.rse.core.internal.subsystems.SubSystemConfigurationProxyComparator;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.model.SystemStartHere;
-import org.eclipse.rse.persistence.IRSEPersistenceManager;
-import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
-import org.eclipse.rse.ui.actions.ISystemDynamicPopupMenuExtension;
-import org.eclipse.rse.ui.actions.SystemDynamicPopupMenuExtensionManager;
-import org.eclipse.rse.ui.actions.SystemShowPreferencesPageAction;
-import org.eclipse.rse.ui.internal.RSESystemTypeAdapterFactory;
-import org.eclipse.rse.ui.internal.RSEUIRegistry;
-import org.eclipse.rse.ui.propertypages.RemoteSystemsPreferencePage;
-import org.eclipse.rse.ui.propertypages.SystemCommunicationsPreferencePage;
-import org.eclipse.rse.ui.view.SubSystemConfigurationAdapterFactory;
-import org.eclipse.rse.ui.view.SystemViewAdapterFactory;
-import org.eclipse.rse.ui.view.team.SystemTeamViewResourceAdapterFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * Plugin for the core remote systems support.
- */
-public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvider
-{
- public static final String PLUGIN_ID = "org.eclipse.rse.ui"; //$NON-NLS-1$
- public static final String HELPPREFIX = "org.eclipse.rse.ui."; //$NON-NLS-1$
-
- public static final boolean INCLUDE_LOCAL_YES = true;
- public static final boolean INCLUDE_LOCAL_NO = false;
- private static RSEUIPlugin inst = null;
-
- private static SystemMessageFile messageFile = null;
- private static SystemMessageFile defaultMessageFile = null;
-
-// private SystemType[] allSystemTypes = null;
- private String enabledSystemTypes;
- private SystemRegistry _systemRegistry = null;
-
-
-
- private ISubSystemConfigurationProxy[] subsystemConfigurations = null;
-
-
- private Vector viewSuppliers = new Vector();
- private SystemViewAdapterFactory svaf; // for fastpath access
- private SystemTeamViewResourceAdapterFactory svraf; // for fastpath
- private SystemShowPreferencesPageAction[] showPrefPageActions = null;
- private boolean dontShowLocalConnection, dontShowProfilePageInitially;
- private boolean loggingSystemMessageLine = false;
-
- /**
- * Constructor for SystemsPlugin
- */
- public RSEUIPlugin()
- {
- super();
-
- if (inst == null)
- {
- inst = this;
- }
- }
-
- /**
- * Return singleton. Same as inherited getBaseDefault but returned object
- * is typed as RSEUIPlugin versus SystemBasePlugin.
- */
- public static RSEUIPlugin getDefault()
- {
- return inst;
- }
-
- /**
- * Initializes default preferences.
- */
- public void initializeDefaultPreferences() {
-
- boolean showNewConnPromptPref = ISystemPreferencesConstants.DEFAULT_SHOWNEWCONNECTIONPROMPT;
- dontShowLocalConnection = false;
- dontShowProfilePageInitially = false;
-
- String showNewConn = System.getProperty("rse.showNewConnectionPrompt");
-
- if (showNewConn != null) {
- showNewConnPromptPref = showNewConn.equals("true");
- }
-
- String showLocalConn = System.getProperty("rse.showLocalConnection");
-
- if (showLocalConn != null) {
- dontShowLocalConnection = showNewConn.equals("false");
- }
-
- enabledSystemTypes = System.getProperty("rse.enableSystemTypes");
-
- if ((enabledSystemTypes != null) && (enabledSystemTypes.length() == 0)) {
- enabledSystemTypes = null;
- }
-
- String showProfileInitially = System.getProperty("rse.showProfilePage");
-
- if (showProfileInitially != null) {
- dontShowProfilePageInitially = showProfileInitially.equals("false");
- }
-
- RemoteSystemsPreferencePage.initDefaults(getPreferenceStore(), showNewConnPromptPref);
- SystemCommunicationsPreferencePage.initDefaults(getPreferenceStore());
- }
-
- /**
- * Returns whether to show profile page initially, i.e. during the first new connection creation.
- * @return <code>true</code> to show profile page initially, <code>false</code> otherwise.
- */
- public boolean getShowProfilePageInitially() {
- return !dontShowProfilePageInitially;
- }
-
- /**
- * Set whether or not to log the messages shown on the system message line for dialogs
- * and wizards. These message are typically validation messages for fields.
- * These are logged using the RSE logging settings. The default is to not log
- * these messages.
- * @param flag true if logging of these messages is desired, false otherwise.
- */
- public void setLoggingSystemMessageLine(boolean flag) {
- loggingSystemMessageLine = flag;
- }
-
- /**
- * @return true if we are logging messages displayed on the system message line.
- */
- public boolean getLoggingSystemMessageLine() {
- return loggingSystemMessageLine;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.SystemBasePlugin#initializeImageRegistry()
- */
- protected void initializeImageRegistry()
- {
- //SystemElapsedTimer timer = new SystemElapsedTimer();
- //timer.setStartTime();
- String path = getIconPath();
- // Wizards...
- /*
- putImageInRegistry(ISystemConstants.ICON_SYSTEM_NEWWIZARD_ID,
- path+ISystemConstants.ICON_SYSTEM_NEWWIZARD);
- */
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLWIZARD);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILTERWIZARD);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_NEWFILTERSTRINGWIZARD_ID,
- // path+ISystemConstants.ICON_SYSTEM_NEWFILTERSTRINGWIZARD);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD);
-
- // Things...
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_PROFILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONNECTION_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CONNECTION);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_FILTERPOOL);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_FILTER_ID,
- path+ISystemIconConstants.ICON_SYSTEM_FILTER);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_FILTERSTRING_ID,
- path+ISystemIconConstants.ICON_SYSTEM_FILTERSTRING);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_FILE_ID,
- // path+ISystemConstants.ICON_SYSTEM_FILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_FOLDER_ID,
- path+ISystemIconConstants.ICON_SYSTEM_FOLDER);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_FOLDEROPEN_ID,
- // path+ISystemConstants.ICON_SYSTEM_FOLDEROPEN);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ROOTDRIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ENVVAR_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ENVVAR);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ENVVAR_LIBPATH_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ENVVAR_LIBPATH);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ENVVAR_PATH_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ENVVAR_PATH);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROCESS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_PROCESS);
-
-// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_TARGET_ID,
- // path+ISystemIconConstants.ICON_SYSTEM_TARGET);
-
- // Message icons: REDUNDANT
- /*
- putImageInRegistry(ISystemConstants.ICON_SYSTEM_SMALLERROR_ID,
- path+ISystemConstants.ICON_SYSTEM_SMALLERROR);
- putImageInRegistry(ISystemConstants.ICON_SYSTEM_SMALLWARNING_ID,
- path+ISystemConstants.ICON_SYSTEM_SMALLWARNING);
- putImageInRegistry(ISystemConstants.ICON_SYSTEM_SMALLINFO_ID,
- path+ISystemConstants.ICON_SYSTEM_SMALLINFO);
- */
-
- // New Actions...
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEW_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEW);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWPROFILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWPROFILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOL);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLREF_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLREF);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTER_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILTER);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_NEWFILTERSTRING_ID,
- // path+ISystemConstants.ICON_SYSTEM_NEWFILTERSTRING);
-
- // Other Actions...
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_PULLDOWN_ID,
- // path+ISystemConstants.ICON_SYSTEM_PULLDOWN);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_LOCK_ID,
- path+ISystemIconConstants.ICON_SYSTEM_LOCK);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID,
- path+ISystemIconConstants.ICON_SYSTEM_MOVEUP);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID,
- path+ISystemIconConstants.ICON_SYSTEM_MOVEDOWN);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_COPY_ID,
- // path+ISystemConstants.ICON_SYSTEM_COPY);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_PASTE_ID,
- // path+ISystemConstants.ICON_SYSTEM_PASTE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MOVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_MOVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CLEAR);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED);
-
-
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_DELETE_ID,
- // path+ISystemConstants.ICON_SYSTEM_DELETE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_DELETEREF_ID,
- path+ISystemIconConstants.ICON_SYSTEM_DELETEREF);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RENAME_ID,
- path+ISystemIconConstants.ICON_SYSTEM_RENAME);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RUN_ID,
- path+ISystemIconConstants.ICON_SYSTEM_RUN);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID,
- path+ISystemIconConstants.ICON_SYSTEM_STOP);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_COMPILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CHANGEFILTER_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CHANGEFILTER);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_CHANGEFILTERSTRING_ID,
- // path+ISystemConstants.ICON_SYSTEM_CHANGEFILTERSTRING);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SELECTPROFILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SELECTPROFILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID,
- path+ISystemIconConstants.ICON_SYSTEM_REFRESH);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFILE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDER_ID,
- path+ISystemIconConstants.ICON_SYSTEM_NEWFOLDER);
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_COLLAPSEALL_ID,
- // path+ISystemConstants.ICON_SYSTEM_COLLAPSEALL); // defect 41203 D54577
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EXTRACT_ID,
- path+ISystemIconConstants.ICON_SYSTEM_EXTRACT);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EXTRACTTO_ID,
- path+ISystemIconConstants.ICON_SYSTEM_EXTRACTTO);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMBINE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_COMBINE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONVERT_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CONVERT);
-
-
-
-
-
-
- // System view icons...
- //putImageInRegistry(ISystemConstants.ICON_SYSTEM_VIEW_ID, // only needed from plugin.xml
- // path+ISystemConstants.ICON_SYSTEM_VIEW);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ERROR_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ERROR);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_ID,
- path+ISystemIconConstants.ICON_SYSTEM_INFO);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_TREE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_INFO_TREE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CANCEL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CANCEL);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_HELP_ID,
- path+ISystemIconConstants.ICON_SYSTEM_HELP);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EMPTY_ID,
- path+ISystemIconConstants.ICON_SYSTEM_EMPTY);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_OK_ID,
- path+ISystemIconConstants.ICON_SYSTEM_OK);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WARNING_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WARNING);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHELL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SHELL);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHELLLIVE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SHELLLIVE);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REMOVE_SHELL_ID,
- path+ISystemIconConstants.ICON_SYSTEM_REMOVE_SHELL);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ID,
- path+ISystemIconConstants.ICON_SYSTEM_EXPORT_SHELL_OUTPUT);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EXPORT_SHELL_HISTORY_ID,
- path+ISystemIconConstants.ICON_SYSTEM_EXPORT_SHELL_HISTORY);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_BLANK_ID,
- path+ISystemIconConstants.ICON_SYSTEM_BLANK);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SEARCH);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE_ID,
- path + ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR_ID,
- path + ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE_ID,
- path + ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID,
- path + ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES);
-
- putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES_ID,
- path + ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES);
-
- /**
- putImageInRegistry(ISystemConstants.ICON_INHERITWIDGET_LOCAL_ID,
- path+ISystemConstants.ICON_INHERITWIDGET_LOCAL);
- putImageInRegistry(ISystemConstants.ICON_INHERITWIDGET_INHERIT_ID,
- path+ISystemConstants.ICON_INHERITWIDGET_INHERIT);
- putImageInRegistry(ISystemConstants.ICON_INHERITWIDGET_INTERIM_ID,
- path+ISystemConstants.ICON_INHERITWIDGET_INTERIM);
- */
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_UP_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ARROW_UP);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID,
- path+ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SERVICE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_SERVICE);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID,
- path+ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION);
-
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROPERTIES_ID,
- path+ISystemIconConstants.ICON_SYSTEM_PROPERTIES);
-
- // close to 1 second...
- //timer.setEndTime();
- //System.out.println("Time to load images: "+timer);
- }
-
- /**
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception
- {
-
- // call super first
- super.start(context);
-
- messageFile = getMessageFile("systemmessages.xml"); //$NON-NLS-1$
- defaultMessageFile = getDefaultMessageFile("systemmessages.xml"); //$NON-NLS-1$
-
- ISystemRegistry registry = getSystemRegistry();
-
- RSECorePlugin.getDefault().setSystemRegistry(registry);
- SystemResourceManager.getRemoteSystemsProject(); // create core folder tree
- try
- {
- SystemStartHere.getSystemProfileManager(); // create folders per profile
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- IAdapterManager manager = Platform.getAdapterManager();
-
- // DKM
- // for subsystem factories
- SubSystemConfigurationAdapterFactory ssfaf = new SubSystemConfigurationAdapterFactory();
- ssfaf.registerWithManager(manager);
-
- RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory();
- manager.registerAdapters(rseSysTypeFactory, IRSESystemType.class);
-
- svaf = new SystemViewAdapterFactory();
- svaf.registerWithManager(manager);
-
- svraf = new SystemTeamViewResourceAdapterFactory();
- svraf.registerWithManager(manager);
-
-
-// getInstallLocation();
-
- //org.eclipse.rse.core.ui.uda.UserDefinedActionAdapterFactory udaaf = new org.eclipse.rse.core.ui.uda.UserDefinedActionAdapterFactory();
- //udaaf.registerWithManager(manager);
-
- // DKM - 49648 - need to make sure that this is first called on the main thread so
- // we don't hit an SWT invalid thread exception later when getting the shell
-
-
-
-
- // add workspace listener for our project
- SystemResourceManager.startResourceEventListening();
-
- // DKM - moved to files.ui plugin
- // refresh the remote edit project at plugin startup, to ensure
- // it's never closed
- // SystemRemoteEditManager.getDefault().refreshRemoteEditProject();
-
- // Auto-start RSE communications daemon if required
- SystemCommunicationsDaemon daemon = SystemCommunicationsDaemon.getInstance();
-
- if (SystemCommunicationsDaemon.isAutoStart()) {
- daemon.startDaemon(false);
- }
-
- registerArchiveHandlers();
- registerDynamicPopupMenuExtensions();
- registerKeystoreProviders();
-
- // if first time creating the remote systems project, add some default connections...
-// if (SystemResourceManager.isFirstTime()
-// && !dontShowLocalConnection) // new support to allow products to not pre-create a local connection
-// {
- //try
- //{
-
-// registry.createLocalHost(null, SystemResources.TERM_LOCAL, SystemProfileManager.getSystemProfileManager().getDefaultPrivateSystemProfileName()); // profile, name, userId
- /* replaced with re-usable method by Phil, in v5.1.2
- SystemConnection localConn = registry.createConnection(
- //SystemResourceConstants.RESOURCE_TEAMPROFILE_NAME, IRSESystemType.SYSTEMTYPE_LOCAL,
- SystemResourceConstants.RESOURCE_PRIVATEPROFILE_NAME, IRSESystemType.SYSTEMTYPE_LOCAL,
- getString(ISystemConstants.TERM_LOCAL, "Local"), // connection name
- "localhost", // hostname
- "", // description
- // DY: defect 42101, description cannot be null
- // null, // description
- getLocalMachineName(), // userId
- ISystemUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE, null);
- */
- //}
- //catch (Exception exc)
- //{
- //logError("Error creating default Local connection", exc);
- //}
-// }
- // new support to allow products to not pre-create a local connection
- if (SystemResourceManager.isFirstTime() && !dontShowLocalConnection) {
- ISystemProfileManager profileManager = SystemProfileManager.getSystemProfileManager();
- ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile();
- String userName = System.getProperty("user.name"); //$NON-NLS-1$
- registry.createLocalHost(profile, SystemResources.TERM_LOCAL, userName);
- }
- }
-
- /**
- * For pathpath access to our adapters for non-local objects in our model. Exploits the knowledge we use singleton adapters.
- */
- public SystemViewAdapterFactory getSystemViewAdapterFactory()
- {
- return svaf;
- }
-
-
- /**
- * Restart the whole thing after a team synchronization
- */
- public void restart()
- {
- if (_systemRegistry != null)
- {
- // disconnect all active connections
- disconnectAll(false); // don't save ?
- // collapse and flush all nodes in all views
- _systemRegistry.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); //$NON-NLS-1$
-
- // allow child classes to override
- closeViews();
-
- // clear in-memory settings for all filter pools and subsystems
- ISubSystemConfigurationProxy[] proxies = getSystemRegistry().getSubSystemConfigurationProxies();
- if (proxies != null)
- for (int idx=0; idx < proxies.length; idx++)
- proxies[idx].reset();
- // clear in-memory settings for all profiles
- SystemProfileManager.clearDefault();
-
- // rebuild profiles
- SystemStartHere.getSystemProfileManager(); // create folders per profile
- // clear in-memory settings for all connections, then restore from disk
- ((SystemRegistry)_systemRegistry).reset();
- // restore in-memory settings for all filter pools and subsystems
- if (proxies != null)
- for (int idx=0; idx < proxies.length; idx++)
- proxies[idx].restore();
-
- // refresh GUIs
- _systemRegistry.fireEvent(new SystemResourceChangeEvent(_systemRegistry, ISystemResourceChangeEvents.EVENT_REFRESH, null));
-
- // allow child classes to override
- openViews();
- }
- }
-
- /**
- * Close or reset views prior to full refresh after team synch
- */
- public void closeViews()
- {
- for (int idx=0; idx<viewSuppliers.size(); idx++)
- {
- try {
- ((ISystemViewSupplier)viewSuppliers.elementAt(idx)).closeViews();
- } catch (Exception exc)
- {
- }
- }
- }
-
- /**
- * Restore views prior to full refresh after team synch
- */
- public void openViews()
- {
- for (int idx=0; idx<viewSuppliers.size(); idx++)
- {
- try {
- ((ISystemViewSupplier)viewSuppliers.elementAt(idx)).openViews();
- } catch (Exception exc)
- {
- }
- }
- }
-
- /**
- * Return the project used to hold all the Remote System Framework files
- */
- public IProject getRemoteSystemsProject()
- {
- return SystemResourceManager.getRemoteSystemsProject();
- }
-
- /**
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
-
-
-
- // disconnect all active connections
- disconnectAll(true);
-
- // remove workspace listener for our project
- SystemResourceManager.endResourceEventListening();
-
- // Stop RSE communications daemon if required, the stopDaemon method checks if the daemon is running or not
- SystemCommunicationsDaemon daemon = SystemCommunicationsDaemon.getInstance();
- daemon.stopDaemon();
-
-
-
- // call this last
- super.stop(context);
- }
-
- /**
- * Disconnect all subsystems
- */
- protected void disconnectAll(boolean doSave)
- {
- if (isSystemRegistryActive())
- {
- ISubSystemConfigurationProxy[] proxies = getSystemRegistry().getSubSystemConfigurationProxies();
- if (proxies != null)
- {
- for (int idx=0; idx < proxies.length; idx++)
- {
- //System.out.println("In shutdown. proxy " + proxies[idx].getId() + " active? " + proxies[idx].isSubSystemConfigurationActive());
- if (proxies[idx].isSubSystemConfigurationActive())
- {
- ISubSystemConfiguration ssf = proxies[idx].getSubSystemConfiguration();
- try
- {
- ssf.disconnectAllSubSystems();
- } catch(Exception exc)
- {
- logError("Error disconnecting for "+ssf.getId(),exc);
- }
- if (doSave)
- {
- try
- {
- // TODO on shutdown classloader might not be able to do this properly
- // ssf.commit();
- } catch(Exception exc)
- {
- logError("Error saving subsystems for "+ssf.getId(),exc);
- }
- }
- }
- }
- }
- }
- }
-
-
-
- /**
- * Returns a qualified hostname given a potentially unqualified hostname
- */
- public static String getQualifiedHostName(String hostName)
- {
- try
- {
- InetAddress address = InetAddress.getByName(hostName);
- return address.getCanonicalHostName();
- }
- catch (java.net.UnknownHostException exc)
- {
- return hostName;
- }
- }
-
- /**
- * Return an array of SubSystemConfigurationProxy objects.
- * These represent all extensions to our subsystemConfigurations extension point.
- */
- public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies()
- {
- if (subsystemConfigurations != null) // added by PSC
- return subsystemConfigurations;
-
- IConfigurationElement[] factoryPlugins = getSubSystemConfigurationPlugins();
- if (factoryPlugins != null)
- {
- Vector v = new Vector();
- for (int idx=0; idx<factoryPlugins.length; idx++)
- {
- SubSystemConfigurationProxy ssf =
- new SubSystemConfigurationProxy(factoryPlugins[idx]);
-
- v.addElement(ssf);
- }
- if (v.size() != 0)
- {
- subsystemConfigurations = new ISubSystemConfigurationProxy[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- subsystemConfigurations[idx] = (ISubSystemConfigurationProxy)v.elementAt(idx);
- }
- }
-
- Arrays.sort(subsystemConfigurations, new SubSystemConfigurationProxyComparator());
-
- return subsystemConfigurations;
- }
-
- /**
- * Return all elements that extend the org.eclipse.rse.ui.subsystemConfigurations extension point
- */
- private IConfigurationElement[] getSubSystemConfigurationPlugins()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- // Get configured extenders
- IConfigurationElement[] subsystemFactoryExtensions =
- registry.getConfigurationElementsFor("org.eclipse.rse.ui","subsystemConfigurations"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return subsystemFactoryExtensions;
- }
-
- /**
- * Returns true if the SystemRegistry has been instantiated already.
- * Use this when you don't want to start the system registry as a side effect of retrieving it.
- */
- public boolean isSystemRegistryActive()
- {
- return (_systemRegistry != null);
- }
-
- /**
- * @return the persistence manager used for persisting RSE profiles
- */
- public IRSEPersistenceManager getPersistenceManager()
- {
- return RSECorePlugin.getThePersistenceManager();
- }
-
-
-
- /**
- * Return the SystemRegistry singleton
- */
- public SystemRegistry getSystemRegistry()
- {
- if (_systemRegistry == null)
- {
- String logfilePath = getStateLocation().toOSString();
-
- _systemRegistry = (SystemRegistry)SystemRegistry.getSystemRegistry(logfilePath);
-
- ISubSystemConfigurationProxy[] proxies = getSubSystemConfigurationProxies();
- if (proxies != null)
- {
- _systemRegistry.setSubSystemConfigurationProxies(proxies);
- }
-
- }
- return (SystemRegistry)_systemRegistry;
- }
-
- /**
- * A static version for convenience
- * Returns the master registry singleton.
- */
- public static SystemRegistry getTheSystemRegistry()
- {
- return getDefault().getSystemRegistry();
- }
-
- public static IRSEPersistenceManager getThePersistenceManager()
- {
- return RSECorePlugin.getThePersistenceManager();
- }
-
-
-
- /**
- * A static version for convenience
- * Returns the master profile manager singleton.
- */
- public static ISystemProfileManager getTheSystemProfileManager()
- {
- return SystemProfileManager.getSystemProfileManager();
- }
-
- /**
- * A static version for convenience
- */
- public static boolean isTheSystemRegistryActive()
- {
- if (inst == null)
- return false;
- else
- return getDefault().isSystemRegistryActive();
- }
-
-
-
- /**
- * Return an array of SystemPropertyPageExtension objects.
- * These represent all extensions to our propertyPage extension point.
- */
- public SystemPropertyPageExtension[] getPropertyPageExtensions()
- {
- SystemPropertyPageExtension[] propertyPageExtensions = null;
- IConfigurationElement[] propertyPagePlugins = getPropertyPagePlugins();
- if (propertyPagePlugins != null)
- {
- Vector v = new Vector();
- for (int idx=0; idx<propertyPagePlugins.length; idx++)
- {
- SystemPropertyPageExtension sppe =
- new SystemPropertyPageExtension(propertyPagePlugins[idx]);
- v.addElement(sppe);
- }
-
- propertyPageExtensions = new SystemPropertyPageExtension[v.size()];
-
- // prescan for first
- boolean foundFirst = false;
-
- for (int idx=0; !foundFirst && (idx<v.size()); idx++)
- if (((SystemPropertyPageExtension)v.elementAt(idx)).isAtTop())
- {
- propertyPageExtensions[0] = (SystemPropertyPageExtension)v.elementAt(idx);
- foundFirst = true;
- }
-
- int ppIdx = foundFirst ? 1: 0;
-
- for (int idx=0; idx<v.size(); idx++)
- if (!((SystemPropertyPageExtension)v.elementAt(idx)).isAtTop())
- propertyPageExtensions[ppIdx++] = (SystemPropertyPageExtension)v.elementAt(idx);
- }
-
- return propertyPageExtensions;
- }
-
- /**
- * Return all elements that extend the org.eclipse.rse.ui.propertyPage extension point
- */
- private IConfigurationElement[] getPropertyPagePlugins()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- // Get configured extenders
- IConfigurationElement[] propertyPageExtensions =
- registry.getConfigurationElementsFor(PLUGIN_ID,"propertyPages"); //$NON-NLS-1$
-
- return propertyPageExtensions;
- }
- /**
- * Return all elements that extend the org.eclipse.rse.ui.remoteSystemsViewPreferencesActions extension point
- */
- private IConfigurationElement[] getPreferencePageActionPlugins()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- // Get configured extenders
- IConfigurationElement[] prefPageExtensions =
- registry.getConfigurationElementsFor(PLUGIN_ID,"remoteSystemsViewPreferencesActions"); //$NON-NLS-1$
-
- return prefPageExtensions;
- }
-
- /**
- * Return an array of action objects registered via our org.eclipse.rse.ui.remoteSystemsViewPreferencesActions
- * extension point. <br>
- * This may return null if there are no extenders.
- */
- public SystemShowPreferencesPageAction[] getShowPreferencePageActions()
- {
- if (showPrefPageActions == null)
- {
- IConfigurationElement[] showPrefPagePlugins = getPreferencePageActionPlugins();
- if (showPrefPagePlugins != null)
- {
- Vector v = new Vector();
- for (int idx=0; idx<showPrefPagePlugins.length; idx++)
- {
- SystemShowPreferencesPageAction action = new SystemShowPreferencesPageAction();
-
- String prefPageId = showPrefPagePlugins[idx].getAttribute("preferencePageId"); //$NON-NLS-1$
- if ((prefPageId!=null)&&(prefPageId.length()>0))
- {
- action.setPreferencePageID(prefPageId);
- }
- String prefPageCategory = showPrefPagePlugins[idx].getAttribute("preferencePageCategory"); //$NON-NLS-1$
- if ((prefPageCategory!=null)&&(prefPageCategory.length()>0))
- {
- action.setPreferencePageCategory(prefPageCategory);
- }
- String iconFile = showPrefPagePlugins[idx].getAttribute("icon"); //$NON-NLS-1$
-
- if ((iconFile!=null)&&(iconFile.length()>0))
- {
- // get namespace of extension (i.e. the id of the declaring plugin)
- String nameSpace = showPrefPagePlugins[idx].getDeclaringExtension().getNamespace();
-
- // now get the associated bundle
- Bundle bundle = Platform.getBundle(nameSpace);
-
- ImageDescriptor id = getPluginImage(bundle, iconFile);
-
- if (id != null) {
- action.setImageDescriptor(id);
- }
- }
- String label = showPrefPagePlugins[idx].getAttribute("label"); //$NON-NLS-1$
- if ((label!=null)&&(label.length()>0))
- {
- action.setText(label);
- }
- String tooltip = showPrefPagePlugins[idx].getAttribute("tooltip"); //$NON-NLS-1$
- if ((tooltip!=null)&&(tooltip.length()>0))
- {
- action.setToolTipText(tooltip);
- }
- String heldId = showPrefPagePlugins[idx].getAttribute("helpContextId"); //$NON-NLS-1$
- if ((heldId!=null)&&(heldId.length()>0))
- {
- action.setHelp(heldId);
- }
- v.addElement(action);
- } // end for all plugins loop
- showPrefPageActions = new SystemShowPreferencesPageAction[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- showPrefPageActions[idx] = (SystemShowPreferencesPageAction)v.elementAt(idx);
- }
- }
- return showPrefPageActions;
- }
-
- /**
- * @return The URL to the message file DTD. Null if it is not found.
- */
- public URL getMessageFileDTD() {
- URL result = getBundle().getEntry("/messageFile.dtd"); //$NON-NLS-1$
- return result;
- }
-
- /**
- * Load a message file for this plugin.
- * @param messageFileName - the name of the message xml file. Will look for it in this plugin's install folder.
- * @return a message file object containing the parsed contents of the message file, or null if not found.
- */
- public SystemMessageFile getMessageFile(String messageFileName)
- {
- return loadMessageFile(getBundle(), messageFileName);
- }
-
- /**
- * Load a default message file for this plugin for cases where messages haven't been translated.
- * @param messageFileName - the name of the message xml file. Will look for it in this plugin's install folder.
- * @return a message file object containing the parsed contents of the message file, or null if not found.
- */
- public SystemMessageFile getDefaultMessageFile(String messageFileName)
- {
- return loadDefaultMessageFile(getBundle(), messageFileName);
- }
-
- /**
- * Return this plugin's message file. Assumes it has already been loaded via a call to getMessageFile.
- */
- public static SystemMessageFile getPluginMessageFile()
- {
- return messageFile;
- }
-
- public SystemMessage getMessage(String msgId)
- {
- return getPluginMessage(msgId);
- }
-
- /**
- * Retrieve a message from this plugin's message file
- * @param msgId - the ID of the message to retrieve. This is the concatenation of the
- * message's component abbreviation, subcomponent abbreviation, and message ID as declared
- * in the message xml file.
- */
- public static SystemMessage getPluginMessage(String msgId)
- {
- SystemMessage msg = getMessage(messageFile, msgId);
- if (msg == null)
- {
- msg = getMessage(defaultMessageFile, msgId);
- }
- return msg;
- }
- /**
- * Retrieve a message from this plugin's message file and do multiple substitution on it.
- * @param msgId - the ID of the message to retrieve. This is the concatenation of the
- * message's component abbreviation, subcomponent abbreviation, and message ID as declared
- * in the message xml file.
- * @param subsVars - an array of objects to substitute in for %1, %2, etc
- */
- public static SystemMessage getPluginMessage(String msgId, Object[] subsVars)
- {
- SystemMessage msg = getMessage(messageFile, msgId);
- if (msg == null)
- {
- msg = getMessage(defaultMessageFile, msgId);
- }
- if ((msg != null) && (subsVars!=null) && (subsVars.length>0) && (msg.getNumSubstitutionVariables()>0))
- {
- msg.makeSubstitution(subsVars);
- }
- return msg;
- }
- /**
- * Retrieve a message from this plugin's message file and do single substitution on it.
- * @param msgId - the ID of the message to retrieve. This is the concatenation of the
- * message's component abbreviation, subcomponent abbreviation, and message ID as declared
- * in the message xml file.
- * @param subsVars - an array of objects to substitute in for %1, %2, etc
- */
- public static SystemMessage getPluginMessage(String msgId, Object subsVar)
- {
- SystemMessage msg = getMessage(messageFile, msgId);
- if (msg == null)
- {
- msg = getMessage(defaultMessageFile, msgId);
- }
- if ((msg != null) && (subsVar!=null) && (msg.getNumSubstitutionVariables()>0))
- {
- msg.makeSubstitution(subsVar);
- }
- return msg;
- }
-
- /**
- * Register a view supplier so we can ask them to participate in team synchs
- */
- public void registerViewSupplier(ISystemViewSupplier vs)
- {
- viewSuppliers.add(vs);
- }
- /**
- * UnRegister a previously registered view supplier
- */
- public void unRegisterViewSupplier(ISystemViewSupplier vs)
- {
- if (viewSuppliers.contains(vs))
- viewSuppliers.remove(vs);
- }
-
- /**
- * Initializes the Archive Handler Manager, by registering archive \
- * file types with their handlers.
- * @author mjberger
- */
- protected void registerArchiveHandlers()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- // Get configured extenders
- IConfigurationElement[] systemTypeExtensions = registry.getConfigurationElementsFor("org.eclipse.rse.ui", "archivehandlers"); //$NON-NLS-1$
-
- for (int i = 0; i < systemTypeExtensions.length; i++) {
- String ext = systemTypeExtensions[i].getAttribute("fileNameExtension"); //$NON-NLS-1$
- if (ext.startsWith(".")) ext = ext.substring(1); //$NON-NLS-1$
- String handlerType = systemTypeExtensions[i].getAttribute("class"); //$NON-NLS-1$
- try
- {
- // get the name space of the declaring extension
- String nameSpace = systemTypeExtensions[i].getDeclaringExtension().getNamespace();
-
- // use the name space to get the bundle
- Bundle bundle = Platform.getBundle(nameSpace);
-
- // if the bundle has not been uninstalled, then load the handler referred to in the
- // extension, and load it using the bundle
- // then register the handler
- if (bundle.getState() != Bundle.UNINSTALLED) {
- Class handler = bundle.loadClass(handlerType);
- ArchiveHandlerManager.getInstance().setRegisteredHandler(ext, handler);
- }
- }
- catch (ClassNotFoundException e)
- {
- logError("Cound not find archive handler class", e);
- }
- }
- }
-
-
- /**
- * Initializes the System View Adapter Menu Extension Manager, by registering menu extensions
- */
- protected void registerDynamicPopupMenuExtensions()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- // Get configured extenders
- IConfigurationElement[] systemTypeExtensions = registry.getConfigurationElementsFor("org.eclipse.rse.ui", "dynamicPopupMenuExtensions"); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int i = 0; i < systemTypeExtensions.length; i++)
- {
- try
- {
- // get the name space of the declaring extension
- String nameSpace = systemTypeExtensions[i].getDeclaringExtension().getNamespace();
-
- String menuExtensionType = systemTypeExtensions[i].getAttribute("class"); //$NON-NLS-1$
-
- // use the name space to get the bundle
- Bundle bundle = Platform.getBundle(nameSpace);
-
- // if the bundle has not been uninstalled, then load the handler referred to in the
- // extension, and load it using the bundle
- // then register the handler
- if (bundle.getState() != Bundle.UNINSTALLED)
- {
- Class menuExtension = bundle.loadClass(menuExtensionType);
-
- ISystemDynamicPopupMenuExtension extension = (ISystemDynamicPopupMenuExtension)menuExtension.getConstructors()[0].newInstance(null);
- SystemDynamicPopupMenuExtensionManager.getInstance().registerMenuExtension(extension);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-
- protected void registerKeystoreProviders()
- {
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- // Get configured extenders
- IConfigurationElement[] systemTypeExtensions = registry.getConfigurationElementsFor("org.eclipse.rse.ui", "keystoreProviders"); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int i = 0; i < systemTypeExtensions.length; i++)
- {
- try
- {
- // get the name space of the declaring extension
- String nameSpace = systemTypeExtensions[i].getDeclaringExtension().getNamespace();
-
- String keystoreProviderType = systemTypeExtensions[i].getAttribute("class"); //$NON-NLS-1$
-
- // use the name space to get the bundle
- Bundle bundle = Platform.getBundle(nameSpace);
-
-
- if (bundle.getState() != Bundle.UNINSTALLED)
- {
- Class keystoreProvider = bundle.loadClass(keystoreProviderType);
-
- ISystemKeystoreProvider extension = (ISystemKeystoreProvider)keystoreProvider.getConstructors()[0].newInstance(null);
- SystemKeystoreProviderManager.getInstance().registerKeystoreProvider(extension);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Returns the RSE UI registry. Clients should use this method to get the registry which
- * is the starting point for working with UI elements in the RSE framework.
- * @return the RSE UI registry.
- */
- public IRSEUIRegistry getRegistry() {
- return RSEUIRegistry.getDefault();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemBaseForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemBaseForm.java
deleted file mode 100644
index 863039260..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemBaseForm.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * A reusable base form.
- * <p>
- * May be used to populate a dialog or a wizard page or properties page.
- * Often we need to support multiple ways to edit the same thing, and we need to
- * abstract out the client area. This base class puts some structure around these
- * abstractions. Note we don't extend Composite. Rather the subclass will create
- * and return the composite in createContents(). This offers us more flexibility
- * in how/where this is used.
- * <p>
- * For error checking, subclasses should simply call setPageComplete whenever they
- * do error checking (such as in response to an event). This will then call any
- * interested listeners who have registered via {@link #addPageCompleteListener(ISystemPageCompleteListener)}.
- * Error messages should be set via {@link #showErrorMessage(SystemMessage)}.
- */
-
-public abstract class SystemBaseForm
- implements Listener, ISystemConnectionWizardErrorUpdater //
-{
-
- private ISystemMessageLine msgLine;
- private Shell shell;
- private Object inputObject, outputObject;
- private Vector pageCompleteListeners;
- private boolean complete;
- protected Vector verifyListeners;
- protected boolean alreadyNotified;
-
- /**
- * Constructor.
- * @deprecated You should now use the constructor that takes a shell.
- * @param msgLine A GUI widget capable of writing error messages to.
- */
- public SystemBaseForm(ISystemMessageLine msgLine)
- {
- this.msgLine = msgLine;
- }
- /**
- * Constructor.
- * @param shell The parent shell.
- * @param msgLine A GUI widget capable of writing error messages to.
- */
- public SystemBaseForm(Shell shell, ISystemMessageLine msgLine)
- {
- this.msgLine = msgLine;
- this.shell = shell;
- }
-
- /**
- * Often the message line is null at the time of instantiation, so we have to call this after
- * it is created.
- */
- public void setMessageLine(ISystemMessageLine msgLine)
- {
- this.msgLine = msgLine;
- }
- /**
- * Return the message line as set via setMessageLine
- */
- public ISystemMessageLine getMessageLine()
- {
- return msgLine;
- }
- /**
- * Occassionally we don't know the shell at constructor time, so we need to be able to set it later
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
- /**
- * Return the shell as set via setShell(Shell)
- */
- public Shell getShell()
- {
- return shell;
- }
- /**
- * Set the input object. This is usually set to the current selection, from where
- * the dialog/page is launched. This matches similar inputObject support in the
- * RSE classes for dialogs and wizards.<br>
- * This is usually set by the using dialog/pane, and queried by this object.
- */
- public void setInputObject(Object inputObject)
- {
- this.inputObject = inputObject;
- }
- /**
- * Return the input object as set by {@link #setInputObject(Object)}.
- */
- protected Object getInputObject()
- {
- return inputObject;
- }
- /**
- * Set the output object. This is usually set by this object, and is subsequently
- * queried by the using dialog/page.
- */
- protected void setOutputObject(Object outputObject)
- {
- this.outputObject = outputObject;
- }
- /**
- * Return the output object as set by {@link #setOutputObject(Object)}.
- */
- public Object getOutputObject()
- {
- return outputObject;
- }
-
- /**
- * Default implementation to satisfy Listener interface. Does nothing.
- */
- public void handleEvent(Event evt) {}
-
- /**
- * Register an interest in knowing whenever {@link #setPageComplete(boolean)} is
- * called by subclass code.
- */
- public void addPageCompleteListener(ISystemPageCompleteListener l)
- {
- if (pageCompleteListeners == null)
- pageCompleteListeners = new Vector();
- pageCompleteListeners.add(l);
- }
- /**
- * De-register a page complete listener.
- */
- public void removePageCompleteListener(ISystemPageCompleteListener l)
- {
- if (pageCompleteListeners != null)
- pageCompleteListeners.remove(l);
- }
-
- /**
- * The completeness of the page has changed.
- * We direct it to the Apply button versus just the OK button
- * @see {@link #addPageCompleteListener(ISystemPageCompleteListener)}
- */
- protected void setPageComplete(boolean complete)
- {
- this.complete = complete;
- if (pageCompleteListeners != null)
- {
- for (int idx=0; idx<pageCompleteListeners.size(); idx++)
- {
- ISystemPageCompleteListener l = (ISystemPageCompleteListener)pageCompleteListeners.elementAt(idx);
- l.setPageComplete(complete);
- }
- }
- }
- /**
- * Return the current completeness value, as last set by {@link #setPageComplete(boolean)}.
- */
- public boolean isPageComplete()
- {
- return complete;
- }
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- * @param parent The parent composite
- */
- public abstract Control createContents(Composite parent);
-
-
-
- // -----------------
- // HELPER METHODS...
- // -----------------
-
- /**
- * Display error message or clear error message (if passed null)
- */
- protected void showErrorMessage(SystemMessage msg)
- {
- if (msgLine != null)
- {
- if (msg != null)
- msgLine.setErrorMessage(msg);
- else
- msgLine.clearErrorMessage();
- }
- }
-
- /**
- * Add a separator line. This is a physically visible line.
- */
- protected Label addSeparatorLine(Composite parent, int nbrColumns)
- {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- separator.setLayoutData(data);
- return separator;
- }
- /**
- * Add a spacer line
- */
- protected Label addFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- filler.setLayoutData(data);
- return filler;
- }
- /**
- * Add a spacer line that grows in height to absorb extra space
- */
- protected Label addGrowableFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- filler.setLayoutData(data);
- return filler;
- }
-
- /**
- * Register an interest in knowing whenever the form is
- * verified and error messages are updated.
- */
- public void addVerifyListener(ISystemVerifyListener l)
- {
- if (verifyListeners == null)
- verifyListeners = new Vector();
- verifyListeners.add(l);
- }
-
- protected void notifyVerifyListeners()
- {
- if (alreadyNotified == true)
- return; // prevent recursion
- if (verifyListeners == null) return;
- alreadyNotified = true;
- for (int i = 0; i < verifyListeners.size(); i++)
- {
- ((ISystemVerifyListener)verifyListeners.get(i)).handleVerifyComplete();
- }
- alreadyNotified = false;
- }
-
-
- /**
- * De-register a verify listener.
- */
- public void removePageCompleteListener(ISystemVerifyListener l)
- {
- if (verifyListeners != null)
- verifyListeners.remove(l);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.propertypages.ISystemConnectionWizardErrorUpdatingPropertyPage#getTheErrorMessage()
- */
- public String getTheErrorMessage()
- {
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java
deleted file mode 100644
index 0b2fa8bd2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java
+++ /dev/null
@@ -1,1309 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import java.lang.reflect.InvocationTargetException;
-import java.net.InetAddress;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.ISystemUserIdConstants;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.propertypages.RemoteSystemsPreferencePage;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorConnectionName;
-import org.eclipse.rse.ui.validators.ValidatorUserId;
-import org.eclipse.rse.ui.widgets.InheritableEntryField;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizardPage;
-import org.eclipse.rse.ui.wizards.RSENewConnectionWizard;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-
-
-/**
- * A reusable form for prompting for connection information,
- * in new or update mode.
- * May be used to populate a dialog or a wizard page.
- * <p>
- * You may subclass this to refine the form. In this case you can
- * override the getForm method of SystemNewConnectionWizardDefaultMainPage
- * and SystemUpdateConnection to return your subclass.
- * </p>
- */
-
-public class SystemConnectionForm
- implements Listener, ISystemUserIdConstants,
- SelectionListener, Runnable, IRunnableWithProgress
-{
-
- public static final boolean CREATE_MODE = false;
- public static final boolean UPDATE_MODE = true;
- public static String lastSystemType = null;
-
-
- // GUI widgets
- protected Label labelType, labelConnectionName,labelHostName,labelUserId, labelDescription, labelProfile;
- protected Label labelTypeValue, labelSystemTypeValue, labelProfileValue;
- protected Combo textSystemType,textHostName, profileCombo;
- protected Text textConnectionName, textDescription;
- protected Button verifyHostNameCB;
-
- // yantzi:artemis 6.0, work offline support
- protected Button workOfflineCB;
-
- protected InheritableEntryField textUserId;
- protected Label textSystemTypeReadOnly; // for update mode
-
- // validators
- protected ISystemValidator[] nameValidators;
- protected ISystemValidator hostValidator;
- protected ISystemValidator userIdValidator;
-
- // other inputs
- protected ISystemMessageLine msgLine;
- protected ISystemConnectionFormCaller caller;
- protected String[] restrictSystemTypesTo;
- protected String defaultSystemType, defaultConnectionName, defaultHostName;
- protected String defaultUserId, defaultDescription, defaultProfile; // update mode initial values
- protected String[] defaultProfileNames;
- protected boolean defaultWorkOffline;
-
- protected boolean userPickedVerifyHostnameCB = false;
-
- // max lengths
- protected int hostNameLength = 100;
- protected int connectionNameLength = ValidatorConnectionName.MAX_CONNECTIONNAME_LENGTH;
- protected int userIdLength = 100;
- protected int descriptionLength = 100;
-
- // state/output
- protected int userIdLocation = USERID_LOCATION_CONNECTION;
- protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog, callerInstanceOfPropertyPage;
- protected boolean userIdFromSystemTypeDefault;
- protected boolean updateMode = false;
- protected boolean initDone = false;
- protected boolean contentsCreated = false;
- protected boolean connectionNameEmpty = false;
- protected boolean connectionNameListen = true;
- protected boolean singleTypeMode = false;
- protected String originalHostName = null;
- protected String currentHostName = null;
- protected SystemMessage errorMessage = null;
- protected SystemMessage verifyingHostName;
-
- /**
- * Constructor.
- * @param msgLine A GUI widget capable of writing error messages to.
- * @param caller The wizardpage or dialog hosting this form.
- */
- public SystemConnectionForm(ISystemMessageLine msgLine, ISystemConnectionFormCaller caller)
- {
- this.msgLine = msgLine;
- this.caller = caller;
- this.defaultProfileNames = RSEUIPlugin.getTheSystemRegistry().getActiveSystemProfileNames();
- callerInstanceOfWizardPage = (caller instanceof WizardPage);
- callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
- callerInstanceOfPropertyPage = (caller instanceof PropertyPage);
-
- userIdValidator = new ValidatorUserId(true); // false => allow empty? Yes.
- defaultUserId = ""; //$NON-NLS-1$
- }
-
- // -------------------------------------------------------------
- // INPUT METHODS CALLABLE BY CALLER TO INITIALIZE INPUT OR STATE
- // -------------------------------------------------------------
-
- /**
- * Often the message line is null at the time of instantiation, so we have to call this after
- * it is created.
- */
- public void setMessageLine(ISystemMessageLine msgLine)
- {
- this.msgLine = msgLine;
- }
-
- /**
- * Call this to specify a validator for the connection name. It will be called per keystroke.
- * You must supply one per active profile, as connections must be unique per profile.
- * The order must be the same as the order of profiles given by getActiveSystemProfiles() in
- * the system registry.
- */
- public void setConnectionNameValidators(ISystemValidator[] v)
- {
- nameValidators = v;
- }
- /**
- * Call this to specify a validator for the hostname. It will be called per keystroke.
- */
- public void setHostNameValidator(ISystemValidator v)
- {
- hostValidator = v;
- }
- /**
- * Call this to specify a validator for the userId. It will be called per keystroke.
- */
- public void setUserIdValidator(ISystemValidator v)
- {
- userIdValidator = v;
- }
-
- /**
- * Set the profile names to show in the combo
- */
- public void setProfileNames(String[] names)
- {
- this.defaultProfileNames = names;
- if (profileCombo != null)
- profileCombo.setItems(names);
- }
- /**
- * Set the profile name to preselect
- */
- public void setProfileNamePreSelection(String selection)
- {
- this.defaultProfile = selection;
- if ((profileCombo != null) && (selection != null))
- {
- int selIdx = profileCombo.indexOf(selection);
- if (selIdx >= 0)
- profileCombo.select(selIdx);
- else
- profileCombo.select(0);
- }
- }
-
- /**
- * For "new" mode, allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId)
- {
- defaultUserId = userId;
- }
- /**
- * Set the currently selected connection so as to better initialize input fields
- */
- public void setCurrentlySelectedConnection(IHost connection)
- {
- if (connection != null)
- {
- initializeInputFields(connection, false);
- }
- }
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- if (systemType.equals("*")) //$NON-NLS-1$
- return;
- this.restrictSystemTypesTo = new String[1];
- this.restrictSystemTypesTo[0] = systemType;
- if (defaultSystemType == null)
- defaultSystemType = systemType;
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- if (systemTypes == null)
- return;
- else if ((systemTypes.length==1) && (systemTypes[0].equals("*"))) //$NON-NLS-1$
- return;
- this.restrictSystemTypesTo = systemTypes;
- if (defaultSystemType == null)
- defaultSystemType = systemTypes[0];
- }
-
-
- /**
- * Initialize input fields to current values in update mode.
- * Note in update mode we do NOT allow users to change the system type.
- * <b>This must be called <i>after</i> calling getContents!
- * You must also be sure to pass true in createContents in order to call this method.
- * @param conn The SystemConnection object that is being modified.
- */
- public void initializeInputFields(IHost conn)
- {
- initializeInputFields(conn, true);
- }
- /**
- * Initialize input fields to current values in update mode.
- * Note in update mode we do NOT allow users to change the system type.
- * <b>This must be called <i>after</i> calling getContents!
- * You must also be sure to pass true in createContents in order to call this method.
- * @param conn The SystemConnection object that is being modified.
- */
- public void initializeInputFields(IHost conn, boolean updateMode)
- {
- this.updateMode = updateMode;
- defaultSystemType = conn.getSystemType();
- defaultConnectionName = conn.getAliasName();
- defaultHostName = conn.getHostName();
- defaultUserId = conn.getLocalDefaultUserId();
- defaultDescription = conn.getDescription();
- defaultProfile = conn.getSystemProfile().getName();
- defaultWorkOffline = conn.isOffline();
-
- if (updateMode)
- {
- defaultProfileNames = new String[1];
- defaultProfileNames[0] = defaultProfile;
- }
-
- if (contentsCreated)
- doInitializeFields();
- }
-
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- defaultConnectionName = name;
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- defaultHostName = name;
- }
-
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
-
- if (errorMessage == null) {
- pageComplete = ((getConnectionName().length() > 0)
- && (getHostName().length() > 0)
- && (getProfileName().length() > 0));
- }
-
- return pageComplete;
- }
-
- /**
- * @return whether the connection name is unique or not
- */
- public boolean isConnectionUnique()
- {
- // DKM - d53587 - used to check connection name uniqueness without displaying the error
- // TODO - need to display a directive for the user to specify a unique connection name
- // when it's invalid to be consistent with the rest of eclipse rather than
- // an error message
- int selectedProfile = 0;
- if (profileCombo != null)
- {
- selectedProfile = profileCombo.getSelectionIndex();
- }
- if (selectedProfile < 0)
- selectedProfile = 0;
-
- ISystemValidator nameValidator = null;
- if ((nameValidators!=null) && (nameValidators.length>0))
- nameValidator = nameValidators[selectedProfile];
- String connName = textConnectionName.getText().trim();
- if (nameValidator != null)
- errorMessage = nameValidator.validate(connName);
-
- if (errorMessage != null)
- {
- return false;
- }
- else
- {
- return true;
- }
-
- }
-
-
- // ---------------------------------------------
- // OUTPUT METHODS FOR EXTRACTING USER DATA ...
- // ---------------------------------------------
- /**
- * Verifies all input. Call this when user presses OK or Finish your dialog or wizard.
- * @param okPressed true if this verify is being done when OK is pressed. If so, we position
- * cursor on error checking, else we do not.
- * @return true if there are no errors in the user input
- */
- public boolean verify(boolean okPressed)
- {
- boolean ok = true;
-
- //SystemMessage errMsg = null;
- Control controlInError = null;
- if (msgLine != null)
- msgLine.clearErrorMessage();
-
- // validate connection name...
- errorMessage = validateConnectionNameInput(false);
- if (errorMessage != null)
- controlInError = textConnectionName;
-
- // validate host name...
- if ((errorMessage == null) && (textHostName != null))
- {
- errorMessage = validateHostNameInput();
- if (errorMessage != null)
- controlInError = textHostName;
- }
- // validate user Id...
- if ((errorMessage == null) && (textUserId != null))
- {
- errorMessage = validateUserIdInput();
- if (errorMessage != null)
- controlInError = textUserId;
- }
- // verify host name...
- if ((errorMessage == null) && okPressed && (textHostName != null) && verifyHostNameCB.getSelection())
- {
- currentHostName = textHostName.getText().trim();
- if (currentHostName.length() > 0)
- {
- if (verifyingHostName == null) {
- verifyingHostName = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_HOSTNAME_VERIFYING);
- }
-
- try
- {
- getRunnableContext().run(true, true, this);
- }
- catch (InterruptedException e)
- {
- // user canceled
- ok = false;
- controlInError = textHostName;
- }
- catch (InvocationTargetException e)
- {
- // error found
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_HOSTNAME_NOTFOUND);
- errorMessage.makeSubstitution(currentHostName);
- controlInError = textHostName;
- }
- }
- }
-
- // if ok pressed, test for warning situation that connection name is in use in another profile...
- if (ok && (errorMessage==null) && okPressed)
- {
- String connectionName = textConnectionName.getText().trim();
- if (!connectionName.equals(defaultConnectionName))
- {
- ok = ValidatorConnectionName.validateNameNotInUse(connectionName, caller.getShell());
- }
- controlInError = textConnectionName;
- }
-
- // ...end of validation...
-
- if (!ok || (errorMessage != null))
- {
- ok = false;
- if (okPressed)
- controlInError.setFocus();
- showErrorMessage(errorMessage);
- }
- // DETERMINE DEFAULT USER ID AND WHERE IT IS TO BE SET...
- // Possibly prompt for where to set user Id...
- else
- {
- boolean isLocal = false;
- if (textUserId != null)
- {
- isLocal = textUserId.isLocal();
- if (isLocal)
- userIdLocation = USERID_LOCATION_CONNECTION; // edit this connection's local value
- else
- userIdLocation = USERID_LOCATION_DEFAULT_SYSTEMTYPE; // edit the preference value
- }
- else
- userIdLocation = USERID_LOCATION_NOTSET;
- SystemPreferencesManager.getPreferencesManager().setVerifyConnection(verifyHostNameCB.getSelection());
- }
-
- return ok;
- }
-
- /**
- * Return the runnable context from the hosting dialog or wizard, if
- * applicable
- */
- protected IRunnableContext getRunnableContext()
- {
- if (callerInstanceOfWizardPage)
- {
- return ((WizardPage)caller).getWizard().getContainer();
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- return ((SystemPromptDialog)caller);
- }
- else
- {
- return new ProgressMonitorDialog(caller.getShell());
- }
- }
-
- /**
- * Check if this system type is enabled for offline support
- *
- * @since RSE 6.0
- */
- private boolean enableOfflineCB()
- {
- // disabled offline checkbox for new connections
- if (!updateMode)
- {
- return false;
- }
-
- IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(defaultSystemType);
- RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
- return sysTypeAdapter.isEnableOffline(sysType);
- }
-
- /**
- * Return user-entered System Type.
- * Call this after finish ends successfully.
- */
- public String getSystemType()
- {
- if (textSystemType != null)
- return textSystemType.getText().trim();
- else
- return defaultSystemType;
- }
- /**
- * Return user-entered Connection Name.
- * Call this after finish ends successfully.
- */
- public String getConnectionName()
- {
- return textConnectionName.getText().trim();
- }
- /**
- * Return user-entered Host Name.
- * Call this after finish ends successfully.
- */
- public String getHostName()
- {
- return textHostName.getText().trim();
- }
- /**
- * Return user-entered Default User Id.
- * Call this after finish ends successfully.
- */
- public String getDefaultUserId()
- {
- if (textUserId != null)
- return textUserId.getText().trim();
- else
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return the user-entered value for work offline.
- * Call this after finish ends successfully.
- */
- public boolean isWorkOffline()
- {
- if (workOfflineCB != null)
- {
- return workOfflineCB.getSelection();
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Return user-entered Description.
- * Call this after finish ends successfully.
- */
- public String getConnectionDescription()
- {
- return textDescription.getText().trim();
- }
- /**
- * Return user-selected profile to contain this connection
- * Call this after finish ends successfully, and only in update mode.
- */
- public String getProfileName()
- {
- return (labelProfileValue!=null)?labelProfileValue.getText():profileCombo.getText();
- }
-
- /**
- * If a default userId was specified, the user may have been queried
- * where to put the userId. This returns one of the constants from
- * ISystemUserIdConstants
- */
- public int getUserIdLocation()
- {
- if ((textUserId != null) && (textUserId.getText().trim().length()>0))
- return userIdLocation;
- else
- return USERID_LOCATION_NOTSET;
- }
-
- // --------------------
- // INTERNAL METHODS...
- // --------------------
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- * @param parent The parent composite
- * @param updateMode true if we are in update mode versus create mode.
- */
- public Control createContents(Composite parent, boolean updateMode, String parentHelpId)
- {
- contentsCreated = true;
- Label labelSystemType = null;
- String temp = null;
-
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
- SystemWidgetHelpers.setCompositeHelp(composite_prompts, parentHelpId);
-
- // Type display
- if (updateMode)
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_TYPE_LABEL);
- labelType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelTypeValue = SystemWidgetHelpers.createLabel(
- composite_prompts, SystemResources.RESID_CONNECTION_TYPE_VALUE);
- }
-
- // PROFILE SELECTION
- if (updateMode)
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
- labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
- labelProfileValue = SystemWidgetHelpers.createLabel(composite_prompts, ""); //$NON-NLS-1$
- labelProfileValue.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_READONLY_TIP);
- }
- else //if (!updateMode)
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_PROFILE_LABEL);
- labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelProfile.setToolTipText(SystemResources.RESID_CONNECTION_PROFILE_TIP);
- if (!updateMode)
- {
- profileCombo = SystemWidgetHelpers.createReadonlyCombo(
- composite_prompts,null,SystemResources.RESID_CONNECTION_PROFILE_TIP);
- 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
- if (updateMode || ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length==1)) )
- {
- if (updateMode)
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
- labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
- textSystemTypeReadOnly = SystemWidgetHelpers.createLabel(composite_prompts,""); //$NON-NLS-1$
- textSystemTypeReadOnly.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP);
- }
- else
- singleTypeMode = true;
- }
-
- if (updateMode)
- SystemWidgetHelpers.createLabel(composite_prompts, " ", nbrColumns); // filler //$NON-NLS-1$
-
- // CONNECTION NAME PROMPT
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_CONNECTIONNAME_LABEL);
- labelConnectionName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelConnectionName.setToolTipText(SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
- textConnectionName = SystemWidgetHelpers.createTextField(
- composite_prompts,null,SystemResources.RESID_CONNECTION_CONNECTIONNAME_TIP);
- SystemWidgetHelpers.setHelp(textConnectionName, RSEUIPlugin.HELPPREFIX + "ccon0002"); //$NON-NLS-1$
-
- // SYSTEMTYPE PROMPT IN CREATE MODE
- //if (!updateMode)
- if ((labelSystemType == null) && !singleTypeMode)
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
- labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
- textSystemType = SystemWidgetHelpers.createSystemTypeCombo(composite_prompts,null,restrictSystemTypesTo);
- textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
- SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$
- }
-
- // HOSTNAME PROMPT
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_HOSTNAME_LABEL);
- labelHostName = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
-
- if (!updateMode && (defaultSystemType==null))
- {
- defaultSystemType = RemoteSystemsPreferencePage.getSystemTypePreference();
- if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
- defaultSystemType = lastSystemType;
- if ((defaultSystemType == null) || (defaultSystemType.length() == 0))
- defaultSystemType = textSystemType.getItem(0);
- }
-
- textHostName = SystemWidgetHelpers.createHostNameCombo(composite_prompts,null,defaultSystemType);
- textHostName.setToolTipText(SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
- SystemWidgetHelpers.setHelp(textHostName, RSEUIPlugin.HELPPREFIX + "ccon0004"); //$NON-NLS-1$
-
- // 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.
- */
- if (updateMode) // added for this experiment
- {
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DEFAULTUSERID_LABEL);
- labelUserId = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelUserId.setToolTipText(SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
- textUserId = SystemWidgetHelpers.createInheritableTextField(
- composite_prompts,SystemResources.RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP,SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
- SystemWidgetHelpers.setHelp(textUserId, RSEUIPlugin.HELPPREFIX + "ccon0005"); //$NON-NLS-1$
- }
-
- // DESCRIPTION PROMPT
- temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_DESCRIPTION_LABEL);
- labelDescription = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelDescription.setToolTipText(SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
- textDescription = SystemWidgetHelpers.createTextField(
- composite_prompts,null,SystemResources.RESID_CONNECTION_DESCRIPTION_TIP);
- SystemWidgetHelpers.setHelp(textDescription, RSEUIPlugin.HELPPREFIX + "ccon0006"); //$NON-NLS-1$
-
- // VERIFY HOST NAME CHECKBOX
- 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);
- if (updateMode)
- verifyHostNameCB.setSelection(false);
- else
- verifyHostNameCB.setSelection(SystemPreferencesManager.getPreferencesManager().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)
- doInitializeFields();
-
- connectionNameEmpty = (textConnectionName.getText().trim().length() == 0); // d43191
-
- textConnectionName.setFocus();
-
-
- // add keystroke listeners...
- textConnectionName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateConnectionNameInput(true);
- }
- }
- );
- textHostName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateHostNameInput();
- }
- }
- );
- if (textUserId!=null)
- textUserId.addModifyListener(
- new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- 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))
- caller.systemTypeSelected(textSystemType.getText(), true);
- else if ((restrictSystemTypesTo!=null) && (restrictSystemTypesTo.length==1))
- caller.systemTypeSelected(restrictSystemTypesTo[0], true);
-
- if (textUserId == null)
- userIdLocation = USERID_LOCATION_NOTSET;
-
- return composite_prompts; // composite;
- }
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- if (updateMode || !singleTypeMode)
- return textConnectionName;
- else
- return textHostName; // create mode and restricted to one system type
- }
-
- /**
- * Default implementation to satisfy Listener interface. Does nothing.
- */
- public void handleEvent(Event evt) {}
-
- /**
- * Combo selection listener method
- */
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- /**
- * Combo selection listener method
- */
- public void widgetSelected(SelectionEvent event)
- {
- Object src = event.getSource();
-
- if (src == profileCombo)
- {
- profileCombo.getDisplay().asyncExec(this);
- }
- else if (src == textSystemType) // can only happen in create mode
- {
- String currHostName = textHostName.getText().trim();
- boolean hostNameChanged = !currHostName.equals(originalHostName);
- String currSystemType = textSystemType.getText().trim();
- textHostName.setItems(RSEUIPlugin.getTheSystemRegistry().getHostNames(currSystemType));
- if (hostNameChanged)
- {
- textHostName.setText(currHostName);
- }
- else if (textHostName.getItemCount()>0)
- {
- textHostName.setText(textHostName.getItem(0));
- originalHostName = textHostName.getText();
- }
- else
- {
- String connName = textConnectionName.getText().trim();
- if (connName.indexOf(' ') == -1)
- textHostName.setText(connName);
- else
- textHostName.setText(""); //$NON-NLS-1$
- originalHostName = textHostName.getText();
- }
-
- initializeUserIdField(currSystemType, null);
-
- verify(false); // re-check all fields in top-down order
-
- caller.systemTypeSelected(currSystemType, false);
- }
- // if verify host name checkbox event
- else if (src == verifyHostNameCB) {
-
- userPickedVerifyHostnameCB = true;
- // if the check box was unselected
- if (!verifyHostNameCB.getSelection()) {
-
- // clear host name not valid or not found error message so that wizard next page is enabled
- if (errorMessage != null && errorMessage == RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_HOSTNAME_NOTFOUND)) {
- errorMessage = null;
-
- if (msgLine != null) {
- msgLine.clearErrorMessage();
- }
-
- // set this page to complete so we can go to next page
- setPageComplete();
-
- // now go through each page and clear error message if there is one
- if (callerInstanceOfWizardPage) {
- IWizard wizard = ((WizardPage)caller).getWizard();
-
- IWizardPage[] pages = null;
-
- if (wizard instanceof RSENewConnectionWizard) {
- RSENewConnectionWizard connWizard = (RSENewConnectionWizard)wizard;
- AbstractSystemWizardPage mainPage = (AbstractSystemWizardPage)(connWizard.getStartingPage());
-
- Vector pageList = new Vector();
-
- IWizardPage page = mainPage;
-
- while (page != null) {
-
- if (page != mainPage) {
- pageList.add(page);
- }
-
- page = connWizard.getNextPage(page);
- }
-
- pages = new IWizardPage[pageList.size()];
-
- for (int j = 0; j < pageList.size(); j++) {
- pages[j] = (IWizardPage)(pageList.get(j));
- }
- }
- else {
- pages = wizard.getPages();
- }
-
- for (int i = 0; i < pages.length; i++) {
-
- IWizardPage page = pages[i];
-
- if (page instanceof AbstractSystemWizardPage) {
- ((AbstractSystemWizardPage)page).clearErrorMessage();
- }
- else if (page instanceof WizardPage) {
- ((WizardPage)page).setErrorMessage(null);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Initialize values of input fields based on input
- */
- private void doInitializeFields()
- {
- // -------
- // profile
- // -------
- // ...output-only:
- if (labelProfileValue != null)
- {
- if (defaultProfile != null)
- labelProfileValue.setText(defaultProfile);
- }
- // ...selectable:
- else
- {
- if (defaultProfileNames != null)
- profileCombo.setItems(defaultProfileNames);
-
- if (defaultProfile != null)
- {
- int selIdx = profileCombo.indexOf(defaultProfile);
- if (selIdx >= 0)
- profileCombo.select(selIdx);
- else
- profileCombo.select(0);
- }
- }
-
- // -----------
- // system type
- // -----------
- // ...output-only:
- if ((textSystemTypeReadOnly != null) || singleTypeMode)
- {
- if (restrictSystemTypesTo != null)
- {
- if (textSystemTypeReadOnly != null)
- textSystemTypeReadOnly.setText(restrictSystemTypesTo[0]);
- if (defaultSystemType == null)
- defaultSystemType = restrictSystemTypesTo[0];
- }
- else if (defaultSystemType != null)
- {
- if (textSystemTypeReadOnly != null)
- textSystemTypeReadOnly.setText(defaultSystemType);
- }
- }
- // ...selectable:
- else
- {
- if (defaultSystemType == null)
- {
- defaultSystemType = RemoteSystemsPreferencePage.getSystemTypePreference();
- if ((defaultSystemType == null) || (defaultSystemType.length()==0))
- defaultSystemType = lastSystemType;
- }
- if (defaultSystemType != null)
- {
- int selIdx = textSystemType.indexOf(defaultSystemType);
- if (selIdx >= 0)
- textSystemType.select(selIdx);
- }
- else
- {
- textSystemType.select(0);
- defaultSystemType = textSystemType.getText();
- }
- }
-
- // ---------------
- // connection name
- // ---------------
- if (defaultConnectionName != null)
- textConnectionName.setText(defaultConnectionName);
- textConnectionName.setTextLimit(connectionNameLength);
-
- // -----------
- // host name
- // -----------
- if (defaultHostName != null)
- {
- textHostName.setText(defaultHostName);
- }
- else if (textHostName.getItemCount() > 0)
- {
- textHostName.select(0);
- }
- textHostName.setTextLimit(hostNameLength);
- textHostName.clearSelection(); // should unselect the text, but it does not!
-
- // ---------------
- // default user id
- // ---------------
- initializeUserIdField(defaultSystemType, defaultUserId);
- if (textUserId!=null)
- textUserId.setTextLimit(userIdLength);
- // description
- if (defaultDescription != null)
- textDescription.setText(defaultDescription);
- textDescription.setTextLimit(descriptionLength);
-
- // ---------------
- // Work offline
- // ---------------
- if (workOfflineCB != null)
- {
- workOfflineCB.setSelection(defaultWorkOffline);
- }
-
- initDone = true;
- }
-
- /**
- * Initialize userId values.
- * We have to reset after user changes the system type
- */
- private void initializeUserIdField(String systemType, String currentUserId)
- {
- // ---------------
- // default user id
- // ---------------
- String parentUserId = SystemPreferencesManager.getPreferencesManager().getDefaultUserId(systemType);
- if (textUserId!=null)
- {
- textUserId.setInheritedText(parentUserId);
- boolean allowEditingOfInherited = ((parentUserId == null) || (parentUserId.length()==0));
- textUserId.setAllowEditingOfInheritedText(allowEditingOfInherited); // if not set yet, let user set it!
- }
- // ----------------------------
- // default user id: update-mode
- // ----------------------------
- if ((currentUserId != null) && (currentUserId.length()>0))
- {
- if (textUserId != null)
- {
- textUserId.setLocalText(currentUserId);
- textUserId.setLocal(true);
- }
- }
- // ----------------------------
- // default user id: create-mode
- // ----------------------------
- else
- {
- if (textUserId != null)
- textUserId.setLocalText(""); //$NON-NLS-1$
- if ((parentUserId != null) && (parentUserId.length() > 0))
- {
- userIdFromSystemTypeDefault = true;
- defaultUserId = parentUserId;
- if (textUserId != null)
- textUserId.setLocal(false);
- }
- // there is no local override, and no inherited value. Default to setting inherited value.
- else
- {
- if (textUserId != null)
- textUserId.setLocal(false);
- }
- }
- }
-
- // ------------------------------------------------------
- // INTERNAL METHODS FOR VERIFYING INPUT PER KEYSTROKE ...
- // ------------------------------------------------------
-
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setConnectionNameValidators(ISystemValidator[])
- */
- protected SystemMessage validateConnectionNameInput(boolean userTyped)
- {
- if (!connectionNameListen)
- return null;
- errorMessage= null;
- int selectedProfile = 0;
- if (profileCombo != null)
- {
- selectedProfile = profileCombo.getSelectionIndex();
- }
- if (selectedProfile < 0)
- selectedProfile = 0;
- ISystemValidator nameValidator = null;
- if ((nameValidators!=null) && (nameValidators.length>0))
- nameValidator = nameValidators[selectedProfile];
- String connName = textConnectionName.getText().trim();
- if (nameValidator != null)
- {
- errorMessage = nameValidator.validate(connName);
- }
- showErrorMessage(errorMessage);
- setPageComplete();
- if (userTyped)
- connectionNameEmpty = (connName.length()==0); // d43191
- return errorMessage;
- }
- /**
- * Set the connection name internally without validation
- */
- protected void internalSetConnectionName(String name)
- {
- SystemMessage currErrorMessage = errorMessage;
- connectionNameListen = false;
- textConnectionName.setText(name);
- connectionNameListen = true;
- errorMessage = currErrorMessage;
- }
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setHostNameValidator(ISystemValidator)
- */
- protected SystemMessage validateHostNameInput()
- {
- String hostName = textHostName.getText().trim();
- if (connectionNameEmpty) // d43191
- internalSetConnectionName(hostName);
- errorMessage= null;
- if (hostValidator != null)
- errorMessage= hostValidator.validate(hostName);
- else if (getHostName().length() == 0)
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_HOSTNAME_EMPTY);
- if (updateMode && !userPickedVerifyHostnameCB)
- {
- boolean hostNameChanged = !hostName.equals(defaultHostName);
- verifyHostNameCB.setSelection(hostNameChanged);
- }
- showErrorMessage(errorMessage);
- setPageComplete();
- return errorMessage;
- }
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setUserIdValidator(ISystemValidator)
- */
- protected SystemMessage validateUserIdInput()
- {
- errorMessage= null;
- if (textUserId != null)
- {
- if (userIdValidator != null)
- errorMessage= userIdValidator.validate(textUserId.getText());
- else if (getDefaultUserId().length()==0)
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY);
- }
- showErrorMessage(errorMessage);
- setPageComplete();
- return errorMessage;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- boolean complete = isPageComplete();
- if (complete && (textSystemType!=null))
- lastSystemType = textSystemType.getText().trim();
- if (callerInstanceOfWizardPage)
- {
- ((WizardPage)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- ((SystemPromptDialog)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfPropertyPage)
- {
- ((PropertyPage)caller).setValid(complete);
- }
- }
-
- /**
- * Display error message or clear error message
- */
- private void showErrorMessage(SystemMessage msg)
- {
- if (msgLine != null)
- if (msg != null)
- msgLine.setErrorMessage(msg);
- else
- msgLine.clearErrorMessage();
- else
- SystemBasePlugin.logDebugMessage(this.getClass().getName(), "MSGLINE NULL. TRYING TO WRITE MSG " + msg);
- }
-
- // ---------------------------------------------------------------
- // STATIC METHODS FOR GETTING A CONNECTION NAME VALIDATOR...
- // ---------------------------------------------------------------
-
- /**
- * Reusable method to return a name validator for renaming a connection.
- * @param conn the current connection object on updates. Can be null for new names. Used
- * to remove from the existing name list the current connection.
- */
- public static ISystemValidator getConnectionNameValidator(IHost conn)
- {
- ISystemProfile profile = conn.getSystemProfile();
- Vector v = RSEUIPlugin.getTheSystemRegistry().getHostAliasNames(profile);
- if (conn != null) // hmm, line 1 of this method will crash if this is the case!
- v.removeElement(conn.getAliasName());
- ValidatorConnectionName connNameValidator = new ValidatorConnectionName(v);
- return connNameValidator;
- }
- /**
- * Reusable method to return a name validator for renaming a connection.
- * @param profile the current connection object's profile from which to get the existing names.
- * Can be null for syntax checking only, versus name-in-use.
- */
- public static ISystemValidator getConnectionNameValidator(ISystemProfile profile)
- {
- Vector v = RSEUIPlugin.getTheSystemRegistry().getHostAliasNames(profile);
- ValidatorConnectionName connNameValidator = new ValidatorConnectionName(v);
- return connNameValidator;
- }
-
- /**
- * Reusable method to return name validators for creating a connection.
- * There is one validator per active system profile.
- */
- public static ISystemValidator[] getConnectionNameValidators()
- {
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISystemProfile[] profiles = sr.getActiveSystemProfiles();
- ISystemValidator[] connNameValidators = new ISystemValidator[profiles.length];
- for (int idx=0; idx<profiles.length; idx++)
- {
- Vector v = sr.getHostAliasNames(profiles[idx]);
- connNameValidators[idx] = new ValidatorConnectionName(v);
- }
- return connNameValidators;
- }
-
- // -------------------------------------------------------
- // METHOD REQUIRED BY RUNNABLE, USED IN CALL TO ASYNCEXEC
- // -------------------------------------------------------
-
- public void run()
- {
- verify(false);
- }
-
- /**
- * METHOD REQUIRED BY IRunnableWithProgress, USED TO SHOW PROGRESS WHILE
- * VERIFYING HOSTNAME
- */
- public void run(IProgressMonitor pm) throws InvocationTargetException, InterruptedException
- {
- pm.beginTask(verifyingHostName.getLevelOneText(),IProgressMonitor.UNKNOWN);
- try
- {
- InetAddress.getByName(currentHostName);
- }
- catch (java.net.UnknownHostException exc)
- {
- pm.done();
- throw new InvocationTargetException(exc);
- }
- pm.done();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemMenuManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemMenuManager.java
deleted file mode 100644
index 6204c7ec1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemMenuManager.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
-import org.eclipse.rse.ui.actions.SystemCascadingBrowseWithAction;
-import org.eclipse.rse.ui.actions.SystemCascadingCompareWithAction;
-import org.eclipse.rse.ui.actions.SystemCascadingExpandToAction;
-import org.eclipse.rse.ui.actions.SystemCascadingNewAction;
-import org.eclipse.rse.ui.actions.SystemCascadingOpenWithAction;
-import org.eclipse.rse.ui.actions.SystemCascadingRemoteServersAction;
-import org.eclipse.rse.ui.actions.SystemCascadingReplaceWithAction;
-import org.eclipse.rse.ui.actions.SystemCascadingViewAction;
-import org.eclipse.rse.ui.actions.SystemCascadingWorkWithAction;
-import org.eclipse.rse.ui.actions.SystemSeparatorAction;
-
-/**
- * Override/wrapper of JFace MenuManager so we can redirect any
- * menu additions to specific menu groups to go into
- * pre-defined submenus.
- * <p>
- * Only exposes core set of MenuManager methods. Rest can be
- * accessed by calling getMenuManger().
- */
-public class SystemMenuManager //implements IMenuManager
- implements ISystemContextMenuConstants
-{
- private IMenuManager mgr;
- private IMenuManager newSubMenu, expandtoSubMenu, openwithSubMenu, browsewithSubMenu, comparewithSubMenu, replacewithSubMenu, workwithSubMenu, viewSubMenu, serverSubMenu;
- private boolean menuCreated = false;
-
- /**
- * Constructor for SystemMenuManager
- * @param menuManager existing JFace menu manager
- */
- public SystemMenuManager(IMenuManager menuManager)
- {
- super();
- mgr = menuManager;
- }
-
- /**
- * Get the wrapped IMenuManager manager
- */
- public IMenuManager getMenuManager()
- {
- return mgr;
- }
-
- /**
- * Method declared on IContributionManager.
- * Add an action to this menu.
- * COMMENTED OUT TO PREVENT CALLING IT. YOU SHOULD EXPLICITLY
- * DECIDE WHAT GROUP EACH ACTION SHOULD BE ADDED TO, SO WE FORCE
- * YOU TO CALL APPENDTOGROUP!
- *
- public void add(IAction action)
- {
- mgr.add(action);
- }*/
-
- /**
- * Method declared on IContributionManager.
- * Append an action to the menu.
- * <p>
- * Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
- * <p>
- * @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
- * @param action action to append.
- */
- public void appendToGroup(String groupName, IAction action)
- {
- if (!checkForSpecialGroup(groupName, action, true))
- if (groupName != null)
- mgr.appendToGroup(groupName, action);
- else
- mgr.add(action);
- }
- /**
- * Method declared on IContributionManager.
- * Append a submenu to the menu.
- * <p>
- * Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
- * <p>
- * @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
- * @param submenu submenu to append.
- */
- public void appendToGroup(String groupName, IContributionItem menuOrSeparator)
- {
- if (!checkForSpecialGroup(groupName, menuOrSeparator, true))
- if (groupName != null)
- mgr.appendToGroup(groupName, menuOrSeparator);
- else
- mgr.add(menuOrSeparator);
- }
-
- /**
- * Method declared on IContributionManager.
- * Prepend an action to the menu.
- * <p>
- * Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
- * <p>
- * @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
- * @param action action to prepend.
- */
- public void prependToGroup(String groupName, IAction action)
- {
- if (!checkForSpecialGroup(groupName, action, false))
- mgr.prependToGroup(groupName, action);
- }
- /**
- * Method declared on IContributionManager.
- * Prepend a submenu to the menu.
- * <p>
- * Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
- * <p>
- * @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
- * @param submenu submenu to append.
- */
- public void prependToGroup(String groupName, IContributionItem subMenu)
- {
- if (!checkForSpecialGroup(groupName, subMenu, true))
- mgr.prependToGroup(groupName, subMenu);
- }
-
- /**
- * Add a separator.
- * HOPEFULLY THIS IS NEVER CALLED. RATHER, BY USING GROUPS AND DECIDING PER GROUP IF THERE
- * SHOULD BE SEPARATORS, WE AVOID HARDCODING SEPARATORS LIKE THIS.
- */
- public void addSeparator()
- {
- mgr.add(new Separator());
- }
-
- /**
- * Special helper that intelligently adds system framework actions
- * @param menuGroup default menuGroup to add to, if action doesn't contain an explicit location
- * @param action action to add to the menu
- */
- public void add(String menuGroup, IAction action)
- {
- if (action instanceof SystemBaseSubMenuAction)
- appendToGroup(getMenuGroup(action,menuGroup),
- ((SystemBaseSubMenuAction)action).getSubMenu());
- else if (!(action instanceof SystemSeparatorAction))
- appendToGroup(getMenuGroup(action,menuGroup),action);
- else // hopefully we don't have these!
- appendToGroup(menuGroup, new Separator()); // add a separator, which is an IContributionItem
- }
-
- private String getMenuGroup(IAction action, String defaultGroup)
- {
- if ( (action instanceof ISystemAction) &&
- (((ISystemAction)action).getContextMenuGroup()!=null) )
- return ((ISystemAction)action).getContextMenuGroup();
- else
- return defaultGroup;
- }
-
- private boolean checkForSpecialGroup(String groupName, IAction action, boolean add)
- {
- boolean takenCareOf = false;
- IMenuManager subMenu = getSpecialSubMenu(groupName);
- if (subMenu != null)
- {
- takenCareOf = true;
- if (action instanceof SystemSeparatorAction)
- {
- subMenu.add(new Separator());
- if (((SystemSeparatorAction)action).isRealAction())
- subMenu.add(action);
- }
- else
- subMenu.add(action);
- }
-
- return takenCareOf;
- }
-
- private boolean checkForSpecialGroup(String groupName, IContributionItem contribution, boolean add)
- {
- boolean takenCareOf = false;
- IMenuManager subMenu = getSpecialSubMenu(groupName);
- if (subMenu != null)
- {
- takenCareOf = true;
- subMenu.add(contribution);
- }
- return takenCareOf;
- }
-
- private IMenuManager getSpecialSubMenu(String groupName)
- {
- IMenuManager subMenu = null;
- menuCreated = false;
- if (groupName!=null)
- {
- if (groupName.equals(GROUP_NEW))
- {
- if (newSubMenu == null)
- {
- newSubMenu = (new SystemCascadingNewAction()).getSubMenu();
- mgr.appendToGroup(GROUP_NEW, newSubMenu);
- menuCreated = true;
- }
- subMenu = newSubMenu;
- }
- /*
- else if (groupName.equals(GROUP_GOTO))
- {
- if (gotoSubMenu == null)
- {
- gotoSubMenu = (new SystemCascadingGoToAction()).getSubMenu();
- mgr.appendToGroup(GROUP_GOTO, gotoSubMenu);
- menuCreated = true;
- }
- subMenu = gotoSubMenu;
- }
- */
- else if (groupName.equals(GROUP_EXPANDTO))
- {
- if (expandtoSubMenu == null)
- {
- expandtoSubMenu = (new SystemCascadingExpandToAction()).getSubMenu();
- mgr.appendToGroup(GROUP_EXPANDTO, expandtoSubMenu);
- menuCreated = true;
- }
- subMenu = expandtoSubMenu;
- }
- else if (groupName.equals(GROUP_OPENWITH))
- {
- if (openwithSubMenu == null)
- {
- openwithSubMenu = (new SystemCascadingOpenWithAction()).getSubMenu();
- mgr.appendToGroup(GROUP_OPENWITH, openwithSubMenu);
- menuCreated = true;
- }
- subMenu = openwithSubMenu;
- }
- else if (groupName.equals(GROUP_BROWSEWITH))
- {
- if (browsewithSubMenu == null)
- {
- browsewithSubMenu = (new SystemCascadingBrowseWithAction()).getSubMenu();
- mgr.appendToGroup(GROUP_BROWSEWITH, browsewithSubMenu);
- menuCreated = true;
- }
- subMenu = browsewithSubMenu;
- }
- else if (groupName.equals(GROUP_COMPAREWITH))
- {
- if (comparewithSubMenu == null)
- {
- comparewithSubMenu = (new SystemCascadingCompareWithAction()).getSubMenu();
- mgr.appendToGroup(GROUP_COMPAREWITH, comparewithSubMenu);
- menuCreated = true;
- }
- subMenu = comparewithSubMenu;
- }
- else if (groupName.equals(GROUP_REPLACEWITH))
- {
- if (replacewithSubMenu == null)
- {
- replacewithSubMenu = (new SystemCascadingReplaceWithAction()).getSubMenu();
- mgr.appendToGroup(GROUP_REPLACEWITH, replacewithSubMenu);
- menuCreated = true;
- }
- subMenu = replacewithSubMenu;
- }
- else if (groupName.equals(GROUP_WORKWITH))
- {
- if (workwithSubMenu == null)
- {
- workwithSubMenu = (new SystemCascadingWorkWithAction()).getSubMenu();
- mgr.appendToGroup(GROUP_WORKWITH, workwithSubMenu);
- menuCreated = true;
- }
- subMenu = workwithSubMenu;
- }
- else if (groupName.equals(GROUP_VIEWER_SETUP))
- {
- if (viewSubMenu == null)
- {
- viewSubMenu = (new SystemCascadingViewAction()).getSubMenu();
- mgr.appendToGroup(GROUP_VIEWER_SETUP, viewSubMenu);
- menuCreated = true;
- }
- subMenu = viewSubMenu;
- }
- else if (groupName.equals(GROUP_STARTSERVER))
- {
- if (serverSubMenu == null)
- {
- serverSubMenu = (new SystemCascadingRemoteServersAction()).getSubMenu();
- mgr.appendToGroup(GROUP_STARTSERVER, serverSubMenu);
- menuCreated = true;
- }
- subMenu = serverSubMenu;
- }
- }
- return subMenu;
- }
-
- public IMenuManager getSpecialSubMenuByMenuID(String menuID)
- {
- IMenuManager subMenu = null;
- String groupName = null;
- menuCreated = false;
- if (menuID!=null)
- {
- if (menuID.equals(MENU_NEW))
- groupName = GROUP_NEW;
- else if (menuID.equals(MENU_GOTO))
- groupName = GROUP_GOTO;
- else if (menuID.equals(MENU_EXPANDTO))
- groupName = GROUP_EXPANDTO;
- else if (menuID.equals(MENU_OPENWITH))
- groupName = GROUP_OPENWITH;
- else if (menuID.equals(MENU_BROWSEWITH))
- groupName = GROUP_BROWSEWITH;
- else if (menuID.equals(MENU_COMPAREWITH))
- groupName = GROUP_COMPAREWITH;
- else if (menuID.equals(MENU_REPLACEWITH))
- groupName = GROUP_REPLACEWITH;
- else if (menuID.equals(MENU_WORKWITH))
- groupName = GROUP_WORKWITH;
- else if (menuID.equals(MENU_STARTSERVER))
- groupName = GROUP_STARTSERVER;
-
- if (groupName != null)
- subMenu = getSpecialSubMenu(groupName);
- }
- return subMenu;
- }
-
- public boolean wasMenuCreated()
- {
- return menuCreated;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemProfileForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemProfileForm.java
deleted file mode 100644
index 5208f3dd5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemProfileForm.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorProfileName;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * A reusable form for prompting for profile information,
- * in new or update mode.
- * <p>
- * May be used to populate a dialog or a wizard page.
- */
-
-public class SystemProfileForm
- implements Listener
-{
-
- // GUI widgets
- protected Label profileLabel;
- protected Control verbage;
- //protected Combo profileCombo;
- protected Text profileName;
- protected ISystemMessageLine msgLine;
- // validators
- protected ISystemValidator nameValidator;
- protected Object caller;
- protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog;
-
- // max lengths
- protected static final int profileNameLength = ValidatorProfileName.MAX_PROFILENAME_LENGTH;
- // state
- protected ISystemProfile profile;
- private boolean showVerbage = true;
- private SystemMessage errorMessage = null;
-
- /**
- * Constructor.
- * @param msgLine A GUI widget capable of writing error messages to.
- * @param caller The wizardpage or dialog hosting this form.
- * @param profile The existing profile being updated, or null for New action.
- * @param showVerbage Specify true to show first-time-user verbage.
- */
- public SystemProfileForm(ISystemMessageLine msgLine, Object caller, ISystemProfile profile, boolean showVerbage)
- {
- this.msgLine = msgLine;
- this.caller = caller;
- this.profile = profile;
- this.showVerbage = showVerbage;
- callerInstanceOfWizardPage = (caller instanceof WizardPage);
- callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
-
- // FIXME cast to SystemProfileManager is temporary to get at api - need to use an adapter for getting validators
- SystemProfileManager mgr = (SystemProfileManager)RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager();
- nameValidator = mgr.getProfileNameValidator(profile);
- }
-
- /**
- * Often the message line is null at the time of instantiation, so we have to call this after
- * it is created.
- */
- public void setMessageLine(ISystemMessageLine msgLine)
- {
- this.msgLine = msgLine;
- }
-
- /**
- * Call this to specify a validator for the profile name. It will be called per keystroke.
- * If not specified, a default is used.
- */
- public void setNameValidators(ISystemValidator v)
- {
- nameValidator = v;
- }
- /**
- * Call to initialize the profile name in create mode. Must be called after createContents
- */
- public void setProfileName(String name)
- {
- if ((name != null) && (profileName != null))
- profileName.setText(name);
- }
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- * @param parent The parent composite
- */
- public Control createContents(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // VERBAGE LABEL
- if (showVerbage)
- {
- verbage = SystemWidgetHelpers.createVerbiage(
- composite_prompts, SystemResources.RESID_PROFILE_PROFILENAME_VERBAGE, nbrColumns, false, 200);
- SystemWidgetHelpers.createLabel(composite_prompts, "", nbrColumns); // dummy line for spacing //$NON-NLS-1$
- }
-
- // NAME PROMPT
- String temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_PROFILE_PROFILENAME_LABEL);
- profileLabel = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- profileName = SystemWidgetHelpers.createTextField(
- composite_prompts,this,
- SystemResources.RESID_PROFILE_PROFILENAME_TIP);
- profileName.setTextLimit(profileNameLength);
-
- if (profile != null)
- profileName.setText(profile.getName());
-
- profileName.setFocus();
-
-
- // add keystroke listeners...
- profileName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateNameInput();
- }
- }
- );
- return composite_prompts;
- }
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- return profileName;
- }
-
- /**
- * Default implementation to satisfy Listener interface. Does nothing.
- */
- public void handleEvent(Event evt) {}
-
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- SystemMessage errMsg = null;
- Control controlInError = null;
- if (msgLine != null)
- {
- msgLine.clearErrorMessage();
- }
- errMsg = validateNameInput();
- if (errMsg != null)
- {
- controlInError = profileName;
- controlInError.setFocus();
- showErrorMessage(errMsg);
- }
- return (errMsg == null);
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return user-entered profile Name.
- * Call this after finish ends successfully.
- */
- public String getProfileName()
- {
- return profileName.getText().trim();
- }
- /**
- * Display error message or clear error message
- */
- private void showErrorMessage(SystemMessage msg)
- {
- if (msgLine != null)
- if (msg != null)
- msgLine.setErrorMessage(msg);
- else
- msgLine.clearErrorMessage();
- else
- System.out.println("MSGLINE NULL. TRYING TO WRITE MSG " + msg);
- }
-
- // ---------------------------------------------
- // METHODS FOR VERIFYING INPUT PER KEYSTROKE ...
- // ---------------------------------------------
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setNameValidators(ISystemValidator)
- */
- protected SystemMessage validateNameInput()
- {
- errorMessage= null;
- errorMessage= nameValidator.validate(profileName.getText().trim());
- showErrorMessage(errorMessage);
- setPageComplete();
- return errorMessage;
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
- if (errorMessage == null)
- pageComplete = (getProfileName().length() > 0);
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- boolean complete = isPageComplete();
- if (callerInstanceOfWizardPage)
- {
- ((WizardPage)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- ((SystemPromptDialog)caller).setPageComplete(complete);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.java
deleted file mode 100644
index 1bd1d9a56..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-public class SystemPropertyResources extends NLS
-{
- private static String BUNDLE_NAME = "org.eclipse.rse.ui.SystemPropertyResources";//$NON-NLS-1$
-
-// ------------------------------
- // PROPERTY SHEET VALUES
- // ------------------------------
- // PROPERTY SHEET VALUES: GENERIC
-
- public static String RESID_PROPERTY_NAME_LABEL;
- public static String RESID_PROPERTY_NAME_TOOLTIP;
-
- public static String RESID_PROPERTY_TYPE_LABEL;
- public static String RESID_PROPERTY_TYPE_TOOLTIP;
-
- public static String RESID_PROPERTY_DESCRIPTION_LABEL;
- public static String RESID_PROPERTY_DESCRIPTION_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERTYPE_VALUE;
-
- public static String RESID_TERM_NOTAPPLICABLE;
- public static String RESID_TERM_NOTAVAILABLE;
-
- public static String RESID_PORT_DYNAMICSELECT;
- public static String RESID_PROPERTY_INHERITED;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SystemPropertyResources.class);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.properties
deleted file mode 100644
index 1bae72139..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPropertyResources.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-################################################################################
-# Copyright (c) 2006 IBM Corporation. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Initial Contributors:
-# The following IBM employees contributed to the Remote System Explorer
-# component that contains this file: David McKnight, Kushal Munir,
-# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
-# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
-#
-# Contributors:
-# {Name} (company) - description of contribution.
-################################################################################
-
-##############################################################
-# PROPERTY VALUES...
-##############################################################
-# NLS_MESSAGEFORMAT_NONE
-
-RESID_PROPERTY_NAME_LABEL=Name
-RESID_PROPERTY_NAME_TOOLTIP=Name of resources
-RESID_PROPERTY_TYPE_LABEL=Type
-RESID_PROPERTY_TYPE_TOOLTIP=Type of resource
-RESID_PROPERTY_DESCRIPTION_LABEL=Description
-RESID_PROPERTY_DESCRIPTION_TOOLTIP=Description of resource
-
-RESID_TERM_NOTAPPLICABLE=Not applicable
-RESID_TERM_NOTAVAILABLE=Not available
-RESID_PORT_DYNAMICSELECT=(First-available)
-RESID_PROPERTY_INHERITED=(Inherited)
-
-RESID_PROPERTY_FILTERTYPE_VALUE=Remote system filter \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.java
deleted file mode 100644
index 1f35880f3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.java
+++ /dev/null
@@ -1,1248 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-
-/**
- * Constants used throughout the System plugin.
- */
-public class SystemResources extends NLS
-{
- private static String BUNDLE_NAME = "org.eclipse.rse.ui.SystemResources";//$NON-NLS-1$
-
- /**
- * Current release as a number (multiplied by 10). E.g. 30 is for release 3.0.
- */
- public static final int CURRENT_RELEASE = 100; // updated to new release
-
- /**
- * Current release as a string.
- */
- public static final String CURRENT_RELEASE_NAME = "1.0.0";
-
-
- // Buttons
- // *** NOT GOOD TO USE BUTTONS. BETTER TO USE ACTIONS WITH THEIR
- // .label,.tooltip and .description ASSOCIATIONS
- // THESE BUTTON LABELS ARE USED IN SYSTEMPROMPTDIALOG
- public static String BUTTON_BROWSE;
- public static String BUTTON_TEST;
- public static String BUTTON_CLOSE;
- public static String BUTTON_ADD;
- public static String BUTTON_CREATE_LABEL;
- public static String BUTTON_CREATE_TOOLTIP;
- public static String BUTTON_APPLY_LABEL;
- public static String BUTTON_APPLY_TOOLTIP;
- public static String BUTTON_RESET_LABEL;
- public static String BUTTON_RESET_TOOLTIP;
- public static String BUTTON_CANCEL_ALL;
- public static String BUTTON_CANCEL_ALL_TOOLTIP;
-
- // THESE TERMS ARE USED POTENTIALLY ANYWHERE
- public static String TERM_YES;
- public static String TERM_NO;
-
- public static String TERM_TRUE;
- public static String TERM_FALSE;
-
- public static String TERM_LOCAL;
- public static String TERM_ALL;
-
- public static String RESID_MSGLINE_TIP;
-
- // ----------------------------------------
- // GENERIC/COMMON WIZARD AND DIALOG STRINGS
- // ----------------------------------------
- // GENERIC MULTI-SELECT RENAME DIALOG...
- public static String RESID_RENAME_TITLE;
- public static String RESID_RENAME_SINGLE_TITLE;
- public static String RESID_RENAME_VERBAGE;
- public static String RESID_RENAME_COLHDG_OLDNAME;
- public static String RESID_RENAME_COLHDG_NEWNAME;
- public static String RESID_RENAME_COLHDG_TYPE;
-
- // SPECIALIZED PROMPTS FOR GENERIC RENAME DIALOG...
- public static String RESID_MULTI_RENAME_PROFILE_VERBAGE;
-
- // GENERIC SINGLE-SELECT RENAME DIALOG...
-
- public static String RESID_SIMPLE_RENAME_PROMPT_LABEL;
- public static String RESID_SIMPLE_RENAME_PROMPT_TOOLTIP;
-
-
-
- public static String RESID_SIMPLE_RENAME_RESOURCEPROMPT_LABEL;
- public static String RESID_SIMPLE_RENAME_RESOURCEPROMPT_TOOLTIP;
- public static String RESID_SIMPLE_RENAME_RADIO_OVERWRITE_LABEL;
- public static String RESID_SIMPLE_RENAME_RADIO_OVERWRITE_TOOLTIP;
- public static String RESID_SIMPLE_RENAME_RADIO_RENAME_LABEL;
- public static String RESID_SIMPLE_RENAME_RADIO_RENAME_TOOLTIP;
-
- // SPECIALIZED PROMPTS FOR GENERIC RENAME DIALOG...
- public static String RESID_SIMPLE_RENAME_PROFILE_PROMPT_LABEL;
-
- public static String RESID_SIMPLE_RENAME_PROFILE_PROMPT_TIP;
-
- // GENERIC DELETE DIALOG...
- public static String RESID_DELETE_TITLE;
-
- public static String RESID_DELETE_PROMPT;
-
- public static String RESID_DELETE_PROMPT_SINGLE;
-
-
- public static String RESID_DELETE_RESOURCEPROMPT_LABEL;
- public static String RESID_DELETE_RESOURCEPROMPT_TOOLTIP;
-
- public static String RESID_DELETE_TIP;
-
- public static String RESID_DELETE_WARNING_LABEL;
- public static String RESID_DELETE_WARNING_TOOLTIP;
-
- public static String RESID_DELETE_WARNINGLOCAL_LABEL;
- public static String RESID_DELETE_WARNINGLOCAL_TOOLTIP;
-
- public static String RESID_DELETE_COLHDG_OLDNAME;
-
- public static String RESID_DELETE_COLHDG_TYPE;
-
- public static String RESID_DELETE_BUTTON;
-
- // SPECIALIZED PROMPTS FOR GENERIC DELETE DIALOG...
- public static String RESID_DELETE_PROFILES_PROMPT;
-
- // GENERIC COPY DIALOG...
- public static String RESID_COPY_TITLE;
- public static String RESID_COPY_SINGLE_TITLE;
- public static String RESID_COPY_PROMPT;
- public static String RESID_COPY_TARGET_PROFILE_PROMPT;
- public static String RESID_COPY_TARGET_FILTERPOOL_PROMPT;
- public static String RESID_COPY_TARGET_FILTER_PROMPT;
-
- // GENERIC MOVE DIALOG...
- public static String RESID_MOVE_TITLE;
- public static String RESID_MOVE_SINGLE_TITLE;
- public static String RESID_MOVE_PROMPT;
- public static String RESID_MOVE_TARGET_PROFILE_PROMPT;
- public static String RESID_MOVE_TARGET_FILTERPOOL_PROMPT;
- public static String RESID_MOVE_TARGET_FILTER_PROMPT;
-
- // GENERIC RESOURCE NAME COLLISION DIALOG...
- public static String RESID_COLLISION_RENAME_TITLE;
- public static String RESID_COLLISION_RENAME_VERBAGE;
- public static String RESID_COLLISION_RENAME_LABEL;
- public static String RESID_COLLISION_RENAME_TOOLTIP;
-
- // GENERIC SELECT CONNECTION DIALOG...
- public static String RESID_SELECTCONNECTION_TITLE;
- public static String RESID_SELECTCONNECTION_VERBAGE;
-
- // -------------------------
- // WIZARD AND DIALOG STRINGS
- // -------------------------
- // NEW PROFILE WIZARD...
- public static String RESID_NEWPROFILE_TITLE;
- public static String RESID_NEWPROFILE_PAGE1_TITLE;
- public static String RESID_NEWPROFILE_PAGE1_DESCRIPTION;
- public static String RESID_NEWPROFILE_NAME_LABEL;
- public static String RESID_NEWPROFILE_NAME_TOOLTIP;
- public static String RESID_NEWPROFILE_MAKEACTIVE_LABEL;
- public static String RESID_NEWPROFILE_MAKEACTIVE_TOOLTIP;
- public static String RESID_NEWPROFILE_VERBAGE;
-
- // RENAME DEFAULT PROFILE WIZARD PAGE...
- public static String RESID_RENAMEDEFAULTPROFILE_PAGE1_TITLE;
-
- public static String RESID_RENAMEDEFAULTPROFILE_PAGE1_DESCRIPTION;
-
- public static String RESID_PROFILE_PROFILENAME_LABEL;
- public static String RESID_PROFILE_PROFILENAME_TIP;
- public static String RESID_PROFILE_PROFILENAME_VERBAGE;
-
-
- // COPY SYSTEM PROFILE DIALOG...
- public static String RESID_COPY_PROFILE_TITLE;
-
- public static String RESID_COPY_PROFILE_PROMPT_LABEL;
- public static String RESID_COPY_PROFILE_PROMPT_TOOLTIP;
-
- // NEW SYSTEM CONNECTION WIZARD...
- public static String RESID_NEWCONN_PROMPT_LABEL;
- public static String RESID_NEWCONN_PROMPT_TOOLTIP;
- public static String RESID_NEWCONN_PROMPT_VALUE;
- public static String RESID_NEWCONN_EXPANDABLEPROMPT_VALUE;
- public static String RESID_NEWCONN_TITLE;
- public static String RESID_NEWCONN_PAGE1_TITLE;
- public static String RESID_NEWCONN_PAGE1_REMOTE_TITLE;
- public static String RESID_NEWCONN_PAGE1_LOCAL_TITLE;
- public static String RESID_NEWCONN_PAGE1_DESCRIPTION;
- public static String RESID_NEWCONN_SUBSYSTEMPAGE_FILES_DESCRIPTION;
- public static String RESID_NEWCONN_SUBSYSTEMPAGE_FILES_TITLE;
- public static String RESID_NEWCONN_SUBSYSTEMPAGE_FILES_VERBAGE1;
- public static String RESID_NEWCONN_SUBSYSTEMPAGE_FILES_VERBAGE2;
- public static String RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION;
-
- public static String RESID_CONNECTION_TYPE_LABEL;
- public static String RESID_CONNECTION_TYPE_VALUE;
- public static String RESID_CONNECTION_SYSTEMTYPE_LABEL;
- public static String RESID_CONNECTION_SYSTEMTYPE_TIP;
- public static String RESID_CONNECTION_SYSTEMTYPE_READONLY_LABEL;
- public static String RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP;
-
- public static String RESID_CONNECTION_CONNECTIONNAME_LABEL;
- public static String RESID_CONNECTION_CONNECTIONNAME_TIP;
-
- public static String RESID_CONNECTION_HOSTNAME_LABEL;
- public static String RESID_CONNECTION_HOSTNAME_TIP;
-
- public static String RESID_CONNECTION_HOSTNAME_READONLY_LABEL;
- public static String RESID_CONNECTION_HOSTNAME_READONLY_TIP;
-
- public static String RESID_CONNECTION_VERIFYHOSTNAME_LABEL;
- public static String RESID_CONNECTION_VERIFYHOSTNAME_TOOLTIP;
-
- public static String RESID_CONNECTION_USERID_LABEL;
- public static String RESID_CONNECTION_USERID_TIP;
-
- public static String RESID_CONNECTION_DEFAULTUSERID_LABEL;
- public static String RESID_CONNECTION_DEFAULTUSERID_TIP;
- public static String RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP;
-
- public static String RESID_CONNECTION_RUNNING_PORT_LABEL;
- public static String RESID_CONNECTION_RUNNING_PORT_TIP;
-
- public static String RESID_CONNECTION_PORT_LABEL;
- public static String RESID_CONNECTION_PORT_TIP;
-
- public static String RESID_CONNECTION_DAEMON_PORT_LABEL;
- public static String RESID_CONNECTION_DAEMON_PORT_TIP;
-
- public static String RESID_CONNECTION_DEFAULTPORT_LABEL;
- public static String RESID_CONNECTION_DEFAULTPORT_TIP;
-
- public static String RESID_CONNECTION_DESCRIPTION_LABEL;
- public static String RESID_CONNECTION_DESCRIPTION_TIP;
-
- public static String RESID_CONNECTION_PROFILE_LABEL;
- public static String RESID_CONNECTION_PROFILE_TIP;
-
- public static String RESID_CONNECTION_PROFILE_READONLY_TIP;
-
- // CHANGE SYSTEM CONNECTION DIALOG...
- public static String RESID_CHGCONN_TITLE;
-
- // SET DEFAULT USERID PER SYSTEM TYPE DIALOG...
- public static String RESID_USERID_PER_SYSTEMTYPE_TITLE;
- public static String RESID_USERID_PER_SYSTEMTYPE_SYSTEMTYPE_LABEL;
- public static String RESID_USERID_PER_SYSTEMTYPE_SYSTEMTYPE_TOOLTIP;
- public static String RESID_USERID_PER_SYSTEMTYPE_LABEL;
- public static String RESID_USERID_PER_SYSTEMTYPE_TOOLTIP;
-
-
-
- // NEW FILTER POOL WIZARD...
- public static String RESID_NEWFILTERPOOL_TITLE;
-
- public static String RESID_NEWFILTERPOOL_PAGE1_TITLE;
-
- public static String RESID_NEWFILTERPOOL_PAGE1_DESCRIPTION;
-
- // WIDGETS FOR THIS WIZARD...
- public static String RESID_FILTERPOOLNAME_LABEL;
- public static String RESID_FILTERPOOLNAME_TIP;
-
- public static String RESID_FILTERPOOLMANAGERNAME_LABEL;
- public static String RESID_FILTERPOOLMANAGERNAME_TIP;
-
- // SELECT FILTER POOLS DIALOG...
- public static String RESID_SELECTFILTERPOOLS_TITLE;
-
- public static String RESID_SELECTFILTERPOOLS_PROMPT;
-
- // WORK WITH FILTER POOLS DIALOG...
- public static String RESID_WORKWITHFILTERPOOLS_TITLE;
-
- public static String RESID_WORKWITHFILTERPOOLS_PROMPT;
-
- // NEW SYSTEM FILTER WIZARD...
- public static String RESID_NEWFILTER_TITLE;
-
- public static String RESID_NEWFILTER_PAGE_TITLE;
-
- // MAIN PAGE (page 1) OF NEW FILTER WIZARD...
- public static String RESID_NEWFILTER_PAGE1_DESCRIPTION;
-
- public static String RESID_NEWFILTER_POOLTIP;
-
- // NAME PAGE (page 2) OF NEW FILTER WIZARD...
- public static String RESID_NEWFILTER_PAGE2_DESCRIPTION;
-
- public static String RESID_NEWFILTER_PAGE2_NAME_VERBAGE;
-
- public static String RESID_NEWFILTER_PAGE2_POOL_VERBAGE;
-
- public static String RESID_NEWFILTER_PAGE2_POOL_VERBAGE_TIP;
-
- public static String RESID_NEWFILTER_PAGE2_PROFILE_VERBAGE;
-
- public static String RESID_NEWFILTER_PAGE2_NAME_LABEL;
- public static String RESID_NEWFILTER_PAGE2_NAME_TOOLTIP;
-
- public static String RESID_NEWFILTER_PAGE2_PROFILE_LABEL;
- public static String RESID_NEWFILTER_PAGE2_PROFILE_TOOLTIP;
-
- public static String RESID_NEWFILTER_PAGE2_POOL_LABEL;
- public static String RESID_NEWFILTER_PAGE2_POOL_TOOLTIP;
-
- public static String RESID_NEWFILTER_PAGE2_UNIQUE_LABEL;
- public static String RESID_NEWFILTER_PAGE2_UNIQUE_TOOLTIP;
-
- // INFO PAGE (page 3) OF NEW FILTER WIZARD...
- public static String RESID_NEWFILTER_PAGE3_DESCRIPTION;
- public static String RESID_NEWFILTER_PAGE3_STRINGS_VERBAGE;
- public static String RESID_NEWFILTER_PAGE3_POOLS_VERBAGE;
-
- public static String RESID_FILTERALIAS_LABEL;
- public static String RESID_FILTERALIAS_TIP;
- public static String RESID_FILTERPARENTPOOL_LABEL;
- public static String RESID_FILTERPARENTPOOL_TIP;
- public static String RESID_FILTERSTRINGS_LABEL;
- public static String RESID_FILTERSTRINGS_TIP;
-
-
- // CHANGE SYSTEM FILTER DIALOG...
- public static String RESID_CHGFILTER_TITLE;
- public static String RESID_CHGFILTER_LIST_NEWITEM;
- public static String RESID_CHGFILTER_NAME_LABEL;
- public static String RESID_CHGFILTER_NAME_TOOLTIP;
- public static String RESID_CHGFILTER_POOL_LABEL;
- public static String RESID_CHGFILTER_POOL_TOOLTIP;
- public static String RESID_CHGFILTER_LIST_LABEL;
- public static String RESID_CHGFILTER_LIST_TOOLTIP;
- public static String RESID_CHGFILTER_FILTERSTRING_LABEL;
- public static String RESID_CHGFILTER_FILTERSTRING_TOOLTIP;
- public static String RESID_CHGFILTER_NEWFILTERSTRING_LABEL;
- public static String RESID_CHGFILTER_NEWFILTERSTRING_TOOLTIP;
- public static String RESID_CHGFILTER_BUTTON_TEST_LABEL;
- public static String RESID_CHGFILTER_BUTTON_TEST_TOOLTIP;
- public static String RESID_CHGFILTER_BUTTON_APPLY_LABEL;
- public static String RESID_CHGFILTER_BUTTON_APPLY_TOOLTIP;
- public static String RESID_CHGFILTER_BUTTON_REVERT_LABEL;
- public static String RESID_CHGFILTER_BUTTON_REVERT_TOOLTIP;
- public static String RESID_CHGFILTER_BUTTON_CREATE_LABEL;
- public static String RESID_CHGFILTER_BUTTON_CREATE_TOOLTIP;
-
-
- // CREATE UNNAMED FILTER DIALOG...
- public static String RESID_CRTFILTER_TITLE;
-
- // RENAME SYSTEM FILTER DIALOG...
- public static String RESID_RENAME_FILTER_TITLE;
-
- public static String RESID_RENAME_FILTER_PROMPT;
-
- // COPY SYSTEM FILTER DIALOG...
- public static String RESID_COPY_FILTER_TITLE;
-
- public static String RESID_COPY_FILTER_PROMPT;
-
- // NEW SYSTEM FILTER STRING WIZARD...
- public static String RESID_NEWFILTERSTRING_TITLE;
- public static String RESID_NEWFILTERSTRING_ADD_TITLE;
- public static String RESID_NEWFILTERSTRING_PAGE1_TITLE;
- public static String RESID_NEWFILTERSTRING_PAGE1_DESCRIPTION;
-
- public static String RESID_NEWFILTERSTRING_PREFIX_LABEL;
- public static String RESID_NEWFILTERSTRING_PREFIX_TOOLTIP;
- public static String RESID_NEWFILTERSTRING_PREFIX_PROMPT;
-
- public static String RESID_FILTERSTRING_STRING_LABEL;
- public static String RESID_FILTERSTRING_STRING_TIP;
-
- // CHANGE FILTER STRING ACTION AND DIALOG...
- public static String RESID_CHGFILTERSTRING_PREFIX_LABEL;
- public static String RESID_CHGFILTERSTRING_PREFIX_TOOLTIP;
- public static String RESID_CHGFILTERSTRING_TITLE;
- public static String RESID_CHGFILTERSTRING_PREFIX_PROMPT;
-
- // TEST SYSTEM FILTER STRING DIALOG...
- public static String RESID_TESTFILTERSTRING_TITLE;
-
- public static String RESID_TESTFILTERSTRING_PROMPT_LABEL;
- public static String RESID_TESTFILTERSTRING_PROMPT_TOOLTIP;
-
- public static String RESID_TESTFILTERSTRING_TREE_TIP;
-
-
- // WORK WITH HISTORY DIALOG...
- public static String RESID_WORKWITHHISTORY_TITLE;
- public static String RESID_WORKWITHHISTORY_VERBAGE;
- public static String RESID_WORKWITHHISTORY_PROMPT;
- public static String RESID_WORKWITHHISTORY_BUTTON_LABEL;
- public static String RESID_WORKWITHHISTORY_BUTTON_TIP;
-
- // PROMPT FOR PASSWORD DIALOG...
- public static String RESID_PASSWORD_TITLE;
-
- public static String RESID_PASSWORD_LABEL;
- public static String RESID_PASSWORD_TIP;
-
- public static String RESID_PASSWORD_USERID_LABEL;
- public static String RESID_PASSWORD_USERID_TIP;
-
- public static String RESID_PASSWORD_USERID_ISPERMANENT_LABEL;
- public static String RESID_PASSWORD_USERID_ISPERMANENT_TIP;
-
- public static String RESID_PASSWORD_SAVE_LABEL;
- public static String RESID_PASSWORD_SAVE_TOOLTIP;
-
- // CHANGE PASSWORD DIALOG
- public static String RESID_CHANGE_PASSWORD_TITLE;
- public static String RESID_CHANGE_PASSWORD_NEW_LABEL;
- public static String RESID_CHANGE_PASSWORD_NEW_TOOLTIP;
- public static String RESID_CHANGE_PASSWORD_CONFIRM_LABEL;
- public static String RESID_CHANGE_PASSWORD_CONFIRM_TOOLTIP;
-
- // TABLE VIEW DIALOGS
- public static String RESID_TABLE_POSITIONTO_LABEL;
- public static String RESID_TABLE_POSITIONTO_ENTRY_TOOLTIP;
-
- public static String RESID_TABLE_SUBSET_LABEL;
- public static String RESID_TABLE_SUBSET_ENTRY_TOOLTIP;
-
- public static String RESID_TABLE_PRINTLIST_TITLE;
-
- // TABLE view column selection
- public static String RESID_TABLE_SELECT_COLUMNS_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_TOOLTIP;
-
- public static String RESID_TABLE_SELECT_COLUMNS_ADD_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP;
-
- public static String RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP;
-
- public static String RESID_TABLE_SELECT_COLUMNS_UP_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP;
-
- public static String RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP;
-
- public static String RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL;
-
- public static String RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL;
- public static String RESID_TABLE_SELECT_COLUMNS_DESCRIPTION_LABEL;
-
- // MONITOR VIEW DIALGOS
- public static String RESID_MONITOR_POLL_INTERVAL_LABEL;
- public static String RESID_MONITOR_POLL_INTERVAL_TOOLTIP;
- public static String RESID_MONITOR_POLL_LABEL;
- public static String RESID_MONITOR_POLL_TOOLTIP;
- public static String RESID_MONITOR_POLL_CONFIGURE_POLLING_LABEL;
- public static String RESID_MONITOR_POLL_CONFIGURE_POLLING_EXPAND_TOOLTIP;
- public static String RESID_MONITOR_POLL_CONFIGURE_POLLING_COLLAPSE_TOOLTIP;
-
- // TEAM VIEW
- public static String RESID_TEAMVIEW_SUBSYSFACTORY_VALUE;
- public static String RESID_TEAMVIEW_USERACTION_VALUE;
- public static String RESID_TEAMVIEW_CATEGORY_VALUE;
-
- public static String RESID_TEAMVIEW_CATEGORY_CONNECTIONS_LABEL;
- public static String RESID_TEAMVIEW_CATEGORY_CONNECTIONS_TOOLTIP;
-
- public static String RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_LABEL;
- public static String RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_TOOLTIP;
-
- public static String RESID_TEAMVIEW_CATEGORY_USERACTIONS_LABEL;
- public static String RESID_TEAMVIEW_CATEGORY_USERACTIONS_TOOLTIP;
-
- public static String RESID_TEAMVIEW_CATEGORY_COMPILECMDS_LABEL;
- public static String RESID_TEAMVIEW_CATEGORY_COMPILECMDS_TOOLTIP;
-
- public static String RESID_TEAMVIEW_CATEGORY_TARGETS_LABEL;
- public static String RESID_TEAMVIEW_CATEGORY_TARGETS_TOOLTIP;
-
- // ------------------------------
- // REUSABLE WIDGET STRINGS...
- // ------------------------------
- // SELECT MULTIPLE REMOTE FILES WIDGET...
- public static String RESID_SELECTFILES_SELECTTYPES_BUTTON_ROOT_LABEL;
- public static String RESID_SELECTFILES_SELECTTYPES_BUTTON_ROOT_TOOLTIP;
-
- public static String RESID_SELECTFILES_SELECTALL_BUTTON_ROOT_LABEL;
- public static String RESID_SELECTFILES_SELECTALL_BUTTON_ROOT_TOOLTIP;
-
- public static String RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_LABEL;
- public static String RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_TOOLTIP;
-
-
- // ------------------------------
- // PROPERTY PAGE STRINGS...
- // ------------------------------
- // SYSTEMREGISTRY PROPERTIES PAGE...
- public static String RESID_SYSTEMREGISTRY_TEXT;
-
- public static String RESID_SYSTEMREGISTRY_CONNECTIONS;
-
- // SUBSYSTEM PROPERTIES PAGE...
- public static String RESID_SUBSYSTEM_TITLE;
- public static String RESID_SUBSYSTEM_TYPE_LABEL;
- public static String RESID_SUBSYSTEM_TYPE_VALUE;
- public static String RESID_SUBSYSTEM_VENDOR_LABEL;
- public static String RESID_SUBSYSTEM_NAME_LABEL;
- public static String RESID_SUBSYSTEM_CONNECTION_LABEL;
- public static String RESID_SUBSYSTEM_PROFILE_LABEL;
-
- public static String RESID_SUBSYSTEM_PORT_LABEL;
- public static String RESID_SUBSYSTEM_PORT_TIP;
- public static String RESID_SUBSYSTEM_PORT_INHERITBUTTON_TIP;
- public static String RESID_SUBSYSTEM_PORT_INHERITBUTTON_INHERIT_TIP;
- public static String RESID_SUBSYSTEM_PORT_INHERITBUTTON_LOCAL_TIP;
-
- public static String RESID_SUBSYSTEM_USERID_LABEL;
- public static String RESID_SUBSYSTEM_USERID_TIP;
-
- public static String RESID_SUBSYSTEM_USERID_INHERITBUTTON_TIP;
- public static String RESID_SUBSYSTEM_USERID_INHERITBUTTON_INHERIT_TIP;
- public static String RESID_SUBSYSTEM_USERID_INHERITBUTTON_LOCAL_TIP;
-
- public static String RESID_SUBSYSTEM_SSL_LABEL;
- public static String RESID_SUBSYSTEM_SSL_TIP;
-
- public static String RESID_SUBSYSTEM_AUTODETECT_LABEL;
- public static String RESID_SUBSYSTEM_AUTODETECT_TIP;
-
- public static String RESID_SUBSYSTEM_SSL_ALERT_LABEL;
- public static String RESID_SUBSYSTEM_SSL_ALERT_TIP;
-
- public static String RESID_SUBSYSTEM_NONSSL_ALERT_LABEL;
- public static String RESID_SUBSYSTEM_NONSSL_ALERT_TIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_TITLE;
- public static String RESID_SUBSYSTEM_ENVVAR_DESCRIPTION;
- public static String RESID_SUBSYSTEM_ENVVAR_TOOLTIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_NAME_TITLE;
- public static String RESID_SUBSYSTEM_ENVVAR_NAME_LABEL;
- public static String RESID_SUBSYSTEM_ENVVAR_NAME_TOOLTIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_VALUE_TITLE;
- public static String RESID_SUBSYSTEM_ENVVAR_VALUE_LABEL;
- public static String RESID_SUBSYSTEM_ENVVAR_VALUE_TOOLTIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_ADD_TOOLTIP;
- public static String RESID_SUBSYSTEM_ENVVAR_REMOVE_TOOLTIP;
- public static String RESID_SUBSYSTEM_ENVVAR_CHANGE_TOOLTIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_MOVEUP_LABEL;
- public static String RESID_SUBSYSTEM_ENVVAR_MOVEUP_TOOLTIP;
- public static String RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_LABEL;
- public static String RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_TOOLTIP;
-
- public static String RESID_SUBSYSTEM_ENVVAR_ADD_TITLE;
- public static String RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE;
-
- // COMMON PROPERTIES PAGE UI...
- public static String RESID_PP_PROPERTIES_TYPE_LABEL;
- public static String RESID_PP_PROPERTIES_TYPE_TOOLTIP;
-
- // FILTER POOL PROPERTIES PAGE...
- public static String RESID_FILTERPOOL_TITLE;
- public static String RESID_FILTERPOOL_TYPE_VALUE;
-
- public static String RESID_FILTERPOOL_NAME_LABEL;
- public static String RESID_FILTERPOOL_NAME_TOOLTIP;
-
- public static String RESID_FILTERPOOL_PROFILE_LABEL;
- public static String RESID_FILTERPOOL_PROFILE_TOOLTIP;
-
- public static String RESID_FILTERPOOL_REFERENCECOUNT_LABEL;
- public static String RESID_FILTERPOOL_REFERENCECOUNT_TOOLTIP;
-
- public static String RESID_FILTERPOOL_RELATEDCONNECTION_LABEL;
- public static String RESID_FILTERPOOL_RELATEDCONNECTION_TOOLTIP;
-
- // FILTER POOL REFERENCE PROPERTIES PAGE...
- public static String RESID_FILTERPOOLREF_TITLE;
- public static String RESID_FILTERPOOLREF_TYPE_VALUE;
-
- public static String RESID_FILTERPOOLREF_NAME_LABEL;
- public static String RESID_FILTERPOOLREF_NAME_TOOLTIP;
-
- public static String RESID_FILTERPOOLREF_SUBSYSTEM_LABEL;
- public static String RESID_FILTERPOOLREF_SUBSYSTEM_TOOLTIP;
-
- public static String RESID_FILTERPOOLREF_CONNECTION_LABEL;
- public static String RESID_FILTERPOOLREF_CONNECTION_TOOLTIP;
-
- public static String RESID_FILTERPOOLREF_PROFILE_LABEL;
- public static String RESID_FILTERPOOLREF_PROFILE_TOOLTIP;
-
- // FILTER PROPERTIES PAGE...
- public static String RESID_PP_FILTER_TITLE_LABEL;
- public static String RESID_PP_FILTER_TYPE_VALUE;
-
- public static String RESID_PP_FILTER_TYPE_PROMPTABLE_VALUE;
- public static String RESID_PP_FILTER_TYPE_PROMPTABLE_TOOLTIP;
-
- public static String RESID_PP_FILTER_NAME_LABEL;
- public static String RESID_PP_FILTER_NAME_TOOLTIP;
-
- public static String RESID_PP_FILTER_STRINGCOUNT_LABEL;
- public static String RESID_PP_FILTER_STRINGCOUNT_TOOLTIP;
-
- public static String RESID_PP_FILTER_FILTERPOOL_LABEL;
- public static String RESID_PP_FILTER_FILTERPOOL_TOOLTIP;
-
- public static String RESID_PP_FILTER_PROFILE_LABEL;
- public static String RESID_PP_FILTER_PROFILE_TOOLTIP;
-
- public static String RESID_PP_FILTER_ISCONNECTIONPRIVATE_LABEL;
- public static String RESID_PP_FILTER_ISCONNECTIONPRIVATE_TOOLTIP;
-
- // FILTER STRING PROPERTIES PAGE...
- public static String RESID_PP_FILTERSTRING_TITLE;
- public static String RESID_PP_FILTERSTRING_TYPE_VALUE;
-
- public static String RESID_PP_FILTERSTRING_STRING_LABEL;
- public static String RESID_PP_FILTERSTRING_STRING_TOOLTIP;
-
- public static String RESID_PP_FILTERSTRING_FILTER_LABEL;
- public static String RESID_PP_FILTERSTRING_FILTER_TOOLTIP;
-
- public static String RESID_PP_FILTERSTRING_FILTERPOOL_LABEL;
- public static String RESID_PP_FILTERSTRING_FILTERPOOL_TOOLTIP;
-
-
- public static String RESID_PP_FILTERSTRING_PROFILE_LABEL;
- public static String RESID_PP_FILTERSTRING_PROFILE_TOOLTIP;
-
- // SUBSYSTEM FACTORY PROPERTIES PAGE...
- public static String RESID_PP_SUBSYSFACTORY_TITLE;
- public static String RESID_PP_SUBSYSFACTORY_ID_LABEL;
- public static String RESID_PP_SUBSYSFACTORY_ID_TOOLTIP;
-
- public static String RESID_PP_SUBSYSFACTORY_VENDOR_LABEL;
- public static String RESID_PP_SUBSYSFACTORY_VENDOR_TOOLTIP;
-
- public static String RESID_PP_SUBSYSFACTORY_TYPES_LABEL;
- public static String RESID_PP_SUBSYSFACTORY_TYPES_TOOLTIP;
-
- public static String RESID_PP_SUBSYSFACTORY_VERBAGE;
-
- // REMOTE SERVER LAUNCH PROPERTIES PAGE...
- public static String RESID_PROP_SERVERLAUNCHER_MEANS;
- public static String RESID_PROP_SERVERLAUNCHER_MEANS_LABEL;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_REXEC;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_NONE;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON_TOOLTIP;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_REXEC_TOOLTIP;
- public static String RESID_PROP_SERVERLAUNCHER_RADIO_NONE_TOOLTIP;
- public static String RESID_PROP_SERVERLAUNCHER_PATH;
- public static String RESID_PROP_SERVERLAUNCHER_PATH_TOOLTIP;
- public static String RESID_PROP_SERVERLAUNCHER_INVOCATION;
- public static String RESID_PROP_SERVERLAUNCHER_INVOCATION_TOOLTIP;
-
-
-
-
- // ---------------------------
- // RE-USABLE WIDGET STRINGS...
- // ---------------------------
-
- // WIDGETS IN SYSTEMCONNECTIONCOMBO.JAVA
- public static String WIDGET_CONNECTION_LABEL;
- public static String WIDGET_CONNECTION_TOOLTIP;
- public static String WIDGET_CONNECTION_NAME;
-
- public static String WIDGET_BUTTON_NEWCONNECTION_LABEL;
- public static String WIDGET_BUTTON_NEWCONNECTION_TOOLTIP;
-
- // -------------------------
- // PREFERENCES...
- // -------------------------
- public static String RESID_PREF_ROOT_PAGE;
- public static String RESID_PREF_ROOT_TITLE;
-
- public static String RESID_PREF_SYSTYPE_COLHDG_NAME;
- public static String RESID_PREF_SYSTYPE_COLHDG_ENABLED;
- public static String RESID_PREF_SYSTYPE_COLHDG_DESC;
- public static String RESID_PREF_SYSTYPE_COLHDG_USERID;
-
- //
- // Signon Information Preferences Page
- //
- public static String RESID_PREF_SIGNON_DESCRIPTION;
-
- public static String RESID_PREF_SIGNON_HOSTNAME_TITLE;
- public static String RESID_PREF_SIGNON_HOSTNAME_LABEL;
- public static String RESID_PREF_SIGNON_HOSTNAME_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_SYSTYPE_TITLE;
- public static String RESID_PREF_SIGNON_SYSTYPE_LABEL;
- public static String RESID_PREF_SIGNON_SYSTYPE_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_USERID_TITLE;
- public static String RESID_PREF_SIGNON_USERID_LABEL;
- public static String RESID_PREF_SIGNON_USERID_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_PASSWORD_LABEL;
- public static String RESID_PREF_SIGNON_PASSWORD_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_PASSWORD_VERIFY_LABEL;
- public static String RESID_PREF_SIGNON_PASSWORD_VERIFY_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_ADD_LABEL;
- public static String RESID_PREF_SIGNON_ADD_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_REMOVE_LABEL;
- public static String RESID_PREF_SIGNON_REMOVE_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_CHANGE_LABEL;
- public static String RESID_PREF_SIGNON_CHANGE_TOOLTIP;
-
- public static String RESID_PREF_SIGNON_ADD_DIALOG_TITLE;
-
- public static String RESID_PREF_SIGNON_CHANGE_DIALOG_TITLE;
-
- // Unable to load message
- public static String RESID_MSG_UNABLETOLOAD;
-
- // Default filter pool name
- public static String RESID_DEFAULT_FILTERPOOL;
-
- public static String RESID_PERCONNECTION_FILTERPOOL;
-
- // RSE Communication Perferences
- public static String RESID_PREF_COMMUNICATIONS_TITLE;
- public static String RESID_PREF_DAEMON_PORT_LABEL;
- public static String RESID_PREF_DAEMON_PORT_TOOLTIP;
- public static String RESID_PREF_DAEMON_AUTOSTART_LABEL;
- public static String RESID_PREF_DAEMON_AUTOSTART_TOOLTIP;
-
- public static String RESID_PREF_IP_ADDRESS_LABEL;
- public static String RESID_PREF_IP_AUTO_LABEL;
- public static String RESID_PREF_IP_AUTO_TOOLTIP;
- public static String RESID_PREF_IP_MANUAL_LABEL;
- public static String RESID_PREF_IP_MANUAL_TOOLTIP;
- public static String RESID_PREF_IP_MANUAL_ENTER_LABEL;
- public static String RESID_PREF_IP_MANUAL_ENTER_TOOLTIP;
-
- // Offline constants (yantzi:3.0)
- public static String RESID_OFFLINE_LABEL;
- public static String RESID_OFFLINE_WORKOFFLINE_LABEL;
- public static String RESID_OFFLINE_WORKOFFLINE_TOOLTIP;
- public static String RESID_OFFLINE_WORKOFFLINE_DESCRIPTION;
-
- // -------------------------------------------
- // remote search view constants
- // -------------------------------------------
-
- // Search view constants
- public static String RESID_SEARCH_VIEW_DEFAULT_TITLE;
-
- // Remove selected matches action
- public static String RESID_SEARCH_REMOVE_SELECTED_MATCHES_LABEL;
- public static String RESID_SEARCH_REMOVE_SELECTED_MATCHES_TOOLTIP;
-
- // Remove all matches action
- public static String RESID_SEARCH_REMOVE_ALL_MATCHES_LABEL;
- public static String RESID_SEARCH_REMOVE_ALL_MATCHES_TOOLTIP;
-
- // Clear history action
- public static String RESID_SEARCH_CLEAR_HISTORY_LABEL;
- public static String RESID_SEARCH_CLEAR_HISTORY_TOOLTIP;
-
- /** ******************************************* */
- /* Generated Vars */
- /** ******************************************* */
- public static String RESID_PREF_SYSTEMTYPE_PREFIX_LABEL;
- public static String RESID_PREF_SYSTEMTYPE_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_USERID_PREFIX_LABEL;
- public static String RESID_PREF_USERID_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_USERID_PERTYPE_PREFIX_LABEL;
- public static String RESID_PREF_USERID_PERTYPE_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_SHOWFILTERPOOLS_PREFIX_LABEL;
- public static String RESID_PREF_SHOWFILTERPOOLS_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_LABEL;
- public static String RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_LABEL;
- public static String RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_REMEMBERSTATE_PREFIX_LABEL;
- public static String RESID_PREF_REMEMBERSTATE_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_USEDEFERREDQUERIES_PREFIX_LABEL;
- public static String RESID_PREF_USEDEFERREDQUERIES_PREFIX_TOOLTIP;
-
- public static String RESID_PREF_RESTOREFROMCACHE_PREFIX_LABEL;
- public static String RESID_PREF_RESTOREFROMCACHE_PREFIX_TOOLTIP;
-
-
-
- //
- // Actions
- //
- // Browse with menu item
- public static String ACTION_CASCADING_BROWSEWITH_LABEL;
- public static String ACTION_CASCADING_BROWSEWITH_TOOLTIP;
-
- // Compare with menu item
- public static String ACTION_CASCADING_COMPAREWITH_LABEL;
- public static String ACTION_CASCADING_COMPAREWITH_TOOLTIP;
-
-
- // Replace with menu item
- public static String ACTION_CASCADING_REPLACEWITH_LABEL;
- public static String ACTION_CASCADING_REPLACEWITH_TOOLTIP;
-
- public static String ACTION_RENAME_LABEL;
- public static String ACTION_RENAME_TOOLTIP;
-
- public static String ACTION_IMPORT_TO_PROJECT_LABEL;
- public static String ACTION_IMPORT_TO_PROJECT_TOOLTIP;
-
- public static String ACTION_EXPORT_FROM_PROJECT_LABEL;
- public static String ACTION_EXPORT_FROM_PROJECT_TOOLTIP;
-
- public static String ACTION_NEWFILE_LABEL;
- public static String ACTION_NEWFILE_TOOLTIP;
-
- public static String ACTION_DAEMON_START_LABEL;
- public static String ACTION_DAEMON_START_TOOLTIP;
-
- public static String ACTION_DAEMON_STOP_LABEL;
- public static String ACTION_DAEMON_STOP_TOOLTIP;
-
- public static String ACTION_CASCADING_NEW_LABEL;
- public static String ACTION_CASCADING_NEW_TOOLTIP;
-
- public static String ACTION_CASCADING_GOTO_LABEL;
- public static String ACTION_CASCADING_GOTO_TOOLTIP;
-
- public static String ACTION_CASCADING_GOINTO_LABEL;
- public static String ACTION_CASCADING_GOINTO_TOOLTIP;
-
- public static String ACTION_CASCADING_OPEN_LABEL;
- public static String ACTION_CASCADING_OPEN_TOOLTIP;
-
- public static String ACTION_CASCADING_OPENWITH_LABEL;
- public static String ACTION_CASCADING_OPENWITH_TOOLTIP;
-
- public static String ACTION_CASCADING_WORKWITH_LABEL;
- public static String ACTION_CASCADING_WORKWITH_TOOLTIP;
-
- public static String ACTION_CASCADING_REMOTESERVERS_LABEL;
- public static String ACTION_CASCADING_REMOTESERVERS_TOOLTIP;
-
- public static String ACTION_REMOTESERVER_START_LABEL;
- public static String ACTION_REMOTESERVER_START_TOOLTIP;
-
- public static String ACTION_REMOTESERVER_STOP_LABEL;
- public static String ACTION_REMOTESERVER_STOP_TOOLTIP;
-
- public static String ACTION_CASCADING_EXPAND_LABEL;
- public static String ACTION_CASCADING_EXPAND_TOOLTIP;
-
- public static String ACTION_CASCADING_EXPAND_TO_LABEL;
- public static String ACTION_CASCADING_EXPAND_TO_TOOLTIP;
-
- public static String ACTION_CASCADING_EXPAND_ALL_LABEL;
- public static String ACTION_CASCADING_EXPAND_ALL_TOOLTIP;
-
- public static String ACTION_CASCADING_EXPAND_BY_LABEL;
- public static String ACTION_CASCADING_EXPAND_BY_TOOLTIP;
-
- public static String ACTION_CASCADING_EXPAND_WORKWITH_LABEL;
- public static String ACTION_CASCADING_EXPAND_WORKWITH_TOOLTIP;
-
- public static String ACTION_CASCADING_VIEW_LABEL;
- public static String ACTION_CASCADING_VIEW_TOOLTIP;
-
- public static String ACTION_CASCADING_USERID_LABEL;
- public static String ACTION_CASCADING_USERID_TOOLTIP;
-
- public static String ACTION_CASCADING_PREFERENCES_LABEL;
- public static String ACTION_CASCADING_PREFERENCES_TOOLTIP;
-
- public static String ACTION_CASCADING_TEAM_LABEL;
- public static String ACTION_CASCADING_TEAM_TOOLTIP;
-
- public static String ACTION_TEAM_SYNC_LABEL;
- public static String ACTION_TEAM_SYNC_TOOLTIP;
-
- public static String ACTION_CASCADING_PULLDOWN_LABEL;
- public static String ACTION_CASCADING_PULLDOWN_TOOLTIP;
-
- public static String ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_LABEL;
- public static String ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_TOOLTIP;
-
- public static String ACTION_TEAM_RELOAD_LABEL;
- public static String ACTION_TEAM_RELOAD_TOOLTIP;
-
- public static String ACTION_PROFILE_ACTIVATE_LABEL;
- public static String ACTION_PROFILE_ACTIVATE_TOOLTIP;
-
- public static String ACTION_PROFILE_MAKEACTIVE_LABEL;
- public static String ACTION_PROFILE_MAKEACTIVE_TOOLTIP;
-
- public static String ACTION_PROFILE_MAKEINACTIVE_LABEL;
- public static String ACTION_PROFILE_MAKEINACTIVE_TOOLTIP;
-
- public static String ACTION_PROFILE_COPY_LABEL;
- public static String ACTION_PROFILE_COPY_TOOLTIP;
-
- public static String ACTION_NEWPROFILE_LABEL;
- public static String ACTION_NEWPROFILE_TOOLTIP;
-
- public static String ACTION_NEW_PROFILE_LABEL;
- public static String ACTION_NEW_PROFILE_TOOLTIP;
-
- public static String ACTION_QUALIFY_CONNECTION_NAMES_LABEL;
- public static String ACTION_QUALIFY_CONNECTION_NAMES_TOOLTIP;
-
- public static String ACTION_RESTORE_STATE_PREFERENCE_LABEL;
- public static String ACTION_RESTORE_STATE_PREFERENCE_TOOLTIP;
-
- public static String ACTION_PREFERENCE_SHOW_FILTERPOOLS_LABEL;
- public static String ACTION_PREFERENCE_SHOW_FILTERPOOLS_TOOLTIP;
-
- public static String ACTION_NEWCONN_LABEL;
- public static String ACTION_NEWCONN_TOOLTIP;
-
- public static String ACTION_ANOTHERCONN_LABEL;
- public static String ACTION_ANOTHERCONN_TOOLTIP;
-
- public static String ACTION_UPDATECONN_LABEL;
- public static String ACTION_UPDATECONN_TOOLTIP;
-
- public static String ACTION_NEWFILTERSTRING_LABEL;
- public static String ACTION_NEWFILTERSTRING_TOOLTIP;
-
- public static String ACTION_ADDFILTERSTRING_LABEL;
- public static String ACTION_ADDFILTERSTRING_TOOLTIP;
-
- public static String ACTION_UPDATEFILTERSTRING_LABEL;
- public static String ACTION_UPDATEFILTERSTRING_TOOLTIP;
-
- public static String ACTION_TESTFILTERSTRING_LABEL;
- public static String ACTION_TESTFILTERSTRING_TOOLTIP;
-
- public static String ACTION_NEWFILTER_LABEL;
- public static String ACTION_NEWFILTER_TOOLTIP;
-
- public static String ACTION_NEWNESTEDFILTER_LABEL;
- public static String ACTION_NEWNESTEDFILTER_TOOLTIP;
-
- public static String ACTION_UPDATEFILTER_LABEL;
- public static String ACTION_UPDATEFILTER_TOOLTIP;
-
- public static String ACTION_NEWFILTERPOOL_LABEL;
- public static String ACTION_NEWFILTERPOOL_TOOLTIP;
-
- public static String ACTION_ADDFILTERPOOLREF_LABEL;
- public static String ACTION_ADDFILTERPOOLREF_TOOLTIP;
-
- public static String ACTION_RMVFILTERPOOLREF_LABEL;
- public static String ACTION_RMVFILTERPOOLREF_TOOLTIP;
-
- public static String ACTION_SELECTFILTERPOOLS_LABEL;
- public static String ACTION_SELECTFILTERPOOLS_TOOLTIP;
-
- public static String ACTION_WORKWITH_FILTERPOOLS_LABEL;
- public static String ACTION_WORKWITH_FILTERPOOLS_TOOLTIP;
-
- public static String ACTION_WORKWITH_WWFILTERPOOLS_LABEL;
- public static String ACTION_WORKWITH_WWFILTERPOOLS_TOOLTIP;
-
- public static String ACTION_WORKWITH_PROFILES_LABEL;
- public static String ACTION_WORKWITH_PROFILES_TOOLTIP;
-
- public static String ACTION_RUN_LABEL;
- public static String ACTION_RUN_TOOLTIP;
-
- public static String ACTION_SIMPLERENAME_LABEL;
- public static String ACTION_SIMPLERENAME_TOOLTIP;
-
- public static String ACTION_REFRESH_ALL_LABEL;
- public static String ACTION_REFRESH_ALL_TOOLTIP;
-
- public static String ACTION_REFRESH_LABEL;
- public static String ACTION_REFRESH_TOOLTIP;
-
-
- public static String ACTION_DELETE_LABEL;
- public static String ACTION_DELETE_TOOLTIP;
-
- public static String ACTION_CLEAR_LABEL;
- public static String ACTION_CLEAR_TOOLTIP;
-
- public static String ACTION_CLEAR_ALL_LABEL;
- public static String ACTION_CLEAR_ALL_TOOLTIP;
-
- public static String ACTION_CLEAR_SELECTED_LABEL;
- public static String ACTION_CLEAR_SELECTED_TOOLTIP;
-
- public static String ACTION_MOVEUP_LABEL;
- public static String ACTION_MOVEUP_TOOLTIP;
-
- public static String ACTION_MOVEDOWN_LABEL;
- public static String ACTION_MOVEDOWN_TOOLTIP;
-
- public static String ACTION_CONNECT_LABEL;
- public static String ACTION_CONNECT_TOOLTIP;
-
- public static String ACTION_CLEARPASSWORD_LABEL;
- public static String ACTION_CLEARPASSWORD_TOOLTIP;
-
- public static String ACTION_DISCONNECT_LABEL;
- public static String ACTION_DISCONNECT_TOOLTIP;
-
- public static String ACTION_DISCONNECTALLSUBSYSTEMS_LABEL;
- public static String ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP;
-
- public static String ACTION_CONNECT_ALL_LABEL;
- public static String ACTION_CONNECT_ALL_TOOLTIP;
-
- public static String ACTION_CLEARPASSWORD_ALL_LABEL;
- public static String ACTION_CLEARPASSWORD_ALL_TOOLTIP;
-
- public static String ACTION_SET_LABEL;
- public static String ACTION_SET_TOOLTIP;
-
- public static String ACTION_HISTORY_DELETE_LABEL;
- public static String ACTION_HISTORY_DELETE_TOOLTIP;
-
- public static String ACTION_HISTORY_CLEAR_LABEL;
- public static String ACTION_HISTORY_CLEAR_TOOLTIP;
-
- public static String ACTION_HISTORY_MOVEUP_LABEL;
- public static String ACTION_HISTORY_MOVEUP_TOOLTIP;
-
- public static String ACTION_HISTORY_MOVEDOWN_LABEL;
- public static String ACTION_HISTORY_MOVEDOWN_TOOLTIP;
-
- public static String ACTION_HISTORY_MOVEFORWARD_LABEL;
- public static String ACTION_HISTORY_MOVEFORWARD_TOOLTIP;
-
- public static String ACTION_HISTORY_MOVEBACKWARD_LABEL;
- public static String ACTION_HISTORY_MOVEBACKWARD_TOOLTIP;
-
-
- public static String ACTION_CONTENT_ASSIST;
- public static String ACTION_SHOW_TOOLTIP_INFORMATION;
-
-
- public static String ACTION_COPY_LABEL;
- public static String ACTION_COPY_TOOLTIP;
-
- public static String ACTION_CUT_LABEL;
- public static String ACTION_CUT_TOOLTIP;
-
- public static String ACTION_UNDO_LABEL;
- public static String ACTION_UNDO_TOOLTIP;
-
- public static String ACTION_PASTE_LABEL;
- public static String ACTION_PASTE_TOOLTIP;
-
- public static String ACTION_COPY_CONNECTION_LABEL;
- public static String ACTION_COPY_CONNECTION_TOOLTIP;
-
- public static String ACTION_COPY_FILTERPOOL_LABEL;
- public static String ACTION_COPY_FILTERPOOL_TOOLTIP;
-
- public static String ACTION_COPY_FILTER_LABEL;
- public static String ACTION_COPY_FILTER_TOOLTIP;
-
- public static String ACTION_COPY_FILTERSTRING_LABEL;
- public static String ACTION_COPY_FILTERSTRING_TOOLTIP;
-
- public static String ACTION_MOVE_LABEL;
- public static String ACTION_MOVE_TOOLTIP;
-
- public static String ACTION_MOVE_CONNECTION_LABEL;
- public static String ACTION_MOVE_CONNECTION_TOOLTIP;
-
- public static String ACTION_MOVE_FILTERPOOL_LABEL;
- public static String ACTION_MOVE_FILTERPOOL_TOOLTIP;
-
- public static String ACTION_MOVE_FILTER_LABEL;
- public static String ACTION_MOVE_FILTER_TOOLTIP;
-
- public static String ACTION_MOVE_FILTERSTRING_LABEL;
- public static String ACTION_MOVE_FILTERSTRING_TOOLTIP;
-
- public static String ACTION_TEAM_BROWSEHISTORY_LABEL;
- public static String ACTION_TEAM_BROWSEHISTORY_TOOLTIP;
-
- public static String ACTION_TABLE_LABEL;
- public static String ACTION_TABLE_TOOLTIP;
-
- public static String ACTION_MONITOR_LABEL;
- public static String ACTION_MONITOR_TOOLTIP;
-
- public static String ACTION_ERROR_LIST_LABEL;
- public static String ACTION_ERROR_LIST_TOOLTIP;
-
- public static String ACTION_FIND_FILES_LABEL;
- public static String ACTION_FIND_FILES_TOOLTIP;
-
- public static String ACTION_SEARCH_LABEL;
- public static String ACTION_SEARCH_TOOLTIP;
-
- public static String ACTION_CANCEL_FIND_FILES_LABEL;
- public static String ACTION_CANCEL_FIND_FILES_TOOLTIP;
-
- public static String ACTION_CANCEL_SEARCH_LABEL;
- public static String ACTION_CANCEL_SEARCH_TOOLTIP;
-
- public static String ACTION_LOCK_LABEL;
- public static String ACTION_LOCK_TOOLTIP;
-
- public static String ACTION_UNLOCK_LABEL;
- public static String ACTION_UNLOCK_TOOLTIP;
-
-
- public static String ACTION_POSITIONTO_LABEL;
- public static String ACTION_POSITIONTO_TOOLTIP;
-
- public static String ACTION_SUBSET_LABEL;
- public static String ACTION_SUBSET_TOOLTIP;
-
- public static String ACTION_PRINTLIST_LABEL;
- public static String ACTION_PRINTLIST_TOOLTIP;
-
- public static String ACTION_SELECTCOLUMNS_LABEL;
- public static String ACTION_SELECTCOLUMNS_TOOLTIP;
-
- public static String ACTION_OPENEXPLORER_CASCADE_LABEL;
- public static String ACTION_OPENEXPLORER_CASCADE_TOOLTIP;
-
- public static String ACTION_OPENEXPLORER_SAMEPERSP_LABEL;
- public static String ACTION_OPENEXPLORER_SAMEPERSP_TOOLTIP;
-
- public static String ACTION_OPENEXPLORER_DIFFPERSP_LABEL;
- public static String ACTION_OPENEXPLORER_DIFFPERSP_TOOLTIP;
-
- public static String ACTION_OPENEXPLORER_DIFFPERSP2_LABEL;
- public static String ACTION_OPENEXPLORER_DIFFPERSP2_TOOLTIP;
-
- public static String ACTION_REMOTE_PROPERTIES_LABEL;
- public static String ACTION_REMOTE_PROPERTIES_TOOLTIP;
-
- public static String ACTION_VIEWFORM_REFRESH_LABEL;
- public static String ACTION_VIEWFORM_REFRESH_TOOLTIP;
-
- public static String ACTION_VIEWFORM_GETLIST_LABEL;
- public static String ACTION_VIEWFORM_GETLIST_TOOLTIP;
-
- public static String ACTION_COMMANDSVIEW_SAVEASFILTER_LABEL;
- public static String ACTION_COMMANDSVIEW_SAVEASFILTER_TOOLTIP;
-
- public static String ACTION_EXPAND_SELECTED_LABEL;
- public static String ACTION_EXPAND_SELECTED_TOOLTIP;
-
- public static String ACTION_COLLAPSE_SELECTED_LABEL;
- public static String ACTION_COLLAPSE_SELECTED_TOOLTIP;
-
- public static String ACTION_COLLAPSE_ALL_LABEL;
- public static String ACTION_COLLAPSE_ALL_TOOLTIP;
-
- public static String ACTION_EXPAND_BY_LABEL;
- public static String ACTION_EXPAND_BY_TOOLTIP;
-
- public static String ACTION_EXPAND_ALL_LABEL;
- public static String ACTION_EXPAND_ALL_TOOLTIP;
-
- public static String ACTION_EXPAND_OTHER_LABEL;
- public static String ACTION_EXPAND_OTHER_TOOLTIP;
-
- public static String ACTION_SELECT_ALL_LABEL;
- public static String ACTION_SELECT_ALL_TOOLTIP;
-
- public static String ACTION_SELECT_INPUT_LABEL;
- public static String ACTION_SELECT_INPUT_DLG;
- public static String ACTION_SELECT_INPUT_TOOLTIP;
-
- public static String ACTION_SELECTCONNECTION_LABEL;
- public static String ACTION_SELECTCONNECTION_TOOLTIP;
-
- public static String RESID_CHANGE_PREFIX_LABEL;
- public static String RESID_CHANGE_PREFIX_TOOLTIP;
-
- public static String RESID_CHANGEVIAENTRY_PREFIX_LABEL;
- public static String RESID_CHANGEVIAENTRY_PREFIX_TOOLTIP;
-
- public static String RESID_ADDVIAENTRY_PREFIX_LABEL;
- public static String RESID_ADDVIAENTRY_PREFIX_TOOLTIP;
-
- public static String RESID_COPYFROM_PREFIX_LABEL;
- public static String RESID_COPYFROM_PREFIX_TOOLTIP;
-
- public static String RESID_COPYTO_PREFIX_LABEL;
- public static String RESID_COPYTO_PREFIX_TOOLTIP;
-
- public static String RESID_DUPLICATE_PREFIX_LABEL;
- public static String RESID_DUPLICATE_PREFIX_TOOLTIP;
-
-
- // services and connector services property pages
- public static String RESID_PROPERTIES_SERVICES_NAME;
- public static String RESID_PROPERTIES_SERVICES_LABEL;
- public static String RESID_PROPERTIES_SERVICES_TOOLTIP;
- public static String RESID_PROPERTIES_DESCRIPTION_LABEL;
- public static String RESID_PROPERTIES_CONNECTOR_SERVICES_LABEL;
- public static String RESID_PROPERTIES_CONNECTOR_SERVICES_TOOLTIP;
- public static String RESID_PROPERTIES_FACTORIES_LABEL;
- public static String RESID_PROPERTIES_FACTORIES_TOOLTIP;
- public static String RESID_PROPERTIES_PROPERTIES_LABEL;
- public static String RESID_PROPERTIES_PROPERTIES_TOOLTIP;
-
-
- public static String ACTION_COMPILE_NOPROMPT_LABEL;
-
- // RSE Model Objects
- public static String RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION;
- public static String RESID_MODELOBJECTS_HOSTPOOL_DESCRIPTION;
- public static String RESID_MODELOBJECTS_PROFILE_DESCRIPTION;
- public static String RESID_MODELOBJECTS_SERVERLAUNCHER_DESCRIPTION;
- public static String RESID_MODELOBJECTS_FILTER_DESCRIPTION;
- public static String RESID_MODELOBJECTS_FILTERPOOL_DESCRIPTION;
-
- // Services form
- public static String RESID_SERVICESFORM_CONFIGURATION_TOOLTIP;
- public static String RESID_SERVICESFORM_SERVICES_TOOLTIP;
- public static String RESID_SERVICESFORM_CONNECTORSERVICES_TOOLTIP;
- public static String RESID_SERVICESFORM_PROPERTIES_TOOLTIP;
-
- // Do not show again message
- public static String RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL;
- public static String RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SystemResources.class);
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.properties
deleted file mode 100644
index d169e2f1f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemResources.properties
+++ /dev/null
@@ -1,1432 +0,0 @@
-################################################################################
-# Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Initial Contributors:
-# The following IBM employees contributed to the Remote System Explorer
-# component that contains this file: David McKnight, Kushal Munir,
-# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
-# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
-#
-# Contributors:
-# {Name} (company) - description of contribution.
-################################################################################
-
-# NLS_MESSAGEFORMAT_NONE
-
-##############################################################
-# Button values. Mnemonics will be assigned automatically, don't set them here.
-##############################################################
-BUTTON_BROWSE=Browse...
-BUTTON_CLOSE=Close
-BUTTON_TEST=Test
-BUTTON_ADD=Add
-BUTTON_CREATE_LABEL=Create
-BUTTON_CREATE_TOOLTIP=Press to create the new resource
-BUTTON_APPLY_LABEL=Apply
-BUTTON_APPLY_TOOLTIP=Press to apply pending changes
-BUTTON_RESET_LABEL=Reset
-BUTTON_RESET_TOOLTIP=Press to reset to original values
-BUTTON_CANCEL_ALL = Cancel All
-BUTTON_CANCEL_ALL_TOOLTIP = Cancel for all
-
-TERM_YES=Yes
-TERM_NO=No
-TERM_TRUE=True
-TERM_FALSE=False
-TERM_LOCAL=Local
-TERM_ALL=All
-
-#=============================================================
-# RE-USABLE COMPOSITE WIDGETS
-#=============================================================
-# RE-USABLE CONNECTION-SELECTION COMPOSITE WIDGETS
-WIDGET_CONNECTION_LABEL=Connection:
-WIDGET_CONNECTION_TOOLTIP=Select remote system connection
-WIDGET_CONNECTION_NAME=%1 in profile %2
-WIDGET_BUTTON_NEWCONNECTION_LABEL=New...
-WIDGET_BUTTON_NEWCONNECTION_TOOLTIP=Create a new remote system connection
-
-
-#=============================================================
-# MESSAGE LINE MRI
-#=============================================================
-RESID_MSGLINE_TIP=Press to see additional message details
-
-##############################################################
-# Preference pages
-##############################################################
-RESID_PREF_ROOT_PAGE=Remote Systems
-RESID_PREF_ROOT_TITLE=Remote Systems Overall Preferences
-RESID_PREF_SYSTEMTYPE_PREFIX_LABEL=Default System Type
-RESID_PREF_SYSTEMTYPE_PREFIX_TOOLTIP=Default for New Connection wizard
-RESID_PREF_USERID_PREFIX_LABEL=Overall Default User ID
-RESID_PREF_USERID_PREFIX_TOOLTIP=Overall default, overriddable per system type
-RESID_PREF_USERID_PERTYPE_PREFIX_LABEL=System type information
-RESID_PREF_USERID_PERTYPE_PREFIX_TOOLTIP=Set enablement state and default user ID for the selected system type. Press F1 for details.
-#RESID_PREF_USERID_PERTYPE_SYSTEMTYPES_LABEL=System Types
-#RESID_PREF_USERID_PERTYPE_USERID_LABEL=User ID
-RESID_PREF_SHOWFILTERPOOLS_PREFIX_LABEL=Show filter pools in Remote Systems view
-RESID_PREF_SHOWFILTERPOOLS_PREFIX_TOOLTIP=Show filter pools when expanding subsystems
-RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_LABEL=Show "New Connection" prompt in Remote Systems view
-RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_TOOLTIP=Show the prompt for a new connection in the Remote Systems view
-RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_LABEL=Show connection names prefixed by profile name
-RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_TOOLTIP=Select this if two connections or filter pools have the same name across different profiles
-RESID_PREF_REMEMBERSTATE_PREFIX_LABEL=Re-open Remote Systems view to previous state
-RESID_PREF_REMEMBERSTATE_PREFIX_TOOLTIP=Re-expand previously expanded connections when starting up
-RESID_PREF_USEDEFERREDQUERIES_PREFIX_LABEL=Use deferred queries in the Remote Systems view
-RESID_PREF_USEDEFERREDQUERIES_PREFIX_TOOLTIP=Select this if, when expanding nodes in the Remote Systems view, you would like queries to happen asynchronously
-RESID_PREF_RESTOREFROMCACHE_PREFIX_LABEL=Use cached information to restore the Remote Systems view
-RESID_PREF_RESTOREFROMCACHE_PREFIX_TOOLTIP=If cached information is available then it is used to restore the Remote Systems view instead of connecting to the remote system
-RESID_PREF_SYSTYPE_COLHDG_NAME=System Type
-RESID_PREF_SYSTYPE_COLHDG_ENABLED=Enabled
-RESID_PREF_SYSTYPE_COLHDG_DESC=Description
-RESID_PREF_SYSTYPE_COLHDG_USERID=Default User ID
-
-##############################################################
-# Preference pages for general communications
-##############################################################
-RESID_PREF_COMMUNICATIONS_TITLE=RSE Communications Preferences
-RESID_PREF_DAEMON_PORT_LABEL=RSE communications daemon port number (1 - 65536)
-RESID_PREF_DAEMON_PORT_TOOLTIP=Enter the local port number for the daemon to listen on
-RESID_PREF_DAEMON_AUTOSTART_LABEL=Start RSE communications daemon on Workbench startup
-RESID_PREF_DAEMON_AUTOSTART_TOOLTIP=Select the checkbox to start daemon on startup
-
-RESID_PREF_IP_ADDRESS_LABEL= Workstation network address
-RESID_PREF_IP_AUTO_LABEL= Automatically detect IP address of workstation
-RESID_PREF_IP_AUTO_TOOLTIP= Allow automatic detection of the IP address of your workstation. This setting should work in most cases
-RESID_PREF_IP_MANUAL_LABEL= Specify IP address or host name of workstation
-RESID_PREF_IP_MANUAL_TOOLTIP= Specify the IP address or host name of your workstation
-RESID_PREF_IP_MANUAL_ENTER_LABEL= IP address or host name:
-RESID_PREF_IP_MANUAL_ENTER_TOOLTIP= Enter the IP address or host name of your workstation
-
-##############################################################
-# Miscellaneous Actions that appear as either buttons and/or menu items.
-# Actions use the following keys:
-# xxx.label=Text shown on button or menu item
-# xxx.tooltip=Short help shown in hover help box
-##############################################################
-# Style popup menu (cascading) on common Work-With lists...
-# labels...
-#MENUITEM_WWSTYLE_LABEL=Style
-#MENUITEM_WWSTYLE_NEXT_LABEL=Next style
-#MENUITEM_WWSTYLE_1_LABEL=1. Entry field and buttons on side
-#MENUITEM_WWSTYLE_2_LABEL=2. Entry field and buttons on top
-#MENUITEM_WWSTYLE_3_LABEL=3. No entry field and buttons on top
-#MENUITEM_WWSTYLE_4_LABEL=4. No entry field and no buttons
-#MENUITEM_WWSTYLE_5_LABEL=5. No entry field and buttons on side
-#MENUITEM_WWSTYLE_6_LABEL=6. No entry field, Add buttons on top, other buttons on side
-# descriptions...
-#MENUITEM_WWSTYLE_DESCRIPTION=Switch to another style of work-with list
-#MENUITEM_WWSTYLE_NEXT_DESCRIPTION=Switch to the next style of work-with list
-#MENUITEM_WWSTYLE_1_DESCRIPTION=Switch to style 1
-#MENUITEM_WWSTYLE_2_DESCRIPTION=Switch to style 2
-#MENUITEM_WWSTYLE_3_DESCRIPTION=Switch to style 3
-#MENUITEM_WWSTYLE_4_DESCRIPTION=Switch to style 4
-#MENUITEM_WWSTYLE_5_DESCRIPTION=Switch to style 5
-#MENUITEM_WWSTYLE_6_DESCRIPTION=Switch to style 6
-
-##############################################################
-# Wizard and dialog resources
-##############################################################
-
-#=============================================================
-# SINGLE-SELECT RENAME DIALOG...
-#=============================================================
-RESID_RENAME_SINGLE_TITLE=Rename Resource
-RESID_SIMPLE_RENAME_PROMPT_LABEL=New name
-RESID_SIMPLE_RENAME_PROMPT_TOOLTIP=Enter unique new resource name
-RESID_SIMPLE_RENAME_RESOURCEPROMPT_LABEL=Resource type:
-RESID_SIMPLE_RENAME_RESOURCEPROMPT_TOOLTIP=Type of object being renamed
-RESID_SIMPLE_RENAME_RADIO_OVERWRITE_LABEL =Overwrite
-RESID_SIMPLE_RENAME_RADIO_OVERWRITE_TOOLTIP =Replace the existing file with the new one.
-RESID_SIMPLE_RENAME_RADIO_RENAME_LABEL =Rename
-RESID_SIMPLE_RENAME_RADIO_RENAME_TOOLTIP =Rename the file to something else.
-
-
-# SPECIALIZED PROMPTS FOR SPECIFIC TYPES OF RESOURCES...
-RESID_SIMPLE_RENAME_PROFILE_PROMPT_LABEL=New profile name:
-RESID_SIMPLE_RENAME_PROFILE_PROMPT_TIP=Enter unique new name for this profile
-
-
-
-
-#=============================================================
-# MULTI-SELECT RENAME DIALOG...
-#=============================================================
-RESID_RENAME_TITLE=Rename Resources
-RESID_RENAME_VERBAGE=Enter a unique new name for each resource. You can Tab between the names.
-#column headings...
-RESID_RENAME_COLHDG_OLDNAME=Resource
-RESID_RENAME_COLHDG_NEWNAME=New name
-RESID_RENAME_COLHDG_TYPE=Resource Type
-# SPECIALIZED PROMPTS FOR SPECIFIC TYPES OF RESOURCES...
-RESID_MULTI_RENAME_PROFILE_VERBAGE=Enter unique new names for each profile
-
-#=============================================================
-# GENERIC DELETE DIALOG...
-#=============================================================
-RESID_DELETE_TITLE=Delete Confirmation
-RESID_DELETE_PROMPT=Delete selected resources?
-RESID_DELETE_PROMPT_SINGLE=Delete selected resource?
-RESID_DELETE_COLHDG_OLDNAME=Resource
-RESID_DELETE_COLHDG_TYPE=Resource Type
-RESID_DELETE_BUTTON=Delete
-RESID_DELETE_TIP=Confirm delete request
-
-RESID_DELETE_RESOURCEPROMPT_LABEL=Selected resource(s) type:
-RESID_DELETE_RESOURCEPROMPT_TOOLTIP=Type of object(s) being deleted
-RESID_DELETE_WARNING_LABEL=WARNING! Remote objects are permanently deleted!
-RESID_DELETE_WARNING_TOOLTIP=You are confirming permanent deletion of the selected resource(s) from the remote system. This action cannot be undone
-RESID_DELETE_WARNINGLOCAL_LABEL=WARNING! Local objects are permanently deleted!
-RESID_DELETE_WARNINGLOCAL_TOOLTIP=You are confirming permanent deletion of the selected resource(s) from the local system. This action cannot be undone
-
-# SPECIALIZED PROMPTS FOR SPECIFIC TYPES OF RESOURCES...
-RESID_DELETE_PROFILES_PROMPT=Delete selected profiles, including their connections, filters and user actions?
-
-
-#=============================================================
-# GENERIC COPY DIALOG...
-#=============================================================
-RESID_COPY_SINGLE_TITLE=Copy Resource
-RESID_COPY_TITLE=Copy Resources
-RESID_COPY_PROMPT=Select the copy destination
-RESID_COPY_TARGET_PROFILE_PROMPT=Select the active profile to copy into
-RESID_COPY_TARGET_FILTERPOOL_PROMPT=Select the filter pool to copy into
-RESID_COPY_TARGET_FILTER_PROMPT=Select the filter to copy into
-
-#=============================================================
-# GENERIC MOVE DIALOG...
-#=============================================================
-RESID_MOVE_SINGLE_TITLE=Move Resource
-RESID_MOVE_TITLE=Move Resources
-RESID_MOVE_PROMPT=Select the move destination
-RESID_MOVE_TARGET_PROFILE_PROMPT=Select the active profile to move into
-RESID_MOVE_TARGET_FILTERPOOL_PROMPT=Select the filter pool to move into
-RESID_MOVE_TARGET_FILTER_PROMPT=Select the filter to move into
-
-#=============================================================
-# GENERIC COPY/MOVE NAME-COLLISION DIALOG...
-#=============================================================
-RESID_COLLISION_RENAME_TITLE=Duplicate Name Collision
-RESID_COLLISION_RENAME_VERBAGE=A resource named "&1" already exists.
-RESID_COLLISION_RENAME_LABEL=Rename to
-RESID_COLLISION_RENAME_TOOLTIP=Enter unique new resource name
-
-
-#=============================================================
-# USERID PER SYSTEMTYPE DIALOG...
-#=============================================================
-RESID_USERID_PER_SYSTEMTYPE_TITLE=Default User ID Preference
-RESID_USERID_PER_SYSTEMTYPE_SYSTEMTYPE_LABEL=System type:
-RESID_USERID_PER_SYSTEMTYPE_SYSTEMTYPE_TOOLTIP=The system type to set the default user ID for
-RESID_USERID_PER_SYSTEMTYPE_LABEL=User ID
-RESID_USERID_PER_SYSTEMTYPE_TOOLTIP=Enter default user ID to use for all connections of this system type
-
-
-#=============================================================
-# SELECT CONNECTION DIALOG...
-#=============================================================
-RESID_SELECTCONNECTION_TITLE=Select Connection
-RESID_SELECTCONNECTION_VERBAGE=Select a connection
-
-#=============================================================
-# NEW PROFILE WIZARD...
-#=============================================================
-RESID_NEWPROFILE_TITLE=New
-RESID_NEWPROFILE_PAGE1_TITLE=Remote System Profile
-RESID_NEWPROFILE_PAGE1_DESCRIPTION=Define profile to hold connections
-RESID_NEWPROFILE_VERBAGE=Profiles enable team support. They contain all the connections, filters, user actions and compile commands. Whenever these items are created, you are prompted for the profile to create them in. Whenever they are shown, the total from all active profiles are shown. By default, team members only have active their own profiles and the Team profile.
-RESID_NEWPROFILE_NAME_LABEL=Name
-RESID_NEWPROFILE_NAME_TOOLTIP=Unique profile name
-RESID_NEWPROFILE_MAKEACTIVE_LABEL=Make active
-RESID_NEWPROFILE_MAKEACTIVE_TOOLTIP=Show connections in this profile
-
-#======================================================================
-# NEW CONNECTION PROMPT ("New Connection..." SPECIAL CONNECTION IN RSE)
-#======================================================================
-RESID_NEWCONN_PROMPT_LABEL=New Connection
-RESID_NEWCONN_PROMPT_TOOLTIP=Expand to create a new connection to a remote system
-RESID_NEWCONN_PROMPT_VALUE=A prompt for a new connection
-RESID_NEWCONN_EXPANDABLEPROMPT_VALUE=An expandable prompt for a new connection
-
-#=============================================================
-# NEW CONNECTION WIZARD...
-#=============================================================
-RESID_NEWCONN_TITLE=New
-RESID_NEWCONN_PAGE1_TITLE=Remote System Connection
-RESID_NEWCONN_PAGE1_LOCAL_TITLE=Local System Connection
-RESID_NEWCONN_PAGE1_REMOTE_TITLE=Remote &1 System Connection
-RESID_NEWCONN_PAGE1_DESCRIPTION=Define connection information
-
-#=============================================================
-# NEW CONNECTION WIZARD INFORMATION PAGE FOR UNIX/LINUX/WINDOWS
-#=============================================================
-RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION=Define subsystem information
-RESID_NEWCONN_SUBSYSTEMPAGE_FILES_TITLE=Communications Server
-RESID_NEWCONN_SUBSYSTEMPAGE_FILES_DESCRIPTION=How to install server support
-RESID_NEWCONN_SUBSYSTEMPAGE_FILES_VERBAGE1=To connect to your remote system, you must first copy and expand the supplied Java server code jar file on that system, and either manually start that server or the supplied daemon. You will find the instructions for this in the Help.
-RESID_NEWCONN_SUBSYSTEMPAGE_FILES_VERBAGE2=If you manually start the communications server, you will need to set the port number property for this connection. To do this, expand your newly created connection in the Remote System Explorer perspective. Right click on the Files subsystem and select Properties. You can specify the port to match the port you specified or were assigned for the server.
-
-#=============================================================
-# RENAME PROFILE PAGE...
-#=============================================================
-RESID_RENAMEDEFAULTPROFILE_PAGE1_TITLE=Name personal profile
-RESID_RENAMEDEFAULTPROFILE_PAGE1_DESCRIPTION=Uniquely name user profile
-RESID_PROFILE_PROFILENAME_LABEL=Profile
-RESID_PROFILE_PROFILENAME_TIP=New name for the profile
-RESID_PROFILE_PROFILENAME_VERBAGE=Welcome to Remote Systems. Connections can be sharable by the team or private to you. Enter a profile name to uniquely identify you from your team members. You will decide for each new connection whether it is owned by the team profile or your profile.
-
-#=============================================================
-# DUPLICATE PROFILE DIALOG...
-#=============================================================
-RESID_COPY_PROFILE_TITLE=Duplicate Profile
-RESID_COPY_PROFILE_PROMPT_LABEL=New profile name
-RESID_COPY_PROFILE_PROMPT_TOOLTIP=Enter a unique name for the new profile
-
-
-#=============================================================
-# UPDATE CONNECTION DIALOG...
-#=============================================================
-RESID_CHGCONN_TITLE=Change Connection
-
-RESID_CONNECTION_TYPE_LABEL=Resource type
-RESID_CONNECTION_TYPE_VALUE=Connection to remote system
-
-RESID_CONNECTION_SYSTEMTYPE_LABEL=System type
-RESID_CONNECTION_SYSTEMTYPE_TIP=Operating system type of the remote host
-
-RESID_CONNECTION_SYSTEMTYPE_READONLY_LABEL=System type
-RESID_CONNECTION_SYSTEMTYPE_READONLY_TIP=Operating system type of the remote host
-
-RESID_CONNECTION_CONNECTIONNAME_LABEL=Connection name
-RESID_CONNECTION_CONNECTIONNAME_TIP=Arbitrary name for this connection, unique to this profile
-
-RESID_CONNECTION_HOSTNAME_LABEL=Host name
-RESID_CONNECTION_HOSTNAME_TIP=Hostname or IP address of target system
-
-RESID_CONNECTION_HOSTNAME_READONLY_LABEL=Host name
-RESID_CONNECTION_HOSTNAME_READONLY_TIP=Hostname or IP address of system this connects to
-
-RESID_CONNECTION_USERID_LABEL=User ID
-RESID_CONNECTION_USERID_TIP=User ID to use when connecting
-
-RESID_CONNECTION_DEFAULTUSERID_LABEL=Default User ID
-RESID_CONNECTION_DEFAULTUSERID_TIP=Default user ID for subsystems that don't specify a user ID
-RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP=Inherit from preferences, or set locally for this connection
-
-RESID_CONNECTION_RUNNING_PORT_LABEL=Running Server Port
-RESID_CONNECTION_RUNNING_PORT_TIP=Port number used by a running server
-
-RESID_CONNECTION_PORT_LABEL=Port
-RESID_CONNECTION_PORT_TIP=Port number used to do the connection
-
-RESID_CONNECTION_DAEMON_PORT_LABEL=Daemon Port
-RESID_CONNECTION_DAEMON_PORT_TIP=Port number used to connect to the daemon that launches Remote Systems Explorer servers
-
-RESID_CONNECTION_DEFAULTPORT_LABEL=Default port
-RESID_CONNECTION_DEFAULTPORT_TIP=Default port for subsystems
-
-RESID_CONNECTION_DESCRIPTION_LABEL=Description
-RESID_CONNECTION_DESCRIPTION_TIP=Commentary description of the connection
-
-RESID_CONNECTION_PROFILE_LABEL=Parent profile
-RESID_CONNECTION_PROFILE_TIP=Select profile to contain this connection
-RESID_CONNECTION_PROFILE_READONLY_TIP=The profile containing this connection
-
-RESID_CONNECTION_VERIFYHOSTNAME_LABEL=Verify host name
-RESID_CONNECTION_VERIFYHOSTNAME_TOOLTIP=Verify a host of the given name or IP address exists
-
-
-
-#=============================================================
-# SYSTEMREGISTRY PROPERTY PAGE DIALOG...
-#=============================================================
-RESID_SYSTEMREGISTRY_TEXT=RemoteSystemsConnections project
-RESID_SYSTEMREGISTRY_CONNECTIONS=Connections
-
-#=============================================================
-# SUBSYSTEM PROPERTY PAGE DIALOG...
-#=============================================================
-RESID_SUBSYSTEM_TITLE=Properties for Subsystem
-RESID_SUBSYSTEM_NAME_LABEL=Name
-RESID_SUBSYSTEM_TYPE_LABEL=Resource type
-RESID_SUBSYSTEM_TYPE_VALUE=Subsystem
-RESID_SUBSYSTEM_VENDOR_LABEL=Vendor
-RESID_SUBSYSTEM_CONNECTION_LABEL=Parent connection
-RESID_SUBSYSTEM_PROFILE_LABEL=Parent profile
-RESID_SUBSYSTEM_PORT_LABEL=Port
-RESID_SUBSYSTEM_PORT_TIP=Port number to connect with
-RESID_SUBSYSTEM_PORT_INHERITBUTTON_TIP=Use first available port, or explicitly set the port number
-RESID_SUBSYSTEM_PORT_INHERITBUTTON_INHERIT_TIP=Click to explicitly set the port number
-RESID_SUBSYSTEM_PORT_INHERITBUTTON_LOCAL_TIP=Click to use first available port
-RESID_SUBSYSTEM_USERID_LABEL=User ID
-RESID_SUBSYSTEM_USERID_TIP=User ID to connect with
-RESID_SUBSYSTEM_USERID_INHERITBUTTON_TIP=Inherit user ID from connection, or set locally for this subsystem
-RESID_SUBSYSTEM_USERID_INHERITBUTTON_INHERIT_TIP=Click to explicitly set the user ID for this subsystem
-RESID_SUBSYSTEM_USERID_INHERITBUTTON_LOCAL_TIP=Click to inherit the user ID from the connection
-
-# Communications property page
-RESID_SUBSYSTEM_SSL_LABEL=Use SSL for network communications
-RESID_SUBSYSTEM_SSL_TIP=Use Secure Sockets Layer (SSL) for communicating with the server
-RESID_SUBSYSTEM_AUTODETECT_LABEL=Auto-detect SSL
-RESID_SUBSYSTEM_AUTODETECT_TIP=Automatically detect whether or not the server uses SSL. On some systems this may cause a longer connection time.
-RESID_SUBSYSTEM_SSL_ALERT_LABEL=Alert me when connecting using SSL
-RESID_SUBSYSTEM_SSL_ALERT_TIP=Show a confirmation dialog when the Secure Sockets Layer (SSL) is used for connecting with the RSE server
-RESID_SUBSYSTEM_NONSSL_ALERT_LABEL=Alert me when connecting insecurely
-RESID_SUBSYSTEM_NONSSL_ALERT_TIP=Show a confirmation dialog when no security layer is used for connecting with the RSE server
-
-# Single signon (Kerberos) Properties Page
-
-# Environment Properties Page
-RESID_SUBSYSTEM_ENVVAR_TITLE= Environment Variables
-RESID_SUBSYSTEM_ENVVAR_DESCRIPTION= Specify the environment variables that will be set when a connection is established:
-RESID_SUBSYSTEM_ENVVAR_TOOLTIP= The environment variables that will be set when a connection is established
-
-RESID_SUBSYSTEM_ENVVAR_NAME_TITLE= Name
-RESID_SUBSYSTEM_ENVVAR_NAME_LABEL= Name:
-RESID_SUBSYSTEM_ENVVAR_NAME_TOOLTIP= Enter a name for the environment variable
-
-RESID_SUBSYSTEM_ENVVAR_VALUE_TITLE= Value
-RESID_SUBSYSTEM_ENVVAR_VALUE_LABEL= Value:
-RESID_SUBSYSTEM_ENVVAR_VALUE_TOOLTIP= Enter a value for the environment variable
-
-
-RESID_SUBSYSTEM_ENVVAR_ADD_TOOLTIP= Add a new environment variable
-RESID_SUBSYSTEM_ENVVAR_REMOVE_TOOLTIP= Remove the selected environment variable
-RESID_SUBSYSTEM_ENVVAR_CHANGE_TOOLTIP= Change the selected environment variable
-RESID_SUBSYSTEM_ENVVAR_MOVEUP_LABEL= Move Up
-RESID_SUBSYSTEM_ENVVAR_MOVEUP_TOOLTIP= Move the selected environment variable(s) up in the list
-RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_LABEL= Move Down
-RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_TOOLTIP= Move the selected environment variable(s) down in the list
-
-# Add / Change Environment Variable Dialog
-RESID_SUBSYSTEM_ENVVAR_ADD_TITLE= Add Environment Variable
-RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE= Change Environment Variable
-
-#=============================================================
-# PROPERTY PAGE DIALOG...
-#=============================================================
-RESID_PROP_SERVERLAUNCHER_MEANS=Indicate how the remote server should be launched
-RESID_PROP_SERVERLAUNCHER_MEANS_LABEL=Launcher
-RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON=Remote daemon
-RESID_PROP_SERVERLAUNCHER_RADIO_REXEC=REXEC
-RESID_PROP_SERVERLAUNCHER_RADIO_NONE=Connect to running server
-RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON_TOOLTIP=Launch the server using a daemon running on the host.
-RESID_PROP_SERVERLAUNCHER_RADIO_REXEC_TOOLTIP=Launch the server using REXEC.
-RESID_PROP_SERVERLAUNCHER_RADIO_NONE_TOOLTIP=Manually launch the server and then connect to it from RSE.
-RESID_PROP_SERVERLAUNCHER_PATH=Path to installed server on host
-RESID_PROP_SERVERLAUNCHER_PATH_TOOLTIP=Specify where the installed server is located on the host.
-RESID_PROP_SERVERLAUNCHER_INVOCATION=Server launch command
-RESID_PROP_SERVERLAUNCHER_INVOCATION_TOOLTIP=Specify the name of the command that invokes the server.
-
-#=============================================================
-# NEW FILTERPOOL WIZARD...
-#=============================================================
-RESID_NEWFILTERPOOL_TITLE=New Filter Pool
-RESID_NEWFILTERPOOL_PAGE1_TITLE=System Filter Pool
-RESID_NEWFILTERPOOL_PAGE1_DESCRIPTION=Define a new pool for filters
-#WIDGETS ON NEW FILTER POOL WIZARD
-RESID_FILTERPOOLNAME_LABEL=Pool name
-RESID_FILTERPOOLNAME_TIP=Enter unique name for the pool within profile
-RESID_FILTERPOOLMANAGERNAME_LABEL=Profile
-RESID_FILTERPOOLMANAGERNAME_TIP=Select profile to contain this pool
-
-#=============================================================
-# COMMON PROPERTIES PAGE WIDGETS...
-#=============================================================
-RESID_PP_PROPERTIES_TYPE_LABEL=Resource type
-RESID_PP_PROPERTIES_TYPE_TOOLTIP=What type of artifact is this?
-
-
-#=============================================================
-# FILTERPOOL PROPERTIES PAGE...
-#=============================================================
-RESID_FILTERPOOL_TITLE=Properties for Filter Pool
-RESID_FILTERPOOL_TYPE_VALUE=Filter pool
-
-RESID_FILTERPOOL_NAME_LABEL=Name
-RESID_FILTERPOOL_NAME_TOOLTIP=Name of this filter pool
-
-RESID_FILTERPOOL_PROFILE_LABEL=Parent profile
-RESID_FILTERPOOL_PROFILE_TOOLTIP=Profile that owns this filter pool
-
-RESID_FILTERPOOL_REFERENCECOUNT_LABEL=Reference count
-RESID_FILTERPOOL_REFERENCECOUNT_TOOLTIP=How many connections show the filters in this pool?
-
-RESID_FILTERPOOL_RELATEDCONNECTION_LABEL=Related connection
-RESID_FILTERPOOL_RELATEDCONNECTION_TOOLTIP=Name of the single connection this pool is private to
-
-#=============================================================
-# FILTERPOOL REFERENCE PROPERTIES PAGE...
-#=============================================================
-RESID_FILTERPOOLREF_TITLE=Properties for Filter Pool Reference
-RESID_FILTERPOOLREF_TYPE_VALUE=Reference to filter pool
-
-RESID_FILTERPOOLREF_NAME_LABEL=Name
-RESID_FILTERPOOLREF_NAME_TOOLTIP=Name of the referenced filter pool
-
-RESID_FILTERPOOLREF_SUBSYSTEM_LABEL=Parent subsystem
-RESID_FILTERPOOLREF_SUBSYSTEM_TOOLTIP=The subsystem which contains this reference
-
-RESID_FILTERPOOLREF_CONNECTION_LABEL=Parent connection
-RESID_FILTERPOOLREF_CONNECTION_TOOLTIP=The connection which owns the subsystem containing this reference
-
-RESID_FILTERPOOLREF_PROFILE_LABEL=Parent profile
-RESID_FILTERPOOLREF_PROFILE_TOOLTIP=The profile which owns the connection containing the subsystem with this reference
-
-#=============================================================
-# FILTER PROPERTIES PAGE...
-#=============================================================
-RESID_PP_FILTER_TITLE_LABEL=Properties for Filter
-RESID_PP_FILTER_TYPE_VALUE=Filter
-RESID_PP_FILTER_TYPE_PROMPTABLE_VALUE=Prompting filter
-RESID_PP_FILTER_TYPE_PROMPTABLE_TOOLTIP=Whether this is a filter that prompts the user when its expanded
-
-RESID_PP_FILTER_NAME_LABEL=Name
-RESID_PP_FILTER_NAME_TOOLTIP=The name of this filter
-
-RESID_PP_FILTER_STRINGCOUNT_LABEL=Number of filter strings
-RESID_PP_FILTER_STRINGCOUNT_TOOLTIP=The number of filter strings contained in this filter
-
-RESID_PP_FILTER_FILTERPOOL_LABEL=Parent filter pool
-RESID_PP_FILTER_FILTERPOOL_TOOLTIP=The filter pool which contains this filter
-
-RESID_PP_FILTER_PROFILE_LABEL=Parent profile
-RESID_PP_FILTER_PROFILE_TOOLTIP=The profile which contains the filter pool with this filter
-
-RESID_PP_FILTER_ISCONNECTIONPRIVATE_LABEL=Connection private
-RESID_PP_FILTER_ISCONNECTIONPRIVATE_TOOLTIP=Whether this is a filter contained in a filter pool that is private to a single connection
-
-#=============================================================
-# FILTERSTRING PROPERTIES PAGE...
-#=============================================================
-RESID_PP_FILTERSTRING_TITLE=Properties for Filter String
-RESID_PP_FILTERSTRING_TYPE_VALUE=Filter string
-
-#=============================================================
-# FILTERSTRING PROPERTIES PAGE...
-#=============================================================
-RESID_PP_FILTERSTRING_TITLE=Properties for Filter String
-
-RESID_PP_FILTERSTRING_TYPE_VALUE==Filter string
-
-RESID_PP_FILTERSTRING_STRING_LABEL=String
-RESID_PP_FILTERSTRING_STRING_TOOLTIP=The actual filter string
-
-RESID_PP_FILTERSTRING_FILTER_LABEL=Parent filter
-RESID_PP_FILTERSTRING_FILTER_TOOLTIP=The filter that contains this filter string
-
-RESID_PP_FILTERSTRING_FILTERPOOL_LABEL=Parent filter pool
-RESID_PP_FILTERSTRING_FILTERPOOL_TOOLTIP=The filter pool that contains the filter with this filter string
-
-RESID_PP_FILTERSTRING_PROFILE_LABEL=Parent profile
-RESID_PP_FILTERSTRING_PROFILE_TOOLTIP=The profile that contains the filter pool with this filter string's filter
-
-#=============================================================
-# SUBSYSTEMFACTORY PROPERTIES PAGE...
-#=============================================================
-RESID_PP_SUBSYSFACTORY_TITLE=Properties for SubSystem Factory
-RESID_PP_SUBSYSFACTORY_VERBAGE=A subsystem factory is responsible for creating and owning subsystem instances, one per connection typically. They may also contain, per profile, team-sharable artifacts.
-
-RESID_PP_SUBSYSFACTORY_ID_LABEL=Identifier
-RESID_PP_SUBSYSFACTORY_ID_TOOLTIP=Unique identifier for this subsystem factory
-
-RESID_PP_SUBSYSFACTORY_VENDOR_LABEL=Vendor
-RESID_PP_SUBSYSFACTORY_VENDOR_TOOLTIP=Vendor who created this subsystem factory
-
-RESID_PP_SUBSYSFACTORY_TYPES_LABEL=System types
-RESID_PP_SUBSYSFACTORY_TYPES_TOOLTIP=System types supported by this factory
-
-#=============================================================
-# NEW FILTER WIZARD...
-#=============================================================
-RESID_NEWFILTER_TITLE=New
-RESID_NEWFILTER_PAGE_TITLE=Filter
-# PAGE 1 OF NEW FILTER WIZARD...
-RESID_NEWFILTER_PAGE1_DESCRIPTION=Create a new filter
-# PAGE 2 OF NEW FILTER WIZARD...
-RESID_NEWFILTER_PAGE2_DESCRIPTION=Name the new filter
-RESID_NEWFILTER_PAGE2_NAME_VERBAGE=Filters are saved for easy re-use. Specify a unique name for this filter. This name will appear in the Remote Systems view, and will be expandable.
-RESID_NEWFILTER_PAGE2_POOL_VERBAGE=Filters are created in filter pools, which are re-usable in multiple connections. Select the pool to create this filter in. The pool names are qualified by their profile name.
-RESID_NEWFILTER_PAGE2_PROFILE_VERBAGE=Select a profile to own the new filter. This determines if it is unique to you, or sharable by the team. It will be placed in the default filter pool for that profile.
-RESID_NEWFILTER_PAGE2_POOL_VERBAGE_TIP=Tip: too many filters? Turn on "Show filter pools in Remote Systems view". Select Preferences from the Window pulldown, then Remote Systems
-
-# PAGE 3 OF NEW FILTER WIZARD...
-RESID_NEWFILTER_PAGE3_DESCRIPTION=Additional Information
-RESID_NEWFILTER_PAGE3_STRINGS_VERBAGE=Tip: Filters can contain multiple filter strings, although this wizard only prompts for one. To add more filter strings, select the filter in the Remote Systems view, and select the Change action from its pop-up menu.
-RESID_NEWFILTER_PAGE3_POOLS_VERBAGE=Tip: Too many filters? Turn on "Show filter pools in Remote Systems view." Select Preferences from the Window pulldown, then Remote Systems.
-
-RESID_FILTERALIAS_LABEL=Filter name:
-RESID_FILTERALIAS_TIP=Enter filter name unique for this filter pool
-RESID_FILTERPARENTPOOL_LABEL=Parent filter pool:
-RESID_FILTERPARENTPOOL_TIP=Filter pool in which this filter will be created
-RESID_FILTERSTRINGS_LABEL=Filter Strings
-RESID_FILTERSTRINGS_TIP=Strings to filter by. Use the pop-up menu for additional actions
-RESID_NEWFILTER_POOLTIP=Tip: too many filters? Turn on "Show filter pools in Remote Systems view." Select Preferences from the Windows pulldown, then Remote Systems.
-
-
-#=============================================================
-# CHANGE SYSTEM FILTER DIALOG...
-#=============================================================
-RESID_CHGFILTER_TITLE=Change System Filter
-RESID_CHGFILTER_LIST_NEWITEM=New filter string
-RESID_CHGFILTER_NAME_LABEL=Filter name:
-RESID_CHGFILTER_NAME_TOOLTIP=Name for this filter. A filter is a named collection of filter strings
-RESID_CHGFILTER_POOL_LABEL=Parent filter pool:
-RESID_CHGFILTER_POOL_TOOLTIP=Filter pool in which this filter exists
-RESID_CHGFILTER_LIST_LABEL=Filter strings:
-RESID_CHGFILTER_LIST_TOOLTIP=Strings to filter by. Use the pop-up menu for additional actions
-RESID_CHGFILTER_LIST_NEWITEM=New filter string
-RESID_CHGFILTER_FILTERSTRING_LABEL=Selected filter string:
-RESID_CHGFILTER_FILTERSTRING_TOOLTIP=Edit the filter string and press Apply to change it in the list
-RESID_CHGFILTER_NEWFILTERSTRING_LABEL=New filter string:
-RESID_CHGFILTER_NEWFILTERSTRING_TOOLTIP=Specify the new filter string, then press Create to add it to this filter
-RESID_CHGFILTER_BUTTON_TEST_LABEL=Test
-RESID_CHGFILTER_BUTTON_TEST_TOOLTIP=Press to test the currently selected filter string
-RESID_CHGFILTER_BUTTON_APPLY_LABEL=Apply
-RESID_CHGFILTER_BUTTON_APPLY_TOOLTIP=Press to apply the changes to the currently selected filter string
-RESID_CHGFILTER_BUTTON_REVERT_LABEL=Revert
-RESID_CHGFILTER_BUTTON_REVERT_TOOLTIP=Press to revert to the last saved values for the currently selected filter string
-RESID_CHGFILTER_BUTTON_CREATE_LABEL=Create
-RESID_CHGFILTER_BUTTON_CREATE_TOOLTIP=Press to create a new filter string in this filter
-
-#=============================================================
-# CREATE UNNAMED FILTER DIALOG...
-#=============================================================
-RESID_CRTFILTER_TITLE=Create Filter
-
-#=============================================================
-# RENAME FILTER DIALOG...
-#=============================================================
-RESID_RENAME_FILTER_TITLE=Rename Filter
-RESID_RENAME_FILTER_PROMPT=Enter the new filter name
-#=============================================================
-# COPY FILTER DIALOG...
-#=============================================================
-RESID_COPY_FILTER_TITLE=Copy Filter
-RESID_COPY_FILTER_PROMPT=Select system to copy to
-#=============================================================
-# NEW FILTER STRING ACTION AND WIZARD...
-#=============================================================
-RESID_NEWFILTERSTRING_TITLE=New System Filter
-RESID_NEWFILTERSTRING_ADD_TITLE=Add...
-RESID_NEWFILTERSTRING_PAGE1_TITLE=System Filter String
-RESID_NEWFILTERSTRING_PAGE1_DESCRIPTION=Create a new filter string
-
-RESID_NEWFILTERSTRING_PREFIX_LABEL=Add...
-RESID_NEWFILTERSTRING_PREFIX_TOOLTIP=Add a new filter string
-
-RESID_NEWFILTERSTRING_PREFIX_PROMPT=Enter a filter string
-
-RESID_FILTERSTRING_STRING_LABEL=Filter string:
-RESID_FILTERSTRING_STRING_TIP=Enter a filter string
-
-#=============================================================
-# CHANGE FILTER STRING ACTION AND DIALOG...
-#=============================================================
-RESID_CHGFILTERSTRING_PREFIX_LABEL=Change...
-RESID_CHGFILTERSTRING_PREFIX_TOOLTIP=Change selected filter string
-RESID_CHGFILTERSTRING_TITLE=Change Filter String
-RESID_CHGFILTERSTRING_PREFIX_PROMPT=Edit the filter string
-
-#=============================================================
-# TEST FILTER STRING DIALOG...
-#=============================================================
-RESID_TESTFILTERSTRING_TITLE=Test Filter String
-RESID_TESTFILTERSTRING_PROMPT_LABEL=Filter string:
-RESID_TESTFILTERSTRING_PROMPT_TOOLTIP=Filter string being tested
-RESID_TESTFILTERSTRING_TREE_TIP=Results of resolving the filter string
-
-
-#=============================================================
-# SELECT REMOTE OBJECT DIALOG...
-#=============================================================
-# unused
-#RESID_SELECTREMOTEOBJECT_PREFIX_QUICKFILTERSTRINGS_LABEL=Quick filter string:
-#RESID_SELECTREMOTEOBJECT_PREFIX_QUICKFILTERSTRINGS_TOOLTIP=Enter simple or generic name to change contents of tree view
-#RESID_SELECTREMOTEOBJECT_PREFIX_GETLISTBUTTON_LABEL=Get list
-#RESID_SELECTREMOTEOBJECT_PREFIX_GETLISTBUTTON_TOOLTIP=Resolves entered filter string and populates tree
-#RESID_SELECTREMOTEOBJECT_EXISTINGFILTERSTRINGS=Existing filter strings
-
-#=============================================================
-# PROMPT FOR PASSWORD DIALOG...
-#=============================================================
-RESID_PASSWORD_TITLE=Enter Password
-RESID_PASSWORD_LABEL=Password
-RESID_PASSWORD_TIP=Enter password for connecting
-RESID_PASSWORD_USERID_LABEL=User ID
-RESID_PASSWORD_USERID_TIP=Enter user ID. It will be remembered
-#NOTE TO TRANSLATER: FOLLOWING LABEL MUST HAVE 2 SPACES IN FRONT OF IT
-# yantzi: artemis 6.0, chagned to save user ID to be consistent with password prompt
-RESID_PASSWORD_USERID_ISPERMANENT_LABEL= Save user ID
-RESID_PASSWORD_USERID_ISPERMANENT_TIP=Select to make user ID change permanent
-RESID_PASSWORD_SAVE_LABEL= Save password
-RESID_PASSWORD_SAVE_TOOLTIP= Save the password for the specified hostname and user ID
-
-#=============================================================
-# CHANGE PASSWORD DIALOG...
-#=============================================================
-RESID_CHANGE_PASSWORD_TITLE=Change password
-RESID_CHANGE_PASSWORD_NEW_LABEL=New password:
-RESID_CHANGE_PASSWORD_NEW_TOOLTIP=Enter your new password
-RESID_CHANGE_PASSWORD_CONFIRM_LABEL=Re-enter to confirm:
-RESID_CHANGE_PASSWORD_CONFIRM_TOOLTIP=Enter your new password again to confirm it
-
-#=============================================================
-# SELECT FILTER POOL DIALOG...
-#=============================================================
-RESID_SELECTFILTERPOOLS_TITLE=Select Filter Pools
-RESID_SELECTFILTERPOOLS_PROMPT=Select filter pools to include in this connection
-
-#=============================================================
-# WORK WITH FILTER POOLS DIALOG...
-#=============================================================
-RESID_WORKWITHFILTERPOOLS_TITLE=Work With Filter Pools
-RESID_WORKWITHFILTERPOOLS_PROMPT=Work with filter pools
-
-#=============================================================
-# WORK WITH HISTORY DIALOG...
-#=============================================================
-RESID_WORKWITHHISTORY_TITLE=Work With History
-RESID_WORKWITHHISTORY_VERBAGE=Remove or re-order history for this GUI control
-RESID_WORKWITHHISTORY_PROMPT=History
-RESID_WORKWITHHISTORY_BUTTON_LABEL=...
-RESID_WORKWITHHISTORY_BUTTON_TIP=Bring up the Work With History dialog
-
-#=============================================================
-# Team View
-#=============================================================
-RESID_TEAMVIEW_SUBSYSFACTORY_VALUE=SubSystem factory
-RESID_TEAMVIEW_USERACTION_VALUE=User action
-RESID_TEAMVIEW_CATEGORY_VALUE=Category
-
-
-RESID_TEAMVIEW_CATEGORY_CONNECTIONS_LABEL=Connections
-RESID_TEAMVIEW_CATEGORY_CONNECTIONS_TOOLTIP=Lists all connections in this profile
-
-RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_LABEL=Filter pools
-RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_TOOLTIP=Lists all filter pools and filters in this profile, per subsystem type that contains them.
-
-RESID_TEAMVIEW_CATEGORY_USERACTIONS_LABEL=User actions
-RESID_TEAMVIEW_CATEGORY_USERACTIONS_TOOLTIP=Lists all user actions defined in this profile, per subsystem type that contains them.
-
-RESID_TEAMVIEW_CATEGORY_COMPILECMDS_LABEL=Compile commands
-RESID_TEAMVIEW_CATEGORY_COMPILECMDS_TOOLTIP=Lists all compile commands defined in this profile, per subsystem type that contains them.
-
-RESID_TEAMVIEW_CATEGORY_TARGETS_LABEL=Targets
-RESID_TEAMVIEW_CATEGORY_TARGETS_TOOLTIP=Lists all targets defined in this profile, per subsystem type that contains them. Targets are used in remote-enabled projects.
-
-
-#=============================================================
-# Specific actions. All actions support:
-# .label for button/menu-item text
-# .tooltip for hover help on pushbuttons
-#=============================================================
-##############################################################
-# ACTION LABELS AND DESCRIPTIONS...
-##############################################################
-ACTION_CASCADING_NEW_LABEL=New
-ACTION_CASCADING_NEW_TOOLTIP=Create a new resource
-
-ACTION_CASCADING_GOTO_LABEL=Go To
-ACTION_CASCADING_GOTO_TOOLTIP=Replace view with previous contents
-
-ACTION_CASCADING_GOINTO_LABEL=Go Into
-ACTION_CASCADING_GOINTO_TOOLTIP=Replace view with children of selected resource. Use Go To to return
-
-ACTION_CASCADING_OPEN_LABEL=Open
-ACTION_CASCADING_OPEN_TOOLTIP=Open in editor
-
-ACTION_CASCADING_OPENWITH_LABEL=Open With
-ACTION_CASCADING_OPENWITH_TOOLTIP=Open new view
-
-ACTION_CASCADING_WORKWITH_LABEL=Work With
-ACTION_CASCADING_WORKWITH_TOOLTIP=Work with resources
-
-ACTION_CASCADING_REMOTESERVERS_LABEL=Remote Servers
-ACTION_CASCADING_REMOTESERVERS_TOOLTIP=Start or stop a server/daemon on the remote system
-ACTION_REMOTESERVER_START_LABEL=Start
-ACTION_REMOTESERVER_START_TOOLTIP=Start this server/daemon on the remote system
-ACTION_REMOTESERVER_STOP_LABEL=Stop
-ACTION_REMOTESERVER_STOP_TOOLTIP=Stop this server/daemon on the remote system
-
-ACTION_CASCADING_EXPAND_LABEL=Expand
-ACTION_CASCADING_EXPAND_TOOLTIP=Expand children with or without subsetting criteria
-ACTION_CASCADING_EXPAND_TO_LABEL=Expand To
-ACTION_CASCADING_EXPAND_TO_TOOLTIP=Expand children with subsetting criteria
-ACTION_CASCADING_EXPAND_ALL_LABEL=All
-ACTION_CASCADING_EXPAND_ALL_TOOLTIP=Expand to show all children
-ACTION_CASCADING_EXPAND_BY_LABEL=By New Expansion Filter...
-ACTION_CASCADING_EXPAND_BY_TOOLTIP=Specify subsetting criteria for children
-ACTION_CASCADING_EXPAND_WORKWITH_LABEL=History...
-ACTION_CASCADING_EXPAND_WORKWITH_TOOLTIP=Work with history of expansion filters
-
-ACTION_CASCADING_VIEW_LABEL=View
-ACTION_CASCADING_VIEW_TOOLTIP=Set viewing options
-
-ACTION_CASCADING_USERID_LABEL=Default User ID
-ACTION_CASCADING_USERID_TOOLTIP=Set default user ID per remote system type
-
-ACTION_CASCADING_PREFERENCES_LABEL=Preferences
-ACTION_CASCADING_PREFERENCES_TOOLTIP=Go to the appropriate preferences page
-
-ACTION_CASCADING_TEAM_LABEL=Team
-ACTION_CASCADING_TEAM_TOOLTIP=Team repository related actions
-ACTION_TEAM_SYNC_LABEL=Synchronize with Stream
-ACTION_TEAM_SYNC_TOOLTIP=Send and receive changes to and from team repository
-
-ACTION_CASCADING_PULLDOWN_LABEL=Profile actions
-ACTION_CASCADING_PULLDOWN_TOOLTIP=Remote system profile actions
-
-ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_LABEL=Filter Pool Reference
-ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_TOOLTIP=Add new reference to existing filter pool
-
-ACTION_TEAM_RELOAD_LABEL=Reload Remote System Explorer
-ACTION_TEAM_RELOAD_TOOLTIP=Reload the Remote System Explorer contents, after synchronizing with a shared repository
-
-ACTION_PROFILE_ACTIVATE_LABEL=Active
-ACTION_PROFILE_ACTIVATE_TOOLTIP=Toggle profile between active and not active
-
-ACTION_PROFILE_MAKEACTIVE_LABEL=Make Active
-ACTION_PROFILE_MAKEACTIVE_TOOLTIP=Make the selected profile(s) active, so its connections, filters and so on are visible in the Remote Systems view.
-
-ACTION_PROFILE_MAKEINACTIVE_LABEL=Make Inactive
-ACTION_PROFILE_MAKEINACTIVE_TOOLTIP=Make the selected profile(s) inactive, so its connections, filters and so on are not visible in the Remote Systems view.
-
-ACTION_PROFILE_COPY_LABEL=Duplicate...
-ACTION_PROFILE_COPY_TOOLTIP=Create a copy of this profile, with a new name. Copies all connections, filters, user actions and compile commands.
-
-ACTION_NEWPROFILE_LABEL=Profile...
-ACTION_NEWPROFILE_TOOLTIP=Create a new profile
-
-ACTION_NEW_PROFILE_LABEL=New Profile...
-ACTION_NEW_PROFILE_TOOLTIP=Create a new profile
-
-ACTION_QUALIFY_CONNECTION_NAMES_LABEL=Qualify Connection Names
-ACTION_QUALIFY_CONNECTION_NAMES_TOOLTIP=Show connection and filter pool names qualified by their profile name
-
-ACTION_RESTORE_STATE_PREFERENCE_LABEL=Restore Previous State
-ACTION_RESTORE_STATE_PREFERENCE_TOOLTIP=If selected, the tree is re-expanded to its previous state, upon startup
-
-ACTION_PREFERENCE_SHOW_FILTERPOOLS_LABEL=Show Filter Pools
-ACTION_PREFERENCE_SHOW_FILTERPOOLS_TOOLTIP=Show filter pools when expanding subsystems
-
-ACTION_NEWCONN_LABEL=New Connection...
-ACTION_NEWCONN_TOOLTIP=Define a connection to remote system
-
-ACTION_ANOTHERCONN_LABEL=Connection...
-ACTION_ANOTHERCONN_TOOLTIP=Define another connection to the same or another remote system
-
-ACTION_UPDATECONN_LABEL=Change
-ACTION_UPDATECONN_TOOLTIP=Change information
-
-ACTION_NEWFILTERSTRING_LABEL=Filter String...
-ACTION_NEWFILTERSTRING_TOOLTIP=Create new filter string for this filter
-
-ACTION_ADDFILTERSTRING_LABEL=Add...
-ACTION_ADDFILTERSTRING_TOOLTIP=Create new filter string
-
-ACTION_UPDATEFILTER_LABEL=Change...
-ACTION_UPDATEFILTER_TOOLTIP=Change this filter's name or contents
-
-ACTION_UPDATEFILTERSTRING_LABEL=Change
-ACTION_UPDATEFILTERSTRING_TOOLTIP=Change this filter string
-
-ACTION_TESTFILTERSTRING_LABEL=Test
-ACTION_TESTFILTERSTRING_TOOLTIP=Test this filter string by resolving it
-
-ACTION_NEWFILTER_LABEL=Filter...
-ACTION_NEWFILTER_TOOLTIP=Create new filter for this filter pool
-
-ACTION_NEWNESTEDFILTER_LABEL=Nested Filter...
-ACTION_NEWNESTEDFILTER_TOOLTIP=Create new filter inside this filter
-
-ACTION_UPDATEFILTER_LABEL=Change...
-ACTION_UPDATEFILTER_TOOLTIP=Work with the filter strings in this filter
-
-ACTION_NEWFILTERPOOL_LABEL=Filter Pool...
-ACTION_NEWFILTERPOOL_TOOLTIP=Create new pool to hold filters
-
-ACTION_ADDFILTERPOOLREF_LABEL=Add Filter Pool Reference
-ACTION_ADDFILTERPOOLREF_TOOLTIP=Add a reference to another existing filter pool
-
-ACTION_RMVFILTERPOOLREF_LABEL=Remove Reference
-ACTION_RMVFILTERPOOLREF_TOOLTIP=Remove filter pool reference
-
-ACTION_SELECTFILTERPOOLS_LABEL=Select Filter Pools...
-ACTION_SELECTFILTERPOOLS_TOOLTIP=Add or remove filter pool references
-
-
-RESID_NEWFILTER_PAGE2_NAME_LABEL=Filter name:
-RESID_NEWFILTER_PAGE2_NAME_TOOLTIP=Enter a unique name for this filter, to show in the Remote Systems view
-RESID_NEWFILTER_PAGE2_PROFILE_LABEL=Owner profile:
-RESID_NEWFILTER_PAGE2_PROFILE_TOOLTIP=Select the profile whose default filter pool is to contain the new filter
-RESID_NEWFILTER_PAGE2_POOL_LABEL=Parent filter pool:
-RESID_NEWFILTER_PAGE2_POOL_TOOLTIP=Select the filter pool in which this filter will be created
-RESID_NEWFILTER_PAGE2_UNIQUE_LABEL=Only create filter in this connection
-RESID_NEWFILTER_PAGE2_UNIQUE_TOOLTIP=Select to create filter in this connection only, de-select to create filter in all applicable connections
-
-
-ACTION_WORKWITH_FILTERPOOLS_LABEL=Filter Pools...
-ACTION_WORKWITH_FILTERPOOLS_TOOLTIP=Create or manage filter pools
-
-ACTION_WORKWITH_WWFILTERPOOLS_LABEL=Work With Filter Pools...
-ACTION_WORKWITH_WWFILTERPOOLS_TOOLTIP=Create or manage filter pools
-
-
-ACTION_WORKWITH_PROFILES_LABEL=Work With Profiles
-ACTION_WORKWITH_PROFILES_TOOLTIP=Switch to the Team view to work with profiles
-
-ACTION_RUN_LABEL=Run
-ACTION_RUN_TOOLTIP=Run this prompt. Same as expanding it
-
-ACTION_SIMPLERENAME_LABEL=Rename...
-ACTION_SIMPLERENAME_TOOLTIP=Rename selected resources
-
-ACTION_IMPORT_TO_PROJECT_LABEL= Import To Project...
-ACTION_IMPORT_TO_PROJECT_TOOLTIP= Import contents of selected folder to a project
-
-ACTION_EXPORT_FROM_PROJECT_LABEL= Export From Project...
-ACTION_EXPORT_FROM_PROJECT_TOOLTIP= Export contents of project to the selected folder
-
-ACTION_REFRESH_ALL_LABEL=Refresh All
-ACTION_REFRESH_ALL_TOOLTIP=Refresh all resource information
-
-ACTION_REFRESH_LABEL=Refresh
-ACTION_REFRESH_TOOLTIP=Refresh information of selected resource
-
-
-ACTION_DELETE_LABEL=Delete...
-ACTION_DELETE_TOOLTIP=Prompts for confirmation to delete selected resources
-
-ACTION_RENAME_LABEL=Rename...
-ACTION_RENAME_TOOLTIP=Rename selected resources
-
-ACTION_NEWFILE_LABEL=File
-ACTION_NEWFILE_TOOLTIP=Create a new File
-
-ACTION_CLEAR_LABEL=Clear
-ACTION_CLEAR_TOOLTIP=Clear the default value for the selected key
-
-ACTION_CLEAR_ALL_LABEL=Remove All From View
-ACTION_CLEAR_ALL_TOOLTIP=Remove all items from the view
-
-ACTION_CLEAR_SELECTED_LABEL=Remove Selected From View
-ACTION_CLEAR_SELECTED_TOOLTIP=Remove the selection from the view
-
-ACTION_MOVEUP_LABEL=Move Up
-ACTION_MOVEUP_TOOLTIP=Move selected resources up by one
-
-ACTION_MOVEDOWN_LABEL=Move Down
-ACTION_MOVEDOWN_TOOLTIP=Move selected resources down by one
-
-ACTION_CONNECT_LABEL=Connect...
-ACTION_CONNECT_TOOLTIP=Connect to remote subsystem
-
-ACTION_CLEARPASSWORD_LABEL=Clear Password
-ACTION_CLEARPASSWORD_TOOLTIP=Clear password from memory and disk
-
-ACTION_DISCONNECT_LABEL=Disconnect
-ACTION_DISCONNECT_TOOLTIP=Disconnect from remote subsystem
-
-ACTION_DISCONNECTALLSUBSYSTEMS_LABEL=Disconnect
-ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP=Disconnect all subsystems
-
-ACTION_CONNECT_ALL_LABEL=Connect
-ACTION_CONNECT_ALL_TOOLTIP=Connect all subsystems
-
-ACTION_CLEARPASSWORD_ALL_LABEL=Clear Passwords
-ACTION_CLEARPASSWORD_ALL_TOOLTIP=Clear passwords from memory and disk for all subsystems
-
-ACTION_SET_LABEL=Set
-ACTION_SET_TOOLTIP=Set the default value for the selected key
-
-ACTION_HISTORY_DELETE_LABEL=Remove
-ACTION_HISTORY_DELETE_TOOLTIP=Remove this item from the history
-
-ACTION_HISTORY_CLEAR_LABEL=Clear
-ACTION_HISTORY_CLEAR_TOOLTIP=Clear all items in this widget's history
-
-ACTION_HISTORY_MOVEUP_LABEL=Move Up
-ACTION_HISTORY_MOVEUP_TOOLTIP=Move selected item up in history
-
-ACTION_HISTORY_MOVEDOWN_LABEL=Move Down
-ACTION_HISTORY_MOVEDOWN_TOOLTIP=Move selected item down in history
-
-ACTION_HISTORY_MOVEFORWARD_LABEL=Move Forward
-ACTION_HISTORY_MOVEFORWARD_TOOLTIP=Move to the next item in history
-
-ACTION_HISTORY_MOVEBACKWARD_LABEL=Move Backward
-ACTION_HISTORY_MOVEBACKWARD_TOOLTIP=Move to the previous item in history
-
-ACTION_COPY_LABEL=Copy
-ACTION_COPY_TOOLTIP=Copy selected resources to same or different parent
-
-ACTION_CUT_LABEL=Cut
-ACTION_CUT_TOOLTIP=Copy selection to clipboard and delete
-
-ACTION_UNDO_LABEL=Undo
-ACTION_UNDO_TOOLTIP=Undo previous edit action
-
-ACTION_PASTE_LABEL=Paste
-ACTION_PASTE_TOOLTIP=Copy clipboard contents
-
-ACTION_COPY_CONNECTION_LABEL=Copy
-ACTION_COPY_CONNECTION_TOOLTIP=Copy selected connection to same or different profile
-
-ACTION_COPY_FILTERPOOL_LABEL=Copy
-ACTION_COPY_FILTERPOOL_TOOLTIP=Copy selected filter pool to same or different profile
-
-ACTION_COPY_FILTER_LABEL=Copy
-ACTION_COPY_FILTER_TOOLTIP=Copy selected filter to same or different filter pool
-
-ACTION_COPY_FILTERSTRING_LABEL=Copy
-ACTION_COPY_FILTERSTRING_TOOLTIP=Copy selected filter string to same or different filter
-
-ACTION_MOVE_LABEL=Move...
-ACTION_MOVE_TOOLTIP=Move selected resources to a different parent
-
-ACTION_MOVE_CONNECTION_LABEL=Move...
-ACTION_MOVE_CONNECTION_TOOLTIP=Move selected connection to a different profile
-
-ACTION_MOVE_FILTERPOOL_LABEL=Move...
-ACTION_MOVE_FILTERPOOL_TOOLTIP=Move selected filter pool to a different profile
-
-ACTION_MOVE_FILTER_LABEL=Move...
-ACTION_MOVE_FILTER_TOOLTIP=Move selected filter to a different filter pool
-
-ACTION_MOVE_FILTERSTRING_LABEL=Move...
-ACTION_MOVE_FILTERSTRING_TOOLTIP=Move selected filter string to a different filter
-
-ACTION_TEAM_BROWSEHISTORY_LABEL=Show in Resource History
-ACTION_TEAM_BROWSEHISTORY_TOOLTIP=Display the version history of this resource
-
-ACTION_TABLE_LABEL=Show in Table
-ACTION_TABLE_TOOLTIP=Display the contents of this resource in a table
-
-ACTION_MONITOR_LABEL=Monitor
-ACTION_MONITOR_TOOLTIP=Display the contents of this resource in a monitoring table
-
-ACTION_ERROR_LIST_LABEL=Show Subsequent Problems in Error List
-ACTION_ERROR_LIST_TOOLTIP=Display all errors, warnings and informational messages that appear from here on in this shell in the Remote Error List view.
-
-ACTION_FIND_FILES_LABEL=Find Files...
-ACTION_FIND_FILES_TOOLTIP=Search for files under the selected resource
-
-ACTION_SEARCH_LABEL=Search...
-ACTION_SEARCH_TOOLTIP=Opens a dialog to search for text and files
-
-ACTION_CANCEL_FIND_FILES_LABEL=Cancel Find Files
-ACTION_CANCEL_FIND_FILES_TOOLTIP=Terminate find files operation
-
-ACTION_CANCEL_SEARCH_LABEL=Cancel Search
-ACTION_CANCEL_SEARCH_TOOLTIP=Terminate search operation
-
-ACTION_LOCK_LABEL=Lock
-ACTION_LOCK_TOOLTIP=Disable the change of view input from another view.
-
-ACTION_UNLOCK_LABEL=Unlock
-ACTION_UNLOCK_TOOLTIP=Enable the change of view input from another view.
-
-ACTION_POSITIONTO_LABEL=Position To...
-ACTION_POSITIONTO_TOOLTIP=Specify objects for the view to scroll to and select
-
-ACTION_SUBSET_LABEL=Subset...
-ACTION_SUBSET_TOOLTIP=Specify objects for the view to show
-
-ACTION_PRINTLIST_LABEL=Print...
-ACTION_PRINTLIST_TOOLTIP=Print the current table
-
-ACTION_SELECTCOLUMNS_LABEL=Customize Table...
-ACTION_SELECTCOLUMNS_TOOLTIP=Select columns to display in the table
-
-ACTION_OPENEXPLORER_CASCADE_LABEL=Open Explorer
-ACTION_OPENEXPLORER_CASCADE_TOOLTIP=Explore this resource in its own view
-
-ACTION_OPENEXPLORER_SAMEPERSP_LABEL=In Same Perspective
-ACTION_OPENEXPLORER_SAMEPERSP_TOOLTIP=Open a new Remote Systems view rooted at this resource
-
-ACTION_OPENEXPLORER_DIFFPERSP_LABEL=In New Perspective
-ACTION_OPENEXPLORER_DIFFPERSP_TOOLTIP=Open a new Remote System Explorer perspective rooted at this resource
-
-ACTION_OPENEXPLORER_DIFFPERSP2_LABEL=Open in New Window
-ACTION_OPENEXPLORER_DIFFPERSP2_TOOLTIP=Open a new workbench window, with the Remote Systems view rooted at this resource
-
-ACTION_REMOTE_PROPERTIES_LABEL=Properties
-ACTION_REMOTE_PROPERTIES_TOOLTIP=Shows remote object properties
-
-ACTION_VIEWFORM_REFRESH_LABEL=Refresh
-ACTION_VIEWFORM_REFRESH_TOOLTIP=Refresh all resource information from disk
-
-ACTION_VIEWFORM_GETLIST_LABEL=Get List
-ACTION_VIEWFORM_GETLIST_TOOLTIP=Retrieve list and populate tree view
-
-
-ACTION_COMMANDSVIEW_SAVEASFILTER_LABEL=Save as Command Set
-ACTION_COMMANDSVIEW_SAVEASFILTER_TOOLTIP=Save the command as a new Command Set
-
-
-ACTION_EXPAND_SELECTED_LABEL=Expand
-ACTION_EXPAND_SELECTED_TOOLTIP=Expand selected elements. '+'
-
-ACTION_COLLAPSE_SELECTED_LABEL=Collapse
-ACTION_COLLAPSE_SELECTED_TOOLTIP=Collapse selected elements. '-'
-
-ACTION_COLLAPSE_ALL_LABEL=Collapse All
-ACTION_COLLAPSE_ALL_TOOLTIP=Collapse whole tree. Ctrl+-
-
-ACTION_EXPAND_BY_LABEL=Expand By
-ACTION_EXPAND_BY_TOOLTIP=Expand with subsetting
-
-ACTION_EXPAND_ALL_LABEL=All
-ACTION_EXPAND_ALL_TOOLTIP=Show all contents
-
-ACTION_EXPAND_OTHER_LABEL=All
-ACTION_EXPAND_OTHER_TOOLTIP=Specify subset criteria for expansion
-
-ACTION_SELECT_ALL_LABEL=Select All
-ACTION_SELECT_ALL_TOOLTIP=Select all child elements. '+'
-
-ACTION_SELECT_INPUT_LABEL=Select Input...
-ACTION_SELECT_INPUT_DLG=Select Input
-ACTION_SELECT_INPUT_TOOLTIP=Select the input for the view
-
-ACTION_DAEMON_START_LABEL=Start Communications Daemon
-ACTION_DAEMON_START_TOOLTIP=Start the RSE communications daemon
-ACTION_DAEMON_STOP_LABEL=Stop Communications Daemon
-ACTION_DAEMON_STOP_TOOLTIP=Stop the RSE communications daemon
-
-ACTION_SELECTCONNECTION_LABEL=Select Connection
-ACTION_SELECTCONNECTION_TOOLTIP=Bring up a dialog for selecting a connection
-
-RESID_USERID_PER_SYSTEMTYPE_LABEL=Default User ID
-RESID_USERID_PER_SYSTEMTYPE_TOOLTIP=Set default user ID per remote system type
-
-#=============================================================
-# Common actions OR menuitems. All actions support:
-# .label for button/menu-item text
-# .tooltip for hover help on pushbuttons
-#=============================================================
-RESID_CHANGE_PREFIX_LABEL=Change
-RESID_CHANGE_PREFIX_TOOLTIP=Change selected item
-
-RESID_CHANGEVIAENTRY_PREFIX_LABEL=Change
-RESID_CHANGEVIAENTRY_PREFIX_TOOLTIP=Replace selected list item with entry field contents
-
-RESID_ADDVIAENTRY_PREFIX_LABEL=Add
-RESID_ADDVIAENTRY_PREFIX_TOOLTIP=Add entry field contents to list
-
-RESID_COPYFROM_PREFIX_LABEL=Copy From...
-RESID_COPYFROM_PREFIX_TOOLTIP=Copy items here from another source
-
-RESID_COPYTO_PREFIX_LABEL=Copy To...
-RESID_COPYTO_PREFIX_TOOLTIP=Copy selected items
-
-RESID_DUPLICATE_PREFIX_LABEL=Duplicate
-RESID_DUPLICATE_PREFIX_TOOLTIP=Create copy of selected item
-
-
-##############################################################
-# Content Assist action
-##############################################################
-ACTION_CONTENT_ASSIST=Content Assist@Ctrl+SPACE
-ACTION_SHOW_TOOLTIP_INFORMATION=Show Tooltip Description@F2
-
-##############################################################
-# COMMON POPUP MENU ITEMS. MNEMONICS WILL BE ASSIGNED AUTOMATICALLY, DON'T SET THEM HERE.
-# THESE ARE MENU-ONLY ITEMS, VS MENU OR BUTTON ACTIONS.
-# THEY GENERALLY ARE USED IN THE SYSTEM TREE VIEW SOMEWHERE.
-##############################################################
-
-
-
-
-##############################################################
-# ERROR MESSAGES
-##############################################################
-
-RESID_MSG_UNABLETOLOAD=Unable to load message &1
-
-
-##############################################################
-# REMOTE FILE SYSTEM TRANSLATABLE STRINGS
-##############################################################
-#=============================================================
-# DEFAULT FILTERS...
-#=============================================================
-#=============================================================
-# NEW FILE FILTER WIZARD...
-#=============================================================
-
-#=============================================================
-# NEW FILE FILTER STRING WIZARD...
-#=============================================================
-
-
-#=============================================================
-# CHANGE FILE FILTER DIALOG...
-#=============================================================
-
-#=============================================================
-# CHANGE FILE FILTER STRING DIALOG...
-#=============================================================
-
-#=============================================================
-# SELECT DIRECTORY DIALOG...
-#=============================================================
-
-
-#=============================================================
-# SELECT FILE DIALOG...
-#=============================================================
-
-
-#=============================================================
-# SELECT FILE OR MEMBER DIALOG...
-#=============================================================
-
-
-#=============================================================
-# PROMPT FOR HOME FOLDER DIALOG...
-#=============================================================
-
-
-#=============================================================
-# FILE SUBSYSTEM ACTIONS...
-#=============================================================
-
-
-
-
-
-
-
-
-#=============================================================
-# REMOTE FILE SYSTEM PROPERTY VALUES
-#=============================================================
-
-#=============================================================
-# REMOTE FILE PROPERTIES PAGE...
-#=============================================================
-
-#=============================================================
-# RE-USABLE COMPOSITE FILE SYSTEM WIDGETS
-#=============================================================
-#=============================================================
-# REMOTE FILE SYSTEM EXCEPTION ERROR MESSAGES
-#=============================================================
-
-#=============================================================
-# REMOTE FILE SYSTEM ERROR MESSAGES
-#=============================================================
-
-# Remote editing progress monitor messages
-
-# Remote edit functionality
-
-# iSeries Editor Save As... Dialog
-
-# CODE editor
-
-# Default Filter Pool names
-RESID_DEFAULT_FILTERPOOL=%1 Filter Pool
-RESID_PERCONNECTION_FILTERPOOL=%1 Filter Pool for connection %2
-
-# Default Team profile name
-
-#==============================================================
-# Signon Information Preferences Page
-#==============================================================
-RESID_PREF_SIGNON_DESCRIPTION= The following user IDs have password information associated with them:
-
-RESID_PREF_SIGNON_HOSTNAME_TITLE= Host Name
-RESID_PREF_SIGNON_HOSTNAME_LABEL= Host name:
-RESID_PREF_SIGNON_HOSTNAME_TOOLTIP= Hostname or IP address of target system
-
-RESID_PREF_SIGNON_SYSTYPE_TITLE= System Type
-RESID_PREF_SIGNON_SYSTYPE_LABEL= System type:
-RESID_PREF_SIGNON_SYSTYPE_TOOLTIP= System type for the remote system
-
-RESID_PREF_SIGNON_USERID_TITLE= User ID
-RESID_PREF_SIGNON_USERID_LABEL= User ID:
-RESID_PREF_SIGNON_USERID_TOOLTIP= User ID used to signon to the remote system
-
-RESID_PREF_SIGNON_ADD_LABEL= Add...
-RESID_PREF_SIGNON_ADD_TOOLTIP= Add a new user ID and password
-
-RESID_PREF_SIGNON_REMOVE_LABEL= Remove
-RESID_PREF_SIGNON_REMOVE_TOOLTIP= Remove the selected user ID and password
-
-RESID_PREF_SIGNON_CHANGE_LABEL= Change...
-RESID_PREF_SIGNON_CHANGE_TOOLTIP= Change the password for the selected user ID
-
-RESID_PREF_SIGNON_PASSWORD_LABEL= Password:
-RESID_PREF_SIGNON_PASSWORD_TOOLTIP= Enter the password for the remote system
-
-RESID_PREF_SIGNON_PASSWORD_VERIFY_LABEL= Verify password:
-RESID_PREF_SIGNON_PASSWORD_VERIFY_TOOLTIP= Re-enter the password for the remote system
-
-RESID_PREF_SIGNON_ADD_DIALOG_TITLE= New Saved Password
-RESID_PREF_SIGNON_CHANGE_DIALOG_TITLE= Change Saved Password
-
-###################################################################################
-######################## Remote Search View ############################
-###################################################################################
-RESID_SEARCH_VIEW_DEFAULT_TITLE= Remote Search
-RESID_SEARCH_REMOVE_SELECTED_MATCHES_LABEL= Remove Selected Matches
-RESID_SEARCH_REMOVE_SELECTED_MATCHES_TOOLTIP= Remove selected matches
-RESID_SEARCH_REMOVE_ALL_MATCHES_LABEL= Remove All Matches
-RESID_SEARCH_REMOVE_ALL_MATCHES_TOOLTIP= Remove all matches
-RESID_SEARCH_CLEAR_HISTORY_LABEL= Clear History
-RESID_SEARCH_CLEAR_HISTORY_TOOLTIP= Clear all search results
-
-###################################################################################
-############################ Table View Dlgs ############################
-###################################################################################
-RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL= Available contents:
-RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL= Displayed contents:
-RESID_TABLE_SELECT_COLUMNS_DESCRIPTION_LABEL= Choose contents to display in the table view.
-
-
-
-###################################################################################
-############################ Monitor View ############################
-###################################################################################
-RESID_MONITOR_POLL_INTERVAL_LABEL=Wait Interval
-RESID_MONITOR_POLL_INTERVAL_TOOLTIP=Specify how long to wait before refreshing the view
-RESID_MONITOR_POLL_LABEL=Poll
-RESID_MONITOR_POLL_TOOLTIP=Periodically refresh the contents
-RESID_MONITOR_POLL_CONFIGURE_POLLING_LABEL=Poll Configuration
-RESID_MONITOR_POLL_CONFIGURE_POLLING_EXPAND_TOOLTIP=Expand to configure polling
-RESID_MONITOR_POLL_CONFIGURE_POLLING_COLLAPSE_TOOLTIP=Collapse to hide polling controls
-
-###################################################################################
-############################ Work With Compile Commands #####################
-###################################################################################
-
-
-##################################################################################
-############################ Browse menu item ##############################
-##################################################################################
-ACTION_CASCADING_BROWSEWITH_LABEL= Browse With
-ACTION_CASCADING_BROWSEWITH_TOOLTIP= Browse resource
-
-##################################################################################
-############################ Compare menu item #############################
-##################################################################################
-ACTION_CASCADING_COMPAREWITH_LABEL= Compare With
-ACTION_CASCADING_COMPAREWITH_TOOLTIP= Compare remote resources
-##################################################################################
-############################ Replace menu item #############################
-##################################################################################
-ACTION_CASCADING_REPLACEWITH_LABEL= Replace With
-ACTION_CASCADING_REPLACEWITH_TOOLTIP= Remote remote resources with local editions
-
-#=============================================================
-# SELECT REMOTE FILES RE-USABLE WIDGET...
-#=============================================================
-RESID_SELECTFILES_SELECTTYPES_BUTTON_ROOT_LABEL=Select Types
-RESID_SELECTFILES_SELECTTYPES_BUTTON_ROOT_TOOLTIP=Select file types to filter by
-RESID_SELECTFILES_SELECTALL_BUTTON_ROOT_LABEL=Select All
-RESID_SELECTFILES_SELECTALL_BUTTON_ROOT_TOOLTIP=Select all files
-RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_LABEL=Deselect All
-RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_TOOLTIP=Deselect all files
-
-
-
-
-# Additions May 15, 2003
-
-##################################################################################
-############################ Offline Support #########################
-##################################################################################
-RESID_OFFLINE_LABEL= Offline
-RESID_OFFLINE_WORKOFFLINE_LABEL= Work Offline
-RESID_OFFLINE_WORKOFFLINE_TOOLTIP= Switch the connection between offline and online modes
-RESID_OFFLINE_WORKOFFLINE_DESCRIPTION= Switch the connection between offline and online modes
-
-#=============================================================
-# ENTER OR SELECT FILE DIALOG...
-#=============================================================
-
-
-##===============================
-# Quick Open
-#================================
-
-#=============================================================
-# RE-USABLE COMPOSITE FILE SYSTEM WIDGETS
-#=============================================================
-
-#==========================
-# Generic Editor Actions
-#==========================
-
-
-###################################################################################
-############################ Table View Dlgs ############################
-###################################################################################
-
-
-RESID_TABLE_POSITIONTO_LABEL=Position To
-RESID_TABLE_POSITIONTO_ENTRY_TOOLTIP=Enter the name filter for the objects that the view is to locate
-RESID_TABLE_SUBSET_LABEL=Subset
-RESID_TABLE_SUBSET_ENTRY_TOOLTIP=Enter a filter pattern for the specified property.
-RESID_TABLE_PRINTLIST_TITLE=Remote Systems Details
-
-
-
-RESID_TABLE_SELECT_COLUMNS_LABEL=Customize Table
-RESID_TABLE_SELECT_COLUMNS_TOOLTIP=Select columns to display in the table
-
-RESID_TABLE_SELECT_COLUMNS_ADD_LABEL=Add>
-RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP=Add the selected properties to be displayed as a column in the table
-
-RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL= <Remove
-RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP=Remove the selected column from the table display
-
-RESID_TABLE_SELECT_COLUMNS_UP_LABEL=Move Up
-RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP=Move the selected column to the left in the table
-
-RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL=Move Down
-RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP=Move the selected column to the right in the table
-
-RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL=Available contents:
-
-RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL=Displayed contents:
-RESID_TABLE_SELECT_COLUMNS_DESCRIPTION_LABEL=Choose contents to display in the table view.
-
-
-#### connectors and services $$$$
-RESID_PROPERTIES_SERVICES_NAME=Services
-RESID_PROPERTIES_SERVICES_LABEL=Available Services
-RESID_PROPERTIES_SERVICES_TOOLTIP=
-RESID_PROPERTIES_DESCRIPTION_LABEL=Description
-RESID_PROPERTIES_CONNECTOR_SERVICES_LABEL=Connector Services
-RESID_PROPERTIES_CONNECTOR_SERVICES_TOOLTIP=
-RESID_PROPERTIES_FACTORIES_LABEL=Configuration
-RESID_PROPERTIES_FACTORIES_TOOLTIP=
-RESID_PROPERTIES_PROPERTIES_LABEL=Properties
-RESID_PROPERTIES_PROPERTIES_TOOLTIP=
-
-ACTION_COMPILE_NOPROMPT_LABEL=Compile
-#### RSE Model Objects ####
-RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION=A filter string is a single string in a filter. It describes which files will pass through the filter.
-RESID_MODELOBJECTS_HOSTPOOL_DESCRIPTION=A host pool is a group of hosts. There is one host pool associated with each profile.
-RESID_MODELOBJECTS_PROFILE_DESCRIPTION=Your profile is the object with which all your unique settings and RSE objects such as connections are associated.
-RESID_MODELOBJECTS_SERVERLAUNCHER_DESCRIPTION=The Server Launcher is an object for storing configuration details about how to launch servers on the remote host.
-RESID_MODELOBJECTS_FILTER_DESCRIPTION=A filter is a collection of filter strings that determines which files will pass through it.
-RESID_MODELOBJECTS_FILTERPOOL_DESCRIPTION=A filter pool is a group of filters. There is one filter pool associated with each profile.
-
-RESID_SERVICESFORM_CONFIGURATION_TOOLTIP=Select the configuration you wish to use to enable this subsystem. A configuration comprises a connector service and a subsystem service.
-RESID_SERVICESFORM_SERVICES_TOOLTIP=Select the elements of your chosen configuration and you can view and edit their properties in the Properties section.
-RESID_SERVICESFORM_CONNECTORSERVICES_TOOLTIP=Select the connector services available to you for this connection and you can view and edit their properties in the Properties section.
-RESID_SERVICESFORM_PROPERTIES_TOOLTIP=Edit the properties of the item selected in the Available Services section by clicking on the property's value.
-
-## Do not show this message again
-RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL = Do not show this message again
-RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP = Select this option if you do not want to see this message again
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemSortableSelection.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemSortableSelection.java
deleted file mode 100644
index 995e20e3a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemSortableSelection.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The TreeViewer widget does not seem to guarantee that multiple-selections are
- * returned sorted in order of appearance in the tree. Some action require they be,
- * such as MoveUp and MoveDown. This class captures the information for each selected item
- * and permits sorting via position, using the Arrays helper class in java.util.
- */
-public class SystemSortableSelection implements Comparable
-{
-
- private Object selectedObject;
- private int position;
-
- /**
- * Constructor for SystemSortableSelection
- */
- public SystemSortableSelection(Object selectedObject)
- {
- super();
- this.selectedObject = selectedObject;
- }
-
- /**
- * Get the selected object
- */
- public Object getSelectedObject()
- {
- return selectedObject;
- }
-
- /**
- * Set the position of the selected object within its parent list
- */
- public void setPosition(int position)
- {
- this.position = position;
- }
-
- /**
- * Get the poisition of the selected object within its parent list
- */
- public int getPosition()
- {
- return position;
- }
-
- /**
- * @see Comparable#compareTo(Object)
- */
- public int compareTo(Object other)
- {
- SystemSortableSelection otherSelectableObject = (SystemSortableSelection)other;
- int otherPosition = otherSelectableObject.getPosition();
- if (position < otherPosition)
- return -1;
- else if (position == otherPosition)
- return 0;
- else
- return 1;
- }
-
- public boolean equals(Object other)
- {
- if (!(other instanceof SystemSortableSelection))
- return super.equals(other);
- SystemSortableSelection otherSelectableObject = (SystemSortableSelection)other;
- int otherPosition = otherSelectableObject.getPosition();
- return (position == otherPosition);
- }
-
- /**
- * Convert structured selection into an array of these objects.
- * YOU MUST CALL SET POSITION AFTER FOR EACH ITEM, BEFORE YOU CAN SORT THIS ARRAY!
- */
- public static SystemSortableSelection[] makeSortableArray(IStructuredSelection selection)
- {
- SystemSortableSelection[] array = new SystemSortableSelection[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- array[idx++] = new SystemSortableSelection(i.next());
- return array;
- }
-
- /**
- * IF YOU HAVE CALLED SETPOSITION ON EACH ITEM IN THE GIVEN ARRAY, THIS WILL SORT THAT ARRAY
- * BY THE POSITION
- */
- public static void sortArray(SystemSortableSelection[] sortableArray)
- {
- Arrays.sort(sortableArray);
- }
-
- /**
- * IF YOU HAVE CALLED SETPOSITION ON EACH ITEM IN THE GIVEN ARRAY, AND CALLED SORTARRAY,
- * THIS CONVERTS INTO A SORTED ARRAY THAT JUST HAS THE ORIGINAL OBJECTS IN IT FROM THE SELECTION LIST.
- */
- public static Object[] getSortedObjects(SystemSortableSelection[] sortedArray, Object[] outputArray)
- {
- //System.out.println("in SystemSortableSelection#getSortedObjects:");
- for (int idx=0;idx<outputArray.length; idx++)
- {
- outputArray[idx] = sortedArray[idx].getSelectedObject();
- //System.out.println("...selected Object: " + outputArray[idx]);
- //System.out.println("...position.......: " + sortedArray[idx].getPosition());
- }
- //System.out.println();
- return outputArray;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemTabFolderLayout.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemTabFolderLayout.java
deleted file mode 100644
index 952256c6c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemTabFolderLayout.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-public class SystemTabFolderLayout extends Layout
-{
-
- protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
-
- Control [] children = composite.getChildren ();
- int count = children.length;
- int maxWidth = 0, maxHeight = 0;
- for (int i=0; i<count; i++) {
- Control child = children [i];
- Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
- maxWidth = Math.max (maxWidth, pt.x);
- maxHeight = Math.max (maxHeight, pt.y);
- }
-
- if (wHint != SWT.DEFAULT)
- maxWidth= wHint;
- if (hHint != SWT.DEFAULT)
- maxHeight= hHint;
-
- return new Point(maxWidth, maxHeight);
-
- }
- protected void layout (Composite composite, boolean flushCache) {
- Rectangle rect= composite.getClientArea();
-
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
-
- // System.out.println("Setting bounds of each page to " + rect);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemWidgetHelpers.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemWidgetHelpers.java
deleted file mode 100644
index eff133753..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemWidgetHelpers.java
+++ /dev/null
@@ -1,1467 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Javier Montalvo Orús (Symbian) - Bug 149151: New Connection first page should use a Listbox for systemtype
- ********************************************************************************/
-
-package org.eclipse.rse.ui;
-import java.util.ArrayList;
-import java.util.Locale;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.widgets.InheritableEntryField;
-import org.eclipse.rse.ui.widgets.SystemHistoryCombo;
-import org.eclipse.rse.ui.widgets.SystemHostCombo;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Static methods that can be used when writing SWT GUI code.
- * They simply make it more productive.
- */
-public class SystemWidgetHelpers {
- public static boolean traceHelpIDs = false;
- public static Label previousLabel;
-
- /**
- * This is the most flexible composite creation method.
- * @param parent Parent composite
- * @param parentSpan number of columns this is to span in the parent's composite
- * @param numColumns number of columns this composite is to have
- * @param border true if you want to show an etched border around the composite
- * @param label optional label to show in the border. Forces border to true
- * @param marginSize the number pixels around the composite. -1 means Eclipse default
- * @param spacingSize the number pixels around the composite controls. -1 means Eclipse default
- */
- public static Composite createComposite(Composite parent, int parentSpan, int numColumns, boolean border, String label, int marginSize, int spacingSize) {
- return createAlignedComposite(parent, parentSpan, numColumns, border, label, marginSize, spacingSize, GridData.FILL);
- }
-
- /**
- * Creates a composite with vertical alignment GridData.VERTICAL_ALIGN_BEGINNING.
- * @param parent Parent composite
- * @param parentSpan number of columns this is to span in the parent's composite
- * @param numColumns number of columns this composite is to have
- * @param border true if you want to show an etched border around the composite
- * @param label optional label to show in the border. Forces border to true
- * @param marginSize the number pixels around the composite. -1 means Eclipse default
- * @param spacingSize the number pixels around the composite controls. -1 means Eclipse default
- */
- public static Composite createVerticalBeginComposite(Composite parent, int parentSpan, int numColumns, boolean border, String label, int marginSize, int spacingSize) {
- return createAlignedComposite(parent, parentSpan, numColumns, border, label, marginSize, spacingSize, GridData.VERTICAL_ALIGN_BEGINNING);
- }
-
- /**
- * Created a composite
- */
- private static Composite createAlignedComposite(Composite parent, int parentSpan, int numColumns, boolean border, String label, int marginSize, int spacingSize, int verticalAlignment) {
- //border = true;
- boolean borderNeeded = border;
- if (label != null)
- borderNeeded = true; // force the case
- int style = SWT.NULL;
- if (borderNeeded)
- style |= SWT.SHADOW_ETCHED_IN;
- Composite composite = null;
- if (borderNeeded) {
- composite = new Group(parent, style);
- if (label != null)
- ((Group) composite).setText(label);
- } else {
- composite = new Composite(parent, style);
- }
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- if (marginSize != -1) {
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- }
- if (spacingSize != -1) {
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- }
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- data.horizontalSpan = parentSpan;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
-
- data.verticalAlignment = verticalAlignment;
- data.grabExcessVerticalSpace = false;
-
- composite.setLayoutData(data);
- return composite;
- }
-
- /**
- * Creates composite control and sets the default layout data.
- * @param parent GridLayout composite to put the new group composite into.
- * @param numColumns Number of columns the new group will contain.
- */
- public static Composite createComposite(Composite parent, int numColumns) {
- boolean testing = false; //true;
- if (testing)
- return createComposite(parent, 1, numColumns, true, Integer.toString(numColumns), -1, -1);
- else
- return createComposite(parent, 1, numColumns, false, null, -1, -1);
- }
-
- /**
- * Creates group composite control and sets the default layout data.
- * Group composites show a visible border line and optional text in it.
- * @param parent GridLayout composite to put the new group composite into.
- * @param numColumns Number of columns the new group will contain.
- * @param label Text to display in the group border. Can be null.
- */
- public static Group createGroupComposite(Composite parent, int numColumns, String label) {
- return (Group) createComposite(parent, 1, numColumns, true, label, -1, -1);
- }
-
- /**
- * Creates "tight" composite control and sets the default layout data.
- * A tight composite is one with no vertical or horizontal spacing, or margin spacing.
- * @param parent GridLayout composite to put the new group composite into.
- * @param numColumns Number of columns the new group will contain.
- */
- public static Composite createTightComposite(Composite parent, int numColumns) {
- return createComposite(parent, 1, numColumns, false, null, 0, 0);
- }
-
- /**
- * Creates "flush" composite control and sets the default layout data.
- * A flush composite is one with no margin spacing but normal inter-component spacing
- * @param parent GridLayout composite to put the new group composite into.
- * @param numColumns Number of columns the new group will contain.
- */
- public static Composite createFlushComposite(Composite parent, int numColumns) {
- return createComposite(parent, 1, numColumns, false, null, 0, -1);
- }
-
- /**
- * Creates a label for use a simple filler, to eat up space. This is for a rigid
- * filler that doesn't consume space.
- * @param parent Composite to put the field into.
- * @param span Horizontal span
- * @param widthHint How wide to make it. Pass -1 to use SWT default
- */
- public static Label createRigidFillerLabel(Composite parent, int span, int widthHint) {
- Label label = new Label(parent, SWT.CENTER);
- label.setText(" "); //$NON-NLS-1$
- GridData data = new GridData();
- data.horizontalSpan = span;
- //System.out.println("in createRigidFillerLabel. span = " + span);
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- if (widthHint != -1)
- data.widthHint = widthHint;
- //else
- // data.widthHint = 5;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Creates a label instance and inserts it into a given GridLayout.
- * @param parent GridLayout composite to put the field into.
- * @param text Text to display in the label.
- */
- public static Label createLabel(Composite parent, String text) {
- return createLabel(parent, text, 1);
- }
-
- /**
- * Creates a label instance and inserts it into a given GridLayout.
- * @param parent Composite to put the field into.
- * @param text Text to display in the label.
- * @param span Horizontal span
- */
- public static Label createLabel(Composite parent, String text, int span) {
- return createLabel(parent, text, span, false);
- }
-
- /**
- * Creates a label instance and inserts it into a given GridLayout, optionally
- * with a border style
- * @param parent Composite to put the field into.
- * @param text Text to display in the label.
- * @param span Horizontal span
- * @param wantBorder true to place border around the label
- */
- public static Label createLabel(Composite parent, String text, int span, boolean wantBorder) {
- int style = SWT.LEFT;
- if (wantBorder)
- style |= SWT.BORDER;
- if (span > 1)
- style |= SWT.WRAP;
- Label label = new Label(parent, style);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = span;
- data.horizontalAlignment = GridData.FILL;
- //data.grabExcessHorizontalSpace = true;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Creates a label instance and inserts it into a given GridLayout. Supports tooltip text
- * @param parent GridLayout composite to put the field into.
- * @param text
- * @param tooltip
- */
- public static Label createLabel(Composite parent, String text, String tooltip)
- {
- Label label = createLabel(parent, text);
- setToolTipText(label, tooltip);
- return label;
- }
-
- /**
- * Creates a label instance and inserts it into a given GridLayout.
- * @param parent Composite to put the field into.
- * @param text
- * @param tooltip
- * @param span Horizontal span
- * @param wantBorder true to place border around the label
- */
- public static Label createLabel(Composite parent, String text, String tooltip, int span, boolean wantBorder)
- {
- Label label = createLabel(parent, text, span, wantBorder);
- setToolTipText(label, tooltip);
- return label;
- }
-
- /**
- * Create a pair of labels, the first being a prompt and the second being a value. A colon
- * is appended to the text of the first label. The text value of the second will be set to "".
- * <p>
- * The first label is set to not grab excess horizontal space, while the second one is, since
- * its contents are variable.
- * <p>
- * To help with initial sizing, the widthHint of the second is set to 100.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the fields into. Will be added sequentially
- * @param label
- * @param tooltip
- * @param wantBorder true if a border is desired around the second label (the value vs the prompt)
- * @return the second label created. Use setText to place the value in it.
- */
- public static Label createLabeledLabel(Composite parent, String label, String tooltip, boolean wantBorder) {
- previousLabel = createLabel(parent, label);
- String text = previousLabel.getText();
- previousLabel.setText(appendColon(text));
- ((GridData) previousLabel.getLayoutData()).grabExcessHorizontalSpace = false;
- Label label2 = createLabel(parent, "", 1, wantBorder); //$NON-NLS-1$
- ((GridData) label2.getLayoutData()).grabExcessHorizontalSpace = true;
- ((GridData) label2.getLayoutData()).widthHint = 100;
- setToolTipText(label2, tooltip);
- return label2;
- }
-
- /**
- * Return the prompting label from the last call to createLabeledXXXX.
- * These methods only return the second control, but we sometimes need access to the label.
- */
- public static Label getLastLabel() {
- return previousLabel;
- }
-
- /**
- * Create a spacer line. No widget returned so we have the freedom to change it over time
- */
- public static void createSpacerLine(Composite parent, int columnSpan, boolean wantBorder) {
- int style = SWT.LEFT; // | SWT.SEPARATOR;
- if (wantBorder)
- style |= SWT.BORDER | SWT.LINE_SOLID;
- if (columnSpan > 1)
- style |= SWT.WRAP;
- Label label = new Label(parent, style);
- //label.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = columnSpan;
- data.horizontalAlignment = GridData.FILL;
- //data.grabExcessHorizontalSpace = true;
- label.setLayoutData(data);
- }
-
-
-
- /**
- * Creates a widget for displaying text verbiage that spans multiple lines. Takes resolved text vs resource bundle id.
- * The returned widget is not typed so we can easily change it in the future if we decide on a better widget.
- * @param parent Composite to put the field into.
- * @param text String is the verbiage text to display
- * @param span Horizontal span
- * @param border true if you want a border around the verbiage
- * @param widthHint number of pixels to limit width to before wrapping. 200 is a reasonable number
- * @return the Label widget, in case you want to tweak it
- */
- public static Label createVerbiage(Composite parent, String text, int span, boolean border, int widthHint) {
- Label widget = new Label(parent, border ? (SWT.LEFT | SWT.WRAP | SWT.BORDER) : (SWT.LEFT | SWT.WRAP));
- widget.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = span;
- data.horizontalAlignment = GridData.FILL;
- data.widthHint = widthHint;
- data.grabExcessHorizontalSpace = true;
- widget.setLayoutData(data);
- return widget;
- }
-
- /**
- * Create a labeled verbage (wrappable label) field and insert it into a GridLayout, and assign tooltip text.
- * After calling this, you must call setText on the result to set its contents.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the field into.
- * @param labelText
- * @param tooltip
- * @param span Horizontal span
- * @param border true if you want a border around the verbage
- * @param widthHint number of pixels to limit width to before wrapping. 200 is a reasonable number
- * @return Label created.
- */
- public static Label createLabeledVerbage(Composite parent, String labelText, String tooltip, int span, boolean border, int widthHint) {
- previousLabel = createLabel(parent, appendColon(labelText));
- Label verbage = createVerbiage(parent, labelText, span, border, widthHint);
- setToolTipText(previousLabel, tooltip);
- setToolTipText(verbage, tooltip);
- return verbage;
- }
-
- /**
- * Create a label to show a command string as it is being built-up in a dialog
- * This version uses a default height of 3 normal lines.
- */
- public static Label createCommandStatusLine(Composite parent, int horizontalSpan) {
- return createCommandStatusLine(parent, horizontalSpan, 3);
- }
-
- /**
- * Create a label to show a command string as it is being built-up in a dialog.
- * This version allows you specify how tall to make it, in terms of normal line height.
- */
- public static Label createCommandStatusLine(Composite parent, int horizontalSpan, int heightInLines) {
- Label commandSoFar = new Label(parent, SWT.LEFT | SWT.WRAP);
- int dx = commandSoFar.getBounds().height;
- //System.out.println("Default label height = " + dx); ALWAYS 0!
- if (dx == 0)
- //dx = 12; // what else?
- dx = 15; // d47377
- GridData data = new GridData();
- data.horizontalSpan = horizontalSpan;
- data.horizontalAlignment = GridData.FILL;
- //data.widthHint = 300;
- data.heightHint = heightInLines * dx;
- data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
- //data.grabExcessVerticalSpace = true;
- commandSoFar.setLayoutData(data);
- return commandSoFar;
- }
-
- /**
- * Create a text field and insert it into a GridLayout.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent GridLayout composite to put the field into.
- * @param listener Listener object to listen for events. Can be null.
- */
- public static Text createTextField(Composite parent, Listener listener) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- if (listener != null)
- text.addListener(SWT.Modify, listener);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 150;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- text.setLayoutData(data);
- return text;
- }
-
- /**
- * Create a text field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the field into.
- * @param listener object to listen for events. Can be null.
- * @param toolTip tooltip text
- */
- public static Text createTextField(Composite parent, Listener listener, String toolTip) {
- Text text = createTextField(parent, listener);
- setToolTipText(text, toolTip);
- return text;
- }
-
- /**
- * Create a labeled text field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the field into.
- * @param listener object to listen for events. Can be null.
- * @param labelText the label
- * @param tooltip the tooltip
- * @return TextField created.
- */
- public static Text createLabeledTextField(Composite parent, Listener listener, String labelText, String tooltip) {
- previousLabel = createLabel(parent, appendColon(labelText));
- Text entry = createTextField(parent, listener, tooltip);
- setToolTipText(previousLabel, tooltip);
- return entry;
- }
-
- /**
- * Create a readonly text field and insert it into a GridLayout.
- * @param parent GridLayout composite to put the field into.
- */
- public static Text createReadonlyTextField(Composite parent) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- text.setEnabled(false);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 150; // defect 45789
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- text.setLayoutData(data);
- return text;
- }
-
- /**
- * Create a readonly text field and insert it into a GridLayout,
- * and assign tooltip text.
- * @param parent composite to put the field into.
- * @param toolTip
- */
- public static Text createReadonlyTextField(Composite parent, String toolTip)
- {
- Text text = createReadonlyTextField(parent);
- setToolTipText(text, toolTip);
- return text;
- }
-
- /**
- * Create a labeled readonly text field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the field into.
- * @param text the label
- * @param tooltip the tooltip
- * @return TextField created.
- */
- public static Text createLabeledReadonlyTextField(Composite parent, String text, String tooltip) {
- previousLabel = createLabel(parent, appendColon(text));
- Text entry = createReadonlyTextField(parent, tooltip);
- setToolTipText(previousLabel, tooltip);
- return entry;
- }
-
- /**
- * Create a multiline text field and insert it into a GridLayout.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent GridLayout composite to put the field into.
- * @param listener Listener object to listen for events. Can be null.
- */
- public static Text createMultiLineTextField(Composite parent, Listener listener, int heightHint) {
- Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
-
- if (listener != null)
- text.addListener(SWT.Modify, listener);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.heightHint = heightHint;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- text.setLayoutData(data);
- return text;
- } // end createMultiLineTextField()
-
- /**
- * Create a multiline labeled text field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the field into.
- * @param listener object to listen for events. Can be null.
- * @param labelString the label
- * @param tooltip the tooltip
- * @return TextField created.
- */
- public static Text createMultiLineLabeledTextField(Composite parent, Listener listener, String labelString, String tooltip, int heightHint) {
- Label label = createLabel(parent, appendColon(labelString));
- Text text = createMultiLineTextField(parent, listener, heightHint);
- setToolTipText(label, tooltip);
- return text;
- } // end createMultiLineLabeledTextField()
-
- /**
- * Creates a new checkbox instance and sets the default
- * layout data. Spans 1 column horizontally.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the checkbox into.
- * @param label to display in the checkbox.
- * @param listener object to listen for events. Can be null.
- */
- public static Button createCheckBox(Composite group, String label, Listener listener) {
- return createCheckBox(group, 1, label, listener);
- }
-
- /**
- * Creates a new checkbox instance with the given horizontal span and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the checkbox into.
- * @param horizontalSpan number of columns this checkbox is to span.
- * @param label to display in the checkbox.
- * @param listener object to listen for events. Can be null.
- */
- public static Button createCheckBox(Composite group, int horizontalSpan, String label, Listener listener) {
- Button button = new Button(group, SWT.CHECK | SWT.LEFT);
- button.setText(label);
- if (listener != null)
- button.addListener(SWT.Selection, listener);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = horizontalSpan;
- button.setLayoutData(data);
- return button;
- }
-
- /**
- * Creates a new checkbox instance and sets the default
- * layout data, and sets the tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the checkbox into.
- * @param listener object to listen for events. Can be null.
- * @param label the label
- * @param tooltip the tooltip
- */
- public static Button createCheckBox(Composite group, Listener listener, String label, String tooltip)
- {
- Button button = createCheckBox(group, label, listener);
- setToolTipText(button, tooltip);
- return button;
- }
-
- /**
- * Creates a new checkbox instance with the given horizontal span and sets the default
- * layout data, and sets the tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the checkbox into.
- * @param horizontalSpan number of columns to span.
- * @param listener object to listen for events. Can be null.
- * @param label the label
- * @param tooltip the tooltip
- */
- public static Button createCheckBox(Composite group, int horizontalSpan, Listener listener, String label, String tooltip)
- {
- Button button = createCheckBox(group, horizontalSpan, label, listener);
- setToolTipText(button, tooltip);
- return button;
- }
-
- /**
- * Creates a new radiobutton instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display in the button
- * @param listener object to listen for events. Can be null.
- */
- public static Button createRadioButton(Composite group, String label, Listener listener) {
- Button button = new Button(group, SWT.RADIO | SWT.LEFT);
- button.setText(label);
- if (listener != null)
- button.addListener(SWT.Selection, listener);
- GridData data = new GridData();
- // following 2 lines added in R2 by Phil, to be consistent with checkboxes
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- button.setLayoutData(data);
- return button;
- }
-
- /**
- * Creates a new radiobutton instance and sets the default
- * layout data, and assigns tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- * @param label the label
- * @param tooltip the tooltip
- */
- public static Button createRadioButton(Composite group, Listener listener, String label, String tooltip)
- {
- Button button = createRadioButton(group, label, listener);
- setToolTipText(button, tooltip);
- return button;
- }
-
- /**
- * Creates a new radiobutton instance and sets the default
- * layout data, and assigns tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- * @param label the label
- */
- public static Button createRadioButton(Composite group, Listener listener, String label)
- {
- Button button = createRadioButton(group, label, listener);
- return button;
- }
-
- /**
- * Creates a new pushbutton instance with an image, vs text.
- * SWT does not allow both image and text on a button.
- * Assign the listener to the passed in implementer of Listener.
- * @param group The composite to put the button into.
- * @param image The image to display in the button
- * @param listener The object to listen for events. Can be null.
- */
- public static Button createImageButton(Composite group, Image image, Listener listener) {
- Button button = new Button(group, SWT.PUSH);
- button.setImage(image);
- if (listener != null)
- button.addListener(SWT.Selection, listener);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- button.setLayoutData(data);
- return button;
- }
-
- /**
- * Creates a new pushbutton instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display in the button
- * @param listener object to listen for events. Can be null.
- */
- public static Button createPushButton(Composite group, String label, Listener listener) {
- Button button = new Button(group, SWT.PUSH);
- button.setText(label);
- if (listener != null)
- button.addListener(SWT.Selection, listener);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- button.setLayoutData(data);
- return button;
- }
-
- /**
- * Creates a new pushbutton instance and sets the default
- * layout data, and assign tooltip text
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display in the button
- * @param listener object to listen for events. Can be null.
- * @param tooltip the tooltip
- */
- public static Button createPushButton(Composite group, String label, Listener listener, String tooltip) {
- Button button = createPushButton(group, label, listener);
- setToolTipText(button, tooltip);
- return button;
- }
-
- /**
- * This one takes the resource bundle key and appends "label" and "tooltip" to it to
- * get the label and tooltip text.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- * @param label the label
- * @param tooltip the tooltip
- */
- public static Button createPushButton(Composite group, Listener listener, String label, String tooltip)
- {
- Button button = createPushButton(group, label, listener);
- setToolTipText(button, tooltip);
- return button;
- }
-
- /**
- * Creates a new "Browse..." pushbutton instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- */
- public static Button createBrowseButton(Composite group, Listener listener)
- {
- String label = SystemResources.BUTTON_BROWSE;
- return createPushButton(group, label, listener);
- }
- /**
- * Creates a new "Browse..." pushbutton instance and sets the default
- * layout data, with tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- * @param bundle ResourceBundle of tooltip text
- * @param id bundle key for tooltip text
- * @deprecated
- */
- public static Button createBrowseButton(Composite group, Listener listener, String tooltip) {
- String label = SystemResources.BUTTON_BROWSE;
- return createPushButton(group, label, listener, tooltip);
- }
-
- /**
- * Creates a readonly system type listbox.
- * Does NOT create the leading prompt or anything except the listbox.
- * @param group composite to put the listbox into.
- * @param listener object to listen for events. Can be null.
- * @return empty listbox
- */
- public static List createSystemTypeListBox(Composite group, Listener listener) {
- return createSystemTypeListBox(group, listener, null);
- }
-
- /**
- * Creates a readonly system type listbox with the given system types.
- * Does NOT create the leading prompt or anything except the listbox.
- * @param group composite to put the listbox into.
- * @param listener object to listen for events. Can be null.
- * @param systemTypes array of system types to add to the listbox
- * @return listbox containing the given system types
-
- */
- public static List createSystemTypeListBox(Composite group, Listener listener, String[] systemTypes) {
- List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
- String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes);
-
- if (systemTypes == null) {
- for (int i = 0; i < typeItems.length; i++) {
- ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
-
- if (configurations != null && configurations.length > 0) {
- list.add(typeItems[i]);
- }
- }
- }
-
- list.select(0);
-
- return list;
- }
-
-
- /**
- * Creates a new listbox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display above the list box (can be null).
- * @param listener object to listen for events. Can be null.
- * @param multiSelect true if this is to be a multiple selection list. False for single selection.
- */
- public static List createListBox(Composite group, String label, Listener listener, boolean multiSelect) {
- return createListBox(group, label, listener, multiSelect, 1);
- }
-
- /**
- * Creates a new listbox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display above the list box (can be null).
- * @param listener object to listen for events. Can be null.
- * @param multiSelect true if this is to be a multiple selection list. False for single selection.
- * @param columnSpan number of columns this should span
- */
- public static List createListBox(Composite group, String label, Listener listener, boolean multiSelect, int columnSpan) {
- Composite composite_list = null;
- if (label != null) {
- composite_list = createComposite(group, 1);
- ((GridLayout) composite_list.getLayout()).marginWidth = 0;
- GridData data = new GridData();
- data.horizontalSpan = columnSpan;
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- composite_list.setLayoutData(data);
- previousLabel = createLabel(composite_list, label);
- }
- int styles = SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER;
- List list = new List((composite_list != null) ? composite_list : group, multiSelect ? (SWT.MULTI | styles) : (SWT.SINGLE | styles));
- if (listener != null)
- list.addListener(SWT.Selection, listener);
- GridData data = new GridData();
- data.widthHint = 100;
- data.heightHint = 150;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = GridData.FILL;
- list.setLayoutData(data);
- return list;
- }
-
- /**
- * Creates a new listbox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param label to display above the list box (can be null).
- * @param listener object to listen for events. Can be null.
- * @param multiSelect true if this is to be a multiple selection list. False for single selection.
- * @param tooltip the tooltip
- */
- public static List createListBox(Composite group, String label, Listener listener, boolean multiSelect, String tooltip) {
- List list = createListBox(group, label, listener, multiSelect);
- setToolTipText(list, tooltip);
- return list;
- }
-
- /**
- * Creates a new listbox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param group composite to put the button into.
- * @param listener object to listen for events. Can be null.
- * @param multiSelect true if this is to be a multiple selection list. False for single selection.
- * @param label the label
- * @param tooltip the tooltip
- */
- public static List createListBox(Composite group, Listener listener, boolean multiSelect, String label, String tooltip) {
- List list = createListBox(group, label, listener, multiSelect);
- setToolTipText(list, tooltip);
- return list;
- }
-
- /**
- * Creates a new combobox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the button into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- */
- public static Combo createCombo(Composite parent, Listener listener) {
- Combo combo = createCombo(parent, SWT.DROP_DOWN);
- if (listener != null)
- combo.addListener(SWT.Selection, listener);
- return combo;
- }
-
- /**
- * private method for re-use
- */
- private static Combo createCombo(Composite parent, int style) {
- Combo combo = new Combo(parent, style);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 150;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- combo.setLayoutData(data);
- return combo;
- }
-
- /**
- * Creates a new combobox instance and sets the default
- * layout data, with tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the combo into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- * @param toolTip tooltip text
- */
- public static Combo createCombo(Composite parent, Listener listener, String toolTip)
- {
- Combo combo = createCombo(parent, listener);
- setToolTipText(combo, toolTip);
- return combo;
- }
-
- /**
- * Create a labeled combo field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the field into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- * @param label the label text
- * @param tooltip the tooltip for the combo field
- * @return Combo created.
- */
- public static Combo createLabeledCombo(Composite parent, Listener listener, String label, String tooltip)
- {
- previousLabel = createLabel(parent, appendColon(label));
- Combo entry = createCombo(parent, listener, tooltip);
- setToolTipText(previousLabel, tooltip);
- return entry;
- }
-
- /**
- * Creates a new readonly combobox instance and sets the default
- * layout data.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the button into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- */
- public static Combo createReadonlyCombo(Composite parent, Listener listener) {
- Combo combo = createCombo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- if (listener != null)
- combo.addListener(SWT.Selection, listener);
- return combo;
- }
-
- /**
- * Creates a new readonly combobox instance and sets the default
- * layout data, with tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * @param parent composite to put the button into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- * @param tooltip
- */
- public static Combo createReadonlyCombo(Composite parent, Listener listener, String tooltip)
- {
- Combo combo = createReadonlyCombo(parent, listener);
- setToolTipText(combo, tooltip);
- return combo;
- }
-
- /**
- * Create a labeled readonly combo field and insert it into a GridLayout, and assign tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * If you need a handle to the prompting label, immediately call {@link #getLastLabel()}
- *
- * @param parent composite to put the field into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- * @param labelText the label
- * @param tooltip the tooltip
- * @return Combo created.
- */
- public static Combo createLabeledReadonlyCombo(Composite parent, Listener listener, String labelText, String tooltip)
- {
- labelText = appendColon(labelText);
- previousLabel = createLabel(parent, labelText);
- Combo entry = createReadonlyCombo(parent, listener, tooltip);
- setToolTipText(previousLabel, tooltip);
- return entry;
- }
-
- /**
- * Creates a new historical combobox instance and sets the default
- * layout data, with tooltip text.
- * <p>
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * A historical combobox is one that persists its contents between sessions. The management
- * of that persistence is handled for you!.
- * <p>
- * @param parent composite to put the combo into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
- * @param historyKey the preferences key (any unique string) to use to persist this combo's history
- * @param readonly true if this combo is to be readonly, forcing user to select from the history
- * @param tooltip the tooltip
- */
- public static SystemHistoryCombo createHistoryCombo(Composite parent, SelectionListener listener, String historyKey, boolean readonly, String tooltip)
- {
- SystemHistoryCombo combo = new SystemHistoryCombo(parent, SWT.NULL, historyKey, readonly);
- if (listener != null)
- combo.addSelectionListener(listener);
- boolean hasGridData = (combo.getLayoutData() != null) && (combo.getLayoutData() instanceof GridData);
- //System.out.println("history combo griddata non-null? " + hasGridData);
- int minwidth = 150;
- if (!hasGridData) {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = minwidth;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- combo.setLayoutData(data);
- } else {
- ((GridData) combo.getLayoutData()).horizontalAlignment = GridData.FILL;
- ((GridData) combo.getLayoutData()).grabExcessHorizontalSpace = true;
- ((GridData) combo.getLayoutData()).widthHint = minwidth;
- }
- setToolTipText(combo, tooltip);
- return combo;
- }
-
-
-
-
- /**
- * Creates a new remote system connection combobox instance and sets the default
- * layout data, with tooltip text.
- * <p>
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * A remote system connection combobox is one that allows users to select a connection. The connection
- * list can be subsetted by system type, subsystem factory or subsystem factory category.
- * It has a "Connection:" prompt in front of it and optionally a "New..." button beside it.
- * <p>
- * @param parent composite to put the combo into.
- * @param listener object to listen for selection events. Can be null.
- * If you want to listen for modify events, call addSelectionListener(...) on your own.
- * @param systemTypes array of system types to subset connection list by. Specify a single entry of '*' for
- * all system types. Specify this <i>OR</i> specify factory <i>OR</i> specify factoryCategory
- * <i>OR</i> specify factory Id
- * @param factory the subsystem factory to subset connection list by. Only connections with a subsystem
- * owned by this factory are listed. Specify this <i>OR</i> specify systemTypes <i>OR</i> specify factoryCategory
- * <i>OR</i> specify factory Id
- * @param factoryId the subsystem factory id to subset connection list by. Only connections with a
- * subsystem owned by this factory are listed, where id is a string specified in the
- * plugin.xml file for the subsystem factory extension point definition.
- * Specify this <i>OR</i> specify factory <i>OR</i> specify systemTypes <i>OR</i> specify factory category
- * @param factoryCategory the subsystem factory category to subset connection list by. Only connections with a
- * subsystem owned by a factory of this category are listed, where category is a string specified in the
- * plugin.xml file for the subsystem factory extension point definition.
- * Specify this <i>OR</i> specify factory <i>OR</i> specify factory Id <i>OR</i> specify systemTypes
- * @param defaultConnection the connection to pre-select. Can be null.
- * @param horizontalSpan number of columns this should span
- * @param newButton true if the combo is to have a "New..." button beside it
- */
- public static SystemHostCombo createConnectionCombo(Composite parent, SelectionListener listener, String[] systemTypes, ISubSystemConfiguration factory, String factoryId, String factoryCategory, IHost defaultConnection, int horizontalSpan, boolean newButton) {
- SystemHostCombo combo = null;
- if (systemTypes != null)
- combo = new SystemHostCombo(parent, SWT.NULL, systemTypes, defaultConnection, newButton);
- else if (factory != null)
- combo = new SystemHostCombo(parent, SWT.NULL, factory, defaultConnection, newButton);
- else if (factoryId != null)
- combo = new SystemHostCombo(parent, SWT.NULL, defaultConnection, factoryId, newButton);
- else if (factoryCategory != null)
- combo = new SystemHostCombo(parent, SWT.NULL, defaultConnection, newButton, factoryCategory);
- if (listener != null)
- combo.addSelectionListener(listener);
- boolean hasGridData = (combo.getLayoutData() != null) && (combo.getLayoutData() instanceof GridData);
- //System.out.println("history directory griddata non-null? " + hasGridData);
- int minwidth = 250; // todo: tweak this?
- if (!hasGridData) {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = minwidth;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- data.horizontalSpan = horizontalSpan;
- combo.setLayoutData(data);
- } else {
- ((GridData) combo.getLayoutData()).horizontalSpan = horizontalSpan;
- ((GridData) combo.getLayoutData()).horizontalAlignment = GridData.FILL;
- ((GridData) combo.getLayoutData()).grabExcessHorizontalSpace = true;
- ((GridData) combo.getLayoutData()).widthHint = minwidth;
- }
- return combo;
- }
-
- /**
- * Creates a readonly system type combination box.
- * Does NOT create the leading prompt or anything except the combo.
- */
- public static Combo createSystemTypeCombo(Composite parent, Listener listener) {
- return createSystemTypeCombo(parent, listener, null);
- }
-
- /**
- * Creates a readonly system type combination box with the given system types.
- * Does NOT create the leading prompt or anything except the combo.
- */
- public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) {
- Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
- String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes);
-
- ArrayList list = new ArrayList();
-
- if (systemTypes == null) {
- for (int i = 0; i < typeItems.length; i++) {
- ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
-
- if (configurations != null && configurations.length > 0) {
- list.add(typeItems[i]);
- }
- }
- }
-
- typeItems = new String[list.size()];
-
- for (int i = 0; i < list.size(); i++) {
- typeItems[i] = (String)(list.get(i));
- }
-
- combo.setItems(typeItems);
- combo.select(0);
- return combo;
- }
-
- /**
- * Creates a hostname combination box. It if prefilled with all previously specified hostnames
- * for the given system type.
- * <p>
- * Does NOT create the leading prompt or anything except the combo.
- */
- public static Combo createHostNameCombo(Composite parent, Listener listener, String systemType) {
- //System.out.println("TipId: " + ISystemConstants.RESID_HOSTNAME_TIP);
- Combo combo = createCombo(parent, listener, SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
- //System.out.println("Tip : " + combo.getToolTipText());
- combo.setItems(RSEUIPlugin.getTheSystemRegistry().getHostNames(systemType));
- combo.select(0);
- return combo;
- }
-
-
-
-
-
- /**
- * Create an entry field controlled by an inherit/override switch button
- * <p>
- * After creating the widget, call setLocal to set initial state, and setInheritedText/setLocalText to set inherited/local text
- * @param parent composite to put the button into.
- * @param toggleToolTip text for the toggle. Can be null
- * @param entryToolTip text for the entry field. Can be null
- * @return The text field widget
- */
- public static InheritableEntryField createInheritableTextField(Composite parent, String toggleToolTip, String entryToolTip)
- {
- InheritableEntryField entryField = new InheritableEntryField(parent, SWT.NULL);
- if (toggleToolTip != null)
- entryField.setToggleToolTipText(toggleToolTip);
- if (entryToolTip != null)
- entryField.setTextFieldToolTipText(entryToolTip);
- return entryField;
- }
-
- /**
- * Helper method to line up the leading prompts in a composite, taking
- * into account composite prompts nested within.
- */
- public static void lineUpPrompts(Composite composite) {
- //System.out.println("Inside lineUpPrompts:");
- composite.layout(true);
- // FIND SIZE OF FIRST LABEL IN FIRST COLUMN (WILL ALL BE SAME SIZE)...
- Label firstLabel = getFirstColumnOneLabel(composite);
- // FIND MAX SIZE OF FIRST LABEL IN ALL NESTED COMPOSITES (WILL ALL BE DIFFERENT SIZES)...
- //System.out.println("Scanning nested composites:");
- int nbrColumns = ((GridLayout) composite.getLayout()).numColumns;
- Control[] childControls = composite.getChildren();
- int maxNestedLabelWidth = 0;
- int currColumn = 0;
- if ((childControls != null) && (childControls.length > 0)) {
- for (int idx = 0;(idx < childControls.length); idx++) {
- int rem = currColumn % nbrColumns;
- //System.out.println("...1.rem = " + rem);
- if ((currColumn == 0) || (rem == 0)) {
- if (childControls[idx] instanceof Composite) {
- Label firstNestedLabel = getFirstColumnOneLabel((Composite) childControls[idx]);
- if (firstNestedLabel != null) {
- if (firstNestedLabel.getSize().x > maxNestedLabelWidth)
- maxNestedLabelWidth = firstNestedLabel.getSize().x;
- }
- }
- }
- currColumn += ((GridData) childControls[idx].getLayoutData()).horizontalSpan;
- }
- //System.out.println("Max nested label size = " + maxNestedLabelWidth);
- }
-
- // DECIDE WHAT MAXIMUM WIDTH IS
- int columnOneWidth = 0;
- if (firstLabel != null)
- columnOneWidth = firstLabel.getSize().x;
- if (maxNestedLabelWidth > columnOneWidth)
- columnOneWidth = maxNestedLabelWidth;
- //System.out.println("Calculated column one width = " + columnOneWidth);
- // APPLY NEW WIDTH TO FIRST COLUMN ONE LABEL
- if (firstLabel != null)
- ((GridData) firstLabel.getLayoutData()).widthHint = columnOneWidth;
- // APPLY NEW WIDTH TO FIRST COLUMN ONE LABEL OF ALL NESTED COMPOSITES...
- currColumn = 0;
- if ((childControls != null) && (childControls.length > 0)) {
- for (int idx = 0;(idx < childControls.length); idx++) {
- int rem = currColumn % nbrColumns;
- if ((currColumn == 0) || (rem == 0)) {
- if (childControls[idx] instanceof Composite) {
- Label firstNestedLabel = getFirstColumnOneLabel((Composite) childControls[idx]);
- if (firstNestedLabel != null)
- ((GridData) firstNestedLabel.getLayoutData()).widthHint = columnOneWidth;
- }
- }
- currColumn += ((GridData) childControls[idx].getLayoutData()).horizontalSpan;
- }
- }
- composite.layout(true);
- }
-
- /**
- * Given a composite that has been layed out, return the first label found in the first column.
- */
- public static Label getFirstColumnOneLabel(Composite composite) {
- //System.out.println("...Inside getFirstColumnOneLabel:");
- int nbrColumns = ((GridLayout) composite.getLayout()).numColumns;
- Control[] childControls = composite.getChildren();
- Label firstLabel = null;
- int currColumn = 0;
- if ((childControls != null) && (childControls.length > 0)) {
- for (int idx = 0;(firstLabel == null) && (idx < childControls.length); idx++) {
- int rem = currColumn % nbrColumns;
- //System.out.println("......0.rem = " + rem);
- if ((currColumn == 0) || (rem == 0)) {
- if (childControls[idx] instanceof Label) {
- firstLabel = (Label) childControls[idx];
- if (firstLabel.getText().trim().length() == 0)
- firstLabel = null; // skip it. Only a filler.
- }
- }
- currColumn += ((GridData) childControls[idx].getLayoutData()).horizontalSpan;
- }
- }
- //if (firstLabel != null)
- // System.out.println("...returning first label of '"+firstLabel.getText()+"', width = " + firstLabel.getSize().x);
- //else
- // System.out.println("...no first label found");
- return firstLabel;
- }
-
- /**
- * Given a Composite, this method walks all the children recursively and
- * and sets the mnemonics uniquely for each child control where a
- * mnemonic makes sense (eg, buttons).
- * The letter/digit chosen for the mnemonic is unique for this Composite,
- * so you should call this on as high a level of a composite as possible
- * per Window.
- * Call this after populating your controls.
- * @return mnemonics object used for recording used-mnemonics. Use this
- * as input to subsequent calls to setMnemonics for the same window/dialog.
- */
- public static Mnemonics setMnemonics(Composite parent) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
- */
- public static Mnemonics setMnemonics(Composite parent, boolean applyToPrecedingLabels) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setApplyMnemonicsToPrecedingLabels(applyToPrecedingLabels);
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but specifically for wizard pages
- */
- public static Mnemonics setWizardPageMnemonics(Composite parent) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setOnWizardPage(true);
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
- */
- public static Mnemonics setWizardPageMnemonics(Composite parent, boolean applyToPrecedingLabels) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setOnWizardPage(true);
- mnemonics.setApplyMnemonicsToPrecedingLabels(applyToPrecedingLabels);
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but specifically for preference pages
- */
- public static Mnemonics setPreferencePageMnemonics(Composite parent) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setOnPreferencePage(true);
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
- */
- public static Mnemonics setPreferencePageMnemonics(Composite parent, boolean applyToPrecedingLabels) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics for composite and nested composites
- mnemonics.setOnPreferencePage(true);
- mnemonics.setApplyMnemonicsToPrecedingLabels(applyToPrecedingLabels);
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
-
- /**
- * Same as above but takes as input a previously populated mnemonics object,
- * which records already-used mnemonics for whatever scope you want (a dialog usually).
- */
- public static Mnemonics setMnemonics(Mnemonics mnemonics, Composite parent) {
- mnemonics.setMnemonics(parent);
- return mnemonics;
- }
- /**
- * Given an SWT Menu, "walk it" and automatically assign unique
- * mnemonics for every menu item in it, and then for each
- * submenu, do so for it too.
- * @param menu the menubar to add mnemonics for
- */
- public static void setMnemonics(Menu menu) {
- Mnemonics mnemonics = new Mnemonics(); // instance of this class to get unique mnemonics FOR THIS MENU ONLY
- // walk the menu bar getting each menu...
- MenuItem menuItems[] = menu.getItems();
- for (int idx = 0; idx < menuItems.length; idx++) {
- MenuItem currMenuItem = menuItems[idx];
- // assign unique mnemonic from characters in menu text...
- currMenuItem.setText(mnemonics.setUniqueMnemonic(currMenuItem.getText()));
- // for a cascade or popup, this menuitem is itself a menu
- Menu nestedMenu = currMenuItem.getMenu();
- if (nestedMenu != null)
- setMnemonics(nestedMenu);
- } // end for all menus loop
- } // end addMnemonicsForMenuBar
-
- /**
- * Given a Composite, this method walks all the children recursively and
- * and sets the infopop help id for each child control where help
- * makes sense (eg, buttons, combos, entry fields, lists, trees).
- * <p>
- * Call this after populating your controls.
- */
- public static void setCompositeHelp(Composite parent, String helpID) {
- //setCompositeHelp(parent, helpID, (Hashtable)null);
- setHelp(parent, helpID);
- }
-
- /**
- * Set the context id for a control on a view part
- * @deprecated
- */
- public static void setHelp(Control c, IViewPart view, Object id) {
- //ViewContextComputer comp = new ViewContextComputer(view, id);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, id.toString());
- if (traceHelpIDs)
- SystemBasePlugin.logInfo("Setting help id: " + id);
- }
-
- /**
- * Set the context id for a control
- */
- public static void setHelp(Control c, String id) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, id);
- }
-
- /**
- * Set the context id for an action
- */
- public static void setHelp(IAction c, String id) {
- String[] ids = new String[1];
- ids[0] = id;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, id);
- }
-
- /**
- * Set the context id for a menu item
- */
- public static void setHelp(MenuItem c, String id) {
- String[] ids = new String[1];
- ids[0] = id;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, id);
- //setHelp(c, ids);
- }
-
- private static char STANDARD_COLON = ':';
- private static char WIDE_COLON = '\uFF1A';
- /**
- * Appends a colon to a label, if the label doesn't already end in a colon of the proper size.
- * If the wrong size colon is already there, it strips it first.
- * @param label
- * @return the label ending with a colon of the appropriate size
- */
- public static String appendColon(String label) {
- /* Added for Defect 47275 */
- String result = label;
- boolean append = false;
- boolean strip = false;
- Locale currentLocale = Locale.getDefault();
- String language = currentLocale.getLanguage();
- boolean cjk = language.equals("zh") || language.equals("ja") || language.equals("ko"); //$NON-NLS-1$ //$NON-NLS-2$
- int n = result.length();
- if (n > 0) {
- char lastCharacter = label.charAt(n - 1);
- if (cjk) {
- strip = (lastCharacter == STANDARD_COLON);
- append = (lastCharacter != WIDE_COLON);
- } else {
- strip = (lastCharacter == WIDE_COLON);
- append = (lastCharacter != STANDARD_COLON);
- }
- } else {
- strip = false;
- append = true;
- }
- if (strip) {
- result = result.substring(0, n - 1);
- }
- if (append) {
- result += (cjk ? WIDE_COLON : STANDARD_COLON);
- }
- return result;
- }
-
-
-
-
- /**
- * Set tooltip text
- * If key does not end in "tooltip", then this is appended to it
- */
- private static void setToolTipText(Control widget, String tooltip) {
- if (tooltip != null)
- widget.setToolTipText(tooltip);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayDialogAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayDialogAction.java
deleted file mode 100644
index 6aecd17dd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayDialogAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * DisplayDialogAction can be used to display a JFace Dialog when
- * not running on the UI thread and no shell is availble. For example:
- * <code>
- * Display.getDefault().syncExec(new DisplayDialogAction(myDialog));
- * </code>
- */
-public class DisplayDialogAction implements Runnable {
-
-
- private Dialog _dialog;
-
- /**
- * Constructor for DisplayDialogAction.
- *
- * @param dialog The dialog to be displayed.
- */
- public DisplayDialogAction(Dialog dialog) {
- _dialog = dialog;
- }
-
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- boolean finished = false;
-
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && !finished; loop++) {
- if (shells[loop].isEnabled())
- {
- _dialog.open();
- finished = true;
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayHidableSystemMessageAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayHidableSystemMessageAction.java
deleted file mode 100644
index be1c441a0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplayHidableSystemMessageAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Michael Berger (IBM) - Initial API and implementation
- ********************************************************************************/
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class DisplayHidableSystemMessageAction extends
- DisplaySystemMessageAction
-{
- protected IPreferenceStore _store;
- protected String _prefID;
- public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID)
- {
- super(message);
- _store = prefStore;
- _prefID = prefID;
- }
-
- /**
- * @see Runnable#run()
- */
- public void run() {
- boolean finished = false;
-
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && !finished; loop++) {
- if (shells[loop].isEnabled() && shells[loop].isVisible()) {
- SystemMessageDialog dialog = new SystemMessageDialog(shells[loop], message);
- dialog.setNoShowAgainOption(true, _store, _prefID, false);
- dialog.openQuestionNoException();
- rc = dialog.getButtonPressedId();
- finished = true;
- }
- }
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplaySystemMessageAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplaySystemMessageAction.java
deleted file mode 100644
index e1d54fc8d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/DisplaySystemMessageAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This class can be used to display SystemMessages via the Display.async
- * and sync methods.
- */
-public class DisplaySystemMessageAction implements Runnable {
-
-
- protected SystemMessage message;
- protected int rc;
-
- public DisplaySystemMessageAction(SystemMessage message) {
- this.message = message;
- }
-
-
- /**
- * @see Runnable#run()
- */
- public void run() {
- boolean finished = false;
-
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && !finished; loop++) {
- if (shells[loop].isEnabled() && shells[loop].isVisible()) {
- SystemMessageDialog dialog = new SystemMessageDialog(shells[loop], message);
- dialog.open();
- rc = dialog.getButtonPressedId();
- finished = true;
- }
- }
- }
-
- /**
- * Retrieve the return code from displaying the SystemMessageDialog
- */
- public int getReturnCode() {
- return rc;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemAction.java
deleted file mode 100644
index 3ca7006fc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemAction.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Suggested interface for actions in popup menus of the remote systems explorer view.
- * While suggested, it is not required to implement this interface.
- * @see SystemBaseAction
- */
-public interface ISystemAction extends IAction, ISelectionChangedListener
-{
-
- // ------------------------
- // CONFIGURATION METHODS...
- // ------------------------
- /**
- * Set the help id for the action
- */
- public void setHelp(String id);
- /**
- * Set the context menu group this action is to go into, for popup menus. If not set,
- * someone else will make this decision.
- */
- public void setContextMenuGroup(String group);
- /**
- * Is this action to be enabled or disabled when multiple items are selected.
- */
- public void allowOnMultipleSelection(boolean allow);
- /**
- * Specify whether this action is selection-sensitive. The default is true.
- * This means the enabled state is tested and set when the selection is set.
- */
- public void setSelectionSensitive(boolean sensitive);
-
- // -----------------------------------------------------------
- // STATE METHODS CALLED BY VIEWER AT FILL CONTEXT MENU TIME...
- // -----------------------------------------------------------
- /**
- * Set shell of parent window. Remote systems explorer will call this.
- */
- public void setShell(Shell shell);
- /**
- * Set the Viewer that called this action. It is good practice for viewers to call this
- * so actions can directly access them if needed.
- */
- public void setViewer(Viewer v);
- /**
- * Sometimes we can't call selectionChanged() because we are not a selection provider.
- * In this case, use this to set the selection.
- */
- public void setSelection(ISelection selection);
- /**
- * An optimization for performance reasons that allows all inputs to be set in one call
- */
- public void setInputs(Shell shell, Viewer v, ISelection selection);
-
-
- // ----------------------------------------------------------------
- // GET METHODS FOR RETRIEVING STATE OR CONFIGURATION INFORMATION...
- // ----------------------------------------------------------------
- /**
- * Get the help id for this action
- */
- public String getHelpContextId();
- /**
- * Convenience method to get shell of parent window, as set via setShell.
- */
- public Shell getShell();
- /**
- * Get the Viewer that called this action. Not guaranteed to be set,
- * depends if that viewer called setViewer or not. SystemView does.
- */
- public Viewer getViewer();
- /**
- * Retrieve selection as set by selectionChanged() or setSelection()
- */
- public IStructuredSelection getSelection();
- /**
- * Get the context menu group this action is to go into, for popup menus. By default is
- * null, meaning there is no recommendation
- */
- public String getContextMenuGroup();
- /**
- * Return whether this action is selection-sensitive. The default is true.
- * This means the enabled state is tested and set when the selection is set.
- */
- public boolean isSelectionSensitive();
- /**
- * Return if true if this is a dummy action
- */
- public boolean isDummy();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemCopyTargetSelectionCallback.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemCopyTargetSelectionCallback.java
deleted file mode 100644
index e13e98b32..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemCopyTargetSelectionCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-
-
-/**
- * Callback interface between copy-actions and copy select-target-parent dialogs
- */
-public interface ISystemCopyTargetSelectionCallback
-{
-
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDialogAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDialogAction.java
deleted file mode 100644
index 72f18109a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDialogAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-/**
- * Suggested interface for actions in popup menus of the remote systems explorer view,
- * which put up dialogs.
- * @see SystemBaseDialogAction
- */
-public interface ISystemDialogAction extends ISystemAction
-{
- /*
- * Return the parent window/dialog of this action. Same as getShell()
- *
- public Shell getParent();*/
-
- /*
- * Set the parent window/dialog of this action. Same as setShell(Shell parent)
- *
- public void setParent(Shell parent);*/
-
- /**
- * Set the value used as input to the dialog. Usually for update mode.
- * This is an alternative to selectionChanged or setSelection, as typically it is
- * the selection that is used as the input to the dialog.
- */
- public void setValue(Object value);
- /**
- * If this action supports allowOnMultipleSelection, then whether the action is to
- * be invoked once per selected item (false), or once for all selected items (true)
- */
- public void setProcessAllSelections(boolean all);
-
- /**
- * Get the output of the dialog.
- */
- public Object getValue();
- /**
- * Returns true if the user cancelled the dialog.
- * The default way to guess at this is to test if the output from
- * getDialogValue was null or not. Override if you need to refine this.
- */
- public boolean wasCancelled();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtension.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtension.java
deleted file mode 100644
index 0a6e073d5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtension.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Required interface for use in making contributions view the
- * adapter menu extension extension point (org.eclipse.rse.ui.dynamicPopupMenuExtensions).
- */
-public interface ISystemDynamicPopupMenuExtension
-{
- /**
- * Returns true if this menu extension supports the specified selection.
- * @param selection the resources to contriubte menu items to
- * @return true if the extension will be used for menu population
- */
- public boolean supportsSelection(IStructuredSelection selection);
-
- /**
- * Populates the menu with specialized actions.
- * @param shell the shell
- * @param menu the menu to contribute actions to
- * @param menuGroup the defect menu group to add actions to
- * @param selection the resources to contriubte menu items to
- *
- */
- public void populateMenu(Shell shell, SystemMenuManager menu, IStructuredSelection selection, String menuGroup);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtensionManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtensionManager.java
deleted file mode 100644
index 4b7c976d8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemDynamicPopupMenuExtensionManager.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-/**
- * @author dmcknigh
- */
-public interface ISystemDynamicPopupMenuExtensionManager {
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemWizardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemWizardAction.java
deleted file mode 100644
index 815353ead..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/ISystemWizardAction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-/**
- * Suggested interface for actions in popup menus of the remote systems explorer view,
- * which put up wizards.
- * @see SystemBaseWizardAction
- */
-public interface ISystemWizardAction extends ISystemDialogAction
-{
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.java
deleted file mode 100644
index 2a91f175a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * This is a base class to simplify the creation of actions supplied via the
- * org.eclipse.rse.core.popupMenus extension point.
- * <p>
- * The only method you must implement is {@link #run()}.
- * You may optionally override {@link #getEnabled(Object[])}
- * <p>
- * Convenience methods are:
- * <ul>
- * <li>{@link #getShell()}
- * <li>{@link #getProxyAction()}
- * <li>{@link #getSelection()}
- * <li>{@link #getSelectionCount()}
- * <li>{@link #getSelectedRemoteObjects()}
- * <li>{@link #getFirstSelectedRemoteObject()}
- * <li>{@link #getRemoteAdapter(Object)}
- *
- * <li>{@link #getSubSystem()}
- * <li>{@link #getSubSystemConfiguration()}
- * <li>{@link #getSystemConnection()}
- *
- * <li>{@link #getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)}
- * <li>{@link #getRemoteObjectSubSystemConfigurationId(Object obj, ISystemRemoteElementAdapter adapter)}
- * <li>{@link #getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)}
- * <li>{@link #getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)}
- * <li>{@link #getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)}
- * <li>{@link #getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)}
- * </ul>
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog
- */
-public abstract class SystemAbstractPopupMenuExtensionAction
- implements IObjectActionDelegate
-{
- protected IWorkbenchPart viewPart = null;
- protected IStructuredSelection sel = null;
- protected IAction proxyAction;
- protected Shell shell;
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * Constructor
- */
- public SystemAbstractPopupMenuExtensionAction()
- {
- super();
- }
-
- // ------------------------
- // OVERRIDABLE METHODS...
- // ------------------------
-
- /**
- * The user has selected this action. This is where the actual code for the action goes.
- */
- public abstract void run();
-
- /**
- * The user has selected one or more objects. This is an opportunity to enable/disable
- * this action based on the current selection. By default, it is always enabled. Return
- * false to disable it.
- */
- public boolean getEnabled(Object[] currentlySelected)
- {
- return true;
- }
-
- // ---------------------------------
- // IOBJECTACTIONDELEGATE METHODS...
- // ---------------------------------
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart part)
- {
- this.viewPart = part;
- this.proxyAction = action;
- this.shell = part.getSite().getShell();
- }
- /**
- * Get the current view part.
- * Handy for things like getting the shell.
- */
- public IWorkbenchPart getActivePart()
- {
- return viewPart;
- }
-
- /**
- * The Eclipse-supplied proxy action has been selected to run.
- * This is the foreward to us, the actual action. This method's default
- * implementation is to simply call {@link #run()}.
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action)
- {
- run();
- }
-
- /**
- * Called by Eclipse when the user selects something. Our opportunity
- * to enable or disable this menu item. The default implementation of this
- * method calls getEnabled to determine if the proxy action should be enabled
- * or not, then calls setEnabled on that proxy action with the result.
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection sel)
- {
- if (!action.isEnabled())
- return; // defect 43471: we were overriding the enableFor attribute enablement
- if (sel instanceof IStructuredSelection)
- {
- this.sel = (IStructuredSelection)sel;
- action.setEnabled(getEnabled(getSelectedRemoteObjects()));
- }
- else
- {
- this.sel = null;
- action.setEnabled(false);
- }
- }
-
- // ---------------------------------------------
- // CONVENIENCE METHODS FOR SUBCLASSES TO USE...
- // ---------------------------------------------
- /**
- * For toggle actions (attribute state specified in action tag), set the toggle state
- */
- public void setChecked(boolean checked)
- {
- proxyAction.setChecked(checked);
- }
-
- /**
- * Change the enabled state of the action
- */
- public void setEnabled(boolean enabled)
- {
- proxyAction.setEnabled(enabled);
- }
-
- /**
- * Return the proxy action for this action delegate
- */
- public IAction getProxyAction()
- {
- return proxyAction;
- }
-
- /**
- * Return the shell hosting this action
- */
- public Shell getShell()
- {
- return shell;
- }
-
- /**
- * Retrieve the current selected objects as a structured selection
- */
- public IStructuredSelection getSelection()
- {
- return sel;
- }
- /**
- * Retrieve the number of items currently selected
- */
- public int getSelectionCount()
- {
- return ((sel==null)?0:sel.size());
- }
-
- /**
- * Retrieve the currently selected objects as an array of Object objects.
- * Array may be length 0, but will never be null, for convenience.
- * To do anything interesting with the object, you will also need to retrieve its adapter
- * @see #getRemoteAdapter(Object)
- */
- public Object[] getSelectedRemoteObjects()
- {
- Object[] seld = new Object[(sel!=null) ? sel.size() : 0];
- if (sel == null)
- return seld;
- Iterator i = sel.iterator();
- int idx=0;
- while (i.hasNext())
- seld[idx++] = i.next();
- return seld;
- }
- /**
- * Retrieve the first selected object, for convenience.
- * Will be null if there is nothing selected
- * To do anything interesting with the object, you will also need to retrieve its adapter
- * @see #getRemoteAdapter(Object)
- */
- public Object getFirstSelectedRemoteObject()
- {
- if (sel == null)
- return null;
- return sel.getFirstElement();
- }
- /**
- * Retrieve the adapters of the currently selected objects as an array of ISystemRemoteElementAdapter objects.
- * Array may be length 0, but will never be null, for convenience.
- */
- public ISystemRemoteElementAdapter[] getSelectedRemoteObjectAdapters()
- {
- ISystemRemoteElementAdapter[] seld = new ISystemRemoteElementAdapter[(sel!=null) ? sel.size() : 0];
- if (sel == null)
- return seld;
- Iterator i = sel.iterator();
- int idx=0;
- while (i.hasNext())
- seld[idx++] = getRemoteAdapter(i.next());
- return seld;
- }
- /**
- * Retrieve the adapter of the first selected object as an ISystemRemoteElementAdapter object, for convenience.
- * Will be null if there is nothing selected
- */
- public ISystemRemoteElementAdapter getFirstSelectedRemoteObjectAdapter()
- {
- if (sel == null)
- return null;
- return getRemoteAdapter(sel.getFirstElement());
- }
-
- /**
- * Returns the implementation of ISystemRemoteElementAdapter for the given
- * object. Returns null if this object does not adaptable to this.
- */
- public ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- if (!(o instanceof IAdaptable))
- return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
- return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
- }
-
- /**
- * Returns the name of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getName(obj);</code>
- */
- public String getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getName(obj);
- }
- /**
- * Returns the id of the subsystem factory of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getSubSystemConfigurationId(obj);</code>
- */
- public String getRemoteObjectSubSystemConfigurationId(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getSubSystemConfigurationId(obj);
- }
- /**
- * Returns the type category of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getRemoteTypeCategory(obj);</code>
- */
- public String getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getRemoteTypeCategory(obj);
- }
- /**
- * Returns the type of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getRemoteType(obj);</code>
- */
- public String getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getRemoteType(obj);
- }
- /**
- * Returns the subtype of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getRemoteSubType(obj);</code>
- */
- public String getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getRemoteSubType(obj);
- }
- /**
- * Returns the sub-subtype of the given remote object, given its remote object adapter.
- * Same as <code>adapter.getRemoteSubSubType(obj);</code>
- */
- public String getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)
- {
- return adapter.getRemoteSubSubType(obj);
- }
- /**
- * Returns the subsystem from which the selected remote objects were resolved.
- */
- public ISubSystem getSubSystem()
- {
- ISystemRemoteElementAdapter ra = getFirstSelectedRemoteObjectAdapter();
- if (ra != null)
- return ra.getSubSystem(getFirstSelectedRemoteObject());
- else
- return null;
- }
- /**
- * Returns the subsystem factory which owns the subsystem from which the selected remote objects were resolved
- */
- public ISubSystemConfiguration getSubSystemConfiguration()
- {
- ISubSystem ss = getSubSystem();
- if (ss != null)
- return ss.getSubSystemConfiguration();
- else
- return null;
- }
-
- /**
- * Return the SystemConnection from which the selected remote objects were resolved
- */
- public IHost getSystemConnection()
- {
- IHost conn = null;
- ISystemRemoteElementAdapter ra = getFirstSelectedRemoteObjectAdapter();
- if (ra != null)
- {
- ISubSystem ss = ra.getSubSystem(getFirstSelectedRemoteObject());
- if (ss != null)
- conn = ss.getHost();
- }
- return conn;
- }
-
- /**
- * Debug method to print out details of given selected object...
- */
- public void printTest()
- {
- System.out.println("Testing. Number of selected objects = "+getSelectionCount()); //$NON-NLS-1$
- Object obj = getFirstSelectedRemoteObject();
- if (obj == null)
- System.out.println("selected obj is null"); //$NON-NLS-1$
- else
- {
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(obj);
- System.out.println();
- System.out.println("REMOTE INFORMATION FOR FIRST SELECTION"); //$NON-NLS-1$
- System.out.println("--------------------------------------"); //$NON-NLS-1$
- System.out.println("Remote object name................: " + getRemoteObjectName(obj,adapter)); //$NON-NLS-1$
- System.out.println("Remote object subsystem factory id: " + getRemoteObjectSubSystemConfigurationId(obj,adapter)); //$NON-NLS-1$
- System.out.println("Remote object type category.......: " + getRemoteObjectTypeCategory(obj,adapter)); //$NON-NLS-1$
- System.out.println("Remote object type ...............: " + getRemoteObjectType(obj,adapter)); //$NON-NLS-1$
- System.out.println("Remote object subtype ............: " + getRemoteObjectSubType(obj,adapter)); //$NON-NLS-1$
- System.out.println("Remote object subsubtype .........: " + getRemoteObjectSubSubType(obj,adapter)); //$NON-NLS-1$
- System.out.println();
- }
- System.out.println();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseAction.java
deleted file mode 100644
index 2b3463b83..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseAction.java
+++ /dev/null
@@ -1,818 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemTree;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * A suggested base class for remote systems related actions.
- * <p>
- * What this offers beyond the basic Action class:
- * <ul>
- * <li>Support for setting label and tooltip and description from a resource bundle and single key prefix,
- * from which each string is derived by appending ".label", ".tooltip" and ".description" to the prefix.
- * <li>Support for setting and retrieving the shell from which the action is launched. Can be
- * set in the parent, or passed as null there and set later via setShell. Retrieve via getShell.
- * <li>Support actions that are selection-dependent, but need not be informed of every selection change.
- * For performance reasons, only track selections if the action is displayed in the toolbar where
- * state change needs to be visible. For popup actions, we only need to be informed of the
- * currently selection at the time the popup is built. Popup menu builders call selectionChanged
- * in this class at popup population time, so you need only subclass this method. However, even
- * that is made easier. The default implementation of this method in this class converts the
- * selection to an IStructuredSelection, and calls an overridable method named updateSelection
- * passing the structured selection. The action is enabled or disabled based on the returned
- * boolean value. Just override updateSelection to enable or disable based on selection.
- * Indeed, the default implementation of the updateSelection method is to return the result of
- * AND-ED result of calling checkObjectType on each item in the selection. So the easiest thing
- * you can do to enable/disable is to override checkObjectType.
- * <li>Support actions that are selection-dependent and need to be informed of every selection change
- * as it happens. To enable this, simply call setSelectionProvider to supply the GUI object such
- * as a viewer which fires the selection changed events we wish to monitor for. For the Remote
- * System Explorer viewer, we would get call setSelectionProvider(SystemViewPlugin.getSystemView());
- * <li>Support for actions that are only to be enabled when a single item is selected. To enable this
- * and save from testing for it yourself, simply call the method allowOnMultipleSelection(false).
- * The default is true, multiple selections are allowed.
- * <li>Support for disabling actions when the corresponding SystemConnection for the selected object
- * is offline. The SystemConnection can be automatically determined for some of the common
- * objects (subsystems, IRemoteFiles), for others you must set the SystemConnection for
- * this offline support.</li>
- * </ul>
- * There are many constructors but they can be broken down into permutations of the following info:
- * <ul>
- * <li>Label, tooltip and description. These can be supplied as strings, or via resource bundle and key.
- * This requires four flavors of constructor to except varying of these four pieces of information.
- * <li>Images. There are four flavors of constructors that take an image, and four identical that do not.
- * </ul>
- *
- * <p>To use this dialog, subclass it and <b>override</b> the following methods</p>:
- * <sl>
- * <li>{@link #run()}, where you place the code to do the actual work when this action is invoked.
- * <li>{@link #updateSelection(IStructuredSelection)}, for selection sensitive actions. This is your first
- * opporunity to enable/disable the action when the selection changes, by looking at the given selection
- * and returning true or false. The default implementation calls checkObjectType for each selected object.
- * <li>{@link #checkObjectType(Object)}, for selection sensitive actions. This is your second
- * opporunity to enable/disable the action when the selection changes, by looking at each individual
- * selected object, and returning true or false.
- * </sl>
- * <p>In addition to the methods you must override, you can optionally call various methods to configure
- * this action:</p>
- * <sl>
- * <li>{@link #setInputs(Shell, Viewer,ISelection)} or {@link #setShell(Shell)} and {@link #setViewer(Viewer)} and
- * {@link #setSelection(ISelection)}. These methods are called by the RSE viewers for context menu actions, and
- * can be called directly for actions used in other contexts.
- * <li>{@link #setSelectionProvider(ISelectionProvider)}, for those cases when your action monitors for selection
- * changes (pull) versus being told about them (push) via setSelection. This is less efficient, and should only
- * be used for selection-dependent actions in toolbars and pull-down menus, versus popup menus.
- * <li>{@link #setHelp(String)} to set the ID of the F1 context help for this action.
- * <li>{@link #setContextMenuGroup(String)} to set the menu group in which to place this action, when used in menus.
- * <li>{@link #allowOnMultipleSelection(boolean)} to specify if this action is to be enabled or disabled when multiple
- * objects are selected. The default is disabled.
- * <li>{@link #setSelectionSensitive(boolean)} to specify if this action's enabled state is not sensitive to what
- * is currently selected.
- * </sl>
- * <p>Further, the code you write can use the properties captured by this action and retrievable by the getter methods
- * supplied by this class.</p>
- *
- * @see ISystemAction
- * @see SystemBaseDialogAction
- * @see SystemBaseWizardAction
- */
-public class SystemBaseAction extends Action implements ISystemAction
-{
- protected Shell shell;
- protected boolean allowOnMultipleSelection = false;
- protected IStructuredSelection sSelection = null;
- private Iterator selectionIterator = null;
- private String contextMenuGroup = null;
- protected boolean selectionSensitive = true;
- protected boolean traceSelections = false;
- protected String traceTarget;
- protected Viewer viewer = null;
- protected String helpId;
- protected Cursor waitCursor;
- protected Cursor arrowCursor;
- private ISelectionProvider fSelectionProvider;
- private Vector previousShells = new Vector();
- private Vector previousViewers = new Vector();
- //private Vector previousSelections = new Vector(); hmm, a problem here: can't just test for disposed.
- // todo: remember previous selections stack, and add a restoreSelection() method that the SystemView
- // will call after the context menu is disposed
-
- // yantzi: artemis 6.0: offline support
- private boolean isAvailableOffline;
- private IHost conn;
-
- /**
- * Constructor for SystemBaseAction when translated label is known. You must separately
- * call setToolTipText and setDescription to enable these if desired.
- * @param text string to display in menu or toolbar
- * @param image icon to display in menu or toolbar. Can be null.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, ImageDescriptor image, Shell shell)
- {
- this(text, null, null, image, shell);
- }
- /**
- * Constructor for SystemBaseAction when translated label and tooltip are known. You must
- * separately call setDescription to enable this if desired.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, String tooltip, ImageDescriptor image, Shell parent)
- {
- this(text, tooltip, null, image, parent);
- }
- /**
- * Constructor for SystemBaseAction when translated label and tooltip and description are
- * all known.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param description string displayed in status bar of some displays. Longer than tooltip.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, String tooltip, String description, ImageDescriptor image, Shell shell)
- {
- super(text, image);
- this.shell = shell;
- if (tooltip != null)
- setToolTipText(tooltip);
- if (description != null)
- setDescription(description);
- //setTracing("SystemFilterPoolReferenceSelectAction");
- }
-
- /**
- * Constructor for SystemBaseAction when translated label and tooltip and description are
- * all known.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param description string displayed in status bar of some displays. Longer than tooltip.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param style one of <code>AS_PUSH_BUTTON</code>, <code>AS_CHECK_BOX</code>,
- * <code>AS_DROP_DOWN_MENU</code>, <code>AS_RADIO_BUTTON</code>, and <code>AS_UNSPECIFIED</code>.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, String tooltip, String description, ImageDescriptor image, int style, Shell shell)
- {
- super(text, style);
- this.shell = shell;
- if (image != null)
- setImageDescriptor(image);
- if (tooltip != null)
- setToolTipText(tooltip);
- if (description != null)
- setDescription(description);
- //setTracing("SystemFilterPoolReferenceSelectAction");
- }
-
-
- /**
- * Used for actions with no image icon.
- * Constructor for SystemBaseAction when translated label is known. You must separately
- * call setToolTipText and setDescription to enable these if desired.
- * @param text string to display in menu or toolbar
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, Shell shell)
- {
- this(text, null, null, null, shell);
- }
- /**
- * Used for actions with no image icon.
- * Constructor for SystemBaseAction when translated label and tooltip are known. You must
- * separately call setDescription to enable this if desired.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, String tooltip, Shell shell)
- {
- this(text, tooltip, null, null, shell);
- }
- /**
- * Used for actions with no image icon.
- * Constructor for SystemBaseAction when translated label and tooltip and description are
- * all known.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param description string displayed in status bar of some displays. Longer than tooltip.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- public SystemBaseAction(String text, String tooltip, String description, Shell shell)
- {
- this(text, tooltip, description, null, shell);
- }
-
-
- // ------------------------
- // HELPER METHODS...
- // ------------------------
-
- /**
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- public void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(waitCursor);
- }
- else
- {
- setDisplayCursor(null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
- /**
- * Sets the given cursor for all shells currently active
- * for this window's display.
- *
- * @param c the cursor
- */
- protected void setDisplayCursor(Cursor c)
- {
- setDisplayCursor(getShell(), c);
- }
- /**
- * Sets the given cursor for all shells currently active for the given shell's display.
- *
- * @param c the cursor
- */
- public static void setDisplayCursor(Shell shell, Cursor c)
- {
- if (c == null)
- {
- // attempt to fix problem that the busy cursor sometimes stays. Phil
- shell.forceActive();
- shell.forceFocus();
- }
- Shell[] shells = shell.getDisplay().getShells();
- for (int i = 0; i < shells.length; i++)
- {
- shells[i].setCursor(c);
- }
- }
- /**
- * Turn on tracing for selections, shell and viewer to watch as it is set
- */
- protected void setTracing(boolean tracing)
- {
- traceSelections = tracing;
- }
- /**
- * Turn on tracing for selections, shell and viewer to watch as it is set,
- * scoped to a particular class name (will use indexOf('xxx') to match).
- */
- protected void setTracing(String tracingClassTarget)
- {
- traceSelections = true;
- traceTarget = tracingClassTarget;
- }
- /**
- * Issue trace message
- */
- protected void issueTraceMessage(String msg)
- {
- if (traceSelections)
- {
- String className = this.getClass().getName();
- if ((traceTarget==null) || (className.indexOf(traceTarget)>=0))
- SystemBasePlugin.logInfo(this.getClass().getName()+": "+getText()+": "+msg);
- }
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
- // -----------------------------------------------------------
- // CONFIGURATION METHODS...
- // -----------------------------------------------------------
-
- /**
- * An optimization for performance reasons that allows all inputs to be set in one call
- */
- public void setInputs(Shell shell, Viewer v, ISelection selection)
- {
- if (traceSelections)
- issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS");
- setShell(shell);
- setViewer(v);
- setSelection(selection);
- }
-
- /**
- * Sets the parent shell for this action. Usually context dependent.
- */
- public void setShell(Shell shell)
- {
- // in defect 42399 it was reported the shell for persistent actions gets reset in browse
- // dialogs, on a right click, overriding the real shell with the browse dialog's shell.
- // When the browse dialog is closed, we only retain the disposed shell. To solve this
- // we have to return a stack of shells and on getShell peel back to the last non-disposed
- // one...
- this.previousShells.add(this.shell);
- this.shell = shell;
- if (traceSelections)
- issueTraceMessage(" INSIDE SETSHELL. shell = " + shell);
- }
- /**
- * Set the Viewer that called this action. It is good practice for viewers to call this
- * so actions can directly access them if needed.
- */
- public void setViewer(Viewer v)
- {
- this.previousViewers.add(this.viewer); // see comment in setShell
- this.viewer = v;
- if (traceSelections)
- issueTraceMessage(" INSIDE SETVIEWER. viewer = " + viewer);
- }
- /**
- * This is called when the user selects something in the tree.
- * This is your opportunity to disable the action based on the current selection.
- * The default implementation of this method:
- * <ul>
- * <li>Disables the action if the selection is not a structured selection. Should never happen.
- * <li>Disables the action if more than one item is selected and allowOnMultipleSelection is false.
- * <li>Converts the selection to a structured selection and calls updateSelection. Uses returned
- * boolean value to setEnabled() this action.
- * </ul>
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- if (traceSelections)
- issueTraceMessage("INSIDE SELECTIONCHANGED. Selection null? " + (selection==null));
- setSelection(selection);
- }
- /**
- * This is called by the UI calling the action, if that UI is not a selection provider.
- * That is, this is an alternative to calling selectionChanged when there is no SelectionChangedEvent.
- * @see #selectionChanged(SelectionChangedEvent event)
- */
- public void setSelection(ISelection selection)
- {
- if (traceSelections)
- issueTraceMessage(" INSIDE SETSELECTION. Selection null? " + (selection==null));
- if ( !(selection instanceof IStructuredSelection) )
- {
- if (selectionSensitive)
- setEnabled(false);
- if (traceSelections)
- System.out.println(this.getClass().getName() + ". Returning false in setSelection. selection= " + selection);
- return;
- }
- if (selectionSensitive)
- {
- // see comment in setShell
- //this.previousSelections.add(this.sSelection);
- }
- sSelection = (IStructuredSelection)selection;
- if (!selectionSensitive || (selection == null))
- {
- if (traceSelections)
- System.out.println(this.getClass().getName() + ". Returning. selectionSensitive = " + selectionSensitive);
- return;
- }
- boolean multiSelect = (sSelection.size() > 1);
- if (!allowOnMultipleSelection && multiSelect)
- {
- setEnabled(false);
- if (traceSelections)
- System.out.println(this.getClass().getName() + ". Returning false in setSelection. #selected = " + sSelection.size());
- }
- else
- {
- boolean enable = false;
- /*
- boolean debug = getText().equals("Copy");
- if (debug)
- enable = updateSelection(sSelection);
- else */
- enable = updateSelection(sSelection);
- setEnabled(enable);
- }
- }
- /**
- * Identify the UI object that will be used to get the selection
- * list from. <b>Only call this if your action is displayed in a toolbar
- * or non-popup menu<b>, as it will impact performance. It results in your
- * action getting called every time the user changes his selection in
- * the given provider viewer.
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- if (fSelectionProvider != null)
- fSelectionProvider.removeSelectionChangedListener(this);
-
- fSelectionProvider = provider;
- if (traceSelections)
- issueTraceMessage(" INSIDE SETSELECTIONPROVIDER. fSelectionProvider = " + fSelectionProvider);
-
-
- if (fSelectionProvider != null)
- fSelectionProvider.addSelectionChangedListener(this);
- }
-
-
- // ---------------------------------------------------------------------------
- // CONFIGURATION METHODS CHILD CLASSES OR OTHERS CALL TO CONFIGURE THIS ACTION
- // ---------------------------------------------------------------------------
- /**
- * Set the help id for the action
- */
- public void setHelp(String id)
- {
- SystemWidgetHelpers.setHelp(this, id);
- this.helpId = id;
- }
-
- /**
- * Set the context menu group this action is to go into, for popup menus. If not set,
- * someone else will make this decision.
- */
- public void setContextMenuGroup(String group)
- {
- contextMenuGroup = group;
- }
- /**
- * This method is supplied for actions that are to be enable even when more than
- * one item is selected. The default is to only enable on single selections.
- */
- public void allowOnMultipleSelection(boolean allow)
- {
- allowOnMultipleSelection = allow;
- }
- /**
- * Specify whether this action is selection-sensitive. The default is true.
- * This means the enabled state is tested and set when the selection is set.
- */
- public void setSelectionSensitive(boolean sensitive)
- {
- selectionSensitive = sensitive;
- }
-
- // ---------------------------------------------------------------------------
- // METHODS THAT CAN OR SHOULD BE OVERRIDDEN BY CHILD CLASSES...
- // ---------------------------------------------------------------------------
-
- /**
- * First opportunity to decide if the action should be enabled or not based on the
- * current selection. Called by default implementation of selectionChanged, which
- * converts the ISelection to an IStructuredSelection, which is all we support. The
- * return result is used to enable or disable this action.
- * <p>
- * The default implementation of this method:
- * <ul>
- * <li>Returns false if calling checkObjectType on any object in the selection list returns false.
- * <li>Returns true otherwise.
- * </ul>
- * If desired, override this method for a different algorithm to decide enablement.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- enable = checkObjectType(e.next());
- }
- return enable;
- }
-
- /**
- * Second and easiest opportunity to decide if the action should be enabled or not based
- * on the current selection. Called by default implementation of updateSelection, once for
- * each item in the selection. If any call to this returns false, the action is disabled.
- * The default implementation returns true.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- return true;
- }
-
-
- /**
- * This is the method called when the user selects this action.
- * Child classes need to override this. If you need the parent shell,
- * call getShell. If you need to know the current selection, call
- * getSelection(), or getFirstSelection() followed by getNextSelection()
- * until null is returned.
- * @see Action#run()
- */
- public void run()
- {
-
- }
-
-
- // -----------------------------------------------------------
- // GETTER METHODS RETURNING INFORMATION CAPTURED IN BASE CLASS
- // -----------------------------------------------------------
- /**
- * Return if true if this is a dummy action
- */
- public boolean isDummy()
- {
- String label = getText();
- if (label == null)
- return false;
- return label.equals("dummy"); //$NON-NLS-1$
- }
-
- /**
- * Retrieve the help id for this action
- */
- public String getHelpContextId()
- {
- return helpId;
- }
-
- /**
- * Retrieves the parent shell for this action. Will be null if setShell has not been called.
- */
- public Shell getShell()
- {
- return internalGetShell(true);
- }
- /**
- * Retrieves the parent shell for this action. Will be null if setShell has not been called.
- * Method for subclasses that want to call this and not do the test for null.
- */
- protected Shell getShell(boolean doTest)
- {
- return internalGetShell(doTest);
- }
- /**
- * Abstraction
- */
- private Shell internalGetShell(boolean doTest)
- {
- // in defect 42399 it was reported the shell for persistent actions gets reset in browse
- // dialogs, on a right click, overriding the real shell with the browse dialog's shell.
- // When the browse dialog is closed, we only retain the disposed shell. To solve this
- // we have to return a stack of shells and on getShell peel back to the last non-disposed
- // one...
- if ((shell!=null) && (shell.isDisposed()))
- {
- boolean found = false;
- Vector disposedShells = new Vector();
- for (int idx=previousShells.size()-1; !found && (idx>=0); idx--)
- {
- shell = (Shell)previousShells.elementAt(idx);
- if (shell.isDisposed())
- disposedShells.add(shell);
- else
- found = true;
- }
- if (!found)
- shell = null;
- for (int idx=0; idx<disposedShells.size(); idx++)
- previousShells.remove(disposedShells.elementAt(idx));
- }
- if (doTest && (shell == null))
- {
- System.out.println("Inside getShell for " + this.getClass().getName() + " and the shell is null! This needs to be investigated");
- SystemBasePlugin.logDebugMessage("SystemBaseAction", "Inside getShell for " + this.getClass().getName() + " and the shell is null! This needs to be investigated");
- }
- return shell;
- }
- /**
- * Get the Viewer that called this action. Not guaranteed to be set,
- * depends if that viewer called setViewer or not. SystemView does.
- */
- public Viewer getViewer()
- {
- // see comment in getShell()...
- if ((viewer!=null) && (viewer.getControl().isDisposed()))
- {
- boolean found = false;
- Vector disposedViewers = new Vector();
- for (int idx=disposedViewers.size()-1; !found && (idx>=0); idx--)
- {
- viewer = (Viewer)previousViewers.elementAt(idx);
- if (viewer.getControl().isDisposed())
- disposedViewers.add(viewer);
- else
- found = true;
- }
- if (!found)
- viewer = null;
- for (int idx=0; idx<disposedViewers.size(); idx++)
- previousViewers.remove(disposedViewers.elementAt(idx));
- }
- return viewer;
- }
- /**
- * Return the current viewer as an ISystemTree if it is one, or null otherwise
- */
- protected ISystemTree getCurrentTreeView()
- {
- Viewer v = getViewer();
- if (v instanceof ISystemTree)
- return (ISystemTree)v;
- else
- return null;
- }
-
- /**
- * Get the context menu group this action is to go into, for popup menus. By default is
- * null, meaning there is no recommendation
- */
- public String getContextMenuGroup()
- {
- return contextMenuGroup;
- }
-
- /**
- * Return whether this action is selection-sensitive. The default is true.
- * This means the enabled state is tested and set when the selection is set.
- */
- public boolean isSelectionSensitive()
- {
- return selectionSensitive;
- }
-
- /**
- * Return value of last call to getSelectionProvider.
- */
- public ISelectionProvider getSelectionProvider()
- {
- return fSelectionProvider;
- }
-
- /**
- * Return current selection, as per last call to selectionChanged.
- */
- public IStructuredSelection getSelection()
- {
- if (traceSelections)
- issueTraceMessage(" INSIDE GETSELECTION. sSelection null? " + (sSelection==null));
- return sSelection;
- }
-
- /**
- * Return first item currently selected, as per last call to selectionChanged.
- * This is handy for actions where allowOnMultipleSelection is false.
- * This method also starts a new iterator, and after you can call getNextSelection()
- * until it returns null. This is handy for actions where allowOnMultipleSelection is true.
- * @see #getNextSelection()
- */
- protected Object getFirstSelection()
- {
- if (sSelection != null)
- {
- selectionIterator = sSelection.iterator();
- if (selectionIterator.hasNext())
- return selectionIterator.next();
- else
- return null;
- }
- else
- selectionIterator = null;
- return null;
- }
- /**
- * Return next item currently selection, as per last call to selectionChanged.
- * YOU MUST HAVE CALLED GETFIRSTSELECTION() PRIOR TO CALLING THIS.
- * Your code can loop until this returns null.
- * @see #getFirstSelection()
- */
- protected Object getNextSelection()
- {
- if ((sSelection != null) && (selectionIterator != null))
- {
- if (selectionIterator.hasNext())
- return selectionIterator.next();
- else
- return null;
- }
- else
- selectionIterator = null;
- return null;
- }
-
- /**
- * Disables this action if offline mode, otherwise delegates to the super class.
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled()
- {
- if (!isAvailableOffline)
- {
- if (conn != null && conn.isOffline())
- {
- return false;
- }
- else
- {
- Object selection = getFirstSelection();
- while (selection != null)
- {
- if (selection instanceof ISubSystem && ((ISubSystem)selection).isOffline())
- {
- return false;
- }
-
- // yantzi: this disables all actions on SystemConnection
- //else if (selection instanceof SystemConnection)
- //{
- // connection = (SystemConnection)selection;
- // if (connection.isOffline())
- // return false;
- //}
-
- selection = getNextSelection();
- }
- }
-
- }
-
- return super.isEnabled();
- }
-
- /**
- * If this is one of those rare actions that is to be made available in offline mode, then call this
- * during or immediately after constructing to state that. The default is false.
- */
- public void setAvailableOffline(boolean availableOffline)
- {
- this.isAvailableOffline = availableOffline;
- }
-
- /**
- * Set the SystemConnection used by this action for disabling the action
- * in offline mode, or for whatever reason subclasses may need it.
- */
- public void setHost(IHost connection)
- {
- conn = connection;
- }
-
- /**
- * Return the system connection which is the parent of whatever is currently selected.
- */
- public IHost getSystemConnection()
- {
- return conn;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseCopyAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseCopyAction.java
deleted file mode 100644
index 7467577a2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseCopyAction.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.dialogs.SystemSimpleCopyDialog;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * An abstract base class for all copy actions. Defers minimal requirements to
- * child classes.
- */
-public abstract class SystemBaseCopyAction extends SystemBaseDialogAction
- implements IRunnableWithProgress, ISystemCopyTargetSelectionCallback
-{
- protected ISystemProfileManager mgr;
- protected ISystemRegistry sr;
- protected String[] oldNames;
- protected String[] newNames;
- protected Object[] oldObjects;
- protected Object targetContainer;
- protected boolean copiedOk = true;
- //private boolean makeActive;
- protected Exception runException = null;
- protected int mode = SystemSimpleCopyDialog.MODE_COPY;
- protected int runCount = 0;
- public static final int MODE_COPY = SystemSimpleCopyDialog.MODE_COPY;
- public static final int MODE_MOVE = SystemSimpleCopyDialog.MODE_MOVE;
-
-
- /**
- * Constructor when using default action ID
- * @param parent Owning shell
- * @param mode Either MODE_COPY or MODE_MOVE from this class
- */
- public SystemBaseCopyAction(Shell parent, int mode)
- {
- this(parent, mode==MODE_COPY ? SystemResources.ACTION_COPY_LABEL : SystemResources.ACTION_MOVE_LABEL, mode);
- }
-
- /**
- * Constructor
- * @param parent Owning shell
- * @param label
- * @param mode Either MODE_COPY or MODE_MOVE from this class
- */
- public SystemBaseCopyAction(Shell parent, String label, int mode)
- {
- super(label,
- (mode==MODE_COPY ?
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY)
- //RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_COPY_ID)
- : RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVE_ID)),
- parent);
- this.mode = mode;
- mgr = SystemProfileManager.getSystemProfileManager();
- sr = RSEUIPlugin.getTheSystemRegistry();
- allowOnMultipleSelection(true);
- setProcessAllSelections(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- oldNames = null;
- newNames = null;
- oldObjects = null;
- targetContainer = null;
- copiedOk = true;
- runException = null;
- //System.out.println("inside base reset()");
- }
-
- /**
- * Override of parent.
- * Return the dialog that will be used to prompt for the copy/move target location
- * @see #run()
- */
- protected Dialog createDialog(Shell parent)
- {
- ++runCount;
- if (runCount > 1)
- reset();
- SystemSimpleCopyDialog copyDlg = new SystemSimpleCopyDialog(parent, getPromptString(), mode, this, getTreeModel(), getTreeInitialSelection());
-
- // our title now reflects multiple selection. If single change it.
- IStructuredSelection sel = getSelection();
- //System.out.println("size = "+sel.size());
- if (sel.size() == 1)
- {
- String singleTitle = null;
- if (mode == MODE_COPY)
- singleTitle = SystemResources.RESID_COPY_SINGLE_TITLE;
- else
- singleTitle = SystemResources.RESID_MOVE_SINGLE_TITLE;
- //System.out.println("..."+singleTitle);
- if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev
- copyDlg.setTitle(singleTitle);
- }
-
- return copyDlg;
- }
-
- protected abstract String[] getOldNames();
- protected abstract Object[] getOldObjects();
- /**
- * Get the verbage prompt to show on line one of the copy dialog
- */
- protected String getPromptString()
- {
- if (mode == MODE_COPY)
- return SystemResources.RESID_COPY_PROMPT;
- else
- return SystemResources.RESID_MOVE_PROMPT;
- }
-
- protected abstract SystemSimpleContentElement getTreeModel();
- protected abstract SystemSimpleContentElement getTreeInitialSelection();
-
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- * <p>
- * The default is to return true if the selected element has no children. This is sufficient for most cases. However,
- * in some cases it is not, such as for filter strings where we want to only enable OK if a filter is selected. It is
- * possible that filter pools have no filters, so the default algorithm is not sufficient. In these cases the child class
- * can override this method.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- return !selectedElement.hasChildren();
- }
-
-
- /**
- * Required by parent. We use it to actually do the work.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- targetContainer = getTargetContainer(dlg);
- if (targetContainer != null)
- {
- boolean okToProceed = preCheckForCollision();
- if (!okToProceed)
- return null;
- IRunnableContext runnableContext = getRunnableContext();
- try
- {
- runnableContext.run(false,false,this); // inthread, cancellable, IRunnableWithProgress
- if (copiedOk)
- {
- SystemMessage completeMsg = getCompletionMessage(targetContainer, oldNames, newNames);
- if (completeMsg != null)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),completeMsg);
- msgDlg.open();
- }
- }
- }
- catch (java.lang.reflect.InvocationTargetException exc) // unexpected error
- {
- showOperationMessage((Exception)exc.getTargetException(), getShell());
- //throw (Exception) exc.getTargetException();
- }
- catch (Exception exc)
- {
- showOperationMessage(exc, getShell());
- //throw exc;
- }
- }
- return null;
- }
- /**
- * Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with
- * a progress monitor in it, we will use this, else we will create a progress monitor dialog.
- */
- protected IRunnableContext getRunnableContext()
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- IRunnableContext irc = sr.getRunnableContext();
- if (irc == null)
- irc = new ProgressMonitorDialog(getShell());
- return irc;
- }
- /**
- * Override this method if you supply your own copy/move target dialog.
- * Return the user-selected target or null if cancelled
- */
- protected Object getTargetContainer(Dialog dlg)
- {
- SystemSimpleCopyDialog cpyDlg = (SystemSimpleCopyDialog)dlg;
- Object targetContainer = null;
- if (!cpyDlg.wasCancelled())
- targetContainer = cpyDlg.getTargetContainer();
- return targetContainer;
- }
-
- /**
- * Do a pre-check for a collision situation.
- * This really is only a problem for filter strings, when a name collision is fatal verus
- * recoverable via a new-name prompt.
- */
- protected boolean preCheckForCollision()
- {
- boolean ok = true;
- oldNames = getOldNames();
- oldObjects = getOldObjects();
- int steps = oldObjects.length;
-
- String oldName = null;
- Object oldObject = null;
- for (int idx=0; ok && (idx<steps); idx++)
- {
- oldName = oldNames[idx];
- oldObject = oldObjects[idx];
- ok = preCheckForCollision(getShell(), targetContainer, oldObject, oldName);
- }
- return ok;
- }
- /**
- * Overridable entry point when you want to prevent any copies/moves if any of the
- * selected objects have a name collision.
- * <p>
- * If you decide to override this, it is your responsibility to issue the error
- * message to the user and return false here.
- * <p>
- * @return true if there is no problem, false if there is a fatal collision
- */
- protected boolean preCheckForCollision(Shell shell, Object targetContainer,
- Object oldObject, String oldName)
- {
- return true;
- }
-
- /**
- * Called after all the copy/move operations end, be it successfully or not.
- * Your opportunity to display completion or do post-copy selections/refreshes
- */
- public void copyComplete() {}
-
- // ----------------------------------
- // INTERNAL METHODS...
- // ----------------------------------
- /**
- * Method required by IRunnableWithProgress interface.
- * Allows execution of a long-running operation modally by via a thread.
- * In our case, it runs the copy operation with a visible progress monitor
- */
- public void run(IProgressMonitor monitor)
- throws java.lang.reflect.InvocationTargetException,
- java.lang.InterruptedException
- {
- SystemMessage msg = getCopyingMessage();
- runException = null;
-
- try
- {
- //oldNames = getOldNames();
- //oldObjects = getOldObjects();
- int steps = oldObjects.length;
- monitor.beginTask(msg.getLevelOneText(), steps);
- copiedOk = true;
- String oldName = null;
- String newName = null;
- Object oldObject = null;
- newNames = new String[oldNames.length];
- for (int idx=0; copiedOk && (idx<steps); idx++)
- {
- oldName = oldNames[idx];
- oldObject = oldObjects[idx];
- monitor.subTask(getCopyingMessage(oldName).getLevelOneText());
- newName = checkForCollision(getShell(), monitor, targetContainer, oldObject, oldName);
- if (newName == null)
- copiedOk = false;
- else
- copiedOk = doCopy(monitor, targetContainer, oldObject, newName);
- newNames[idx] = newName;
- monitor.worked(1);
- }
- monitor.done();
- }
- catch(java.lang.InterruptedException exc)
- {
- monitor.done();
- runException = exc;
- throw (java.lang.InterruptedException)runException;
- }
- catch(Exception exc)
- {
- monitor.done();
- runException = new java.lang.reflect.InvocationTargetException(exc);
- throw (java.lang.reflect.InvocationTargetException)runException;
- }
- copyComplete();
- }
-
- protected abstract String checkForCollision(Shell shell, IProgressMonitor monitor, Object targetContainer, Object oldObject, String oldName);
- /**
- * Get the generic "Copying..." or "Moving..." message
- */
- protected SystemMessage getCopyingMessage()
- {
- if (mode == MODE_COPY)
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYGENERIC_PROGRESS);
- else
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEGENERIC_PROGRESS);
- }
- /**
- * Get the specific "Copying %1..." or "Moving %1..." message
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- SystemMessage msg = null;
- if (mode == MODE_COPY)
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYTHINGGENERIC_PROGRESS);
- else
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVETHINGGENERIC_PROGRESS);
- msg.makeSubstitution(oldName);
- return msg;
- }
-
- /**
- * DO THE ACTUAL COPY OR MOVE. THIS MUST BE IMPLEMENTED BY CHILD CLASSES
- */
- protected abstract boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception;
-
- /**
- * Return complete message.
- * Override if you want to popup a completion message after a successful copy/move
- */
- public SystemMessage getCompletionMessage(Object targetContainer, String[] oldNames, String[] newNames)
- {
- return null;
- }
-
- /**
- * Helper method to show an error message resulting from the attempted operation.
- */
- protected void showOperationMessage(Exception exc, Shell shell)
- {
- if (exc instanceof java.lang.InterruptedException)
- showOperationCancelledMessage(shell);
- else if (exc instanceof java.lang.reflect.InvocationTargetException)
- showOperationErrorMessage(shell, ((java.lang.reflect.InvocationTargetException)exc).getTargetException());
- else
- showOperationErrorMessage(shell, exc);
- }
-
- /**
- * Show an error message when the operation fails.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showOperationErrorMessage(Shell shell, Throwable exc)
- {
- if (exc instanceof SystemMessageException)
- showOperationErrorMessage(shell, (SystemMessageException)exc);
- else
- {
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException))
- msg = exc.getClass().getName();
- SystemMessageDialog msgDlg =
- new SystemMessageDialog(shell,
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED).makeSubstitution(msg));
- msgDlg.setException(exc);
- msgDlg.open();
- //RSEUIPlugin.logError("Copy/Move operation failed",exc);
- }
- }
- /**
- * Show an error message when the operation fails.
- * Shows a SystemMessage that was encapsulated in a SystemMessage exception
- * Overridable.
- */
- protected void showOperationErrorMessage(Shell shell, SystemMessageException exc)
- {
- SystemMessage msg = exc.getSystemMessage();
- SystemMessageDialog msgDlg =
- new SystemMessageDialog(shell, msg);
- msgDlg.open();
- //RSEUIPlugin.logError("Copy/Move operation failed",exc);
- }
-
- /**
- * Show an error message when the user cancels the operation.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showOperationCancelledMessage(Shell shell)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED));
- msgDlg.open();
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDialogAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDialogAction.java
deleted file mode 100644
index 2d7a4fdba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDialogAction.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.ui.dialogs.ISystemPromptDialog;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * A specialization for Action for actions that put up dialogs.
- * These actions have some common requirements:
- * <sl>
- * <li>They need to take the parent Shell object in the constructor or later perhaps via setParent
- * <li>They need to be able to set the input value for the dialog. This is typically related to
- * what is currently selected.
- * <li>They need to be able to get the output value from the dialog. This can be queried by
- * calling getValue after the action runs.
- * </sl>
- * <p>This subclass of SystemBaseAction implements the run() method in a way optimized for the processing
- * of dialogs: it calls an abstract method to create the dialog, then sets the input from the action's
- * value (if set) or selection (otherwise) and opens the dialog. After, it calls an abstract method to
- * extract the dialog's output object which is used to set this action's value, for the benefit of the
- * caller.
- * </p>
- * <p>To use this dialog, subclass it and <b>override</b> the following methods</p>:
- * <sl>
- * <li>{@link #createDialog(Shell)}
- * <li>{@link #getDialogValue(Dialog)}
- * <li>{@link #run()} but ONLY if you don't want the default implementation of this method.
- * </sl>
- * <p>In addition to the methods you must override, you can optionally call various methods to configure
- * this action. In addition to those in the parent class, this class offers these configuration methods:</p>
- * <sl>
- * <li>{@link #setDialogHelp(String)} to set the context help ID for the dialog, for cases where the dialog is generic
- * and its help depends on context and hence cannot be hardcoded in the dialog class.
- * <li>{@link #setValue(Object)} to the set the input object to pass to the dialog, for cases where the current selection
- * is not what you want to pass to the dialog.
- * <li>{@link #setNeedsProgressMonitor(boolean)} to specify if the dialog is to display a progress monitor or not, for cases
- * where this decision depends on context and hence cannot be hardcoded in the dialog class.
- * <li>{@link #setProcessAllSelections(boolean)} to specify the behaviour when there are multiple objects selected. By
- * default, the dialog will be created and processed once for each selected object, but you can specify that you instead
- * want to only invoke the dialog once and pass in all selected objects as a single ISelection object.
- * </sl>
- *
- */
-public abstract class SystemBaseDialogAction extends SystemBaseAction
- implements ISystemDialogAction
-{
- protected Object value;
- protected boolean processAll;
- protected boolean needsProgressMonitor, needsProgressMonitorSet;
- protected boolean cancelled;
- protected String dlgHelpId;
-
- /**
- * Constructor for SystemBaseDialogAction when translated label is known. You must separately
- * call setToolTipText and setDescription to enable these if desired.
- * @param text string to display in menu or toolbar
- * @param image icon to display in menu or toolbar. Can be null.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseDialogAction(String text, ImageDescriptor image, Shell shell)
- {
- super(text, image, shell);
- }
- /**
- * Constructor for SystemBaseDialogAction when translated label and tooltip are known. You must
- * separately call setDescription to enable this if desired.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseDialogAction(String text, String tooltip, ImageDescriptor image, Shell shell)
- {
- super(text, tooltip, image, shell);
- }
-
-
- /**
- * Constructor for SystemBaseDialogAction when translated label and tooltip and description are
- * all known.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param description string displayed in status bar of some displays. Longer than tooltip.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseDialogAction(String text, String tooltip, String description, ImageDescriptor image, Shell shell)
- {
- super(text, tooltip, description, image, shell);
- }
-
-
-
-
- // ------------------------
- // HELPER/GETTER METHODS...
- // ------------------------
- /**
- * Return the help Id destined for the dialog this action brings up
- */
- public String getDialogHelpContextId()
- {
- return dlgHelpId;
- }
- /**
- * Get the value, typically set in actionPerformed
- * after putting up the dialog, and holds the output
- * from the dialog.
- */
- public Object getValue()
- {
- return value;
- }
- /**
- * Return true if the action's dialog/wizard is to include a progress monitor
- */
- public boolean getNeedsProgressMonitor()
- {
- return needsProgressMonitor;
- }
- /**
- * Return true if the caller explicitly called setNeedsProgressMonitor
- */
- protected boolean wasNeedsProgressMonitorSet()
- {
- return needsProgressMonitorSet;
- }
- /**
- * Return setting of setProcessAllSelections.
- * @see #setProcessAllSelections(boolean)
- */
- protected boolean getProcessAllSelections()
- {
- return this.processAll;
- }
- /**
- * Returns true if the user cancelled the dialog.
- * The default way to guess at this is to test if the output from
- * getDialogValue was null or not. Override if you need to refine this.
- */
- public boolean wasCancelled()
- {
- if (cancelled) // most accurate
- return true;
- else
- return (value == null);
- }
-
- // -----------------------------------------------------------
- // CONFIGURATION METHODS...
- // -----------------------------------------------------------
-
- /**
- * When using generic dialogs, it is nice to offer non-generic help.
- * If desired, set the help context ID here, and it will be passed on
- * to the generic dialog after instantiation of it.
- */
- public void setDialogHelp(String id)
- {
- this.dlgHelpId = id;
- }
- /**
- * Set the value used as input to the dialog
- */
- public void setValue(Object value)
- {
- this.value = value;
- }
- /**
- * If desired, specify if you want to include a progress monitor in your
- * dialog or wizard. If the dialog is a SystemPromptDialog or the Wizard
- * is a SystemWizardDialog, it will be passed on after instantiating the
- * dialog or wizard.
- */
- public void setNeedsProgressMonitor(boolean needs)
- {
- this.needsProgressMonitor = needs;
- this.needsProgressMonitorSet = true;
- }
- /**
- * If this action supports being enabled for multiple selections (the default,
- * but changable by calling allowOnMultipleSelections(false)), then by default
- * the default run() implementation will create and invoke the dialog once for each
- * item selected. Call this with true to change that behaviour so that the dialog
- * is only created and processed once.
- * <p>
- * Use this when the dialog itself will process all selected items at once.
- * <p>
- * The default is false.
- */
- public void setProcessAllSelections(boolean all)
- {
- this.processAll = all;
- }
-
- // -----------------------------------------------------------
- // OVERRIDABLE METHODS...
- // -----------------------------------------------------------
-
- /**
- * This is the method called by the system when the user
- * selects this action. This is a default implementation
- * which:
- * <ul>
- * <li>calls abstract method createDialog() to get the dialog
- * object. Child classes must implement this method.
- * <li>if the returned dialog implements ISystemPromptDialog, then
- * it will call setInputObject passing getValue() as the paramter.
- * If getValue returns null, then instead the currently selected objects
- * are passed as the parameter. If setProcessAllSelections has been called
- * then the current ISelection is passed, else the each object in the selection
- * is passed, and the dialog is displayed once per selected object.
- * Your dialog can then cast this input as necessary to initialize its input
- * fields, say. Presumably it knows what to cast it to. Note: code that
- * creates actions does not typically call setValue unless
- * the action is used in a UI that has no concept of ISelection, such as a
- * raw swt widget. ISelection is a JFace viewer concept.
- * <li>calls dlg.open(getShell()) on the dialog to display it.
- * <li>calls setValue(getDialogValue(dlg)) so callers can get the dialog output
- * via a call to getValue() on this action object. Again, this is typically only
- * used when launching actions from non-viewers, such as launching one dialog from
- * another dialog. When launching from popup-menus of viewers, use selectionChanged
- * instead. Either way, the object set or selected is passed on to the dialog,
- * if not null, by way of a call to the dialog's setInputObject method.
- * </ul>
- * If this action is to be enabled when multiple items are selected
- * (the default) then the processing above is repeated once for every object
- * selected. If your dialog actually processes all the selected items, then
- * call setProcessAllSelections(true) to change the behaviour to only do all
- * of this once. In this case setInputObject will be called with the
- * entire IStructuredSelection object, and your dialog code can process each
- * of the objects in it.
- * <p>
- * Please note that if NO ITEMS are selected, we will still call createDialog
- * but not call setInput.
- * <p>
- * To use this default implementation you must implement
- * the createDialog method. Note we will also call
- * dlg.setBlockOnOpen(true) on the returned dialog to
- * force it to be modal.
- */
- public void run()
- {
- Shell shell = getShell();
- if (shell == null)
- SystemBasePlugin.logDebugMessage(this.getClass().getName(),"Warning: shell is null!");
- Object currentSelection = null;
- if (!getProcessAllSelections())
- currentSelection = getFirstSelection();
- else
- currentSelection = getSelection();
- boolean cancelled = false;
-
- do
- {
- Dialog dlg = createDialog(getShell());
- if (dlg == null)
- return;
- dlg.setBlockOnOpen(true);
- Object dialogInputValue = currentSelection;
- if (getValue() != null)
- dialogInputValue = getValue();
- if ((dialogInputValue != null) && (dlg instanceof ISystemPromptDialog))
- {
- ((ISystemPromptDialog)dlg).setInputObject(dialogInputValue);
- }
- if (dlgHelpId!=null)
- {
- if (dlg instanceof SystemPromptDialog)
- ((SystemPromptDialog)dlg).setHelp(dlgHelpId);
- else if (dlg instanceof SystemWizardDialog)
- ((SystemWizardDialog)dlg).setHelp(dlgHelpId);
- }
- if (dlg instanceof SystemPromptDialog)
- {
- if (needsProgressMonitorSet)
- ((SystemPromptDialog)dlg).setNeedsProgressMonitor(needsProgressMonitor);
- }
-
- int rc = dlg.open();
-
- // if (rc != 0) NOT RELIABLE!
- if (dlg instanceof SystemWizardDialog)
- {
- if (((SystemWizardDialog)dlg).wasCancelled())
- cancelled = true;
- //System.out.println("Testing cancelled state of SystemWizardDialog: " + cancelled);
- }
- else if (dlg instanceof SystemPromptDialog)
- {
- if (((SystemPromptDialog)dlg).wasCancelled())
- cancelled = true;
- //System.out.println("Testing cancelled state of SystemPromptDialog: " + cancelled);
- }
-
- if (!cancelled)
- {
- setValue(getDialogValue(dlg));
-
- if ((currentSelection != null) && !getProcessAllSelections())
- currentSelection = getNextSelection();
- else if (currentSelection != null)
- currentSelection = null;
- }
- else
- setValue(null);
- } while (!cancelled && (currentSelection != null));
- }
-
- // -----------------------------------------------------------
- // ABSTRACT METHODS...
- // -----------------------------------------------------------
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override actionPerformed with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected abstract Dialog createDialog(Shell parent);
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to retrieve the data
- * from the dialog. For SystemPromptDialog dialogs, this is simply
- * a matter of returning dlg.getOutputObject();
- * <p>
- * This is called by the run method after the dialog returns, and
- * wasCancelled() is false. Callers of this object can subsequently
- * retrieve this returned value by calling getValue. If you don't need
- * to pass a value back to the caller of this action, simply return null
- * from this method.
- *
- * @param dlg The dialog object, after it has returned from open.
- */
- protected abstract Object getDialogValue(Dialog dlg);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDummyAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDummyAction.java
deleted file mode 100644
index be36882dd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseDummyAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-/**
- * A dummy "placeholder" action for submenus that will be dynamically populated
- */
-public class SystemBaseDummyAction extends SystemBaseAction
-{
- public SystemBaseDummyAction()
- {
- super("dummy", null); //$NON-NLS-1$
- setSelectionSensitive(false);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseSubMenuAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseSubMenuAction.java
deleted file mode 100644
index cde645c72..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseSubMenuAction.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Our framework is designed to allow actions to be added to popup menus.
- * Sometimes, we want an expandable or cascading menu item for an action.
- * That is what this class is designed for. It represents a populated submenu.
- */
-public abstract class SystemBaseSubMenuAction
- extends SystemBaseAction
-
-{
-
- protected SystemSubMenuManager subMenu = null;
- protected String actionLabel;
- protected String menuID;
- protected boolean createMenuEachTime = true;
- protected boolean populateMenuEachTime = true;
- private boolean dontCascade = false;
- private boolean test;
- private static final IAction[] EMPTY_ACTION_ARRAY = new IAction[0];
-
- /**
- * Constructor for SystemBaseSubMenuAction when there is an image
- * @param label
- * @param tooltip
- * @param image The image to display for this action
- * @param shell The owning shell. If you pass null now, be sure to call setShell later
- *
- * @deprecated use fields from resource class directly now instead of via ResourceBundle
- */
- protected SystemBaseSubMenuAction(ResourceBundle rb, String label, String tooltip,ImageDescriptor image,Shell shell)
- {
- super(label, tooltip, image, shell);
- actionLabel = label;
- //setTracing(true);
- }
-
-
- /**
- * Constructor for SystemBaseSubMenuAction when there is just a string
- * @param label The label to display
- * @param parent The owning shell. If you pass null now, be sure to call setShell later
- */
- protected SystemBaseSubMenuAction(String label, Shell shell)
- {
- super(label, shell);
- actionLabel = label;
- //setTracing(true);
- }
- /**
- * Constructor for SystemBaseSubMenuAction when there is just a string
- * @param label The label to display
- * @param tooltip The tooltip to display
- * @param parent The owning shell. If you pass null now, be sure to call setShell later
- */
- protected SystemBaseSubMenuAction(String label, String tooltip, Shell shell)
- {
- super(label, tooltip, shell);
- actionLabel = label;
- //setTracing(true);
- }
- /**
- * Constructor for SystemBaseSubMenuAction when there is just a string and image
- * @param label The label to display
- * @param parent The owning shell. If you pass null now, be sure to call setShell later
- */
- protected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell)
- {
- super(label, image, shell);
- actionLabel = label;
- //setTracing(true);
- }
-
- /**
- * Constructor for SystemBaseSubMenuAction when there is just a string and image
- * @param label The label to display
- * @param tooltip the tooltip to display
- * @param parent The owning shell. If you pass null now, be sure to call setShell later
- */
- protected SystemBaseSubMenuAction(String label, String tooltip, ImageDescriptor image, Shell shell)
- {
- super(label, tooltip, image, shell);
- actionLabel = label;
- //setTracing(true);
- }
-
- /**
- * Set the menu ID. This is important to allow action contributions via the popupMenus extension point.
- */
- public void setMenuID(String Id)
- {
- this.menuID = Id;
- }
-
- /**
- * Call this if the submenu should be created on-the-fly every time, versus creating and populating it
- * only on the first usage.
- */
- public void setCreateMenuEachTime(boolean eachTime)
- {
- this.createMenuEachTime = eachTime;
- }
- /**
- * Call this if the submenu should be populated on-the-fly every time, versus populating it
- * only on the first usage. This only makes sense to be true if setCreateMenuEachTime is false.
- */
- public void setPopulateMenuEachTime(boolean eachTime)
- {
- this.populateMenuEachTime = eachTime;
- }
-
- /**
- * Set test mode on
- */
- public void setTest(boolean testMode)
- {
- this.test = testMode;
- }
-
-
- /**
- * <i>Must be overridden</i>
- * <p>Example of this:<p>
- * <pre><code>
- * menu.add(new MyAction1());
- * </code></pre>
- * @param menu The cascading menu, which is created for you. Add your actions to it.
- * @return The given menu if you just populated it, or a new menu if you want to create the menu yourself.
- */
- public abstract IMenuManager populateSubMenu(IMenuManager menu);
-
- /**
- * Return the MenuManager object. It is this that is added to the primary popup menu.
- */
- public IMenuManager getSubMenu()
- {
- if ((subMenu == null) || createMenuEachTime)
- {
- if (menuID == null)
- {
- if (test)
- subMenu = new SystemSubMenuManagerForTesting(this,actionLabel);
- else
- subMenu = new SystemSubMenuManager(this,actionLabel);
- }
- else
- {
- if (test)
- subMenu = new SystemSubMenuManagerForTesting(this, actionLabel, menuID);
- else
- subMenu = new SystemSubMenuManager(this,actionLabel, menuID);
- }
- createStandardGroups(subMenu);
- subMenu.setTracing(traceSelections, traceTarget);
- populateSubMenu(subMenu);
- if (traceSelections)
- {
- issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". createMenuEachTime = " + createMenuEachTime);
- }
- subMenu.setToolTipText(getToolTipText());
- //cascadeAllInputs(); no point in doing in now, setInputs will be called later by SV
- subMenu.addMenuListener(createMnemonicsListener(!populateMenuEachTime));
- }
- else if (populateMenuEachTime)
- {
- subMenu.removeAll();
- createStandardGroups(subMenu);
- populateSubMenu(subMenu);
- if (traceSelections)
- {
- issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". populateMenuEachTime = " + populateMenuEachTime);
- }
- //cascadeAllInputs(); no point in doing in now, setInputs will be called later by SV
- //Menu m = subMenu.getMenu();
- //System.out.println("SubMenu's menu null? " + (m==null));
- //if (m != null)
- //m.addMenuListener(new SystemViewMenuListener());
- }
- else if (traceSelections)
- {
- issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". SUBMENU ALREADY CREATED. ");
- }
-
- return subMenu;
- }
- /**
- * Creates the standard groups for the context sub-menu.
- */
- protected void createStandardGroups(IMenuManager menu)
- {
- if (!menu.isEmpty())
- return;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- //... decided it is better to let this get created when needed, else will be at the top of the menu.
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
-
- }
-
- /**
- * Return the actions currently in the menu.
- * Never returns null, but may return an empty array.
- */
- public IAction[] getActions()
- {
- //System.out.println("in getActions. subMenu null? "+(subMenu==null));
- if (subMenu==null)
- return EMPTY_ACTION_ARRAY;
- else
- {
- IContributionItem[] items = subMenu.getItems();
- //System.out.println("in getActions. #items "+items.length);
- Vector v = new Vector();
- for (int idx=0; idx<items.length; idx++)
- if (items[idx] instanceof ActionContributionItem)
- v.add( ((ActionContributionItem)items[idx]).getAction() );
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager menu = (SystemSubMenuManager)items[idx];
- v.add(menu.getParentCascadingAction());
- }
- //else
- //System.out.println("...item: "+items[idx].getClass().getName());
- IAction[] actions = new IAction[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- actions[idx] = (IAction)v.elementAt(idx);
- return actions;
- }
- }
-
-
-
- /**
- * Overridable method that instantiates the menu listener who job is to add mnemonics.
- * @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics need only be set once. False if it is dynamic
- */
- protected SystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
- {
- return new SystemViewMenuListener(setMnemonicsOnlyOnce);
- }
-
- /**
- * Sets the parent shell for this action. This is an override of our parent's method so we can
- * cascade it to each sub-action.
- */
- public void setShell(Shell shell)
- {
- super.setShell(shell);
- if (!dontCascade)
- cascadeShell();
- }
-
- /**
- * This is called by the framework to set the selection input, just prior to showing the popup menu.
- * We cascade this down to all of the actions added to this submenu.
- */
- public void setSelection(ISelection selection)
- {
- super.setSelection(selection);
- if (!dontCascade)
- cascadeSelection(selection);
- }
-
- /**
- * This is called by the framework to set the selection input, just prior to showing the popup menu.
- * We cascade this down to all of the actions added to this submenu.
- */
- public void setViewer(Viewer v)
- {
- super.setViewer(v);
- if (!dontCascade)
- cascadeViewer();
- }
-
- /**
- * Return the shell. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
- */
- public Shell getShell()
- {
- if (super.getShell(false) != null)
- return super.getShell(false);
- else if (subMenu != null)
- return subMenu.getShell();
- else
- return null;
- }
- /**
- * Return the selection. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
- */
- public IStructuredSelection getSelection()
- {
- if (super.getSelection() != null)
- return super.getSelection();
- else if (subMenu != null)
- return subMenu.getSelection();
- else
- return null;
- }
- /**
- * Return the viewer. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
- */
- public Viewer getViewer()
- {
- if (super.getViewer() != null)
- return super.getViewer();
- else if (subMenu != null)
- return subMenu.getViewer();
- else
- return null;
- }
-
- /**
- * Special method called by our submenu manager when from its setInputs method. No need to
- * cascade as the menu manager will do it for us.
- */
- public void setInputsFromSubMenuManager(Shell shell, Viewer v, ISelection selection)
- {
- dontCascade = true; // so we don't redundantly do cascading. Phil
- super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer
- dontCascade = false;
- }
-
- /**
- * An optimization for performance reasons that allows all inputs to be set in one call.
- * Intercept of parent so we can cascade to sub-actions. Note however this won't really ever
- * get called. This is because for cascading menu actions we don't put this action object into
- * the menumanager ... we put the SystemSubMenu object so that is what the SystemView will call.
- */
- public void setInputs(Shell shell, Viewer v, ISelection selection)
- {
- dontCascade = true; // so we don't redundantly do cascading. Phil
- super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer
- dontCascade = false;
- if (traceSelections)
- issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS");
- cascadeAllInputs();
- }
-
- /**
- * Cascade the current selection to all actions
- */
- private void cascadeSelection(ISelection selection)
- {
- if (traceSelections)
- {
- issueTraceMessage("*** INSIDE CASCADESELECTION ***");
- issueTraceMessage(" subMenu = " + subMenu);
- issueTraceMessage(" selection = " + selection);
- }
- if (subMenu == null)
- return;
- subMenu.setSelection(selection);
- /*
- IAction[] actions = subMenu.getActions();
- for (int idx=0; idx<actions.length; idx++)
- {
- if (actions[idx] instanceof ISystemAction)
- {
- ((ISystemAction)actions[idx]).setSelection(selection);
- }
- }
- */
- }
-
- /**
- * Cascade the current shell to all actions
- */
- private void cascadeShell()
- {
- if (subMenu == null)
- return;
- Shell shell = super.getShell(false);
- if (shell != null)
- {
- subMenu.setShell(shell);
- /*
- IAction[] items = subMenu.getActions();
- for (int idx=0; idx<items.length; idx++)
- if (items[idx] instanceof ISystemAction)
- ((ISystemAction)items[idx]).setShell(shell);
- */
- }
- }
-
- /**
- * Cascade the current viewer to all actions
- */
- private void cascadeViewer()
- {
- if (subMenu == null)
- return;
- if (viewer != null)
- {
- subMenu.setViewer(viewer);
- /*
- IAction[] items = subMenu.getActions();
- for (int idx=0; idx<items.length; idx++)
- if (items[idx] instanceof ISystemAction)
- ((ISystemAction)items[idx]).setViewer(viewer);
- */
- }
- }
-
- /**
- * Called when actions added dynamically
- */
- protected void cascadeAllInputs()
- {
- if (subMenu == null)
- return;
- Shell shell = super.getShell(false);
- Viewer viewer = super.getViewer();
- ISelection selection = super.getSelection();
- subMenu.setInputs(shell, viewer, selection);
- /*
- IAction[] actions = subMenu.getActions();
- if (traceSelections)
- {
- issueTraceMessage("INSIDE CASCADEALLINPUTS FOR "+actionLabel+". NBR ACTIONS = "+actions.length);
- }
-
- for (int idx=0; idx<actions.length; idx++)
- {
- if (actions[idx] instanceof ISystemAction)
- {
- ISystemAction action = (ISystemAction)actions[idx];
- action.setInputs(shell, viewer, selection);
- }
- }
- */
- }
-
- /**
- * Enable/disable this menu action. This amounts to enabling/disabling the associated sub menu.
- * Unfortunately, there is no way to do this!
- */
- public void setEnabled(boolean enable)
- {
- super.setEnabled(enable);
- if (subMenu!=null)
- {
- //subMenu.setEnabled(enable);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseWizardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseWizardAction.java
deleted file mode 100644
index 4ca9186f2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemBaseWizardAction.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.rse.ui.wizards.ISystemWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * A specialization for the eclipse Action method, for actions that put up wizards.
- * <p> This class is most effective when used with actions that extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard},
- * or implement {@link org.eclipse.rse.ui.wizards.ISystemWizard}. It supports
- * settings that are propogated to the wizard, and wizard pages if they extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage},
- * or implement {@link org.eclipse.rse.ui.wizards.ISystemWizardPage}.
- * </p>
- * The advantages to using this class over the base action class are:
- * <ul>
- * <li>Supports setting the label, description, image and tooltip text for this action, via constructors.
- * <li>Sets {@link org.eclipse.rse.ui.SystemBaseAction#allowOnMultipleSelection(boolean)} to false, since most wizard actions are not permitted on multiple selection.
- * <li>Supports setting whether the wizard requires a {@link org.eclipse.rse.ui.actions.SystemBaseDialogAction#setNeedsProgressMonitor() progress-monitor} or not, which is propogated to the wizard.
- * <li>Supports setting the overall wizard {@link #setWizardTitle(String) title}, which is propogated to the wizard.
- * <li>Supports setting the overall wizard {@link #setWizardImage(ImageDescriptor) image}, which is propogated to the wizard.
- * <li>Supports setting the default wizard {@link #setWizardPageTitle(String) page-title}, which is propogated to the wizard and the wizard pages.
- * <li>Supports setting the wizard;s default {@link #setHelp(String) contextual-help}, which is propogated to the wizard and the wizard pages.
- * <li>Supports setting the wizard's {@link #setMinimumPageSize(int,int) minimum-size}, which is propogated and applied to the wizard.
- * <li>Supports setting an {@link org.eclipse.rse.ui.SystemBaseAction#setInputObject(Object) input-object}, which is propogated to the wizard and wizard pages. By default, this
- * is set the current StructuredSelection.
- * <li>Supports querying a {@link org.eclipse.rse.ui.SystemBaseAction#getOutputObject() output-object} which is set by the wizard class.
- * <li>Supports a {@link #wasCancelled()} method so the caller can easily determine if the wizard was dismissed or cancelled by the user.
- * <li>Supports propogation of the {@link org.eclipse.rse.ui.SystemBaseAction#getViewer() current-viewer}.
- * </ul>
- *
- * <p>To use this class:</p>
- * <ol>
- * <li>Create your wizard class that extends {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard}, and is populated with
- * pages that extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage}.
- * <li>Define your action's label and tooltip translatable strings in a resource bundle, where the former's key ends with "label" and the latter's
- * key ends with "tooltip".
- * <li>Define your subclass of this wizard. Decide if you want to set the wizard's title, page-title, image, help and optionally minimum size
- * in your wizard subclass, or here in your action subclass. For re-use it is best to set it in the wizard, if possible.
- * <li>Override {@link #createWizard()} to instantiate, configure and return your wizard.
- * <li>Decide if you will do the work of the wizard in the wizard's performFinish method, or here in this action subclass. If here,
- * override {@link #postProcessWizard(IWizard)}. You might also override this if you need to set output variables in the action,
- * after the sucessful completion of the wizard.
- * </ol>
- */
-public abstract class SystemBaseWizardAction extends SystemBaseDialogAction
- implements ISystemWizardAction
-{
-
- private IWizard newWizard;
- private String wizardTitle, pageTitle;
- private ImageDescriptor wizardImage;
- private int minPageWidth=-1, minPageHeight=-1;
-
- /**
- * Constructor for SystemBaseWizardAction when translated label is known. You must separately
- * call setToolTipText and setDescription to enable these if desired.
- * @param text string to display in menu or toolbar
- * @param image icon to display in menu or toolbar. Can be null.
- * @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseWizardAction(String text, ImageDescriptor image, Shell parent)
- {
- super(text, image, parent);
- allowOnMultipleSelection(false);
- }
- /**
- * Constructor for SystemBaseWizardAction when translated label and tooltip are known. You must
- * separately call setDescription to enable this if desired.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseWizardAction(String text, String tooltip, ImageDescriptor image, Shell parent)
- {
- super(text, tooltip, image, parent);
- allowOnMultipleSelection(false);
- }
- /**
- * Constructor for SystemBaseWizardAction when translated label and tooltip and description are
- * all known.
- * @param text string to display in menu or toolbar
- * @param tooltip string to display when user hovers mouse over action.
- * @param description string displayed in status bar of some displays. Longer than tooltip.
- * @param image icon to display in menu or toolbar. Can be null.
- * @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
- */
- protected SystemBaseWizardAction(String text, String tooltip, String description, ImageDescriptor image, Shell parent)
- {
- super(text, tooltip, description, image, parent);
- allowOnMultipleSelection(false);
- }
-
-
-
- /**
- * Set the wizard title. Using this makes it possible to avoid subclassing a wizard
- */
- public void setWizardTitle(String title)
- {
- this.wizardTitle = title;
- }
- /**
- * Set the wizard image. Using this makes it possible to avoid subclassing a wizard
- */
- public void setWizardImage(ImageDescriptor wizardImage)
- {
- this.wizardImage = wizardImage;
- }
- /**
- * Set the wizard page title. Using this makes it possible to avoid subclassing.
- * The page title goes below the wizard title, and can be unique per page. However,
- * typically the wizard page title is the same for all pages... eg "Filter".
- * <p>
- * This is not used by default, but can be queried via getPageTitle() when constructing
- * pages.
- */
- public void setWizardPageTitle(String pageTitle)
- {
- this.pageTitle = pageTitle;
- }
- /**
- * Return the page title as set via setWizardPageTitle
- */
- public String getWizardPageTitle()
- {
- return pageTitle;
- }
- /**
- * Call this method to set the wizard's dimensions without having to subclass the wizard.
- * If you pass zero for either value, then the default will be used for that.
- */
- public void setMinimumPageSize(int width, int height)
- {
- //if (width <= 0)
- // width = 300; // found this number in WizardDialog code
- //if (height<= 0)
- // height = 225; // found this number in WizardDialog code
- this.minPageWidth = width;
- this.minPageHeight = height;
- }
- /**
- * Override of parent's method. Does the following:
- * <ul>
- * <li>Calls abstract createWizard() method to get wizard instance
- * <li>If wizard implements ISystemWizard, calls setInputValue(...), passing in
- * getValue() if not null, else passing in getFirstSelection() if not null.
- * <li>Instantiates a WizardDialog object with the wizard object from createWizard().
- * Returns this to run() in our parent class which then opens this dialog.
- * </ul>
- *
- */
- protected Dialog createDialog(Shell shell)
- {
- newWizard = createWizard();
-
- if ((newWizard instanceof Wizard) && wasNeedsProgressMonitorSet())
- ((Wizard)newWizard).setNeedsProgressMonitor(getNeedsProgressMonitor());
-
- if (newWizard instanceof Wizard)
- {
- if (wizardTitle != null)
- ((Wizard)newWizard).setWindowTitle(wizardTitle);
- if (wizardImage != null)
- ((Wizard)newWizard).setDefaultPageImageDescriptor(wizardImage);
- }
-
-
- WizardDialog dialog = null;
-
- if (newWizard instanceof ISystemWizard)
- {
- ISystemWizard swizard = (ISystemWizard)newWizard;
- if (pageTitle != null)
- swizard.setWizardPageTitle(pageTitle);
- swizard.setViewer(getViewer());
- dialog = new SystemWizardDialog(shell,swizard);
- int w = swizard.getMinimumPageWidth();
- int h = swizard.getMinimumPageHeight();
- if (minPageWidth > 0)
- w = minPageWidth;
- if (minPageHeight > 0)
- h = minPageHeight;
- //System.out.println("In SystemBaseWizardAction. minPageWidth = " + w + ", minPageHeight = " + h);
- if ((w>0) && (h>0))
- dialog.setMinimumPageSize(w,h);
-
- /*
- * Don't do the following here as it is redundant! The run method in the parent SystemBaseDialogAction
- * does this already
- Object wizardInputValue = null;
- if (getValue() != null)
- wizardInputValue = getValue();
- else
- wizardInputValue = getFirstSelection();
- if (wizardInputValue != null)
- ((SystemWizardDialog)dialog).setInputObject(wizardInputValue);
- */
- }
- else
- dialog = new WizardDialog(shell,newWizard);
-
- return dialog;
- }
-
- /**
- * The default processing for the run method calls createDialog, which
- * we override in this class. The implementation of createDialog calls
- * this method that you must override, to create the wizard. The result
- * goes into a WizardDialog which is opened and hence displayed to the
- * user.
- */
- protected abstract IWizard createWizard();
-
- /**
- * By default, we try to get the wizard's value by calling getOutputObject()
- */
- protected Object getDialogValue(Dialog dlg)
- {
- postProcessWizard(newWizard);
- if (newWizard instanceof ISystemWizard)
- {
- ISystemWizard ourWizard = (ISystemWizard)newWizard;
- return ourWizard.getOutputObject();
- }
- else
- return null;
- }
-
- /**
- * Typically, the wizard's performFinish method does the work required by
- * a successful finish of the wizard. However, often we also want to be
- * able to extract user-entered data from the wizard, by calling getters
- * in this action. To enable this, override this method to populate your
- * output instance variables from the completed wizard, which is passed
- * as a parameter. This is only called after successful completion of the
- * wizard.
- */
- protected void postProcessWizard(IWizard wizard)
- {
- }
-
- /**
- * Returns true if the user cancelled the wizard.
- * This is an override of the parent method, since we can be more
- * accurate with wizards than we can with dialogs.
- */
- public boolean wasCancelled()
- {
- if (newWizard instanceof ISystemWizard)
- {
- ISystemWizard ourWizard = (ISystemWizard)newWizard;
- return ourWizard.wasCancelled();
- }
- else
- return super.wasCancelled();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingBrowseWithAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingBrowseWithAction.java
deleted file mode 100644
index 6e2b73e3b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingBrowseWithAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Browse With->"
- */
-public class SystemCascadingBrowseWithAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingBrowseWithAction()
- {
- super(SystemResources.ACTION_CASCADING_BROWSEWITH_LABEL,SystemResources.ACTION_CASCADING_BROWSEWITH_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_BROWSEWITH);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingCompareWithAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingCompareWithAction.java
deleted file mode 100644
index ebf10a73d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingCompareWithAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Compare With->"
- */
-public class SystemCascadingCompareWithAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingCompareWithAction()
- {
- super(SystemResources.ACTION_CASCADING_COMPAREWITH_LABEL, SystemResources.ACTION_CASCADING_COMPAREWITH_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_COMPAREWITH);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingExpandToAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingExpandToAction.java
deleted file mode 100644
index 2bdbba0d4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingExpandToAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Expand To->"
- */
-public class SystemCascadingExpandToAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingExpandToAction()
- {
- super(SystemResources.ACTION_CASCADING_EXPAND_TO_LABEL, SystemResources.ACTION_CASCADING_EXPAND_TO_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_EXPANDTO);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGoToAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGoToAction.java
deleted file mode 100644
index 4e9389ed7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGoToAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.SystemViewPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.framelist.BackAction;
-import org.eclipse.ui.views.framelist.ForwardAction;
-import org.eclipse.ui.views.framelist.FrameList;
-import org.eclipse.ui.views.framelist.UpAction;
-
-
-/**
- * A cascading menu action for "Go To->"
- */
-public class SystemCascadingGoToAction extends SystemBaseSubMenuAction
-{
- //private IAdaptable pageInput;
- //private IMenuManager parentMenuManager;
- private boolean actionsMade = false;
-
- private SystemViewPart fSystemViewPart;
- private BackAction backAction;
- private ForwardAction forwardAction;
- private UpAction upAction;
-
-
- /**
- * Constructor
- */
- public SystemCascadingGoToAction(Shell shell, SystemViewPart systemViewPart)
- {
- super(SystemResources.ACTION_CASCADING_GOTO_LABEL, SystemResources.ACTION_CASCADING_GOTO_TOOLTIP, shell);
- setMenuID(ISystemContextMenuConstants.MENU_GOTO);
- this.fSystemViewPart = systemViewPart;
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_GOTO);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager gotoMenu)
- {
- if (!actionsMade)
- makeActions();
- gotoMenu.add(backAction);
- gotoMenu.add(forwardAction);
- gotoMenu.add(upAction);
- return gotoMenu;
- }
-
- protected void makeActions()
- {
- FrameList frameList = fSystemViewPart.getFrameList();
- backAction = new BackAction(frameList);
- forwardAction = new ForwardAction(frameList);
- upAction = new UpAction(frameList);
-
- actionsMade = true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGotoActionOLD.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGotoActionOLD.java
deleted file mode 100644
index b33b91434..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingGotoActionOLD.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "View->"
- */
-public class SystemCascadingGotoActionOLD extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingGotoActionOLD()
- {
- super(SystemResources.ACTION_CASCADING_GOTO_LABEL, SystemResources.ACTION_CASCADING_GOTO_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_GOTO);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingNewAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingNewAction.java
deleted file mode 100644
index c11482cb1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingNewAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "New->"
- */
-public class SystemCascadingNewAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor for SystemCascadingNewAction
- */
- public SystemCascadingNewAction()
- {
- super(SystemResources.ACTION_CASCADING_NEW_LABEL, SystemResources.ACTION_CASCADING_NEW_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_NEW);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingOpenWithAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingOpenWithAction.java
deleted file mode 100644
index 925c13ea7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingOpenWithAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Open With->"
- */
-public class SystemCascadingOpenWithAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingOpenWithAction()
- {
- super(SystemResources.ACTION_CASCADING_OPENWITH_LABEL, SystemResources.ACTION_CASCADING_OPENWITH_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_OPENWITH);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPreferencesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPreferencesAction.java
deleted file mode 100644
index 930b1bed2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPreferencesAction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * A cascading menu action for "Preferences->".
- * @see org.eclipse.rse.ui.actions.SystemShowPreferencesPageAction
- */
-public class SystemCascadingPreferencesAction
- extends SystemBaseSubMenuAction implements IMenuListener
-{
-
- /**
- * Constructor
- */
- public SystemCascadingPreferencesAction(Shell shell)
- {
- super(SystemResources.ACTION_CASCADING_PREFERENCES_LABEL, SystemResources.ACTION_CASCADING_PREFERENCES_TOOLTIP, shell);
- setMenuID(ISystemContextMenuConstants.MENU_PREFERENCES);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- setSelectionSensitive(false);
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actnpref");
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager ourSubMenu)
- {
- // WE DON'T WANT TO FIRE UP ALL PLUGINS THAT USE OUR EXTENSION POINT,
- // AT THE TIEM WE ARE CREATING OUR VIEW! SO WE DEFER IT UNTIL THIS CASCADING
- // MENU IS FIRST EXPANDED...
- ourSubMenu.addMenuListener(this);
- ourSubMenu.setRemoveAllWhenShown(true);
- //menu.setEnabled(true);
- ourSubMenu.add(new SystemBaseAction("dummy",null));
-
- return ourSubMenu;
- }
-
- /**
- * Called when submenu is about to show
- */
- public void menuAboutToShow(IMenuManager ourSubMenu)
- {
- //System.out.println("In menuAboutToShow!");
- setBusyCursor(true);
- ourSubMenu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- SystemShowPreferencesPageAction[] prefPageActions = RSEUIPlugin.getDefault().getShowPreferencePageActions();
- if (prefPageActions!=null)
- {
- for (int idx=0; idx<prefPageActions.length; idx++)
- {
- prefPageActions[idx].setShell(getShell());
- ourSubMenu.appendToGroup(ISystemContextMenuConstants.GROUP_ADDITIONS, prefPageActions[idx]);
- }
- }
- setBusyCursor(false);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPulldownMenuAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPulldownMenuAction.java
deleted file mode 100644
index 5a0a6f6f9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingPulldownMenuAction.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.SystemViewPart;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A cascading menu action for a toolbar, emulating the pulldown menu view parts have.
- */
-public class SystemCascadingPulldownMenuAction
- extends SystemBaseSubMenuAction
- implements IMenuListener, IMenuCreator
-{
-
- private SystemSubMenuManager dropDownMenuMgr;
- private ISelectionProvider sp = null;
-
- /**
- * Constructor
- */
- public SystemCascadingPulldownMenuAction(Shell shell, ISelectionProvider selectionProviderForToolbarActions)
- {
- super(SystemResources.ACTION_CASCADING_PULLDOWN_LABEL, SystemResources.ACTION_CASCADING_PULLDOWN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID),shell);
- sp = selectionProviderForToolbarActions;
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- setMenuCreator(this); // this IAction method tells JFace this is a dropdown menu
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- menu.addMenuListener(this);
- menu.setRemoveAllWhenShown(false);
- boolean showConnectionActions = true;
- SystemViewPart.populateSystemViewPulldownMenu(menu, getShell(), showConnectionActions, null, sp);
- return menu;
- }
-
- /**
- * Called when submenu is about to show
- */
- public void menuAboutToShow(IMenuManager ourSubMenu)
- {
- }
-
- //------------------------
- // IMenuCreator methods...
- //------------------------
- /**
- * dispose method comment.
- */
- public void dispose()
- {
- if (dropDownMenuMgr != null)
- {
- dropDownMenuMgr.dispose();
- dropDownMenuMgr = null;
- }
- }
- /**
- * getMenu method comment.
- */
- public Menu getMenu(Control parent)
- {
- if (dropDownMenuMgr == null)
- {
- //dropDownMenuMgr = new MenuManager();
- dropDownMenuMgr = (SystemSubMenuManager)getSubMenu();
- }
- return dropDownMenuMgr.createContextMenu(parent);
- }
- public Menu getMenu(Menu parent)
- {
- //System.out.println("In SystemCascadingPulldownMenuAction#getMenu(Menu)");
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServerBaseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServerBaseAction.java
deleted file mode 100644
index cfd68fa6f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServerBaseAction.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This is the base class for actions that populate the "Remote Servers" cascading
- * menu. The actions in this menu cascade again, into Start and Stop actions.
- * These cascading actions are handling automatically by this base class, but when
- * they are run, they call back into abstract methods in this base class, to
- * actually start and stop the remote server/daemon.
- *
- */
-public abstract class SystemCascadingRemoteServerBaseAction extends SystemBaseSubMenuAction implements IMenuListener
-{
- private SystemRemoteServerStartAction startAction;
- private SystemRemoteServerStopAction stopAction;
-
- /**
- * Constructor
- * @deprecated
- */
- public SystemCascadingRemoteServerBaseAction(String label, String tooltip, Shell shell)
- {
- super(label, tooltip, shell);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- }
-
- /**
- * Populate the submenu for this action. Here is where we add the start and stop actions.
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- startAction = new SystemRemoteServerStartAction(getShell(), this);
- stopAction = new SystemRemoteServerStopAction(getShell(), this);
- startAction.setHelp(getHelpContextId());
- stopAction.setHelp(getHelpContextId());
- menu.add(startAction);
- menu.add(stopAction);
- menu.addMenuListener(this); // we want to know when menu is about to be shown.
- //System.out.println("in populateSubMenu in "+getClass().getName());
- return menu;
- }
-
- /**
- * Called when submenu is about to show.
- * We use this to decide whether to enable/disable the start and stop actions underneath.
- */
- public void menuAboutToShow(IMenuManager subMenu)
- {
- //System.out.println("menuAboutToShow");
- /*
- IStructuredSelection selection = getSelection();
- if( selection == null )
- {
- subMenu.add(new SystemBaseAction("Programming error. Selection is null! ", null));
- return;
- } // end if(nothing is selected)
- */
- if (!isEnabled())
- {
- startAction.setEnabled(false);
- stopAction.setEnabled(false);
- }
- else if (canDetectServerState())
- {
- //System.out.println("in action itself. getSystemConnection() = "+getSystemConnection());
- boolean started = isServerStarted(getSystemConnection());
- //System.out.println("... started? "+started);
- startAction.setEnabled(started);
- stopAction.setEnabled(!started);
- }
- }
- /**
- * This method is an opportunity to decide whether to enable this action or not.
- * Sometimes we can determine if the connection is connected or not, in which case
- * we want to disable this action if the connection is not connected.
- */
- protected boolean shouldEnable(IHost connection)
- {
- return true;
- }
-
- /**
- * Overridable method to tell the base code if you are able to determine dynamically if
- * the server is currently running or not. The default is true, and so {@link #isStarted(IHost)} is
- * called to determine enablement state of the cascading start and stop actions. If you
- * cannot determine this, override this method and return false, and both start and stop
- * will be enabled always.
- * @return true if you have the capability of dynamically determining if this server is running.
- */
- protected boolean canDetectServerState()
- {
- return true;
- }
-
- /**
- * Overridable method to compute if this remote server/daemon is currently running or not.
- * This decides the enablement of the start and stop actions underneath. If there is no way
- * to determine this, return false from {@link #canDetectServerState()}, and ignore this method.
- * @return true if the server is currently running or not.
- */
- protected abstract boolean isServerStarted(IHost connection);
-
- /**
- * Callback from the {@link org.eclipse.rse.ui.actions.SystemRemoteServerStartAction} class
- * that is called when the user selects to start this remote server/daemon.
- * @return true if the remote server was successfully started, false if not.
- */
- public abstract boolean startServer();
-
- /**
- * Callback from the {@link org.eclipse.rse.ui.actions.SystemRemoteServerStartAction} class
- * that is called when the user selects to stop this remote server/daemon.
- * @return true if the remote server was successfully stopped, false if not.
- */
- public abstract boolean stopServer();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServersAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServersAction.java
deleted file mode 100644
index 026262382..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingRemoteServersAction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Remote Servers->". The actions contributed to the
- * menu must implement the ISystemRemoteServerAction interface.
- * @see org.eclipse.rse.ui.actions.ISystemRemoteServerAction
- */
-public class SystemCascadingRemoteServersAction extends SystemBaseSubMenuAction implements IMenuListener
-{
-
- /**
- * Constructor
- */
- public SystemCascadingRemoteServersAction()
- {
- super(SystemResources.ACTION_CASCADING_REMOTESERVERS_LABEL, SystemResources.ACTION_CASCADING_REMOTESERVERS_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_STARTSERVER);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- setHelp(RSEUIPlugin.HELPPREFIX+"actnsrsv"); //$NON-NLS-1$
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- menu.addMenuListener(this);
- //System.out.println("in populateSubMenu");
- return menu;
- }
-
- /**
- * Called when submenu is about to show
- */
- public void menuAboutToShow(IMenuManager subMenu)
- {
- //System.out.println("menuAboutToShow");
- IStructuredSelection selection = getSelection();
- if( selection == null )
- {
- subMenu.add(new SystemBaseAction("Programming error. Selection is null! ", null));
- return;
- } // end if(nothing is selected)
- Object firstSelection = selection.getFirstElement();
- IHost conn = null;
- if (firstSelection instanceof IHost)
- conn = (IHost)firstSelection;
- else if (firstSelection instanceof ISubSystem)
- conn = ((ISubSystem)firstSelection).getHost();
-
- // decide whether or not to enable/disable each entry, by letting it decide...
- IAction[] actions = getActions();
- //System.out.println("...how many actions? "+actions.length);
- //System.out.println("...connection null ? "+(conn==null));
- for (int idx=0; idx<actions.length; idx++)
- {
- if (actions[idx] instanceof SystemCascadingRemoteServerBaseAction)
- {
- SystemCascadingRemoteServerBaseAction action = (SystemCascadingRemoteServerBaseAction)actions[idx];
- action.setHost(conn);
- if (conn.isOffline())
- action.setEnabled(false);
- else
- action.setEnabled(action.shouldEnable(conn));
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingReplaceWithAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingReplaceWithAction.java
deleted file mode 100644
index 445938ca8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingReplaceWithAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Replace With->"
- */
-public class SystemCascadingReplaceWithAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingReplaceWithAction()
- {
- super(SystemResources.ACTION_CASCADING_REPLACEWITH_LABEL, SystemResources.ACTION_CASCADING_REPLACEWITH_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_REPLACEWITH);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingViewAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingViewAction.java
deleted file mode 100644
index 1690dba88..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingViewAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-
-
-
-/**
- * A cascading menu action for "View->"
- */
-public class SystemCascadingViewAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingViewAction()
- {
- super(SystemResources.ACTION_CASCADING_VIEW_LABEL, SystemResources.ACTION_CASCADING_VIEW_TOOLTIP, null);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingWorkWithAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingWorkWithAction.java
deleted file mode 100644
index addbdc66d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCascadingWorkWithAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * A cascading menu action for "Work With->"
- */
-public class SystemCascadingWorkWithAction extends SystemBaseSubMenuAction
-{
-
- /**
- * Constructor
- */
- public SystemCascadingWorkWithAction()
- {
- super(SystemResources.ACTION_CASCADING_WORKWITH_LABEL, SystemResources.ACTION_CASCADING_WORKWITH_TOOLTIP, null);
- setMenuID(ISystemContextMenuConstants.MENU_WORKWITH);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(true);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- // we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
- return menu;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearAllPasswordsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearAllPasswordsAction.java
deleted file mode 100644
index 00aa52d3b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearAllPasswordsAction.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Action to clear cached passwords for all subsystems in a connection.
- */
-public class SystemClearAllPasswordsAction extends SystemBaseAction {
-
- /**
- * Constructor.
- * @param shell the parent shell.
- */
- public SystemClearAllPasswordsAction(Shell shell) {
- super(SystemResources.ACTION_CLEARPASSWORD_ALL_LABEL, SystemResources.ACTION_CLEARPASSWORD_ALL_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- }
-
- /**
- * @see org.eclipse.rse.ui.actions.SystemBaseAction#checkObjectType(java.lang.Object)
- */
- public boolean checkObjectType(Object selectedObject) {
-
- if (!(selectedObject instanceof IHost)) {
- return false;
- }
- else {
-
- IHost conn = (IHost)selectedObject;
-
- ISubSystem[] subsystems = conn.getSubSystems();
-
- boolean anyOk = false;
-
- for (int i = 0; i < subsystems.length; i++) {
-
- ISubSystem subsystem = subsystems[i];
- IConnectorService system = subsystem.getConnectorService();
-
- anyOk = !system.isConnected() && system.isPasswordCached(true);
-
- if (anyOk)
- {
- return true;
- }
- }
-
- return anyOk;
- }
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- IHost conn = (IHost)getFirstSelection();
-
- ISubSystem[] subsystems = conn.getSubSystems();
-
- for (int i = 0; i < subsystems.length; i++)
- {
- ISubSystem ss = subsystems[i];
- try
- {
- IConnectorService system = ss.getConnectorService();
-
- if (system.isPasswordCached() || system.isPasswordCached(true))
- {
- // get the user id
- String userId = system.getUserId();
-
- // clear userid/password from memory and fire event
- //DKM and disk now
- system.clearPasswordCache(true);
- RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss,
- ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,
- ss.getHost()));
- }
-
- }
- catch (Exception exc)
- {
- // msg already shown
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java
deleted file mode 100644
index b007c34d7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is the action for clearing in-memory userId and password cache
- */
-public class SystemClearPasswordAction extends SystemBaseAction
-{
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemClearPasswordAction(Shell shell)
- {
- super(SystemResources.ACTION_CLEARPASSWORD_LABEL, SystemResources.ACTION_CLEARPASSWORD_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0049");
- }
-
- /**
- * Override of parent.
- * Called when testing if an action should be enabled based on the current selection.
- * The clear password action can be enabled if the selected object is a subsystem
- * that is not connected and has a password that is saved.
- * @return true if the clear password action can be enabled.
- */
- public boolean checkObjectType(Object obj) {
- boolean result = false;
- if (obj instanceof ISubSystem) {
- ISubSystem subsystem = (ISubSystem) obj;
- IConnectorService cs = subsystem.getConnectorService();
- result = !cs.isConnected() && cs.isPasswordCached(true);
- }
- return result;
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- ISubSystem ss = (ISubSystem)getFirstSelection();
- try {
- IConnectorService system = ss.getConnectorService();
- system.clearPasswordCache(true);
- RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss,
- ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,
- ss.getHost()));
- }
- catch (Exception exc) {
- // msg already shown
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java
deleted file mode 100644
index a906da125..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemTree;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The action allows users to collapse the selected nodes in the Remote Systems Explorer tree view
- */
-public class SystemCollapseAction extends SystemBaseAction {
- /**
- * Constructor
- * @param parent the parent shell for this action
- */
- public SystemCollapseAction(Shell parent) {
- super(SystemResources.ACTION_COLLAPSE_SELECTED_LABEL, SystemResources.ACTION_COLLAPSE_SELECTED_TOOLTIP, parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
- setAccelerator('-');
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0024");
- setAvailableOffline(true);
- }
-
- /**
- * We intercept to ensure at least one selected item is collapsable
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection) {
- boolean enable = false;
- if ((viewer != null) && (viewer instanceof ISystemTree)) {
- return ((ISystemTree) viewer).areAnySelectedItemsExpanded();
- }
- Iterator e = selection.iterator();
- ISystemViewElementAdapter adapter = null;
- while (!enable && e.hasNext()) {
- Object selectedObject = e.next();
- adapter = getAdapter(selectedObject);
- if (adapter != null) {
- if (adapter.hasChildren(selectedObject)) enable = true;
- }
- }
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- //System.out.println("Inside run of SystemRefreshAction");
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) {
- sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_COLLAPSE_SELECTED, null));
- } else
- sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_COLLAPSE_SELECTED, null));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java
deleted file mode 100644
index 4d21937cb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The action allows users to collapse the entire Remote Systems Explorer tree view.
- */
-public class SystemCollapseAllAction extends SystemBaseAction {
- /**
- * Constructor
- * @param parent the shell that is employing this action
- */
- public SystemCollapseAllAction(Shell parent) {
- super(SystemResources.ACTION_COLLAPSE_ALL_LABEL, SystemResources.ACTION_COLLAPSE_ALL_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_COLLAPSEALL_ID), // D54577
- parent);
- setHoverImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptorFromIDE("elcl16/collapseall.gif")); //$NON-NLS-1$
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); // should never be used
- setSelectionSensitive(false);
-
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0023");
- setAccelerator(SWT.CTRL | '-');
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection) {
- return true;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) {
- sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
- } else
- sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonDeleteAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonDeleteAction.java
deleted file mode 100644
index 606f4b64d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonDeleteAction.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemDeleteDialog;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The action that displays the Delete confirmation dialog.There are two ways to use this action:
- * <ol>
- * <li>When invoking from a class that implements ISystemDeleteTarget. In this case, that class
- * will be called back to determine if this action is to be enabled or not, and to do the actual delete for
- * each selected object, after the dialog is dismissed.
- * <li>When used without an ISystemDeleteTarget, in which case you need to call wasCancelled() after
- * running the action, and then do your own delete.
- * </ol>
- * <p>
- * If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
- * {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter}, then you
- * should call {@link #setNameValidator(org.eclipse.rse.core.ui.validators.ISystemValidator)} to
- * specify a validator that is called to verify the typed new name is valid. Further, to show the type value
- * of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
- *
- * @see org.eclipse.rse.ui.dialogs.SystemDeleteDialog
- */
-public class SystemCommonDeleteAction
- extends SystemBaseDialogAction
- implements ISystemIconConstants
-{
- private String promptLabel;
-
- /**
- * Constructor for SystemDeleteAction when using a delete target
- * @param parent The Shell of the parent UI for this dialog
- * @param deleteTarget The UI part that has selectable and deletable parts.
- */
- public SystemCommonDeleteAction(Shell parent, ISystemDeleteTarget deleteTarget)
- {
- super(SystemResources.ACTION_DELETE_LABEL, SystemResources.ACTION_DELETE_TOOLTIP,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)
- , parent);
- setSelectionProvider(deleteTarget);
- allowOnMultipleSelection(true);
- setProcessAllSelections(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0021");
- }
-
- /**
- * Constructor for SystemDeleteAction when not using a delete target
- * @param parent The Shell of the parent UI for this dialog
- */
- public SystemCommonDeleteAction(Shell parent)
- {
- this(parent, null);
- }
-
- /**
- * Specify the text to show for the label prompt. The default is
- * "Delete selected resources?"
- */
- public void setPromptLabel(String text)
- {
- this.promptLabel = text;
- }
-
- private ISystemDeleteTarget getDeleteTarget()
- {
- return (ISystemDeleteTarget)getSelectionProvider();
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemDeleteTarget deleteTarget = getDeleteTarget();
- if (deleteTarget == null)
- return true;
- else
- return deleteTarget.showDelete() && getDeleteTarget().canDelete();
- }
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override run with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected Dialog createDialog(Shell shell)
- {
- SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
- if (promptLabel != null)
- dlg.setPromptLabel(promptLabel);
- Object firstSelection = getFirstSelection();
- if (getRemoteAdapter(firstSelection) != null)
- {
- String warningMsg = null;
- String warningTip = null;
-
- warningMsg = SystemResources.RESID_DELETE_WARNING_LABEL;
- warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP;
- dlg.setWarningMessage(warningMsg,warningTip);
- }
- return dlg;
- }
-
- public class DeleteRunnable implements IRunnableWithProgress
- {
- private ISystemDeleteTarget _target;
- public DeleteRunnable(ISystemDeleteTarget target)
- {
- _target = target;
- }
-
- public void run(IProgressMonitor monitor)
- {
- _target.doDelete(monitor); // deletes all the currently selected items
- }
- }
-
- /**
- * Required by parent.
- * In our case, we overload it to also perform the deletion, but only if using a delete target,
- * else it is up to the caller to call wasCancelled() and if not true, do their own deletion.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- if (!((SystemDeleteDialog)dlg).wasCancelled() && (getDeleteTarget() != null))
- {
- ISystemDeleteTarget target = getDeleteTarget();
- DeleteRunnable delRunnable = new DeleteRunnable(target);
- IRunnableContext runnableContext = getRunnableContext(dlg.getShell());
- try
- {
- runnableContext.run(false, true, delRunnable);
- }
- catch (Exception e)
- {
- }
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- setEnabled(target.canDelete());
- }
- return null;
- }
-
- protected IRunnableContext getRunnableContext(Shell shell)
- {
- IRunnableContext irc = RSEUIPlugin.getTheSystemRegistry().getRunnableContext();
- if (irc != null)
- {
- return irc;
- }
- else
- {
- irc = new ProgressMonitorDialog(shell);
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
- return irc;
- }
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonRenameAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonRenameAction.java
deleted file mode 100644
index 665512c51..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonRenameAction.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemRenameDialog;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the Rename dialog. There are two ways to use this action:
- * <ol>
- * <li>When invoking from a class that implements ISystemRenameTarget. In this case, that class
- * will be called back to determine if this action is to be enabled or not, and to do the actual rename for
- * each selected object, after the dialog is dismissed.
- * <li>When used without an ISystemRenameTarget, in which case you need to call getNewNames() after
- * running the action, and then use the new names to do the rename. This will return null if the dialog
- * was cancelled.
- * </ol>
- * <p>
- * If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
- * {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter}, then you
- * should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
- * specify a validator that is called to verify the typed new name is valid. Further, to show the type value
- * of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
- *
- * @see org.eclipse.rse.ui.dialogs.SystemRenameDialog
- * @see org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog
- */
-public class SystemCommonRenameAction extends SystemBaseDialogAction
-
-{
- private ISystemRenameTarget renameTarget;
- private boolean copyCollisionMode = false;
- private String newNames[];
- private ISystemValidator nameValidator;
- private String singleSelectionHelp, multiSelectionHelp, promptLabel, promptTip, verbage;
-
- /**
- * Constructor when using a rename target
- * @param parent The Shell of the parent UI for this dialog
- * @param target The UI part that has selectable and renamable parts.
- */
- public SystemCommonRenameAction(Shell parent, ISystemRenameTarget target)
- {
- super(SystemResources.ACTION_RENAME_LABEL, SystemResources.ACTION_RENAME_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_RENAME_ID), parent);
- allowOnMultipleSelection(true);
- setProcessAllSelections(true);
- renameTarget = target;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0018");
- }
-
- /**
- * Constructor when not using a rename target
- * @param parent The Shell of the parent UI for this dialog
- */
- public SystemCommonRenameAction(Shell parent)
- {
- this(parent, null);
- }
- /**
- * Set the help to use in the dialog when there is a single selection
- */
- public void setDialogSingleSelectionHelp(String helpID)
- {
- this.singleSelectionHelp = helpID;
- }
- /**
- * Set the help to use in the dialog when there are multiple selections
- */
- public void setDialogMultiSelectionHelp(String helpID)
- {
- this.multiSelectionHelp = helpID;
- }
- /**
- * Set the label and tooltip of the prompt, used when only one thing is selected. The default is "New name:"
- */
- public void setSingleSelectPromptLabel(String label, String tooltip)
- {
- this.promptLabel = label;
- this.promptTip = tooltip;
- }
- /**
- * Set the verbage to show at the top of the table, used when multi things are selected. The default is "Enter a new name for each resource"
- */
- public void setMultiSelectVerbage(String verbage)
- {
- this.verbage = verbage;
- }
-
- /**
- * Set the validator for the new name,as supplied by the adaptor for name checking.
- * Overrides the default which is to query it from the object's adapter.
- */
- public void setNameValidator(ISystemValidator nameValidator)
- {
- this.nameValidator = nameValidator;
- }
-
- /**
- * Indicate this dialog is the result of a copy/move name collision.
- * Affects the title, verbage at the top of the dialog, and context help.
- */
- public void setCopyCollisionMode(boolean copyCollisionMode)
- {
- this.copyCollisionMode = copyCollisionMode;
- }
- /**
- * Query if this dialog is the result of a copy/move name collision.
- * Affects the title, verbage at the top of the dialog, and context help.
- */
- public boolean getCopyCollisionMode()
- {
- return copyCollisionMode;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- * We overload it to call canRename() in the SystemView class.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- if (renameTarget == null)
- return true;
- else
- return renameTarget.canRename();
- }
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override run with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected Dialog createDialog(Shell parent)
- {
- // multi-select
- if (getSelection().size() > 1)
- {
- SystemRenameDialog dlg = new SystemRenameDialog(parent);
- if (nameValidator != null)
- dlg.setNameValidator(nameValidator);
- if (multiSelectionHelp != null)
- dlg.setHelp(multiSelectionHelp);
- if (verbage != null)
- dlg.setVerbage(verbage);
- return dlg;
- }
- // single-select
- else
- {
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(parent);
- if (copyCollisionMode)
- dlg.setCopyCollisionMode(copyCollisionMode);
- if (nameValidator != null)
- dlg.setNameValidator(nameValidator);
- if (singleSelectionHelp != null)
- dlg.setHelp(singleSelectionHelp);
- if ((promptLabel != null) || (promptTip != null))
- dlg.setPromptLabel(promptLabel, promptTip);
- return dlg;
- }
- }
-
- /**
- * Required by parent. We use it to actually do the rename by calling doRename
- * in the supplied ISystemRenameTarget, if we are in that mode.
- * As a result, we return null from here.
- * @see #getNewNames()
- */
- protected Object getDialogValue(Dialog dlg)
- {
- newNames = null;
- if (dlg instanceof SystemRenameDialog)
- {
- SystemRenameDialog rnmDlg = (SystemRenameDialog)dlg;
- if (!rnmDlg.wasCancelled())
- {
- newNames = rnmDlg.getNewNames();
- if (renameTarget != null)
- renameTarget.doRename(newNames); // perform the actual renames.
- }
- }
- else
- {
- SystemRenameSingleDialog rnmDlg = (SystemRenameSingleDialog)dlg;
- if (!rnmDlg.wasCancelled())
- {
- String name = rnmDlg.getNewName();
- newNames = new String[1];
- newNames[0] = name;
- if (renameTarget != null)
- renameTarget.doRename(newNames); // perform the actual renames.
- }
- }
- return null;
- }
-
- /**
- * Return the new names entered by the user. You only need to call this when you don't supply a
- * rename target. In this case, it is your responsibility to do the actual renames.
- * @return - array of new names, with the order matching the order of the input selection. Null if dialog cancelled.
- */
- public String[] getNewNames()
- {
- return newNames;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonSelectAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonSelectAllAction.java
deleted file mode 100644
index 771b5a0b5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCommonSelectAllAction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.view.ISystemSelectAllTarget;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * The global action that enables select all.
- * For the RSE tree view, we interpret select all to mean select all the
- * children of the currently selected parent, if applicable.
- */
-public class SystemCommonSelectAllAction
- extends SystemBaseAction
-
-{
- private ISystemSelectAllTarget target;
-
- /**
- * Constructor
- * @param parent The Shell of the parent UI for this dialog
- * @param selProvider The viewer that provides the selections
- * @param target The viewer that is running this action
- */
- public SystemCommonSelectAllAction(Shell parent, ISelectionProvider selProvider, ISystemSelectAllTarget target)
- {
- //super(RSEUIPlugin.getResourceBundle(), ISystemConstants.ACTION_SELECTALL, null, parent); TODO: XLATE!
- super("Select All", (ImageDescriptor)null, parent);
- setSelectionProvider(selProvider);
- this.target = target;
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- //setHelp(RSEUIPlugin.HELPPREFIX+"actn0021"); // TODO: ADD HELP!
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return target.enableSelectAll(selection);
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- target.doSelectAll(getSelection());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java
deleted file mode 100644
index c4374dce7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-//import org.eclipse.rse.core.ui.SystemMessage;
-
-
-/**
- * This is the action for connecting to the remote subsystem
- */
-public class SystemConnectAction extends SystemBaseAction
-{
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemConnectAction(Shell shell)
- {
- super(SystemResources.ACTION_CONNECT_LABEL,SystemResources.ACTION_CONNECT_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0047");
- }
- /**
- * Override of parent. Called when testing if action should be enabled base on current
- * selection. We check the selected object is one of our subsystems, and we are not
- * already connected.
- */
- public boolean checkObjectType(Object obj)
- {
- if ( !(obj instanceof ISubSystem) ||
- ((ISubSystem)obj).getConnectorService().isConnected() )
- return false;
- else
- return true;
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- ISubSystem ss = (ISubSystem)getFirstSelection();
- try {
- if (ss.getHost().getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
- ss.connect();
- else
- ss.connect(true);
- } catch (Exception exc) {} // msg already shown
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java
deleted file mode 100644
index 9cb29b37e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This is the action for connecting all subsystems for a given connection.
- */
-public class SystemConnectAllSubSystemsAction extends SystemBaseAction
-{
-
- private ISystemRegistry sr = null;
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemConnectAllSubSystemsAction(Shell shell)
- {
- super(SystemResources.ACTION_CONNECT_ALL_LABEL,SystemResources.ACTION_CONNECT_ALL_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- sr = RSEUIPlugin.getTheSystemRegistry();
- //setHelp(RSEUIPlugin.HELPPREFIX+"actn0022");
- }
- /**
- * Override of parent. Called when testing if action should be enabled base on current
- * selection. We check the selected object is one of our subsystems, and if we are
- * currently connected.
- */
- public boolean checkObjectType(Object obj)
- {
- if ((obj instanceof IHost) &&
- !sr.areAllSubSystemsConnected((IHost)obj))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- List failedSystems = new ArrayList();
- IHost conn = (IHost)getFirstSelection();
- try
- {
- Shell shell = getShell();
- ISubSystem[] subsystems = conn.getSubSystems();
- for (int i = 0; i < subsystems.length; i++)
- {
- ISubSystem subsystem = subsystems[i];
- IConnectorService system = subsystem.getConnectorService();
- if (!subsystem.isConnected() && !failedSystems.contains(system))
- {
- try
- {
- subsystem.connect(false);
- }
- catch (Exception e)
- {
- failedSystems.add(system);
-
- // if the user was prompted for password and cancelled
- // or if the connect was interrupted for some other reason
- // we don't attempt to connect the other subsystems
- if (e instanceof InterruptedException) {
- break;
- }
- }// msg already shown
- }
- }
- }
- catch (Exception exc)
- {
- } // msg already shown
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyConnectionAction.java
deleted file mode 100644
index 911de7337..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyConnectionAction.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Copy a connection action.
- */
-public class SystemCopyConnectionAction extends SystemBaseCopyAction
-{
- private ISystemRegistry sr = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- /**
- * Constructor for SystemCopyConnectionAction
- */
- public SystemCopyConnectionAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_COPY_CONNECTION_LABEL, MODE_COPY);
- sr = RSEUIPlugin.getTheSystemRegistry();
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0019"); //$NON-NLS-1$
- setDialogHelp(RSEUIPlugin.HELPPREFIX+"dccn0000"); //$NON-NLS-1$
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only connections from the same profile are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- ISystemProfile prevProfile = null;
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IHost)
- {
- IHost conn = (IHost)selectedObject;
- if (prevProfile == null)
- prevProfile = conn.getSystemProfile();
- else
- enable = (prevProfile == conn.getSystemProfile());
- if (enable)
- prevProfile = conn.getSystemProfile();
- }
- else
- enable = false;
- }
- return enable;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemProfile profile = (ISystemProfile)targetContainer;
- String newName = oldName;
- IHost match = sr.getHost(profile, oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorConnectionName validator = new ValidatorConnectionName(sr.getConnectionAliasNames(profile));
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- IHost oldConnection = (IHost)oldObject;
- //String oldName = oldConnection.getAliasName();
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"starting to copy "+oldName+" to "+newName);
- ISystemProfile targetProfile = (ISystemProfile)targetContainer;
- IHost newConn = sr.copyHost(monitor, oldConnection, targetProfile, newName);
- return (newConn != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- return getProfileTreeModel(getFirstSelectedConnection().getSystemProfile());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return SystemResources.RESID_COPY_TARGET_PROFILE_PROMPT;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYCONNECTIONS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYCONNECTION_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedConnections();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- IHost[] conns = getSelectedConnections();
- String[] names = new String[conns.length];
- for (int idx=0; idx<conns.length; idx++)
- names[idx] = conns[idx].getAliasName();
- return names;
- }
-
- /**
- * Get the currently selected connections
- */
- protected IHost[] getSelectedConnections()
- {
- IStructuredSelection selection = getSelection();
- IHost[] conns = new IHost[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- conns[idx++] = (IHost)i.next();
- }
- return conns;
- }
- /**
- * Get the first selected connection
- */
- protected IHost getFirstSelectedConnection()
- {
- return (IHost)getFirstSelection();
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param profile whose tree model element is to be selected
- */
- protected SystemSimpleContentElement getProfileTreeModel(ISystemProfile profile)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Profiles", //$NON-NLS-1$
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemProfile[] profiles = RSEUIPlugin.getTheSystemRegistry().getActiveSystemProfiles();
- ImageDescriptor image = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
-
- if (profiles == null)
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<profiles.length; idx++)
- {
- SystemSimpleContentElement profileElement =
- new SystemSimpleContentElement(profiles[idx].getName(),
- profiles[idx], veryRootElement, (Vector)null);
- profileElement.setRenamable(false);
- profileElement.setDeletable(false);
- profileElement.setImageDescriptor(image);
- veryRootChildren.addElement(profileElement);
- if (profiles[idx] == profile)
- initialSelectionElement = profileElement;
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyToClipboardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyToClipboardAction.java
deleted file mode 100644
index 9869f1ede..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCopyToClipboardAction.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemDropActionDelegate;
-import org.eclipse.rse.ui.view.SystemViewDataDropAdapter;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.part.PluginTransferData;
-
-
-/**
- * Copy selected objects to clipboard action.
- */
-public class SystemCopyToClipboardAction extends SystemBaseAction implements IValidatorRemoteSelection
-{
-
-
- private IStructuredSelection _selection;
- private Clipboard _clipboard;
-
- /**
- * Constructor
- */
- public SystemCopyToClipboardAction(Shell shell, Clipboard clipboard)
- {
- super(SystemResources.ACTION_COPY_LABEL,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
- shell);
-
- _clipboard = clipboard;
-
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0116"); //$NON-NLS-1$
- }
-
- public void run()
- {
- if (_selection != null)
- {
- copySelectionToClipboard(_selection);
- }
- }
-
- private void copySelectionToClipboard(IStructuredSelection ss)
- {
- Iterator iterator = ss.iterator();
-
- // marshall data
- StringBuffer textStream = new StringBuffer(""); //$NON-NLS-1$
- StringBuffer dataStream = new StringBuffer(""); //$NON-NLS-1$
- ArrayList fileNames = new ArrayList();
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
-
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
-
- if (dragObject instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) dragObject).getAdapter(ISystemViewElementAdapter.class);
-
- if (adapter != null)
- {
- String text = adapter.getAlternateText(dragObject);
- textStream.append(getTextTransferPrepend(dragObject, adapter));
- textStream.append(text);
- textStream.append(getTextTransferAppend(dragObject, adapter));
-
- if (adapter.canDrag(dragObject))
- {
- // get the subsystem id
- ISubSystem subSystem = adapter.getSubSystem(dragObject);
- String subSystemId = registry.getAbsoluteNameForSubSystem(subSystem);
-
- dataStream.append(subSystemId);
- dataStream.append(":"); //$NON-NLS-1$
-
- String objectId = adapter.getAbsoluteName(dragObject);
- dataStream.append(objectId);
-
- if (iterator.hasNext())
- {
- dataStream.append(SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
- }
-
- /** FIXME - files can't be coupled to systems.core!
- // support for external copy for local files
- if (dragObject instanceof IRemoteFile)
- {
- IRemoteFile file = (IRemoteFile) dragObject;
-
- String connectionType = file.getParentRemoteFileSubSystem().getHost().getSystemType();
-
- if (connectionType.equals("Local"))
- {
- fileNames.add(file.getAbsolutePath());
- }
- }
- */
- }
- }
- }
- }
-
- PluginTransferData data = new PluginTransferData(SystemDropActionDelegate.ID, dataStream.toString().getBytes());
-
- // put data in clipboard
- if (fileNames.size() == 0)
- {
- _clipboard.setContents(new Object[] { data, textStream.toString() }, new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance()});
- }
- else
- {
- String[] ft = new String[fileNames.size()];
- for (int i = 0; i < ft.length; i++)
- {
- ft[i] = (String) fileNames.get(i);
- }
-
- _clipboard.setContents(new Object[] { data, ft, textStream.toString() }, new Transfer[] { PluginTransfer.getInstance(), FileTransfer.getInstance(), TextTransfer.getInstance()});
- }
- }
-
- /**
- * Returns the string to prepend for the selected object for text transfer.
- * Default implementation returns the empty string.
- * @param obj the selected object.
- * @param adapter the adapter of the selected object.
- * @return the string to prepend for the selected object.
- */
- protected String getTextTransferPrepend(Object obj, ISystemViewElementAdapter adapter) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the string to append for the selected object for text transfer.
- * Default implementation returns the system line separator (i.e. the line.separator property).
- * @param obj the selected object.
- * @param adapter the adapter of the selected object.
- * @return the string to append for the selected object.
- */
- protected String getTextTransferAppend(Object obj, ISystemViewElementAdapter adapter) {
- return System.getProperty("line.separator"); //$NON-NLS-1$
- }
-
- /**
- * The user has selected a remote object. Return null if OK is to be enabled, or a SystemMessage
- * if it is not to be enabled. The message will be displayed on the message line.
- * <p>
- * This is overridden in SystemMoveRemoteFileAction
- */
- public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects)
- {
- return null;
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We simply ensure every selected object has a system view element adapter.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IAdaptable)
- {
- IAdaptable adaptable = (IAdaptable) selectedObject;
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) (adaptable.getAdapter(ISystemViewElementAdapter.class));
- if (va != null)
- {
- enable = va.canDrag(selectedObject);
- }
- else
- {
- enable = false;
- }
- }
- else
- {
- enable = false;
- }
- }
-
- if (enable)
- {
- _selection = selection;
- }
- return enable;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java
deleted file mode 100644
index c3c54fadb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is the action for disconnecting from a remote subsystem.
- */
-public class SystemDisconnectAction extends SystemBaseAction
-{
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemDisconnectAction(Shell shell)
- {
- super(SystemResources.ACTION_DISCONNECT_LABEL, SystemResources.ACTION_DISCONNECT_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0048");
- }
- /**
- * Override of parent. Called when testing if action should be enabled based on current
- * selection. We check the selected object is one of our subsystems, and if we are
- * currently connected.
- */
- public boolean checkObjectType(Object obj)
- {
- if ( !(obj instanceof ISubSystem) ||
- !((ISubSystem)obj).getConnectorService().isConnected() )
- return false;
- else
- return true;
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- ISubSystem ss = (ISubSystem)getFirstSelection();
- try {
- ss.disconnect();
- } catch (Exception exc) {} // msg already shown
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAllSubSystemsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAllSubSystemsAction.java
deleted file mode 100644
index bf9d4a576..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAllSubSystemsAction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This is the action forconnecting all subsystems for a given connection.
- */
-public class SystemDisconnectAllSubSystemsAction extends SystemBaseAction
-{
-
- private ISystemRegistry sr = null;
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemDisconnectAllSubSystemsAction(Shell shell)
- {
- super(SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_LABEL, SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- sr = RSEUIPlugin.getTheSystemRegistry();
- // TODO help for connect all
- //setHelp(RSEUIPlugin.HELPPREFIX+"actn0022");
- }
- /**
- * Override of parent. Called when testing if action should be enabled base on current
- * selection. We check the selected object is one of our subsystems, and if we are
- * currently connected.
- */
- public boolean checkObjectType(Object obj)
- {
- if ( !(obj instanceof IHost) ||
- !(sr.isAnySubSystemConnected((IHost)obj) ))
- return false;
- else
- return true;
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- IHost conn = (IHost)getFirstSelection();
- try {
- sr.disconnectAllSubSystems(conn);
- } catch (Exception exc) {} // msg already shown
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDynamicPopupMenuExtensionManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDynamicPopupMenuExtensionManager.java
deleted file mode 100644
index 8ac97dbf2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDynamicPopupMenuExtensionManager.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Singleton class for managing adapter menu extensions.
- * View adapters that support this feature, should call populateMenu to allow for
- * extended menu contributions.
- */
-public class SystemDynamicPopupMenuExtensionManager implements
- ISystemDynamicPopupMenuExtensionManager
-{
- private static SystemDynamicPopupMenuExtensionManager _instance = new SystemDynamicPopupMenuExtensionManager();
-
- private List _extensions;
-
- private SystemDynamicPopupMenuExtensionManager()
- {
- _extensions= new ArrayList();
- }
-
- public static SystemDynamicPopupMenuExtensionManager getInstance()
- {
- return _instance;
- }
-
- public void registerMenuExtension(ISystemDynamicPopupMenuExtension ext)
- {
- _extensions.add(ext);
- }
-
- /**
- * Actions are added to a contribution menu.
- * @param shell the shell
- * @param menu the menu to contribute to
- * @param selection(s) are processed to determine the resource source file
- * @param menuGroup the default menu group to add actions to
- * @return the menu is populated with actions
- */
- public void populateMenu(Shell shell, SystemMenuManager menu,IStructuredSelection selection, String menuGroup)
- {
- for (int i = 0; i <_extensions.size(); i++)
- {
- ISystemDynamicPopupMenuExtension extension = (ISystemDynamicPopupMenuExtension)_extensions.get(i);
- if (extension.supportsSelection(selection))
- {
- extension.populateMenu(shell, menu, selection, menuGroup);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java
deleted file mode 100644
index bcd08dbf1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemTree;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The action allows users to expand the selected nodes in the Remote Systems Explorer tree view
- */
-public class SystemExpandAction extends SystemBaseAction {
-
- /**
- * Constructor
- * @param parent the shell that employs this action
- */
- public SystemExpandAction(Shell parent) {
- super(SystemResources.ACTION_EXPAND_SELECTED_LABEL, SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP, parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
- setAccelerator('+');
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0025");
- setAvailableOffline(true);
- }
-
- /**
- * <p>
- * We intercept to ensure at least one selected item is expandable
- *
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection) {
- boolean enable = false;
- if ((viewer != null) && (viewer instanceof ISystemTree)) {
- return ((ISystemTree) viewer).areAnySelectedItemsExpandable();
- }
- Iterator e = selection.iterator();
- ISystemViewElementAdapter adapter = null;
- while (!enable && e.hasNext()) {
- Object selectedObject = e.next();
- adapter = getAdapter(selectedObject);
- if (adapter != null) {
- if (adapter.hasChildren(selectedObject)) enable = true;
- }
- }
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- //System.out.println("Inside run of SystemRefreshAction");
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) {
- sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
- } else
- sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveConnectionAction.java
deleted file mode 100644
index d1aafdf75..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveConnectionAction.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Move a connection action.
- */
-public class SystemMoveConnectionAction extends SystemBaseCopyAction
-{
-
- private ISystemRegistry sr = null;
- private SystemSimpleContentElement initialSelectionElement = null;
-
- /**
- * Constructor
- */
- public SystemMoveConnectionAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_MOVE_CONNECTION_LABEL, MODE_MOVE);
- //allowOnMultipleSelection(false); // too hard to handle, for now!
- sr = RSEUIPlugin.getTheSystemRegistry();
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0020"); //$NON-NLS-1$
- setDialogHelp(RSEUIPlugin.HELPPREFIX+"dmcn0000"); //$NON-NLS-1$
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only connections from the same profile are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- if (sr.getActiveSystemProfiles().length <= 1)
- return false;
- boolean enable = true;
- ISystemProfile prevProfile = null;
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IHost)
- {
- IHost conn = (IHost)selectedObject;
- if (prevProfile == null)
- prevProfile = conn.getSystemProfile();
- else
- enable = (prevProfile == conn.getSystemProfile());
- if (enable)
- prevProfile = conn.getSystemProfile();
- }
- else
- enable = false;
- }
- return enable;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemProfile profile = (ISystemProfile)targetContainer;
- String newName = oldName;
- IHost match = sr.getHost(profile, oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorConnectionName validator = new ValidatorConnectionName(sr.getConnectionAliasNames(profile));
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- IHost oldConnection = (IHost)oldObject;
- //String oldName = oldConnection.getAliasName();
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"starting to copy "+oldName+" to "+newName);
- ISystemProfile targetProfile = (ISystemProfile)targetContainer;
- IHost newConn = sr.moveHost(monitor, oldConnection, targetProfile, newName);
- return (newConn != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- return getProfileTreeModel(getFirstSelectedConnection().getSystemProfile());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return SystemResources.RESID_MOVE_TARGET_PROFILE_PROMPT;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVECONNECTIONS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVECONNECTION_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedConnections();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- IHost[] conns = getSelectedConnections();
- String[] names = new String[conns.length];
- for (int idx=0; idx<conns.length; idx++)
- names[idx] = conns[idx].getAliasName();
- return names;
- }
-
- /**
- * Get the currently selected connections
- */
- protected IHost[] getSelectedConnections()
- {
- IStructuredSelection selection = getSelection();
- IHost[] conns = new IHost[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- conns[idx++] = (IHost)i.next();
- }
- return conns;
- }
- /**
- * Get the first selected connection
- */
- protected IHost getFirstSelectedConnection()
- {
- return (IHost)getFirstSelection();
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param profile whose tree model element is not to be include
- */
- protected SystemSimpleContentElement getProfileTreeModel(ISystemProfile profile)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Profiles", //$NON-NLS-1$
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemProfile[] profiles = RSEUIPlugin.getTheSystemRegistry().getActiveSystemProfiles();
- ImageDescriptor image = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
-
- if (profiles == null)
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
-
- for (int idx=0; idx<profiles.length; idx++)
- {
- if (!(profiles[idx]==profile))
- {
- SystemSimpleContentElement profileElement =
- new SystemSimpleContentElement(profiles[idx].getName(),
- profiles[idx], veryRootElement, (Vector)null);
- profileElement.setRenamable(false);
- profileElement.setDeletable(false);
- profileElement.setImageDescriptor(image);
- veryRootChildren.addElement(profileElement);
- if (initialSelectionElement == null)
- initialSelectionElement = profileElement;
- }
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveDownConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveDownConnectionAction.java
deleted file mode 100644
index 9872e376a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveDownConnectionAction.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current connection down in the list
- */
-public class SystemMoveDownConnectionAction extends SystemBaseAction
-
-{
-
- private ISystemProfile prevProfile = null;
-
- /**
- * Constructor for SystemMoveDownAction
- */
- public SystemMoveDownConnectionAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEDOWN_LABEL, SystemResources.ACTION_MOVEDOWN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0002"); //$NON-NLS-1$
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only connections from the same profile are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- prevProfile = null;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IHost)
- {
- IHost conn = (IHost)selectedObject;
- int connCount = sr.getHostCountWithinProfile(conn)-1;
- if (prevProfile == null)
- prevProfile = conn.getSystemProfile();
- else
- enable = (prevProfile == conn.getSystemProfile());
- if (enable)
- {
- enable = (sr.getHostPosition(conn) < connCount);
- prevProfile = conn.getSystemProfile();
- }
- }
- else
- enable = false;
- }
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- SystemSortableSelection[] sortableArray = SystemSortableSelection.makeSortableArray(getSelection());
- IHost conn = null;
- for (int idx=0; idx<sortableArray.length; idx++)
- {
- conn = (IHost)sortableArray[idx].getSelectedObject();
- sortableArray[idx].setPosition(sr.getHostPosition(conn));
- }
- SystemSortableSelection.sortArray(sortableArray);
- IHost[] conns = (IHost[])SystemSortableSelection.getSortedObjects(sortableArray, new IHost[sortableArray.length]);
- sr.moveHosts(prevProfile.getName(),conns,1);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveUpConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveUpConnectionAction.java
deleted file mode 100644
index f39fdd152..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemMoveUpConnectionAction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current connection up in the list
- */
-public class SystemMoveUpConnectionAction extends SystemBaseAction
-
-{
-
- private ISystemProfile prevProfile = null;
-
- /**
- * Constructor for SystemMoveUpAction
- */
- public SystemMoveUpConnectionAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEUP_LABEL, SystemResources.ACTION_MOVEUP_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0001"); //$NON-NLS-1$
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only connections from the same profile are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- prevProfile = null;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IHost)
- {
- IHost conn = (IHost)selectedObject;
- if (prevProfile == null)
- prevProfile = conn.getSystemProfile();
- else
- enable = (prevProfile == conn.getSystemProfile());
- if (enable)
- {
- enable = (sr.getHostPosition(conn) > 0);
- prevProfile = conn.getSystemProfile();
- }
- }
- else
- enable = false;
- }
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
-
- SystemSortableSelection[] sortableArray = SystemSortableSelection.makeSortableArray(getSelection());
- IHost conn = null;
- for (int idx=0; idx<sortableArray.length; idx++)
- {
- conn = (IHost)sortableArray[idx].getSelectedObject();
- sortableArray[idx].setPosition(sr.getHostPosition(conn));
- }
- SystemSortableSelection.sortArray(sortableArray);
- IHost[] conns = (IHost[])SystemSortableSelection.getSortedObjects(sortableArray, new IHost[sortableArray.length]);
-
- sr.moveHosts(prevProfile.getName(),conns,-1);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java
deleted file mode 100644
index b0268724c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.wizards.RSENewConnectionWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the New Connection wizard
- */
-public class SystemNewConnectionAction extends SystemBaseWizardAction
-
-{
-
- private IHost currConn;
- private boolean fromPopupMenu = true;
- private ISelectionProvider sp = null;
- private String[] restrictSystemTypesTo;
- private String defaultConnectionName, defaultHostName;
-
- /**
- * Constructor for SystemNewConnectionAction
- * @param shell The parent shell to host the new wizard
- * @param fromPopupMenu true if being launched from the remote systems explorer view directly,
- * false if being launched from a dialog
- * @param sp The selection provider that will supply the selection via getSelection, if
- * fromPopupMenu is false
- */
- public SystemNewConnectionAction(Shell shell, boolean fromPopupMenu, ISelectionProvider sp)
- {
- this(shell, fromPopupMenu, true, sp);
- }
- /**
- * Constructor for SystemNewConnectionAction when you don't want the icon.
- * @param shell The parent shell to host the new wizard
- * @param fromPopupMenu true if being launched from the remote systems explorer view directly,
- * false if being launched from a dialog
- * @param wantIcon true if you want the icon to show beside the action, false if not
- * @param sp The selection provider that will supply the selection via getSelection, if
- * fromPopupMenu is false
- */
- public SystemNewConnectionAction(Shell shell, boolean fromPopupMenu, boolean wantIcon, ISelectionProvider sp)
- {
- this(shell, SystemResources.ACTION_NEWCONN_LABEL, SystemResources.ACTION_NEWCONN_TOOLTIP, fromPopupMenu, wantIcon, sp);
- }
- /**
- * Constructor for SystemNewConnectionAction when you possibly don't want the icon, and want to
- * supply your own label. This is the "full" flavoured constructor!
- *
- * @param shell The parent shell to host the new wizard
- * @param label The label for the action
- * @param tooltip the tooltip for the action
- * @param fromPopupMenu true if being launched from the remote systems explorer view directly,
- * false if being launched from a dialog
- * @param wantIcon true if you want the icon to show beside the action, false if not
- * @param sp The selection provider that will supply the selection via getSelection, if
- * fromPopupMenu is false
- */
- public SystemNewConnectionAction(Shell shell, String label, String tooltip,
- boolean fromPopupMenu, boolean wantIcon, ISelectionProvider sp)
- {
- super(label, tooltip,
- wantIcon ? RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID) : null ,
- shell);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- this.fromPopupMenu = fromPopupMenu;
- this.sp = sp;
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0000"); //$NON-NLS-1$
- }
-
- /**
- * The default processing for the run method calls createDialog, which
- * in turn calls this method to return an instance of our wizard.
- * <p>
- * Our default implementation is to return SystemNewConnectionWizard.
- */
- protected IWizard createWizard()
- {
- RSENewConnectionWizard newConnWizard = new RSENewConnectionWizard();
- if (!fromPopupMenu && (sp!=null))
- {
- setSelection(sp.getSelection());
- }
-
- // newConnWizard.setCurrentlySelectedConnection(currConn);
- if (restrictSystemTypesTo != null) {
-
- IRSESystemType[] systemTypes = new IRSESystemType[restrictSystemTypesTo.length];
- for (int i = 0; i < restrictSystemTypesTo.length; i++) {
- systemTypes[i] = RSECorePlugin.getDefault().getRegistry().getSystemType(restrictSystemTypesTo[i]);
- }
-
- newConnWizard.restrictToSystemTypes(systemTypes);
- }
-
- // if (defaultHostName != null)
- // newConnWizard.setHostName(defaultHostName);
- // if (defaultConnectionName != null)
- // newConnWizard.setConnectionName(defaultConnectionName);
- return newConnWizard;
- }
-
- /**
- * Set the current selected connection so we can better intelligently set
- * the defaults.
- */
- public void setCurrentConnection(IHost conn)
- {
- this.currConn = conn;
- }
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- this.restrictSystemTypesTo = systemTypes;
- }
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- defaultConnectionName = name;
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- defaultHostName = name;
- }
-
- /**
- * Override of parent method so we can deduce currently selected connection (direct or indirect if child object selected).
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = super.updateSelection(selection);
- if (enable)
- {
- Object firstSelection = getFirstSelection();
- IHost conn = null;
- if (firstSelection != null)
- {
- if (firstSelection instanceof IHost)
- conn = (IHost)firstSelection;
- else if (firstSelection instanceof ISubSystem)
- conn = ((ISubSystem)firstSelection).getHost();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- {
- ISystemFilterPoolReference sfpr = (ISystemFilterPoolReference)firstSelection;
- ISubSystem ss = (ISubSystem)sfpr.getProvider();
- conn = ss.getHost();
- }
- else if (firstSelection instanceof ISystemFilterReference)
- {
- ISystemFilterReference sfr = (ISystemFilterReference)firstSelection;
- ISubSystem ss = (ISubSystem)sfr.getProvider();
- conn = ss.getHost();
- }
- else if (firstSelection instanceof ISystemFilterStringReference)
- {
- ISystemFilterStringReference sfsr = (ISystemFilterStringReference)firstSelection;
- ISubSystem ss = (ISubSystem)sfsr.getProvider();
- conn = ss.getHost();
- }
- }
- setCurrentConnection(conn);
- }
- return enable;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java
deleted file mode 100644
index fc3468704..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the Create Another Connection wizard
- */
-public class SystemNewConnectionFromExistingConnectionAction extends SystemNewConnectionAction
-
-{
-
- /**
- * Constructor
- * @param shell The parent shell to host the new wizard
- */
- public SystemNewConnectionFromExistingConnectionAction(Shell shell)
- {
- super(shell, SystemResources.ACTION_ANOTHERCONN_LABEL, SystemResources.ACTION_ANOTHERCONN_TOOLTIP, false, true, null);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0015");
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewProfileAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewProfileAction.java
deleted file mode 100644
index c04c1561e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewProfileAction.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.team.SystemTeamView;
-import org.eclipse.rse.ui.wizards.SystemNewProfileWizard;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The action that displays the New Profile wizard
- */
-public class SystemNewProfileAction extends SystemBaseWizardAction {
-
- /**
- * Constructor for SystemNewProfileAction for "New -> Profile..."
- * @param parent the parent shell in which this action executes
- */
- public SystemNewProfileAction(Shell parent) {
- super(SystemResources.ACTION_NEWPROFILE_LABEL, SystemResources.ACTION_NEWPROFILE_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWPROFILE_ID), parent);
- setSelectionSensitive(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0003"); //$NON-NLS-1$
- }
-
- /**
- * Constructor for SystemNewProfileAction where you can choose between "New profile..." and "New -> Profile"
- * @param parent the parent shell in which this action executes
- * @param cascading if true then use the "New -> Profile" style, else use the "New profile..." style.
- */
- public SystemNewProfileAction(Shell parent, boolean cascading) {
- super(cascading ? SystemResources.ACTION_NEWPROFILE_LABEL : SystemResources.ACTION_NEW_PROFILE_LABEL, cascading ? SystemResources.ACTION_NEWPROFILE_TOOLTIP
- : SystemResources.ACTION_NEW_PROFILE_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWPROFILE_ID), parent);
- setSelectionSensitive(false);
- if (cascading)
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- else
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW_NONCASCADING);
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0003"); //$NON-NLS-1$
- }
-
- /**
- * Refresh the enabled state
- */
- public void refreshEnablement() {
- setEnabled(isEnabled());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.actions.SystemBaseAction#isEnabled()
- */
- public boolean isEnabled() {
- return true;
- /*
- * From the old javadoc:
- * We disable this action if it is a new workspace and the user has yet to create
- * their first connection, and hence rename their default profile.
- * @return true if the action is enabled
- *
- * defect 43428 was an early RSE defect whose fix prevented the creation of profiles until the first
- * connection was created. However, new default profiles are created when RSE is initially activated
- * so there is no need to inhibit profile creation.
- */
-// ISystemProfile defaultProfile = SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile();
-// if (defaultProfile != null)
-// return false;
-// else
-// return true;
- }
-
- /**
- * @return a new Wizard object for creating a profile.
- */
- protected IWizard createWizard() {
- return new SystemNewProfileWizard();
- }
-
- /**
- * Typically, the wizard's performFinish method does the work required by
- * a successful finish of the wizard. However, often we also want to be
- * able to extract user-entered data from the wizard, by calling getters
- * in this action. To enable this, override this method to populate your
- * output instance variables from the completed wizard, which is passed
- * as a parameter. This is only called after successful completion of the
- * wizard.
- * @param wizard the wizard that was just completed
- */
- protected void postProcessWizard(IWizard wizard) {
- if (getViewer() instanceof SystemTeamView) {
- getViewer().refresh();
- }
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenExplorerPerspectiveAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenExplorerPerspectiveAction.java
deleted file mode 100644
index ef330fe3f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenExplorerPerspectiveAction.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.SystemPerspectiveLayout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.OpenInNewWindowAction;
-
-
-/**
- * The action allows users to open a new Remote Systems Explorer perspective, anchored
- * by the currently selected resource.
- */
-public class SystemOpenExplorerPerspectiveAction
- extends SystemBaseAction
-
-{
- //private boolean replaceEnabled = true;
- private IWorkbenchWindow window;
- private IPerspectiveRegistry reg;
- private IPerspectiveDescriptor desc = null;
-
- /**
- * Constructor
- */
- public SystemOpenExplorerPerspectiveAction(Shell parent, IWorkbenchWindow currentWorkbenchWindow)
- {
- super(SystemResources.ACTION_OPENEXPLORER_DIFFPERSP2_LABEL, SystemResources.ACTION_OPENEXPLORER_DIFFPERSP2_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE_ID),
- parent);
- this.window = currentWorkbenchWindow;
- this.reg = PlatformUI.getWorkbench().getPerspectiveRegistry();
- this.desc = reg.findPerspectiveWithId(SystemPerspectiveLayout.ID);
-
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_OPEN);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0016");
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only connections from the same profile are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- Object selected = selection.getFirstElement();
- if (selected instanceof ISystemFilterReference)
- {
- if ( ((ISystemFilterReference)selected).getReferencedFilter().isPromptable() )
- enable = false;
- }
- else if (selected instanceof ISystemPromptableObject)
- enable = false;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see Action#run()
- */
- public void run()
- {
- /* OLD RELEASE 1 CODE
- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
- String perspectiveSetting =
- store.getString(IWorkbenchPreferenceConstants.OPEN_NEW_PERSPECTIVE);
- runWithPerspectiveValue(desc, perspectiveSetting);
- */
- OpenInNewWindowAction workbenchOpenAction = // NEW FOR RELEASE 2
- new OpenInNewWindowAction(window,getPageInput());
- workbenchOpenAction.run();
- }
-
- /**
- * Sets the page input.
- *
- * @param input the page input
- */
- public void setPageInput(IAdaptable input)
- {
- }
- /**
- * Get the page input.
- * Will use explicitly set input if given, else deduces from selection
- */
- public IAdaptable getPageInput()
- {
- //if (pageInput != null) safer to always recalculate!
- // return pageInput;
- //else
- {
- Object firstSel = getFirstSelection();
- if ((firstSel != null) && (firstSel instanceof IAdaptable))
- return (IAdaptable)firstSel;
- else
- return null;
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenRSEPerspectiveAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenRSEPerspectiveAction.java
deleted file mode 100644
index b402d077d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemOpenRSEPerspectiveAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.rse.core.SystemPerspectiveHelpers;
-
-
-/**
- * Open the RSE perspective (used in welcome.xml)
- */
-public class SystemOpenRSEPerspectiveAction extends Action {
-
-
- public SystemOpenRSEPerspectiveAction()
- {
- super();
- }
-
- /**
- * @see Action#run()
- */
- public void run()
- {
- SystemPerspectiveHelpers.openRSEPerspective();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPasteFromClipboardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPasteFromClipboardAction.java
deleted file mode 100644
index b2230f027..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPasteFromClipboardAction.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
-import org.eclipse.rse.ui.view.ISystemDragDropAdapter;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.SystemDNDTransferRunnable;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.part.PluginTransferData;
-import org.eclipse.ui.part.ResourceTransfer;
-
-
-/**
- * Paste resources in system clipboard to the selected resource action.
- */
-public class SystemPasteFromClipboardAction extends SystemBaseAction implements IValidatorRemoteSelection
-{
-
-
- private int _srcType;
- private Object _selection;
- private Clipboard _clipboard;
- /**
- * Constructor
- */
- public SystemPasteFromClipboardAction(Shell shell, Clipboard clipboard)
- {
- super(SystemResources.ACTION_PASTE_LABEL,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
- //RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_PASTE_ID),
- shell);
- _clipboard = clipboard;
- _srcType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
- setEnabled(false);
-
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0117"); //$NON-NLS-1$
- }
-
- public void run()
- {
- if (_selection != null)
- {
- pasteClipboardToSelection(_selection);
- }
- }
-
-
- private void pasteClipboardToSelection(Object target)
- {
- List srcObjects = RSEUIPlugin.getTheSystemRegistry().getSystemClipboardObjects(_srcType);
- if (srcObjects.size() > 0)
- {
- // do the transfer
- SystemDNDTransferRunnable runnable = new SystemDNDTransferRunnable(target, (ArrayList)srcObjects, getViewer(), _srcType);
- if (target instanceof IAdaptable)
- {
- ISystemDragDropAdapter targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- if (targetAdapter != null)
- {
- ISubSystem targetSubSystem = targetAdapter.getSubSystem(target);
- List rulesList = new ArrayList();
- int j = 0;
- for (int i = 0; i < srcObjects.size(); i++)
- {
- if (srcObjects.get(i) instanceof ISchedulingRule)
- {
- rulesList.add(srcObjects.get(i));
- j++;
- }
- /** FIXME - IREmoteFile is systems.core independent now
- else if (srcObjects.get(i) instanceof IRemoteFile)
- {
- rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)srcObjects.get(i)));
- j++;
- }
- **/
- }
- /*
- if (target instanceof ISchedulingRule)
- {
- rulesList.add(target);
- }
- */
- /** FIXME - IREmoteFile is systems.core independent now
- else if (target instanceof IRemoteFile)
- {
- rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)target));
- }
- */
- /*
- else
- {
- rulesList.add(targetSubSystem);
- }
- */
- ISchedulingRule[] rules = (ISchedulingRule[])rulesList.toArray(new ISchedulingRule[rulesList.size()]);
- MultiRule rule = new MultiRule(rules);
- runnable.setRule(rule);
- }
- }
- runnable.schedule();
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- }
- // clear clipboard
- // _clipboard.setContents(new Object[] { null }, new Transfer[] { PluginTransfer.getInstance()});
- // setEnabled(false);
- }
-
-
- /**
- * The user has selected a remote object. Return null if OK is to be enabled, or a SystemMessage
- * if it is not to be enabled. The message will be displayed on the message line.
- * <p>
- * This is overridden in SystemMoveRemoteFileAction
- */
- public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects)
- {
- return null;
- }
-
- public boolean hasSource()
- {
- synchronized (_clipboard)
- {
- try
- {
- Object object = _clipboard.getContents(PluginTransfer.getInstance());
- if (object != null)
- {
- if (object instanceof PluginTransferData)
- {
- PluginTransferData data = (PluginTransferData) object;
- byte[] result = data.getData();
- if (result != null)
- {
- _srcType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
- return true;
- }
- }
- }
- else
- {
- // clipboard must have resources or files
- ResourceTransfer resTransfer = ResourceTransfer.getInstance();
- object = _clipboard.getContents(resTransfer);
- if (object != null)
- {
- IResource[] resourceData = (IResource[]) object;
- if (resourceData.length > 0)
- {
- _srcType = SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE;
- return true;
- }
- }
- else
- {
- FileTransfer fileTransfer = FileTransfer.getInstance();
- object = _clipboard.getContents(fileTransfer);
-
- if (object != null)
- {
- String[] fileData = (String[]) object;
- if (fileData.length > 0)
- {
- _srcType = SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE;
- return true;
- }
- }
- else
- {
- TextTransfer textTransfer = TextTransfer.getInstance();
- object = _clipboard.getContents(textTransfer);
-
- if (object != null)
- {
- //String textData = (String) object;
- _srcType = SystemDNDTransferRunnable.SRC_TYPE_TEXT;
- return true;
- }
- }
- }
- }
- }
- catch (Exception e)
- {
- }
- }
- return false;
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We simply ensure every selected object is an IRemoteFile
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- if (hasSource())
- {
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof IAdaptable)
- {
- IAdaptable adaptable = (IAdaptable) selectedObject;
- ISystemDragDropAdapter va = (ISystemDragDropAdapter) (adaptable.getAdapter(ISystemDragDropAdapter.class));
- if (va != null)
- {
- enable = va.canDrop(selectedObject);
- /* to allow disable of paste
- * not sure if this is a performance hit or not
- if (enable)
- {
- SubSystem tgtSS = va.getSubSystem(selectedObject);
- List srcObjects = getClipboardObjects();
- if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
- {
-
- for (int i = 0; i < srcObjects.size() && enable; i++)
- {
- Object srcObject = srcObjects.get(i);
- ISystemDragDropAdapter srcAdapter = (ISystemDragDropAdapter)((IAdaptable)srcObject).getAdapter(ISystemDragDropAdapter.class);
- SubSystem srcSS = srcAdapter.getSubSystem(srcObject);
- boolean sameSystem = (srcSS == tgtSS);
- enable = va.validateDrop(srcObject, selectedObject, sameSystem);
- }
- }
- else if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE)
- {
- for (int i = 0; i < srcObjects.size() && enable; i++)
- {
- Object srcObject = srcObjects.get(i);
- boolean sameSystem = false;
- enable = va.validateDrop(srcObject, selectedObject, sameSystem);
- }
- }
- else if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
- {
- for (int i = 0; i < srcObjects.size() && enable; i++)
- {
- Object srcObject = srcObjects.get(i);
- boolean sameSystem = false;
- enable = va.validateDrop(srcObject, selectedObject, sameSystem);
- }
- }
-
- }
- */
- }
- else
- {
- enable = false;
- }
- }
- else
- {
- enable = false;
- }
- }
- if (enable)
- {
- _selection = selection.getFirstElement();
- }
- return enable;
- }
- else
- {
- return false;
- }
-
- }
-
- protected IRunnableContext getRunnableContext(Shell shell)
- {
- IRunnableContext irc = RSEUIPlugin.getTheSystemRegistry().getRunnableContext();
- if (irc != null)
- {
- return irc;
- }
- else
- {
- /*
- // for other cases, use statusbar
- IWorkbenchWindow win = RSEUIPlugin.getActiveWorkbenchWindow();
- if (win != null)
- {
- Shell winShell = RSEUIPlugin.getActiveWorkbenchShell();
- if (winShell != null && !winShell.isDisposed() && winShell.isVisible())
- {
- RSEUIPlugin.logInfo("Using active workbench window as runnable context");
- shell = winShell;
- return win;
- }
- else
- {
- win = null;
- }
- }
- */
-
- irc = new ProgressMonitorDialog(shell);
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
- return irc;
- }
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceQualifyConnectionNamesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceQualifyConnectionNamesAction.java
deleted file mode 100644
index 9e5cb6f53..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceQualifyConnectionNamesAction.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action is a shortcut to the preferences setting for showing connection names
- * qualified by profile name.
- */
-public class SystemPreferenceQualifyConnectionNamesAction extends SystemBaseAction
-
-{
-
- private ISystemRegistry sr = null;
- /**
- * Constructor
- */
- public SystemPreferenceQualifyConnectionNamesAction(Shell parent)
- {
- super(SystemResources.ACTION_QUALIFY_CONNECTION_NAMES_LABEL,SystemResources.ACTION_QUALIFY_CONNECTION_NAMES_TOOLTIP,
- parent);
- setSelectionSensitive(false);
- allowOnMultipleSelection(true);
- sr = RSEUIPlugin.getTheSystemRegistry();
- setChecked(sr.getQualifiedHostNames());
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0008");
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- boolean newState = isChecked();
- sr.setQualifiedHostNames(newState);
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_QUALIFYCONNECTIONNAMES,
- !newState,newState); // defect 41794
- }
-
- /**
- * Fire a preference change event
- */
- private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().fireEvent(
- new SystemPreferenceChangeEvent(type,
- oldValue ? Boolean.TRUE : Boolean.FALSE,
- newValue ? Boolean.TRUE : Boolean.FALSE));
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceRestoreStateAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceRestoreStateAction.java
deleted file mode 100644
index 273b65d49..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceRestoreStateAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
-import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action is a shortcut to the preferences setting for restoring the RSE to its
- * previous state.
- */
-public class SystemPreferenceRestoreStateAction extends SystemBaseAction
-{
- //private ISystemRegistry sr = null;
-
- /**
- * Constructor
- */
- public SystemPreferenceRestoreStateAction(Shell parent)
- {
- super(SystemResources.ACTION_RESTORE_STATE_PREFERENCE_LABEL,SystemResources.ACTION_RESTORE_STATE_PREFERENCE_TOOLTIP, parent);
- setSelectionSensitive(false);
- allowOnMultipleSelection(true);
- //sr = RSEUIPlugin.getTheSystemRegistry();
- setChecked(SystemPreferencesManager.getPreferencesManager().getRememberState());
-
- setHelp(RSEUIPlugin.HELPPREFIX+"aprefres"); //$NON-NLS-1$
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- boolean newState = isChecked();
- SystemPreferencesManager.getPreferencesManager().setRememberState(newState);
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_RESTORESTATE,
- !newState,newState);
- }
-
- /**
- * Fire a preference change event
- */
- private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().fireEvent(
- new SystemPreferenceChangeEvent(type,
- oldValue ? Boolean.TRUE : Boolean.FALSE,
- newValue ? Boolean.TRUE : Boolean.FALSE));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceShowFilterPoolsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceShowFilterPoolsAction.java
deleted file mode 100644
index a693eac8f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemPreferenceShowFilterPoolsAction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
-import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to decide whether or not to show filter pools in the remote systems explorer.
- * It is a fastpath/convenience method for this option in the preferences page.
- */
-public class SystemPreferenceShowFilterPoolsAction extends SystemBaseAction
-
-{
-
- //private SystemRegistry sr = null;
- /**
- * Constructor
- */
- public SystemPreferenceShowFilterPoolsAction(Shell parent)
- {
- super(SystemResources.ACTION_PREFERENCE_SHOW_FILTERPOOLS_LABEL,SystemResources.ACTION_PREFERENCE_SHOW_FILTERPOOLS_TOOLTIP,
- parent);
- allowOnMultipleSelection(true);
- setChecked(SystemPreferencesManager.getPreferencesManager().getShowFilterPools());
- setSelectionSensitive(false);
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0011"); //$NON-NLS-1$
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- boolean newState = isChecked();
- SystemPreferencesManager.getPreferencesManager().setShowFilterPools(newState);
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_SHOWFILTERPOOLS,
- !newState,newState); // defect 41794
- }
-
- /**
- * Fire a preference change event
- */
- private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().fireEvent(
- new SystemPreferenceChangeEvent(type,
- oldValue ? Boolean.TRUE : Boolean.FALSE,
- newValue ? Boolean.TRUE : Boolean.FALSE));
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameCopyAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameCopyAction.java
deleted file mode 100644
index 5bd5e324c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameCopyAction.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemCopyProfileDialog;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * A copy profile action. Will copy the profile, and all connections for the profile.
- * We must first prompt user for a new name for the copied profile.
- */
-public class SystemProfileNameCopyAction extends SystemBaseDialogAction
- implements IRunnableWithProgress
-{
- private ISystemProfile profile, newProfile;
- //private ISystemProfileManager mgr;
- private ISystemRegistry sr;
- private String oldName,newName;
- private boolean makeActive;
- private Exception runException = null;
-
- /**
- * Constructor for selection-sensitive popup menu for profiles in Team view.
- */
- public SystemProfileNameCopyAction(Shell shell)
- {
- super(SystemResources.ACTION_PROFILE_COPY_LABEL, SystemResources.ACTION_PROFILE_COPY_TOOLTIP,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
- shell);
- //mgr = SystemProfileManager.getSystemProfileManager();
- sr = RSEUIPlugin.getTheSystemRegistry();
- setSelectionSensitive(true);
- allowOnMultipleSelection(false);
- setHelp(RSEUIPlugin.HELPPREFIX+"actndupr"); //$NON-NLS-1$
- }
-
- /**
- * Set the profile
- */
- public void setProfile(ISystemProfile profile)
- {
- this.profile = profile;
- }
-
- /**
- * Override of parent
- * @see #run()
- */
- protected Dialog createDialog(Shell parent)
- {
- return new SystemCopyProfileDialog(parent, profile);
- }
-
- /**
- * Required by parent. We use it to return the new name
- */
- protected Object getDialogValue(Dialog dlg)
- {
- newName = null;
- SystemCopyProfileDialog rnmDlg = (SystemCopyProfileDialog)dlg;
- if (!rnmDlg.wasCancelled())
- {
- oldName = profile.getName();
- newName = rnmDlg.getNewName();
- makeActive = rnmDlg.getMakeActive();
- IRunnableContext runnableContext = getRunnableContext();
- try
- {
- runnableContext.run(false,false,this); // inthread, cancellable, IRunnableWithProgress
- if (makeActive && (newProfile!=null))
- sr.setSystemProfileActive(newProfile, true);
- }
- catch (java.lang.reflect.InvocationTargetException exc) // unexpected error
- {
- showOperationMessage(exc, getShell());
- //throw (Exception) exc.getTargetException();
- }
- catch (Exception exc)
- {
- showOperationMessage(exc, getShell());
- //throw exc;
- }
- }
- return newName;
- }
- /**
- * Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with
- * a progress monitor in it, we will use this, else we will create a progress monitor dialog.
- */
- protected IRunnableContext getRunnableContext()
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- IRunnableContext irc = sr.getRunnableContext();
- if (irc == null)
- irc = new ProgressMonitorDialog(getShell());
- return irc;
- }
-
-
- // ----------------------------------
- // INTERNAL METHODS...
- // ----------------------------------
- /**
- * Method required by IRunnableWithProgress interface.
- * Allows execution of a long-running operation modally by via a thread.
- * In our case, it runs the copy operation with a visible progress monitor
- */
- public void run(IProgressMonitor monitor)
- throws java.lang.reflect.InvocationTargetException,
- java.lang.InterruptedException
- {
- String msg = getCopyingMessage(oldName,newName);
- runException = null;
-
- try
- {
- int steps = 0;
- IHost[] conns = sr.getHostsByProfile(profile);
- if ((conns != null) && (conns.length > 0))
- steps = conns.length;
- steps += 2; // for filterpools and subsystems
- monitor.beginTask(msg, steps);
- newProfile = sr.copySystemProfile(monitor, profile,newName,makeActive);
- monitor.done();
- }
- catch(java.lang.InterruptedException exc)
- {
- monitor.done();
- runException = exc;
- throw (java.lang.InterruptedException)runException;
- }
- catch(Exception exc)
- {
- monitor.done();
- runException = new java.lang.reflect.InvocationTargetException(exc);
- throw (java.lang.reflect.InvocationTargetException)runException;
- }
-
- }
-
-
- /**
- * Helper method to return the message "Copying &1 to &2..."
- */
- public static String getCopyingMessage(String oldName, String newName)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS);
- msg.makeSubstitution(oldName,newName);
- return msg.getLevelOneText();
- }
-
- /**
- * Helper method to show an error message resulting from the attempted operation.
- */
- protected void showOperationMessage(Exception exc, Shell shell)
- {
- if (exc instanceof java.lang.InterruptedException)
- showOperationCancelledMessage(shell);
- else if (exc instanceof java.lang.reflect.InvocationTargetException)
- showOperationErrorMessage(shell, ((java.lang.reflect.InvocationTargetException)exc).getTargetException());
- else
- showOperationErrorMessage(shell, exc);
- }
-
- /**
- * Show an error message when the operation fails.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showOperationErrorMessage(Shell shell, Throwable exc)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED).makeSubstitution(exc.getMessage()));
- msgDlg.open();
- SystemBasePlugin.logError("Copy profile operation failed",exc);
- }
- /**
- * Show an error message when the user cancels the operation.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showOperationCancelledMessage(Shell shell)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED));
- msgDlg.open();
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameSelectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameSelectAction.java
deleted file mode 100644
index b72123062..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemProfileNameSelectAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A selectable profile name action.
- */
-public class SystemProfileNameSelectAction extends SystemBaseAction
-{
- private ISystemProfile profile;
-
- /**
- * Constructor
- */
- public SystemProfileNameSelectAction(Shell parent, ISystemProfile profile)
- {
- super(profile.getName(),parent);
- this.profile = profile;
- ISystemProfileManager mgr = SystemProfileManager.getSystemProfileManager();
- setChecked(mgr.isSystemProfileActive(profile.getName()));
- setSelectionSensitive(false);
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0004"); //$NON-NLS-1$
- }
-
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- sr.setSystemProfileActive(profile, isChecked());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAction.java
deleted file mode 100644
index ea0fac591..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAction.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to refresh the selected node in the Remote Systems Explorer tree view
- */
-public class SystemRefreshAction extends SystemBaseAction
- //
-{
- private IStructuredSelection _selection = null;
-
- /**
- * Constructor
- */
- public SystemRefreshAction(Shell parent)
- {
- super(SystemResources.ACTION_REFRESH_LABEL, SystemResources.ACTION_REFRESH_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID), // D54577
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0017");
- setAvailableOffline(true);
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- _selection = selection;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- if (_selection != null)
- {
- Iterator iter = _selection.iterator();
- while(iter.hasNext())
- {
- Object obj = iter.next();
-
- if (obj instanceof ISystemContainer)
- {
- ((ISystemContainer)obj).markStale(true);
- }
- sr.fireEvent(new SystemResourceChangeEvent(obj, ISystemResourceChangeEvents.EVENT_REFRESH, obj));
- }
- }
- else
- {
- if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener))
- {
- sr.fireEvent((ISystemResourceChangeListener)viewer,
- new SystemResourceChangeEvent(sr,
- ISystemResourceChangeEvents.EVENT_REFRESH_SELECTED, null));
- }
- else
- sr.fireEvent(new SystemResourceChangeEvent(sr, ISystemResourceChangeEvents.EVENT_REFRESH_SELECTED, null));
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAllAction.java
deleted file mode 100644
index c012dedfc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRefreshAllAction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to refresh the entire Remote Systems Explorer tree view
- */
-public class SystemRefreshAllAction extends SystemBaseAction
-
-{
-
- //private SystemProfile prevProfile = null;
- private IStructuredSelection _selection = null;
- private Object _rootObject = null;
-
- /**
- * Constructor for SystemRefreshAllAction
- */
- public SystemRefreshAllAction(Shell parent)
- {
- super(SystemResources.ACTION_REFRESH_ALL_LABEL,SystemResources.ACTION_REFRESH_ALL_TOOLTIP,
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
- //setSelectionSensitive(false);
- setSelectionSensitive(true);// use selection to decide what to invalidate
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0009");
- }
-
- public void setRootObject(Object object)
- {
- _rootObject = object;
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- _selection = selection;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- if (_selection != null)
- {
- // mark all selected objects as stale if applicable
- Iterator iter = _selection.iterator();
- while(iter.hasNext())
- {
- Object obj = iter.next();
-
- if (obj instanceof ISystemContainer)
- {
- ((ISystemContainer)obj).markStale(true);
- }
- }
- }
- if (_rootObject != null)
- {
- if (_rootObject instanceof ISystemContainer)
- {
- ((ISystemContainer)_rootObject).markStale(true);
- }
- }
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- sr.fireEvent(new SystemResourceChangeEvent(sr, ISystemResourceChangeEvents.EVENT_REFRESH, null));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemotePropertiesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemotePropertiesAction.java
deleted file mode 100644
index 37f144056..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemotePropertiesAction.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import java.text.MessageFormat;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemPropertyPageExtensionManager;
-import org.eclipse.rse.ui.GenericMessages;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.dialogs.PropertyDialog;
-import org.eclipse.ui.internal.dialogs.PropertyPageManager;
-
-
-/**
- * The action shows properties for remote objects
- */
-public class SystemRemotePropertiesAction
- extends SystemBaseAction
-
-{
-
- /**
- * Constructor
- */
- public SystemRemotePropertiesAction(Shell shell)
- {
- super(SystemResources.ACTION_REMOTE_PROPERTIES_LABEL, SystemResources.ACTION_REMOTE_PROPERTIES_TOOLTIP,shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_PROPERTIES);
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * It is too expense to check for registered property pages at popup time, so we just return true.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- return enable;
- }
-
- /**
- * Returns the name of the given element.
- * @param element the element
- * @return the name of the element
- */
- private String getName(Object element)
- {
- return getAdapter(element).getName(element);
- }
- /**
- * Returns whether the provided object has pages registered in the property page
- * manager.
- */
- public boolean hasPropertyPagesFor(Object object)
- {
- //PropertyPageContributorManager manager = PropertyPageContributorManager.getManager();
- return getOurPropertyPageManager().hasContributorsFor(getRemoteAdapter(object), object);
- }
- /**
- * Get the remote property page extension manager
- */
- private SystemPropertyPageExtensionManager getOurPropertyPageManager()
- {
- return SystemPropertyPageExtensionManager.getManager();
- }
- /**
- * Returns whether this action is actually applicable to the current selection.
- * Returns true if there are any registered property pages applicable for the
- * given input object.
- * <p>
- * This method is generally too expensive to use when updating the enabled state
- * of the action.
- * </p>
- *
- * @return <code>true</code> if there are property pages for the currently
- * selected element, and <code>false</code> otherwise
- */
- public boolean isApplicableForSelection()
- {
- return hasPropertyPagesFor(getFirstSelection());
- }
- /**
- * The <code>PropertyDialogAction</code> implementation of this
- * <code>IAction</code> method performs the action by opening the Property Page
- * Dialog for the current selection. If no pages are found, an informative
- * message dialog is presented instead.
- */
- public void run()
- {
- PropertyPageManager pageManager = new PropertyPageManager();
- String title = "";//$NON-NLS-1$
-
- // get selection
- //Object element = getFirstSelection();
- IAdaptable element = (IAdaptable)getFirstSelection();
- if (element == null)
- return;
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(element);
- if (adapter == null)
- return;
-
- // load pages for the selection
- // fill the manager with contributions from the matching contributors
- getOurPropertyPageManager().contribute(pageManager, getRemoteAdapter(element), element);
- //PropertyPageContributorManager.getManager().contribute(pageManager, element);
-
- Shell shell = getShell();
-
- // testing if there are pages in the manager
- Iterator pages = pageManager.getElements(PreferenceManager.PRE_ORDER).iterator();
- String name = getName(element);
- if (!pages.hasNext()) {
- MessageDialog.openInformation(
- shell,
- GenericMessages.PropertyDialog_messageTitle,
- MessageFormat.format(GenericMessages.PropertyDialog_noPropertyMessage, new Object[] {name}));
- return;
- }
- else
- {
- title = MessageFormat.format(GenericMessages.PropertyDialog_propertyMessage, new Object[] {name});
- }
-
- PropertyDialog propertyDialog = new PropertyDialog(shell, pageManager, getSelection());
- propertyDialog.create();
- propertyDialog.getShell().setText(title);
-
-
-
- // TODO - hack to make this work in 3.1
- String id = PlatformUI.PLUGIN_ID + ".property_dialog_context";
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyDialog.getShell(), id);
-
- propertyDialog.open();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStartAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStartAction.java
deleted file mode 100644
index 6accc607f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStartAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is the "Start" action that shows up under a remote server action
- * within the Remote Servers cascading menu.
- */
-public class SystemRemoteServerStartAction extends SystemBaseAction
-{
- private SystemCascadingRemoteServerBaseAction parentAction;
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- * @param parentAction The action that cascades into this action.
- */
- public SystemRemoteServerStartAction(Shell shell, SystemCascadingRemoteServerBaseAction parentAction)
- {
- super(SystemResources.ACTION_REMOTESERVER_START_LABEL,SystemResources.ACTION_REMOTESERVER_START_TOOLTIP, shell);
- this.parentAction = parentAction;
- allowOnMultipleSelection(false);
- //setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"actnstsv");
- }
-
- /**
- * Called when this action is selection from the popup menu.
- * Calls {@link SystemCascadingRemoteServerBaseAction#startServer()} in the parent action.
- */
- public void run()
- {
- boolean ok = parentAction.startServer();
- setEnabled(!ok);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStopAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStopAction.java
deleted file mode 100644
index 7fc98446f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRemoteServerStopAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is the "Stop" action that shows up under a remote server action
- * within the Remote Servers cascading menu.
- */
-public class SystemRemoteServerStopAction extends SystemBaseAction
-{
- private SystemCascadingRemoteServerBaseAction parentAction;
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- * @param parentAction The action that cascades into this action.
- */
- public SystemRemoteServerStopAction(Shell shell, SystemCascadingRemoteServerBaseAction parentAction)
- {
- super(SystemResources.ACTION_REMOTESERVER_STOP_LABEL,SystemResources.ACTION_REMOTESERVER_STOP_TOOLTIP, shell);
- this.parentAction = parentAction;
- allowOnMultipleSelection(false);
- //setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"actnspsv");
- }
-
- /**
- * Called when this action is selection from the popup menu.
- * Calls {@link SystemCascadingRemoteServerBaseAction#stopServer()} in the parent action.
- */
- public void run()
- {
- boolean ok = parentAction.stopServer();
- setEnabled(!ok);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemResolveFilterStringAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemResolveFilterStringAction.java
deleted file mode 100644
index 823d68187..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemResolveFilterStringAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.dialogs.SystemResolveFilterStringDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action for testing a given filter string by resolving it and showing the resolve results
- */
-public class SystemResolveFilterStringAction extends SystemTestFilterStringAction
-{
-
-
- /**
- * Constructor when input subsystem and filter string are known already
- */
- public SystemResolveFilterStringAction(Shell shell, ISubSystem subsystem, String filterString)
- {
- super(shell, subsystem, filterString);
- }
-
- /**
- * Constructor when input subsystem and filter string are not known already.
- * @see #setSubSystem(ISubSystem)
- * @see #setFilterString(String)
- */
- public SystemResolveFilterStringAction(Shell shell)
- {
- super(shell);
- }
-
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override run with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected Dialog createDialog(Shell shell)
- {
- dlg = new SystemResolveFilterStringDialog(shell, subsystem, filterString);
-
- return dlg;
- } // end createDialog()
-
- /**
- * Return selected object. If multiple objects are selected,
- * returns the first selected object.
- */
- public Object getSelectedObject()
- {
- return getValue();
- }
-
-} // end class SystemResolveFilterStringAction \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRunAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRunAction.java
deleted file mode 100644
index 8ff90b179..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemRunAction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemViewRunnableObject;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action is for any object that wants a "Run" action in their popup menu.
- * The object must support the ISystemViewRunnableObject interface.
- */
-public class SystemRunAction extends SystemBaseAction
-
-{
-
- /**
- * Constructor.
- */
- public SystemRunAction(Shell shell)
- {
- this(SystemResources.ACTION_RUN_LABEL, SystemResources.ACTION_RUN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_RUN_ID),
- shell);
- }
-
-
- /**
- * Constructor.
- * @param label
- * @param tooltip
- * @param image the image.
- * @param shell the parent shell.
- */
- public SystemRunAction(String label, String tooltip, ImageDescriptor image, Shell shell)
- {
- super(label, tooltip, image, shell);
- init();
- }
-
- /**
- * Initialize.
- */
- protected void init() {
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_OPEN);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0100");
- }
-
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- Object selectedObject = getFirstSelection();
- if ((selectedObject == null) || !(selectedObject instanceof ISystemViewRunnableObject))
- enable = false;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- Object selectedObject = getFirstSelection();
- if ((selectedObject == null) || !(selectedObject instanceof ISystemViewRunnableObject))
- return;
- ISystemViewRunnableObject runnable = (ISystemViewRunnableObject)selectedObject;
- runnable.run(getShell());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSelectConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSelectConnectionAction.java
deleted file mode 100644
index afbd16558..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSelectConnectionAction.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemSelectConnectionDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Use this action to put up a dialog allowing users to select one or
- * more connections.
- */
-public class SystemSelectConnectionAction extends SystemBaseDialogAction
-{
- private boolean multiSelect;
- private boolean showPropertySheetInitialState;
- private boolean showPropertySheet;
- private String message;
- private boolean showNewConnectionPrompt = true;
- private String[] systemTypes;
- private String systemType;
- private IHost defaultConn;
- private Object result;
-
- /**
- * Constructor
- */
- public SystemSelectConnectionAction(Shell shell)
- {
- super(SystemResources.ACTION_SELECTCONNECTION_LABEL, SystemResources.ACTION_SELECTCONNECTION_TOOLTIP,null, shell);
- }
-
- /**
- * Set the connection to default the selection to
- */
- public void setDefaultConnection(IHost conn)
- {
- this.defaultConn = conn;
- }
- /**
- * Restrict to certain system types
- * @param systemTypes the system types to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemTypes(String[] systemTypes)
- {
- this.systemTypes = systemTypes;
- }
- /**
- * Restrict to a certain system type
- * @param systemType the system type to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemType(String systemType)
- {
- this.systemType = systemType;
- }
- /**
- * Set to true/false if a "New Connection..." special connection is to be shown for creating new connections.
- * Defaault is true.
- */
- public void setShowNewConnectionPrompt(boolean show)
- {
- this.showNewConnectionPrompt = show;
- }
- /**
- * Set the label text shown at the top of the dialog
- */
- public void setInstructionLabel(String message)
- {
- this.message = message;
- }
-
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload always shows the property sheet
- * <p>
- * Default is false
- */
- public void setShowPropertySheet(boolean show)
- {
- this.showPropertySheet = show;
- }
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload shows a Details>>> button so the user can decide if they want to see the
- * property sheet.
- * <p>
- * @param show True if show the property sheet within the dialog
- * @param initialState True if the property is to be initially displayed, false if it is not
- * to be displayed until the user presses the Details button.
- */
- public void setShowPropertySheet(boolean show, boolean initialState)
- {
- this.showPropertySheet = show;
- this.showPropertySheetInitialState = initialState;
- }
-
- /**
- * Set multiple selection mode. Default is single selection mode
- * <p>
- * If you turn on multiple selection mode, you must use the getSelectedObjects()
- * method to retrieve the list of selected objects.
- * <p>
- * Further, if you turn this on, it has the side effect of allowing the user
- * to select any remote object. The assumption being if you are prompting for
- * files, you also want to allow the user to select a folder, with the meaning
- * being that all files within the folder are implicitly selected.
- *
- * @see #getSelectedObjects()
- */
- public void setMultipleSelectionMode(boolean multiple)
- {
- this.multiSelect = multiple;
- }
-
- /**
- * Return the selected connection in single select mode
- */
- public IHost getSystemConnection()
- {
- if (result instanceof IHost)
- return (IHost)result;
- else if (result instanceof IHost[])
- return ((IHost[])result)[0];
- else
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.actions.SystemBaseDialogAction#createDialog(org.eclipse.swt.widgets.Shell)
- */
- protected Dialog createDialog(Shell shell)
- {
- SystemSelectConnectionDialog selectDlg = new SystemSelectConnectionDialog(shell);
- if (defaultConn != null)
- selectDlg.setDefaultConnection(defaultConn);
- if (systemTypes != null)
- selectDlg.setSystemTypes(systemTypes);
- else if (systemType != null)
- selectDlg.setSystemType(systemType);
- selectDlg.setShowNewConnectionPrompt(showNewConnectionPrompt);
- if (message != null)
- selectDlg.setInstructionLabel(message);
- if (showPropertySheet)
- selectDlg.setShowPropertySheet(showPropertySheet,showPropertySheetInitialState);
- selectDlg.setMultipleSelectionMode(multiSelect);
- return selectDlg;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.actions.SystemBaseDialogAction#getDialogValue(org.eclipse.jface.dialogs.Dialog)
- */
- protected Object getDialogValue(Dialog dlg)
- {
- SystemSelectConnectionDialog selectDlg = (SystemSelectConnectionDialog)dlg;
- result = selectDlg.getOutputObject();
- return result;
- }
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSeparatorAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSeparatorAction.java
deleted file mode 100644
index 77221c324..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSeparatorAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Shell;
-/**
- * Dummy action representing a separator in menus.
- */
-public class SystemSeparatorAction extends SystemBaseAction
-{
- private boolean realAction;
-
- /**
- * Constructor for SystemSeparatorAction when you intend to subclass
- */
- public SystemSeparatorAction(Shell parent)
- {
- super("_separator_",(ImageDescriptor)null,parent);
- realAction = true;
- }
- /**
- * Constructor for SystemSeparatorAction when you just want the separator
- */
- public SystemSeparatorAction()
- {
- super("_separator_",(ImageDescriptor)null,null);
- realAction = false;
- }
-
- public Separator getSeparator()
- {
- return new Separator();
- }
-
- /**
- * Return true if this is both a separator and a real action, false if this is only
- * a separator
- */
- public boolean isRealAction()
- {
- return realAction;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInMonitorAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInMonitorAction.java
deleted file mode 100644
index 15c80ad13..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInMonitorAction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.monitor.SystemMonitorUI;
-import org.eclipse.rse.ui.view.monitor.SystemMonitorViewPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * This is the default action for showing a remote object in a table
- */
-public class SystemShowInMonitorAction extends SystemBaseAction
-{
- private Object _selected;
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemShowInMonitorAction(Shell parent)
- {
- super(SystemResources.ACTION_MONITOR_LABEL,
- SystemResources.ACTION_MONITOR_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR_ID),
- parent);
- setAvailableOffline(true);
- }
-
- /**
- * Called when this action is selected from the popup menu.
- */
- public void run()
- {
- SystemMonitorViewPart viewPart = null;
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- try
- {
- viewPart = (SystemMonitorViewPart) page.showView(SystemMonitorUI.MONITOR_VIEW_ID, null, IWorkbenchPage.VIEW_CREATE);
- }
- catch (PartInitException e)
- {
- return;
- }
- catch (Exception e)
- {
- return;
- }
-
- viewPart.addItemToMonitor((IAdaptable) _selected);
- page.activate(viewPart);
-
- }
-
- /**
- * Called when the selection changes. The selection is checked to
- * make sure this action can be performed on the selected object.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = false;
- Iterator e = selection.iterator();
- Object selected = e.next();
-
- if (selected != null && selected instanceof IAdaptable)
- {
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) ((IAdaptable) selected).getAdapter(ISystemViewElementAdapter.class);
- if (va.hasChildren(selected))
- {
- _selected = selected;
- enable = true;
- }
- }
-
- return enable;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInTableAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInTableAction.java
deleted file mode 100644
index bc42bfe55..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowInTableAction.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableViewPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * This is the default action for showing a remote object in a table
- */
-public class SystemShowInTableAction extends SystemBaseAction
-{
- private Object _selected;
-
- /**
- * Constructor.
- * @param shell Shell of parent window, used as the parent for the dialog.
- * Can be null, but be sure to call setParent before the action is used (ie, run).
- */
- public SystemShowInTableAction(Shell parent)
- {
- super(SystemResources.ACTION_TABLE_LABEL,
- SystemResources.ACTION_TABLE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE_ID),
- parent);
- setAvailableOffline(true);
- }
-
- /**
- * Called when this action is selected from the popup menu.
- */
- public void run()
- {
- SystemTableViewPart viewPart = null;
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- try
- {
- viewPart = (SystemTableViewPart) page.showView("org.eclipse.rse.ui.view.systemTableView", null, IWorkbenchPage.VIEW_CREATE);
- }
- catch (PartInitException e)
- {
- return;
- }
- catch (Exception e)
- {
- return;
- }
-
- viewPart.setInput((IAdaptable) _selected);
- page.activate(viewPart);
-
- }
-
- /**
- * Called when the selection changes. The selection is checked to
- * make sure this action can be performed on the selected object.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = false;
- Iterator e = selection.iterator();
- Object selected = e.next();
-
- if (selected != null && selected instanceof IAdaptable)
- {
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) ((IAdaptable) selected).getAdapter(ISystemViewElementAdapter.class);
- if (va.hasChildren(selected))
- {
- _selected = selected;
- enable = true;
- }
- }
-
- return enable;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowPreferencesPageAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowPreferencesPageAction.java
deleted file mode 100644
index 0dc04c479..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemShowPreferencesPageAction.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog;
-
-
-
-/**
- * This action will launch the Prefences dialog, but only rooted at a given
- * preference page (it will include its children underneath), including the
- * child pages registered under that page ("category").
- * <p>
- * This is used by the org.eclipse.rse.core.remoteSystemsViewPreferencesActions
- * extension point.
- * @see org.eclipse.rse.ui.actions.SystemCascadingPreferencesAction
- */
-public class SystemShowPreferencesPageAction extends SystemBaseAction implements IViewActionDelegate
-{
-
- private PreferenceManager preferenceManager;
- private String[] preferencePageIDs;
- private String preferencePageCategory;
-
- /**
- * Constructor. We are instantiated inside {@link RSEUIPlugin#getPreferencePageActionPlugins()}
- * for each extension of our extension point <code>org.eclipse.rse.core.remoteSystemsViewPreferencesActions</code>
- */
- public SystemShowPreferencesPageAction()
- {
- super("temp label", null);
- }
-
- /**
- * Set ID of the preference root page to show.
- * @param preferencePageID The ID of the preference page root to show. All child nodes will also be shown.
- */
- public void setPreferencePageID(String preferencePageID)
- {
- setPreferencePageID(new String[] {preferencePageID});
- }
- /**
- * Set IDs of the preference root pages to show.
- * @param preferencePageIDs The IDs of the preference page roots to show. All child nodes will also be shown.
- */
- public void setPreferencePageID(String[] preferencePageIDs)
- {
- allowOnMultipleSelection(false);
- setSelectionSensitive(false);
- this.preferencePageIDs = preferencePageIDs;
- }
- /**
- * Set the category of the pages to be shown. This only needs to be called
- * for non-root pages. Note that the ID to give here is not of the immediate
- * parent, but that of the root parent. It tells us which root subtree to
- * search for the given page(s).
- */
- public void setPreferencePageCategory(String preferencePageCategory)
- {
- this.preferencePageCategory = preferencePageCategory;
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view)
- {
- setShell(view.getSite().getShell());
- }
-
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action)
- {
- run();
- }
-
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- // Bring up the preferences page
- /*
- PreferenceManager prefMgr = new PreferenceManager();
- prefMgr.addToRoot(new PreferenceNode("tempid", new RemoteSystemsPreferencePage()));
- PreferenceDialog dialog = new PreferenceDialog(shell, prefMgr);
- dialog.open();
- */
- PreferenceManager pm = getPreferenceManager();
-
- if (pm != null)
- {
- PreferenceDialog d = new WorkbenchPreferenceDialog(shell, pm);
- d.create();
- // TODO - hack to make this work in 3.1
- String id = PlatformUI.PLUGIN_ID + ".preference_dialog_context";
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(d.getShell(), id);
- d.open();
- }
- }
- /*
- * Get the preference manager.
- */
- public PreferenceManager getPreferenceManager()
- {
- if (preferenceManager == null)
- {
- preferenceManager = new PreferenceManager('/');
-
- //Get the pages from the registry
- //PreferencePageRegistryReader registryReader = new PreferencePageRegistryReader(PlatformUI.getWorkbench());
-
- //List pageContributions = registryReader.getPreferenceContributions(Platform.getExtensionRegistry());
-
- PreferenceManager workbenchMgr = PlatformUI.getWorkbench().getPreferenceManager();
-
- List pageContributions = workbenchMgr.getElements(PreferenceManager.POST_ORDER);
-
-
-
- //Add the contributions to the manager
- Iterator iter = pageContributions.iterator();
- while (iter.hasNext())
- {
- IPreferenceNode prefNode = (IPreferenceNode) iter.next();
- //System.out.println("prefNode.getId() == "+prefNode.getId());
- //System.out.println(" getLabelText() == "+prefNode.getLabelText());
- boolean match = false;
- String prefNodeID = prefNode.getId();
- if (preferencePageCategory == null)
- {
- match = testForMatch(prefNodeID);
- }
- else if (prefNodeID.equals(preferencePageCategory))
- {
- //System.out.println("Made it here");
- prefNode = searchForSubPage(prefNode, prefNodeID);
- if (prefNode != null)
- match = true;
- }
- if (match)
- preferenceManager.addToRoot(prefNode);
- }
-
- }
- return preferenceManager;
- }
-
- private IPreferenceNode searchForSubPage(IPreferenceNode parent, String prefNodeID)
- {
- IPreferenceNode match = null;
-
- IPreferenceNode[] subNodes = parent.getSubNodes();
- if (subNodes!=null)
- for (int idx=0; (match==null) && (idx<subNodes.length); idx++)
- {
- if (testForMatch(subNodes[idx].getId()))
- match = subNodes[idx];
- else
- match = searchForSubPage(subNodes[idx], prefNodeID);
- }
-
- return match;
- }
-
- private boolean testForMatch(String prefNodeID)
- {
- boolean match = false;
- for (int idx=0; !match && (idx<preferencePageIDs.length); idx++)
- {
- if (prefNodeID.equals(preferencePageIDs[idx]))
- match = true;
- }
- return match;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStartCommunicationsDaemonAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStartCommunicationsDaemonAction.java
deleted file mode 100644
index 6683c5137..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStartCommunicationsDaemonAction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.rse.core.comm.SystemCommunicationsDaemon;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Action to start and stop RSE communications daemon
- */
-public class SystemStartCommunicationsDaemonAction extends SystemBaseAction implements IAction
-{
-
- /**
- * Constructor
- *
- * @param shell
- */
- public SystemStartCommunicationsDaemonAction(Shell shell)
- {
- super(SystemResources.ACTION_DAEMON_STOP_LABEL,
- SystemResources.ACTION_DAEMON_STOP_TOOLTIP,
- shell);
-
- setHelp(RSEUIPlugin.HELPPREFIX + "dmna0000");
-
- if (!SystemCommunicationsDaemon.isAutoStart() || !SystemCommunicationsDaemon.getInstance().isRunning())
- {
- setActionLabelToStart();
- }
-
- SystemCommunicationsDaemon.setAction(this);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- SystemCommunicationsDaemon daemon = SystemCommunicationsDaemon.getInstance();
- if (daemon.isRunning())
- {
- daemon.stopDaemon();
-
- // Change the menu label for the action
- setActionLabelToStart();
- }
- else
- {
- daemon.startDaemon();
- // Change the menu label for the action
- setActionLabelToStop();
- }
- }
-
- /**
- * Helper method for changing the action text and tooltip to start
- */
- public void setActionLabelToStart()
- {
- setText(SystemResources.ACTION_DAEMON_START_LABEL);
- setToolTipText(SystemResources.ACTION_DAEMON_START_TOOLTIP);
- }
-
- /**
- * Helper method for changing the action text and tooltip to stop
- */
- public void setActionLabelToStop()
- {
- setText(SystemResources.ACTION_DAEMON_STOP_LABEL);
- setToolTipText(SystemResources.ACTION_DAEMON_STOP_TOOLTIP);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStringPromptAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStringPromptAction.java
deleted file mode 100644
index e53677d80..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemStringPromptAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is a default action for prompting for a string.
- * It puts up a simple dialog with an entry field. You specify the button/menuitem
- * strings, and the title and prompt on the resulting dialog.
- * You can also optionally specify an input validator that is called to verify the
- * contents of the entry field.
- */
-public class SystemStringPromptAction extends SystemBaseDialogAction
-{
-
- private String title, prompt;
- private ISystemValidator inputValidator;
-
- /**
- * @param rb Resource bundle where to find following keys
- * @param key Key used as prefix in resource bundle to get:
- * <sl>
- * <li>button/menuitem label -> appends ".label" to key
- * <li>button/menuitem tooltip -> appends ".tooltip" to key
- * <li>button/menuitem description on status line -> appends ".description" to key
- * <li>title of generic prompt dialog box displayed -> appends ".title"
- * <li>prompt text in generic prompt dialog box displayed -> appends ".prompt"
- * </sl>
- * @param parent Shell of parent window
- *
- * @deprecated use fields from resource class directly now
- */
- public SystemStringPromptAction(String label, String tooltip, String title, String prompt, Shell parent)
- {
- super(label, tooltip, null, parent); // null => no image
- this.title = title;
- this.prompt = prompt;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_OPEN);
- }
-
-
- /**
- * Set validator to use to check validity of input
- * @param text validator
- */
- public void setValidator(ISystemValidator inputValidator)
- {
- this.inputValidator = inputValidator;
- }
-
- /**
- * We use the default inherited actionPerformed method,
- * which calls this method to create our dialog.
- */
- public Dialog createDialog(Shell parent)
- {
- InputDialog dlg= new InputDialog(parent, title, prompt,null,inputValidator);
- //dlg.getShell().setSize(300, 200); // ? right thing to do ?
- dlg.setBlockOnOpen(true); // modal
- return dlg;
- }
-
- /**
- * We use the default inherited actionPerformed method,
- * which calls this method after the dialog is closed in
- * order to retrieve the dialog's data. This is then
- * placed in this object's value property and can be
- * retrieved publicly via getValue().
- */
- protected Object getDialogValue(Dialog dlg)
- {
- String value = ((InputDialog)dlg).getValue();
- if (value != null)
- value = value.trim();
- return value;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManager.java
deleted file mode 100644
index 300bdc182..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManager.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * For cascading menus, we need our own menu subclass so we can intercept
- * the state-setting methods of our frameworks, and foreword those onto the
- * sub-menu actions.
- * <p>
- * The state-setting methods including setShell, setSelection and setValue.
- */
-public class SystemSubMenuManager
- extends MenuManager
- //implements ISelectionChangedListener
- //implements ISystemAction
-{
- protected String toolTipText;
- protected ImageDescriptor image = null;
- protected Shell shell = null;
- protected Viewer viewer = null;
- protected boolean deferPopulation;
- protected boolean traceSelections = false;
- protected String traceTarget;
- protected ISelection selection;
- protected String label;
- protected SystemBaseSubMenuAction parentCascadingAction;
-
- /**
- * Constructor for SystemSubMenuManager
- */
- public SystemSubMenuManager(SystemBaseSubMenuAction parentAction)
- {
- super();
- this.parentCascadingAction = parentAction;
- }
- /**
- * Constructor for SystemSubMenuManager
- */
- public SystemSubMenuManager(SystemBaseSubMenuAction parentAction, String text)
- {
- super(text);
- this.label = text;
- this.parentCascadingAction = parentAction;
- }
- /**
- * Constructor for SystemSubMenuManager
- */
- public SystemSubMenuManager(SystemBaseSubMenuAction parentAction, String text, String id)
- {
- super(text, id);
- this.label = text;
- this.parentCascadingAction = parentAction;
- }
- /**
- * Constructor for SystemSubMenuManager
- */
- public SystemSubMenuManager(SystemBaseSubMenuAction parentAction, String text, String id, ImageDescriptor image)
- {
- super(text, id);
- this.label = text;
- this.image = image;
- this.parentCascadingAction = parentAction;
- }
-
- /**
- * Return the parent cascading menu action that created this.
- */
- public SystemBaseSubMenuAction getParentCascadingAction()
- {
- return parentCascadingAction;
- }
-
- /**
- * Set the tooltip text when this is used for in a cascading menu.
- * @see org.eclipse.rse.ui.actions.SystemBaseSubMenuAction
- */
- public void setToolTipText(String tip)
- {
- this.toolTipText = tip;
- }
- /**
- * Get the tooltip text when this is used for in a cascading menu
- */
- public String getToolTipText()
- {
- return toolTipText;
- }
-
- /**
- * Return the label for this submenu
- */
- public String getLabel()
- {
- return label;
- }
-
- // ------------------------
- // ISYSTEMACTION METHODS...
- // ------------------------
- /**
- * An optimization for performance reasons that allows all inputs to be set in one call.
- * This is called by SystemView's fillContextMenu method.
- */
- public void setInputs(Shell shell, Viewer v, ISelection selection)
- {
- if (traceSelections)
- issueTraceMessage(" INSIDE SETINPUTS FOR SUBMENUMGR FOR '"+label+"'");
- this.shell = shell;
- this.viewer = v;
- this.selection = selection;
- if (parentCascadingAction != null)
- parentCascadingAction.setInputsFromSubMenuManager(shell, v, selection);
- cascadeAllInputs();
- }
-
-
- /**
- * Sets the parent shell for this action. Usually context dependent.
- * We cascade this down to all of the actions added to this submenu.
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- IContributionItem[] items = getItems();
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- item.setShell(shell);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- item.setShell(shell);
- }
- }
- if (traceSelections)
- {
- issueTraceMessage("*** INSIDE SETSHELL FOR SUBMENUMGR "+label+". #ITEMS = "+items.length);
- }
-
- }
-
- /**
- * This is called by the framework to set the selection input, just prior to showing the popup menu.
- * We cascade this down to all of the actions added to this submenu.
- */
- public void setSelection(ISelection selection)
- {
- this.selection = selection;
- IContributionItem[] items = getItems();
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- item.setSelection(selection);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- item.setSelection(selection);
- }
- }
- if (traceSelections)
- {
- issueTraceMessage("*** INSIDE SETSELECTION FOR SUBMENUMGR"+label+". #ITEMS = "+items.length);
- }
-
- }
- /**
- * Set the Viewer that called this action. It is good practice for viewers to call this
- * so actions can directly access them if needed.
- */
- public void setViewer(Viewer v)
- {
- this.viewer = v;
- IContributionItem[] items = getItems();
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- item.setViewer(viewer);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- item.setViewer(viewer);
- }
- }
- }
-
- /**
- * Get the Viewer that called this action. Not guaranteed to be set,
- * depends if that viewer called setViewer or not. SystemView does.
- */
- public Viewer getViewer()
- {
- return viewer;
- }
- /**
- * Get the Shell that hosts this action. Not guaranteed to be set,
- */
- public Shell getShell()
- {
- return shell;
- }
- /**
- * Get the Selection
- */
- public IStructuredSelection getSelection()
- {
- return (IStructuredSelection)selection;
- }
-
- /**
- * @see ContributionManager#add(IAction)
- */
-
- // add(): solve problem that cascaded menu items were not receiving their
- // setSelection() call, due to them only being constructed on the
- // cascade's MenuAboutToShow(), after the setSelections have run.
-
- // THE QUESTION IS, IF WE DO THIS HERE WHEN ITEMS ARE ADDED TO THIS SUBMENU,
- // IS IT REDUNDANT TO ALSO DO IT WHEN SETINPUTS IS CALLED?
-
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void appendToGroup(String groupName, IAction action)
- {
- super.appendToGroup(groupName, action);
- if (action instanceof ISystemAction)
- cascadeAllInputs((ISystemAction)action);
- }
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void appendToGroup(String groupName, IContributionItem item)
- {
- super.appendToGroup(groupName, item);
- if (item instanceof SystemSubMenuManager)
- cascadeAllInputs((SystemSubMenuManager)item);
- }
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- * THIS WAS ONLY CATCHING ACTIONS, NOT NESTED SUBMENUS. THE SUPER OF THIS
- * METHOD CALLS ADD(new ActionContributionItem(action)) SO WE NOW INTERCEPT
- * THERE INSTEAD, AS THAT IS WHAT IS CALLED FOR MULTI-CASCADING MENUS
- public void add(IAction action)
- {
- super.add(action);
- if (action instanceof ISystemAction)
- cascadeAllInputs((ISystemAction)action);
- }*/
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void add(IContributionItem item)
- {
- super.add(item);
- if (item instanceof ActionContributionItem)
- {
- IAction action = ((ActionContributionItem)item).getAction();
- if (action instanceof ISystemAction)
- cascadeAllInputs((ISystemAction)action);
- }
- else if (item instanceof SystemSubMenuManager)
- cascadeAllInputs((SystemSubMenuManager)item);
- }
-
- /**
- * Cascade in one shot all input state inputs to all actions
- */
- protected void cascadeAllInputs()
- {
- //super.menuAboutToShow(ourSubMenu);
- IContributionItem[] items = getItems();
- if (traceSelections)
- {
- issueTraceMessage("INSIDE CASCADEALLINPUTS FOR SUBMENUMGR FOR "+label+". NBR ITEMS = "+items.length);
- }
-
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- if (!item.isDummy())
- cascadeAllInputs(item);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- cascadeAllInputs(item);
- }
- }
-
- }
- /**
- * Cascade in one shot all input state inputs to one action
- */
- protected void cascadeAllInputs(ISystemAction action)
- {
- if (action.isDummy())
- return; // waste of time
- if (shell != null)
- action.setShell(shell);
- if (viewer != null)
- action.setViewer(viewer);
- if (selection != null)
- action.setSelection(selection);
- }
- /**
- * Cascade in one shot all input state inputs to one submenu
- */
- protected void cascadeAllInputs(SystemSubMenuManager submenu)
- {
- if (shell != null)
- submenu.setShell(shell);
- if (viewer != null)
- submenu.setViewer(viewer);
- if (selection != null)
- submenu.setSelection(selection);
- }
- // ------------------------
- // HELPER METHODS...
- // ------------------------
- /**
- * Turn on tracing for selections, shell and viewer to watch as it is set
- */
- public void setTracing(boolean tracing)
- {
- traceSelections = tracing;
- }
- /**
- * Turn on tracing for selections, shell and viewer to watch as it is set,
- * scoped to a particular class name (will use indexOf('xxx') to match).
- */
- public void setTracing(String tracingClassTarget)
- {
- traceSelections = (tracingClassTarget != null);
- traceTarget = tracingClassTarget;
- }
- /**
- * Turn on tracing for selections, shell and viewer to watch as it is set,
- * scoped to a particular class name (will use indexOf('xxx') to match).
- */
- public void setTracing(boolean tracing, String tracingClassTarget)
- {
- traceSelections = tracing;
- traceTarget = tracingClassTarget;
- }
-
- /**
- * Issue trace message
- */
- protected void issueTraceMessage(String msg)
- {
- if (traceSelections)
- {
- String className = this.getClass().getName();
- if ((traceTarget==null) || (className.indexOf(traceTarget)>=0))
- {
- className = className.substring(className.lastIndexOf('.'));
- SystemBasePlugin.logInfo(className+": "+msg);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManagerForTesting.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManagerForTesting.java
deleted file mode 100644
index 888a80715..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemSubMenuManagerForTesting.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * For cascading menus, we need our own menu subclass so we can intercept
- * the state-setting methods our frameworks, and foreword those onto the
- * sub-menu actions.
- * <p>
- * The state-setting methods including setShell, setSelection and setValue.
- * <p>
- * We often have trouble tracking down when the shell, selection and viewer is
- * not properly set for cascading actions. For these cases, we can use this
- * override of the SystemSubMenuManager to trace what happens.
- */
-public class SystemSubMenuManagerForTesting
- extends SystemSubMenuManager
- //implements ISelectionChangedListener
- //implements ISystemAction
-{
- private String prefix = "";
-
- /**
- * Constructor
- */
- public SystemSubMenuManagerForTesting(SystemBaseSubMenuAction parentAction)
- {
- super(parentAction);
- }
- /**
- * Constructor
- */
- public SystemSubMenuManagerForTesting(SystemBaseSubMenuAction parentAction, String text)
- {
- super(parentAction, text);
- System.out.println("SUBMENUMGR CTOR " + text);
- }
- /**
- * Constructor
- */
- public SystemSubMenuManagerForTesting(SystemBaseSubMenuAction parentAction, String text, String id)
- {
- super(parentAction, text, id);
- System.out.println("SUBMENUMGR CTOR " + text);
- }
- /**
- * Constructor
- */
- public SystemSubMenuManagerForTesting(SystemBaseSubMenuAction parentAction, String text, String id, ImageDescriptor image)
- {
- super(parentAction, text, id, image);
- }
-
-
- /**
- * Override of parent so we can trace it....
- */
- public void setInputs(Shell shell, Viewer v, ISelection selection)
- {
- System.out.println(" INSIDE SETINPUTS FOR SUBMENUMGR '"+label+"': selection = "+selection);
- super.setInputs(shell, v, selection);
- }
-
-
-
-
- // add(): solve problem that cascaded menu items were not receiving their
- // setSelection() call, due to them only being constructed on the
- // cascade's MenuAboutToShow(), after the setSelections have run.
-
- // THE QUESTION IS, IF WE DO THIS HERE WHEN ITEMS ARE ADDED TO THIS SUBMENU,
- // IS IT REDUNDANT TO ALSO DO IT WHEN SETINPUTS IS CALLED?
-
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void appendToGroup(String groupName, IAction action)
- {
- System.out.println("INSIDE APPENDTOGROUP OF ISYSTEMACTION FOR SUBMENUMGR FOR '"+label+"'");
- prefix = " ";
- super.appendToGroup(groupName, action);
- prefix = "";
- }
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void appendToGroup(String groupName, IContributionItem item)
- {
- System.out.println("INSIDE APPENDTOGROUP OF SYSTEMSUBMENUMGR FOR SUBMENUMGR FOR '"+label+"'");
- prefix = " ";
- super.appendToGroup(groupName, item);
- prefix = "";
- }
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- * THIS WAS ONLY CATCHING ACTIONS, NOT NESTED SUBMENUS. THE SUPER OF THIS
- * METHOD CALLS ADD(new ActionContributionItem(action)) SO WE NOW INTERCEPT
- * THERE INSTEAD, AS THAT IS WHAT IS CALLED FOR MULTI-CASCADING MENUS
- public void add(IAction action)
- {
- super.add(action);
- if (action instanceof ISystemAction)
- cascadeAllInputs((ISystemAction)action);
- }*/
- /**
- * Intercept so we can cascade the selection, viewer and shell down
- */
- public void add(IContributionItem item)
- {
- prefix = " ";
- if (item instanceof ActionContributionItem)
- {
- IAction action = ((ActionContributionItem)item).getAction();
- if (action instanceof ISystemAction)
- System.out.println("INSIDE ADD OF ISYSTEMACTION(action="+action.getText()+") FOR THIS MNUMGR: "+label);
- }
- else if (item instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager submenu = (SystemSubMenuManager)item;
- System.out.println("INSIDE ADD OF SUBMENUMGR(submenu="+submenu.getLabel()+") FOR THIS MNUMGR: "+label);
- }
- super.add(item);
- prefix = "";
- }
-
- /**
- * Cascade in one shot all input state inputs to all actions
- */
- protected void cascadeAllInputs()
- {
- //super.menuAboutToShow(ourSubMenu);
- IContributionItem[] items = getItems();
- System.out.println(prefix+"INSIDE CASCADEALLINPUTS TO ALL ITEMS FOR SUBMENUMGR FOR "+label+". NBR ITEMS = "+items.length);
- System.out.println(prefix+"...shell = "+shell+", viewer = "+viewer+", selection = "+selection);
- String oldPrefix = prefix;
- prefix += " ";
- super.cascadeAllInputs();
- prefix = oldPrefix;
- }
- /**
- * Cascade in one shot all input state inputs to one action
- */
- protected void cascadeAllInputs(ISystemAction action)
- {
- System.out.println(prefix+"INSIDE CASCADEALLINPUTS TO ISYSTEMACTION(action="+action.getText()+") FOR THIS MNUMGR: "+label);
- System.out.println(prefix+"...shell = "+shell+", viewer = "+viewer+", selection = "+selection);
- super.cascadeAllInputs(action);
- }
- /**
- * Cascade in one shot all input state inputs to one submenu
- */
- protected void cascadeAllInputs(SystemSubMenuManager submenu)
- {
- System.out.println("INSIDE CASCADEALLINPUTS TO SUBMENUMGR(submenu="+submenu.getLabel()+") FOR THIS MNUMGR: "+label);
- System.out.println("...shell = "+shell+", viewer = "+viewer+", selection = "+selection);
- super.cascadeAllInputs(submenu);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTablePrintAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTablePrintAction.java
deleted file mode 100644
index 89ec5bd12..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTablePrintAction.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.SystemTableView;
-import org.eclipse.rse.ui.view.SystemTableViewProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.printing.PrintDialog;
-import org.eclipse.swt.printing.Printer;
-import org.eclipse.swt.printing.PrinterData;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-
-/**
- * This is the action for printing the contents of the table view
- */
-public class SystemTablePrintAction extends SystemBaseAction
-{
-
- private int[] _columnWidths = null;
- private int[] _columnAlignments = null;
-
- private boolean bPrintSelection;
- private boolean bPageRange;
-
- private int endLine;
- private int bottomMargin = 100;
- private int leftMargin = 100;
- private int rightMargin = 100;
- private int topMargin = 100;
-
- private String sPrintOutputName = null;
- private String sPageTitle = null;
- private String sTableTitle = null;
- private String sColumnHeader = null;
- private String sUnderLine = null;
- private String sEndOfListing = null;
-
- private int pageNumber = 1;
- private boolean startedPage = false;
- int startPage;
- int endPage;
-
- private int pageHeight;
- private int pageWidth;
- private int x;
- private int y = 0;
- private int w;
- private int textHeight;
-
- private Printer printer;
- private boolean bPrintPage;
- private GC g;
-
- private SystemTableView _viewer = null;
- private String _title = null;
- private boolean _hasColumns = false;
-
- /**
- * Constructor.
- * @param title the title for the print document
- * @param viewer the viewer to print the contents of
- */
- public SystemTablePrintAction(String title, SystemTableView viewer)
- {
- super(SystemResources.ACTION_PRINTLIST_LABEL, null);
- setToolTipText(SystemResources.ACTION_PRINTLIST_TOOLTIP);
- setTableView(title, viewer);
- }
-
- /**
- * Sets the title for the print document and the table view to print from
- * @param title the title for the print document
- * @param viewer the viewer to print the contents of
- */
- public void setTableView(String title, SystemTableView viewer)
- {
- _title = title;
- _viewer = viewer;
- }
-
- /**
- * Called to check whether this action should be enabled.
- */
- public void checkEnabledState()
- {
- if (_viewer != null && _viewer.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
-
- /**
- * Called when the user chooses to print
- */
- public void run()
- {
- // page format info
- DateFormat dateFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
- String sCurrentDate = dateFormatter.format(new Date());
-
- sPrintOutputName = SystemResources.RESID_TABLE_PRINTLIST_TITLE;
- sPageTitle = sPrintOutputName;
- sPageTitle = sPageTitle + sCurrentDate;
-
- // Table title
- sTableTitle = _title;
-
- /*============================*/
- /* Present the print dialog */
- /*============================*/
- PrintDialog printDialog = new PrintDialog(_viewer.getShell());
-
- PrinterData printerData = printDialog.open();
- if (printerData == null) // user cancelled the print job?
- {
- return;
- }
- // get updated settings from the print dialog
- bPrintSelection = (printerData.scope & PrinterData.SELECTION) != 0;
- bPageRange = printerData.scope == PrinterData.PAGE_RANGE;
-
- Table table = _viewer.getTable();
-
- TableItem[] printItems = table.getItems();
- if (bPrintSelection)
- {
- printItems = table.getSelection();
- endLine = printItems.length;
- if (endLine == 0)
- return; // nothing to print
- }
- else if (bPageRange)
- {
- endLine = printItems.length;
- startPage = printerData.startPage;
- endPage = printerData.endPage;
- if (endPage < startPage)
- return; // nothing to print
- }
-
- /*===================*/
- /* do the printing */
- /*===================*/
- // start print job
- printer = new Printer(printerData);
-
- if (!printer.startJob(sPrintOutputName))
- {
- printer.dispose();
- return;
- }
-
- Rectangle clientArea = printer.getClientArea();
-
- pageHeight = clientArea.height;
- pageWidth = clientArea.width;
- g = new GC(printer);
-
- textHeight = g.getFontMetrics().getHeight();
-
- /*----------------------------------------*/
- /* go through all the lines to print... */
- /*----------------------------------------*/
- pageNumber = 1;
- startedPage = false;
-
- // scale factor
- int scaleFactor = 1;
- Rectangle tableClientArea = table.getClientArea();
- int tableWidth = tableClientArea.width - 5;
- if (tableWidth > pageWidth)
- {
- scaleFactor = tableWidth / pageWidth;
- }
-
- int columnCount = table.getColumnCount();
- if (columnCount > 1)
- {
- _hasColumns = true;
- }
- else
- {
- _hasColumns = false;
- }
-
- // header info
-
- getColumnInfo(scaleFactor);
- sColumnHeader = getColumnHeader();
- sUnderLine = getHeaderSeparator();
-
- sEndOfListing = getTableFooter();
-
- for (int i = 0; i < printItems.length; i++)
- {
- TableItem item = printItems[i];
- Object data = item.getData();
-
- String line = getLine(data, columnCount);
-
- printLine(line);
- }
-
- printLine(" ");
- printLine(sEndOfListing);
-
- /*=======================*/
- /* finish up print job */
- /*=======================*/
- g.dispose();
-
- printer.endJob();
- printer.dispose();
-
- System.gc();
- return;
- }
-
- /*
- * Print one line
- */
- private void printLine(String text)
- {
- do // until the text of one line is printed
- {
- // start a new page
- if (!startedPage)
- {
- if (bPageRange)
- {
- if (pageNumber >= startPage && pageNumber <= endPage)
- bPrintPage = true;
- else
- bPrintPage = false;
- }
- else
- bPrintPage = true;
-
- startedPage = true;
- x = leftMargin;
- y = topMargin;
- if (bPrintPage)
- {
- printer.startPage();
- g.drawString(sPageTitle + pageNumber, x, y);
-
- y += textHeight * 2;
-
- g.drawString(sTableTitle, x, y);
- y += textHeight * 2;
-
- g.drawString(sColumnHeader, x, y);
- y += textHeight;
-
- g.drawString(sUnderLine, x, y);
- y += textHeight;
- }
- else
- {
- y = topMargin + textHeight * 6;
- }
- pageNumber++;
- }
- // start at beginning of the line
- x = leftMargin;
-
- if (text != null)
- {
- int l = text.length();
- while (l > 0)
- {
- w = g.stringExtent(text.substring(0, l)).x;
- if (x + w <= pageWidth - rightMargin)
- {
- break;
- }
- l--;
- }
- String remainingText = null; // text spillin' to next print line
- if (l > 0 && l < text.length())
- {
- remainingText = text.substring(l);
- text = text.substring(0, l);
- }
- if (bPrintPage)
- g.drawString(text, x, y);
- text = remainingText; // still to print text spillin' over edge
- }
- // finished a print line, go to next
- y += textHeight;
- // done with this page (a new line height doesn't fit)?
- if (y + textHeight > pageHeight - bottomMargin)
- {
- if (bPrintPage)
- printer.endPage();
- startedPage = false;
- }
- }
- while (text != null); //end do
- }
-
- private void getColumnInfo(int scaleFactor)
- {
- // scale widths
- Table table = _viewer.getTable();
- if (table.getColumnCount() > 1)
- {
- _hasColumns = true;
- }
- else
- {
- _hasColumns = false;
- }
-
- if (_hasColumns)
- {
- _columnWidths = new int[table.getColumnCount()];
- _columnAlignments = new int[table.getColumnCount()];
-
- for (int i = 0; i < table.getColumnCount(); i++)
- {
- TableColumn column = table.getColumn(i);
- int width = column.getWidth();
- _columnWidths[i] = width / 9;
- _columnAlignments[i] = column.getAlignment();
- }
- }
- }
-
- private String getColumnHeader()
- {
- StringBuffer sbColumnHeader = new StringBuffer("");
- sbColumnHeader.append(getBlankLine());
-
- if (_hasColumns)
- {
- IPropertyDescriptor[] descriptors = _viewer.getVisibleDescriptors(_viewer.getInput());
- sbColumnHeader.insert(0, SystemPropertyResources.RESID_PROPERTY_NAME_LABEL);
-
- int offset = _columnWidths[0];
- sbColumnHeader.insert(offset, " ");
- offset++;
-
- for (int i = 0; i < descriptors.length; i++)
- {
- String label = descriptors[i].getDisplayName();
- int columnWidth = _columnWidths[i + 1];
- int labelWidth = label.length();
-
- if (_columnAlignments[i + 1] == SWT.LEFT)
- {
- if (labelWidth > columnWidth)
- {
- label = label.substring(0, columnWidth - 3);
- label += "...";
- }
- sbColumnHeader.insert(offset, label);
- }
- else
- {
-
- int rightOffset = offset + (columnWidth - labelWidth) - 1;
-
- if (rightOffset < offset)
- {
- int delta = (offset - rightOffset) - 3;
- label = label.substring(0, delta);
- label += "...";
- rightOffset = offset;
- }
-
- sbColumnHeader.insert(rightOffset, label);
- }
-
- offset += columnWidth;
- sbColumnHeader.insert(offset, " ");
- offset++;
- }
- }
- return sbColumnHeader.toString();
- }
-
- private String getHeaderSeparator()
- {
- StringBuffer separator = new StringBuffer("");
- if (_hasColumns)
- {
- for (int i = 0; i < _columnWidths.length; i++)
- {
- int width = _columnWidths[i];
- for (int t = 0; t < width; t++)
- {
- separator.append("-");
- }
-
- separator.append(" ");
- }
- }
-
- return separator.toString();
- }
-
- private String getTableFooter()
- {
- String footer = " * * * * * E N D O F L I S T I N G * * * * *";
- return footer;
- }
-
- private int getTotalWidth()
- {
- int totalWidth = 0;
- if (_hasColumns)
- {
- for (int i = 0; i < _columnWidths.length; i++)
- {
- totalWidth += _columnWidths[i];
- }
- }
- else
- {
- totalWidth = pageWidth;
- }
-
- return totalWidth;
- }
-
- private String getBlankLine()
- {
- StringBuffer blankLine = new StringBuffer();
-
- int totalWidth = getTotalWidth();
- for (int b = 0; b < totalWidth; b++)
- {
- blankLine.append(" ");
- }
-
- return blankLine.toString();
- }
-
- private String getLine(Object object, int numColumns)
- {
- StringBuffer line = new StringBuffer("");
-
- SystemTableViewProvider lprovider = (SystemTableViewProvider) _viewer.getLabelProvider();
- if (_hasColumns)
- {
- line.append(getBlankLine());
- int offset = 0;
- for (int column = 0; column < numColumns; column++)
- {
- String columnText = lprovider.getColumnText(object, column);
- int labelWidth = columnText.length();
-
- int columnWidth = _columnWidths[column];
- if (_columnAlignments[column] == SWT.LEFT)
- {
- if (labelWidth > columnWidth)
- {
- columnText = columnText.substring(0, columnWidth - 3);
- columnText += "...";
- }
-
- line.insert(offset, columnText);
-
- }
- else
- {
- int rightOffset = offset + (columnWidth - labelWidth) - 1;
- if (rightOffset < offset)
- {
- int delta = (offset - rightOffset) + 3;
- columnText = columnText.substring(0, labelWidth - delta);
- columnText += "...";
- rightOffset = offset;
- }
-
- line.insert(rightOffset, columnText);
- }
-
- offset += columnWidth;
- line.insert(offset, " ");
- offset++;
- }
- }
- else
- {
- String columnText = lprovider.getColumnText(object, 0);
- line.append(columnText);
- }
-
- return line.toString();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTeamReloadAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTeamReloadAction.java
deleted file mode 100644
index a392b8420..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTeamReloadAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemResourceListener;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to refresh the entire Remote Systems Explorer tree view,
- * by reloading it from disk. This is to be done after the user does a synchronization
- * with the repository.
- */
-public class SystemTeamReloadAction extends SystemBaseAction
-
-{
-
- //private SystemProfile prevProfile = null;
-
- /**
- * Constructor
- */
- public SystemTeamReloadAction(Shell parent)
- {
- super(SystemResources.ACTION_TEAM_RELOAD_LABEL,SystemResources.ACTION_TEAM_RELOAD_TOOLTIP,
- parent);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
- //setSelectionSensitive(false);
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0009");
- }
-
- /**
- * Selection has been changed. Decide to enable or not.
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = SystemResourceListener.changesPending();
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action to run.
- */
- public void run()
- {
- //SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- SystemMessage confirmMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONFIRM_RELOADRSE);
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), confirmMsg);
- boolean ok = msgDlg.openQuestionNoException();
- if (ok)
- {
- SystemResourceListener.reloadRSE();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTestFilterStringAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTestFilterStringAction.java
deleted file mode 100644
index d72f482a3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemTestFilterStringAction.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemTestFilterStringDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action for testing a given filter string by resolving it and showing the resolve results
- */
-public class SystemTestFilterStringAction extends SystemBaseDialogAction
-
-{
-
- protected ISubSystem subsystem;
- protected String filterString;
- protected SystemTestFilterStringDialog dlg;
-
-
- /**
- * Constructor when input subsystem and filter string are known already
- */
- public SystemTestFilterStringAction(Shell shell, ISubSystem subsystem, String filterString)
- {
- super(SystemResources.ACTION_TESTFILTERSTRING_LABEL, SystemResources.ACTION_TESTFILTERSTRING_TOOLTIP, null,
- shell);
- allowOnMultipleSelection(false);
- setSubSystem(subsystem);
- setFilterString(filterString);
- }
- /**
- * Constructor when input subsystem and filter string are not known already.
- * @see #setSubSystem(ISubSystem)
- * @see #setFilterString(String)
- */
- public SystemTestFilterStringAction(Shell shell)
- {
- this(shell, null, null);
- }
-
- /**
- * Set the subsystem within the context of which this filter string is to be tested.
- */
- public void setSubSystem(ISubSystem subsystem)
- {
- this.subsystem = subsystem;
- }
-
- /**
- * Set the filter string to test
- */
- public void setFilterString(String filterString)
- {
- this.filterString = filterString;
- }
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override run with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected Dialog createDialog(Shell shell)
- {
- //if (dlg == null) // I hoped to reduce memory requirements by re-using but doesn't work. Phil
- dlg = new SystemTestFilterStringDialog(shell, subsystem, filterString);
- //else
- //{
- //dlg.reset(subsystem, filterString);
- //}
- return dlg;
- }
-
- /**
- * Required by parent. We just return null.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemUpdateConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemUpdateConnectionAction.java
deleted file mode 100644
index 68d786613..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemUpdateConnectionAction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemUpdateConnectionDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the Change Connection dialog
- * THIS DIALOG AND ITS ACTION ARE NO LONGER USED. THEY ARE REPLACED WITH A PROPERTIES DIALOG.
- */
-public class SystemUpdateConnectionAction extends SystemBaseDialogAction
-
-{
-
- /**
- * Constructor for SystemUpdateConnectionAction
- */
- public SystemUpdateConnectionAction(Shell parent)
- {
- super(SystemResources.ACTION_UPDATECONN_LABEL, SystemResources.ACTION_UPDATECONN_TOOLTIP, null, parent);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- return (selectedObject instanceof IHost);
- }
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to create and return
- * the dialog that is displayed by the default run method
- * implementation.
- * <p>
- * If you override run with your own, then
- * simply implement this to return null as it won't be used.
- * @see #run()
- */
- protected Dialog createDialog(Shell parent)
- {
- return new SystemUpdateConnectionDialog(parent);
- }
-
- /**
- * Required by parent but we do not use it so return null;
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToAllAction.java
deleted file mode 100644
index 12d56f9c7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToAllAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * When we support Expand-To menu items to expand a remote item via subsetting criteria,
- * we should also support an Expand-To->All action. This is it.
- */
-public class SystemViewExpandToAllAction extends SystemViewExpandToBaseAction
-{
-
-
-
- /**
- * Constructor for SystemViewExpandToAllAction.
- * @param rb
- * @param prefix
- * @param image
- * @param parent
- */
- public SystemViewExpandToAllAction(Shell parent)
- {
- super(SystemResources.ACTION_EXPAND_ALL_LABEL, SystemResources.ACTION_EXPAND_ALL_TOOLTIP,null, parent);
- }
-
- /**
- * @see org.eclipse.rse.ui.actions.SystemViewExpandToBaseAction#getFilterString(Object)
- */
- protected String getFilterString(Object selectedObject)
- {
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToBaseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToBaseAction.java
deleted file mode 100644
index 5231d71a5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemViewExpandToBaseAction.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.ui.view.ISystemTree;
-import org.eclipse.rse.ui.view.SystemView;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Base class for Expand To actions on a container
- */
-public abstract class SystemViewExpandToBaseAction extends SystemBaseAction
-{
-
-
-
- /**
- * Constructor.
- */
- public SystemViewExpandToBaseAction(String label, String tooltip, ImageDescriptor image, Shell parent)
- {
- super(label, tooltip, image, parent);
- allowOnMultipleSelection(false);
- setContextMenuGroup(org.eclipse.rse.ui.ISystemContextMenuConstants.GROUP_EXPANDTO);
- setChecked(false); // will reset once we know the selection.
- }
-
- /**
- * Second and easiest opportunity to decide if the action should be enabled or not based
- * on the current selection. Called by default implementation of updateSelection, once for
- * each item in the selection. If any call to this returns false, the action is disabled.
- * The default implementation returns true.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- SystemView sv = getSystemView();
- if (sv == null)
- return false;
- String currentFilter = sv.getExpandToFilter(selectedObject);
- String thisFilter = getFilterString(selectedObject);
- if (currentFilter != null)
- {
- if ((thisFilter!=null) && currentFilter.equals(thisFilter))
- setChecked(true);
- }
- else if (thisFilter == null) // I assume this is only the case for Expand To->All.
- setChecked(true);
- return true;
- }
-
- /**
- * Actually do the work
- */
- public void run()
- {
- Object element = getFirstSelection();
- if (element != null)
- {
- SystemView view = (SystemView)getCurrentTreeView();
- view.expandTo(getFilterString(element));
- }
- }
-
- /**
- * Overridable extension point to get the fully resolved filter string at the time
- * action is run.
- */
- protected abstract String getFilterString(Object selectedObject);
-
- /**
- * Return the current SystemView or null if the current viewer is not a system view
- */
- protected SystemView getSystemView()
- {
- ISystemTree tree = getCurrentTreeView();
- if ((tree instanceof SystemView) && (((SystemView)tree).getSystemViewPart() != null))
- return (SystemView)tree;
- else
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java
deleted file mode 100644
index 801f87cf6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Action for switching RSE Connections offline
- *
- * @author yantzi
- * @since Artemis 6.0
- */
-public class SystemWorkOfflineAction extends SystemBaseAction
-{
- /**
- * Constructor
- *
- * @param shell
- */
- public SystemWorkOfflineAction(Shell shell) {
- super(SystemResources.RESID_OFFLINE_WORKOFFLINE_LABEL, SystemResources.RESID_OFFLINE_WORKOFFLINE_TOOLTIP, shell);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
- setHelp(RSEUIPlugin.HELPPREFIX+"wofa0000"); //$NON-NLS-1$
- }
-
- /**
- * Override of parent. Called when testing if action should be enabled base on current
- * selection. We check the selected object is one of our subsystems, and if we are
- * currently connected.
- */
- public boolean checkObjectType(Object obj)
- {
- if (obj instanceof IHost)
- return true;
- else
- return false;
- }
-
- /**
- * Called when this action is selection from the popup menu.
- */
- public void run()
- {
- IHost conn = (IHost)getFirstSelection();
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
-
- if (conn.isOffline())
- {
- // offline going online
- setChecked(false);
- sr.setHostOffline(conn, false);
- }
- else
- {
- // these need to be set before calling disconnect so the iSeires subsystems know not
- // to collapse
- sr.setHostOffline(conn, true);
- setChecked(true);
-
- // online going offline, disconnect all subsystems
- ISubSystem[] subsystems = sr.getSubSystems(conn);
- if (subsystems != null)
- {
- boolean cancelled = false;
- for (int i = 0; i < subsystems.length && !cancelled; i++)
- {
- try
- {
- subsystems[i].disconnect(false);
- } catch (InterruptedException e) {
- // user cancelled disconnect
- cancelled = true;
- } catch (Exception e) {
- SystemBasePlugin.logError("SystemWorkOfflineAction.run", e);
- }
- }
- }
-
- // check that everything was disconnedted okay and this is not the local connection
- if(sr.isAnySubSystemConnected(conn) && !IRSESystemType.SYSTEMTYPE_LOCAL.equals(conn.getSystemType()))
- {
- // backout changes, likely because user cancelled the disconnect
- setChecked(false);
- sr.setHostOffline(conn, false);
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.actions.SystemBaseAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection) {
- if (super.updateSelection(selection))
- {
- setChecked(((IHost) selection.getFirstElement()).isOffline());
- return true;
- }
-
- return false;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkWithProfilesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkWithProfilesAction.java
deleted file mode 100644
index 4fc1b3807..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkWithProfilesAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-import org.eclipse.rse.core.SystemPerspectiveHelpers;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.team.SystemTeamViewPart;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action shows in the local toolbar of the Remote Systems View, and
- * users can select it to give the Team view focus.
- */
-public class SystemWorkWithProfilesAction extends SystemBaseAction
-
-{
- //private ISystemRegistry sr = null;
-
- /**
- * Constructor
- */
- public SystemWorkWithProfilesAction(Shell parent)
- {
- super(SystemResources.ACTION_WORKWITH_PROFILES_LABEL, SystemResources.ACTION_WORKWITH_PROFILES_TOOLTIP, parent);
- setSelectionSensitive(false);
- allowOnMultipleSelection(true);
- //sr = RSEUIPlugin.getTheSystemRegistry();
- setHelp(RSEUIPlugin.HELPPREFIX+"actnwwpr");
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- SystemPerspectiveHelpers.showView(SystemTeamViewPart.ID);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/TestPopupMenuAction1.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/TestPopupMenuAction1.java
deleted file mode 100644
index bdee9f2fc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/TestPopupMenuAction1.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.actions;
-/**
- * This is just a test action to ensure the popupMenus extension point works
- * for adding popup menu actions to remote objects
- */
-public class TestPopupMenuAction1 extends SystemAbstractPopupMenuExtensionAction
-{
-
-
-
- /**
- * Constructor for TestPopupMenuAction1
- */
- public TestPopupMenuAction1()
- {
- super();
- }
-
- /**
- * Called when the user selects this action
- */
- public void run()
- {
- printTest();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/EnvironmentVariablesPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/EnvironmentVariablesPromptDialog.java
deleted file mode 100644
index 20ba341fa..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/EnvironmentVariablesPromptDialog.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Dialog for prompting the user to add / change an environment variable.
- */
-public class EnvironmentVariablesPromptDialog extends SystemPromptDialog implements ModifyListener {
-
-
- private Text nameTextField, valueTextField;
- private String name, value, systemType, invalidNameChars;
- private boolean change; // Is this dialog for add or change
- private String[] existingNames;
-
- /**
- * Constructor for EnvironmentVariablesPromptDialog.
- * @param shell
- * @param title
- */
- public EnvironmentVariablesPromptDialog(Shell shell, String title, String systemType, String invalidNameChars, String[] existingNames, boolean change) {
- super(shell, title);
- this.change = change;
- this.systemType = systemType;
- this.invalidNameChars = invalidNameChars;
- this.existingNames = existingNames;
- }
-
- /**
- * Constructor for EnvironmentVariablesPromptDialog.
- * @param shell
- * @param title
- * @param inputObject
- */
- public EnvironmentVariablesPromptDialog(Shell shell, String title, Object inputObject, String invalidNameChars, String[] existingNames, boolean change) {
- super(shell, title, inputObject);
- this.change = change;
- this.invalidNameChars = invalidNameChars;
- this.existingNames = existingNames;
- }
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent) {
-
- Composite page = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Prompt for name
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_SUBSYSTEM_ENVVAR_NAME_LABEL);
- nameTextField = SystemWidgetHelpers.createTextField(page, null);
- nameTextField.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_NAME_TOOLTIP);
- if (name != null && !name.trim().equals(""))
- {
- nameTextField.setText(name);
- setInitialOKButtonEnabledState(true);
- }
- else
- {
- setInitialOKButtonEnabledState(false);
- }
- nameTextField.addModifyListener(this);
-
- // Prompt for value
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_SUBSYSTEM_ENVVAR_VALUE_LABEL);
- valueTextField = SystemWidgetHelpers.createTextField(page, null);
- valueTextField.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_VALUE_TOOLTIP);
- if (value != null)
- {
- valueTextField.setText(value);
- }
-
- if (!change)
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "envv0001");
- else
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "envv0002");
-
-
- // Set name and value limits for known system types
- if (systemType != null)
- {
- if (systemType.equals("iSeries"))
- {
- nameTextField.setTextLimit(128);
- valueTextField.setTextLimit(1024);
- }
- else if (systemType.equals("Windows"))
- {
- nameTextField.setTextLimit(300);
- valueTextField.setTextLimit(1024);
- }
- else if (systemType.equals("Local"))
- {
- if (System.getProperty("os.name").toLowerCase().indexOf("win") != -1)
- {
- nameTextField.setTextLimit(300);
- valueTextField.setTextLimit(1024);
- }
- }
- }
-
- return parent;
- }
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl() {
- return nameTextField;
- }
-
- /**
- * Get the environment varaible name entered in the dialog.
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Get the environment varaible value entered in the dialog.
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Preset the name for the environment variable
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
- /**
- * Preset the value for the environment variable
- */
- public void setValue(String value)
- {
- this.value = value;
- }
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#processOK()
- */
- protected boolean processOK() {
- if (nameTextField.getText() != null && !nameTextField.getText().trim().equals(""))
- {
- String nameStr;
- if (invalidNameChars != null && invalidNameChars.indexOf(' ') != -1)
- {
- nameStr = nameTextField.getText().trim();
- }
- else
- {
- nameStr = nameTextField.getText();
- }
-
- // dy: Change to use a String of invalid charactes supplied by the subsystem
- //if (nameStr.indexOf('=') > 0 || nameStr.indexOf(' ') > 0)
- if (invalidNameChars != null)
- {
- for (int i = 0; i < invalidNameChars.length(); i++)
- {
- if (nameStr.indexOf(invalidNameChars.charAt(i)) != -1)
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_INVALIDCHAR));
- nameTextField.setFocus();
- return false;
- }
- }
- }
-
- if (existingNames != null)
- {
- // Check if this one already exists
- for (int i = 0; i < existingNames.length; i++)
- {
- if (nameStr.equals(existingNames[i]))
- {
- if (!change || !nameStr.equals(name))
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_DUPLICATE);
- msg.makeSubstitution(nameStr);
- setErrorMessage(msg);
- nameTextField.setFocus();
- return false;
- }
- }
- }
- }
-
- name = nameStr;
- value = valueTextField.getText();
- return true;
- }
- else
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_NONAME));
- nameTextField.setFocus();
- return false;
- }
- }
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- if (nameTextField.getText().trim().equals(""))
- {
- enableOkButton(false);
- }
- else
- {
- enableOkButton(true);
- }
-
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISignonValidator.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISignonValidator.java
deleted file mode 100644
index 876d69a3a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISignonValidator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.core.model.SystemSignonInformation;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Interace for providing a signon validator to the password prompt dialog.
- */
-public interface ISignonValidator
-{
-
- /**
- * Used by ISystemPasswordPromptDialog to verify if the password entered by the user
- * is correct.
- *
- * @return null if the password is valid, otherwise a SystemMessage is returned that can
- * be displayed to the end user.
- */
- public SystemMessage isValid(ISystemPasswordPromptDialog dialog, String userid, String password);
-
- /**
- * Verify if persisted userid and password are still valid
- *
- * @param shell Shell: if null the validator will run headless, if not null then the validator
- * may use the shell to prompt the user (for example, if the password has expired.)
- *
- * @return true if signonInfo contains a valid signon, false otherwise.
- */
- public boolean isValid(Shell shell, SystemSignonInformation signonInfo);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPasswordPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPasswordPromptDialog.java
deleted file mode 100644
index cdcb64ab7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPasswordPromptDialog.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Suggested interface for a dialog used to prompt user for a password.
- */
-public interface ISystemPasswordPromptDialog
-{
- /**
- * Set modal vs modeless
- */
- public void setBlockOnOpen(boolean block);
- /**
- * Open the dialog
- */
- public int open();
- /**
- * Set the input System object in which the user is attempting to do a connect action.
- * This is used to query the system type, host name and userId to display to the user for
- * contextual information.
- * <p>
- * This must be called right after instantiating this dialog.
- */
- public void setSystemInput(IConnectorService systemObject);
- /**
- * Allow caller to determine if window was cancelled or not.
- */
- public boolean wasCancelled();
- /**
- * Call this to specify a validator for the userId. It will be called per keystroke.
- */
- public void setUserIdValidator(ISystemValidator v);
- /**
- * Call this to specify a validator for the password. It will be called per keystroke.
- */
- public void setPasswordValidator(ISystemValidator v);
- /**
- * Call this to specify a validator for the signon. It will be called when the OK button is pressed.
- */
- public void setSignonValidator(ISignonValidator v);
- /**
- * Call this to force the userId and password to uppercase
- */
- public void setForceToUpperCase(boolean force);
- /**
- * Call this to query the force-to-uppercase setting
- */
- public boolean getForceToUpperCase();
- /**
- * Return the userId entered by user
- */
- public String getUserId();
- /**
- * Return the password entered by user
- */
- public String getPassword();
- /**
- * Sets the password
- */
- public void setPassword(String password);
- /**
- * Preselect the save password checkbox. Default value is to not
- * select the save password checkbox.
- */
- public void setSavePassword(boolean save);
- /**
- * Return true if the user changed the user id
- */
- public boolean getIsUserIdChanged();
- /**
- * Return true if the user elected to make the changed user Id a permanent change.
- */
- public boolean getIsUserIdChangePermanent();
- /**
- * Return true if the user elected to save the password
- */
- public boolean getIsSavePassword();
- /**
- * Return the shell for this dialog
- */
- public Shell getShell();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPromptDialog.java
deleted file mode 100644
index 7c204f143..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemPromptDialog.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-
-/**
- * Suggested interface for dialogs used in actions in remote system framework.
- */
-public interface ISystemPromptDialog
-{
- /**
- * For explicitly setting input object
- */
- public void setInputObject(Object inputObject);
-
- /**
- * For explicitly getting input object
- */
- public Object getInputObject();
-
- /**
- * For explicitly getting output object after dialog is dismissed. Set by the
- * dialog's processOK method.
- */
- public Object getOutputObject();
-
- /**
- * Allow caller to determine if window was cancelled or not.
- */
- public boolean wasCancelled();
-
- /**
- * Expose inherited protected method convertWidthInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertWidthInCharsToPixels(int chars);
- /**
- * Expose inherited protected method convertHeightInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertHeightInCharsToPixels(int chars);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemTypedObject.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemTypedObject.java
deleted file mode 100644
index 8a86b0cb2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/ISystemTypedObject.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * The re-usable rename and delete dialogs in RSE require the objects to be adaptable to
- * ISystemViewElementAdapter, in order to show the object's type in the dialog. If you
- * want to re-use these dialogs for inputs that do not adapt to ISystemViewElementAdapter,
- * then ensure your input objects implement this interface.
- */
-public interface ISystemTypedObject
-{
- /**
- * Return the name of the object.
- */
- public String getName();
- /**
- * Return the type of the object. This is a displayable string, used to tell the user
- * what type of resource this is.
- */
- public String getType();
- /**
- * Returns an image descriptor for the image to represent this object. More efficient than getting the image.
- */
- public ImageDescriptor getImageDescriptor();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemChangePasswordDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemChangePasswordDialog.java
deleted file mode 100644
index a3660a5fc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemChangePasswordDialog.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * A SystemChangePasswordDialog is typically presented when the password on the remote system has expired
- * and a new one needs to be saved. This dialog presents presents two enabled text fields - the first holds
- * the new password, the second holds its confirmation.
- * There is also a checkbox to save the password. Actually saving the password is the responsibility of the client.
- */
-public class SystemChangePasswordDialog extends SystemPromptDialog
-{
- private String _hostname;
- private String _user;
- private String _newPassword = "";
-
- private Text _txtNewPassword;
- private Text _txtConfirmPassword;
-
- private boolean savePassword = false;
- protected Button _chkBoxSavePassword;
-
- private boolean newPasswordModified = false;
- private boolean confirmModified = false;
-
- /**
- * Construct a new SystemChangePasswordDialog. Since this dialog is asking for a new password
- * there is no need to supply the old password, however a remote system will usually require
- * the old password to effect a change. Thus clients of this class would typically be expected
- * to have this available.
- * @param shell The shell the dialog will use to present itself.
- * @param hostname The remote host name.
- * @param userid The user id that will be presented. May be the empty string.
- * @param msg The message that will be presented when the dialog is initially shown. This may be null.
- */
- public SystemChangePasswordDialog(Shell shell, String hostname, String userid, SystemMessage msg)
- {
- super(shell, SystemResources.RESID_CHANGE_PASSWORD_TITLE, false);
- _hostname = hostname;
- _user = userid;
- setErrorMessage(msg);
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl() {
- return _txtNewPassword;
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent) {
-
- Label label = null;
- Composite c = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- c.setLayout(layout);
-
- // Host Name
- label = new Label(c, SWT.NONE);
- label.setText(SystemResources.RESID_PREF_SIGNON_HOSTNAME_LABEL);
-
- Text system = SystemWidgetHelpers.createTextField(c, null);
- system.setText(_hostname);
- system.setEditable(false);
- system.setEnabled(false);
- system.setToolTipText(SystemResources.RESID_PREF_SIGNON_HOSTNAME_TOOLTIP);
- ((GridData) system.getLayoutData()).widthHint = 75;
-
- // User ID
- label = new Label(c, SWT.NONE);
- label.setText(SystemResources.RESID_PREF_SIGNON_USERID_LABEL);
-
- Text userID = SystemWidgetHelpers.createTextField(c, null);
- userID.setText(_user);
- userID.setEditable(false);
- userID.setEnabled(false);
- userID.setToolTipText(SystemResources.RESID_PREF_SIGNON_USERID_TOOLTIP);
- ((GridData) userID.getLayoutData()).widthHint = 75;
-
- // New password
- label = new Label(c, SWT.NONE);
- label.setText(SystemResources.RESID_CHANGE_PASSWORD_NEW_LABEL);
- _txtNewPassword = SystemWidgetHelpers.createTextField(c, null);
- _txtNewPassword.setEchoChar('*');
- _txtNewPassword.setToolTipText(SystemResources.RESID_CHANGE_PASSWORD_NEW_TOOLTIP);
- ((GridData) _txtNewPassword.getLayoutData()).widthHint = 75;
-
- // Confirm new password
- label = new Label(c, SWT.NONE);
- label.setText(SystemResources.RESID_CHANGE_PASSWORD_CONFIRM_LABEL);
- _txtConfirmPassword = SystemWidgetHelpers.createTextField(c, null);
- _txtConfirmPassword.setEchoChar('*');
- _txtConfirmPassword.setToolTipText(SystemResources.RESID_CHANGE_PASSWORD_CONFIRM_TOOLTIP);
- ((GridData) _txtConfirmPassword.getLayoutData()).widthHint = 75;
-
- // Save signon information checkbox
- // DY: align password checkbox with entry fields
- _chkBoxSavePassword = SystemWidgetHelpers.createCheckBox(
- c, 1, this, SystemResources.RESID_PASSWORD_SAVE_LABEL, SystemResources.RESID_PASSWORD_SAVE_TOOLTIP);
- _chkBoxSavePassword.setSelection(savePassword);
- // disable until the user enters something for consistency with the save user ID checkbox
- _chkBoxSavePassword.setEnabled(false);
-
- _txtNewPassword.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- newPasswordModified = true;
- validatePasswordInput();
- }
- }
- );
-
- _txtConfirmPassword.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- confirmModified = true;
- validatePasswordInput();
- }
- }
- );
- setInitialOKButtonEnabledState(false);
-
- return parent;
- }
-
- /**
- * Return true if the user elected to save the password
- */
- private boolean internalGetIsSavePassword()
- {
- savePassword = _chkBoxSavePassword.getSelection();
- return savePassword;
- }
-
- /**
- * This hook method is called whenever the text changes in the password input fields.
- */
- protected SystemMessage validatePasswordInput()
- {
- clearErrorMessage();
- _chkBoxSavePassword.setEnabled(newPasswordModified || confirmModified);
- if (!newPasswordModified || !confirmModified) return null;
- okButton.setEnabled(true);
-
- String newPassword = _txtNewPassword.getText().trim();
- String confirmPassword = _txtConfirmPassword.getText().trim();
-
- if (!newPassword.equals(confirmPassword))
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_MISMATCH);
- }
- else if (newPassword.equals(""))
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD);
- }
- _newPassword = newPassword;
- return null;
- }
-
- /**
- * @see SystemPromptDialog#processOK()
- */
- protected boolean processOK()
- {
- savePassword = internalGetIsSavePassword();
- SystemMessage error = validatePasswordInput();
- if (error == null) return true;
- else setErrorMessage(error);
- return false;
- }
-
- /**
- * @return The new password set by the user or null if the
- * cancel button was pressed.
- */
- public String getNewPassword()
- {
- return _newPassword;
- }
-
- /**
- * Return true if the user elected to make the changed user Id a permanent change.
- */
- public boolean getIsSavePassword()
- {
- return savePassword;
- }
-
- /**
- * Preselect the save password checkbox. Default value is to not
- * select the save password checkbox.
- */
- public void setSavePassword(boolean save)
- {
- savePassword = save;
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemControlEnableState.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemControlEnableState.java
deleted file mode 100644
index 23b35feb3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemControlEnableState.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.rse.ui.view.SystemPropertySheetForm;
-import org.eclipse.rse.ui.view.SystemViewForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * Helper class to save the enable/disable state of a control
- * including all its descendent controls.
- */
-public class SystemControlEnableState
-{
-
-
-
- /**
- * List of exception controls (element type: <code>Control</code>);
- * <code>null</code> if none.
- */
- private List exceptions = null;
-
- /**
- * List of saved states (element type: <code>ItemState</code>).
- */
- private List states;
-
- /**
- * Internal class for recording the enable/disable state of a
- * single control.
- */
- private class ItemState
- {
- protected Control item;
- protected boolean state;
- public ItemState(Control item, boolean state)
- {
- this.item = item;
- this.state = state;
- }
- public void restore()
- {
- if (item != null)
- item.setEnabled(state);
- }
- }
-
- /**
- * Creates a new object and saves in it the current enable/disable
- * state of the given control and its descendents; the controls
- * that are saved are also disabled.
- *
- * @param w the control
- */
- protected SystemControlEnableState(Control w)
- {
- this(w, null);
- }
- /**
- * Creates a new object and saves in it the current enable/disable
- * state of the given control and its descendents except for the
- * given list of exception cases; the controls that are saved
- * are also disabled.
- *
- * @param w the control
- * @param exceptions the list of controls to not disable
- * (element type: <code>Control</code>), or <code>null</code> if none
- */
- protected SystemControlEnableState(Control w, List exceptions)
- {
- super();
- states = new ArrayList();
- this.exceptions = exceptions;
- readStateForAndDisable(w);
- }
- /**
- * Saves the current enable/disable state of the given control
- * and its descendents in the returned object; the controls
- * are all disabled.
- *
- * @param w the control
- * @return an object capturing the enable/disable state
- */
- public static SystemControlEnableState disable(Control w)
- {
- return new SystemControlEnableState(w);
- }
- /**
- * Saves the current enable/disable state of the given control
- * and its descendents in the returned object except for the
- * given list of exception cases; the controls that are saved
- * are also disabled.
- *
- * @param w the control
- * @param exceptions the list of controls to not disable
- * (element type: <code>Control</code>)
- * @return an object capturing the enable/disable state
- */
- public static SystemControlEnableState disable(Control w, List exceptions)
- {
- return new SystemControlEnableState(w, exceptions);
- }
- /**
- * Recursively reads the enable/disable state for the given window
- * and disables all controls.
- */
- private void readStateForAndDisable(Control w)
- {
- if ((exceptions != null && exceptions.contains(w)))
- return;
-
- if ((w instanceof Composite) && !(w instanceof SystemViewForm) && !(w instanceof SystemPropertySheetForm))
- {
- Composite c = (Composite) w;
- Control[] children = c.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- readStateForAndDisable(children[i]);
- }
- }
- // XXX: Workaround for 1G2Q8SS: ITPUI:Linux - Combo box is not enabled in "File->New->Solution"
- states.add(new ItemState(w, w.getEnabled()));
- w.setEnabled(false);
- }
- /**
- * Restores the window enable state saved in this object.
- */
- public void restore()
- {
- int size = states.size();
- for (int i = 0; i < size; i++)
- {
- ((ItemState) states.get(i)).restore();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemCopyProfileDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemCopyProfileDialog.java
deleted file mode 100644
index 6dc686dfd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemCopyProfileDialog.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorProfileName;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Dialog for copying a system profile.
- */
-public class SystemCopyProfileDialog extends SystemPromptDialog
- implements ISystemPropertyConstants
-{
- private Text newName;
- private Button makeActiveCB;
- private String newNameString, inputName;
- private boolean makeActive = false;
- private SystemMessage errorMessage;
- private ISystemValidator nameValidator;
- private boolean initialized = false;
- private ISystemProfile profile;
-
- /**
- * Constructor when profile not already known
- * @param shell The parent window hosting this dialog
- */
- public SystemCopyProfileDialog(Shell shell)
- {
- this(shell, null);
- }
- /**
- * Constructor when profile known
- * @param shell The parent window hosting this dialog
- * @param profile The profile to be copied
- */
- public SystemCopyProfileDialog(Shell shell, ISystemProfile profile)
- {
- super(shell, SystemResources.RESID_COPY_PROFILE_TITLE);
- this.profile = profile;
- if (profile != null)
- {
- setInputObject(profile);
- }
-
- // FIXME cast to SystemProfileManager is temporary to get at api - need to use an adapter for getting validators
- SystemProfileManager mgr = (SystemProfileManager)RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager();
- nameValidator = mgr.getProfileNameValidator((String)null);
- //pack();
- setHelp(RSEUIPlugin.HELPPREFIX+"drnp0000"); //$NON-NLS-1$
- }
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- ISystemMessageLine msgLine = super.createMessageLine(c);
- //form.setMessageLine(msgLine);
- return fMessageLine;
- }
-
-
- /**
- * Return widget to set focus to initially
- */
- protected Control getInitialFocusControl()
- {
- return newName;
- }
-
- /**
- * Set the name validator
- */
- public void setNameValidator(ISystemValidator nv)
- {
- nameValidator = nv;
- }
-
- /**
- * Create widgets, and populate given composite with them
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // ENTRY FIELD
- newName = SystemWidgetHelpers.createLabeledTextField(composite_prompts,null,
- SystemResources.RESID_COPY_PROFILE_PROMPT_LABEL, SystemResources.RESID_COPY_PROFILE_PROMPT_TOOLTIP);
- newName.setTextLimit(ValidatorProfileName.MAX_PROFILENAME_LENGTH); // defect 41816
- // Make active
- makeActiveCB = SystemWidgetHelpers.createCheckBox(
- composite_prompts, nbrColumns, null, SystemResources.RESID_NEWPROFILE_MAKEACTIVE_LABEL, SystemResources.RESID_NEWPROFILE_MAKEACTIVE_TOOLTIP);
-
- // SET HELP CONTEXT IDS...
- //SystemWidgetHelpers.setHelp(newName, RSEUIPlugin.HELPPREFIX+"drnp0002", RSEUIPlugin.HELPPREFIX+"drnp0000");
- SystemWidgetHelpers.setHelp(newName, RSEUIPlugin.HELPPREFIX+"drnp0002"); //$NON-NLS-1$
- //SystemWidgetHelpers.setHelp(makeActiveCB, RSEUIPlugin.HELPPREFIX+"drnp0003", RSEUIPlugin.HELPPREFIX+"drnp0000");
- SystemWidgetHelpers.setHelp(makeActiveCB, RSEUIPlugin.HELPPREFIX+"drnp0003"); //$NON-NLS-1$
-
- initialize();
-
- // add keystroke listeners...
- newName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateNameInput();
- }
- }
- );
-
- return composite_prompts;
- }
-
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- //System.out.println("INSIDE SETINPUTOBJECT: " + inputObject + ", "+inputObject.getClass().getName());
- super.setInputObject(inputObject);
- if (inputObject instanceof SystemSimpleContentElement)
- {
- SystemSimpleContentElement element = (SystemSimpleContentElement)inputObject;
- inputName = element.getName();
- }
- else if (inputObject instanceof ISelection)
- {
- SystemSimpleContentElement element = (SystemSimpleContentElement)(((IStructuredSelection)inputObject).getFirstElement());
- inputName = element.getName();
- }
- else if (inputObject instanceof ISystemProfile)
- inputName = profile.getName();
- initialize();
- }
-
- /**
- * Initialize input fields from input
- */
- protected void initialize()
- {
- if (!initialized && (newName!=null) && (inputName!=null))
- {
- initialized = true;
- newName.setText(inputName);
- newName.selectAll();
- if (makeActiveCB != null)
- makeActiveCB.setSelection(true);
- setPageComplete(false);
- }
- }
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- newNameString = newName.getText().trim();
- boolean closeDialog = verify();
- if (closeDialog)
- {
- if (makeActiveCB != null)
- makeActive = makeActiveCB.getSelection();
- setOutputObject(newNameString);
- }
- return closeDialog;
- }
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- clearErrorMessage();
- errorMessage = validateNameInput();
- if (errorMessage != null)
- newName.setFocus();
- return (errorMessage == null);
- }
-
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setNameValidator(ISystemValidator)
- */
- protected SystemMessage validateNameInput()
- {
- errorMessage = nameValidator.validate(newName.getText());
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- else
- clearErrorMessage();
- setPageComplete();
- return errorMessage;
- }
-
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
- if (errorMessage == null)
- {
- String theNewName = newName.getText().trim();
- pageComplete = (theNewName.length() > 0) && !(theNewName.equalsIgnoreCase(inputName));
- }
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
- /**
- * Returns the user-entered new name
- */
- public String getNewName()
- {
- return newNameString;
- }
- /**
- * Returns the make-active checkbox state
- */
- public boolean getMakeActive()
- {
- return makeActive;
- }
-
-
- /**
- * Returns the user-entered new name as an array for convenience to ISystemRenameTarget hosts.
- */
- public String[] getNewNameArray()
- {
- String[] newNames = new String[1];
- newNames[0] = newNameString;
- return newNames;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteDialog.java
deleted file mode 100644
index e6e6d8dd6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteDialog.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * Dialog for confirming resource deletion.
- * <p>
- * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.ui.actions.SystemCommonDeleteAction}
- * action. It asks the user to confirm the deletion of the input selection.
- * <p>If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter} or
- * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, then they should implement the
- * interface {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject} so that their type can be
- * displayed in this delete confirmation dialog.
- *
- * @see org.eclipse.rse.ui.actions.SystemCommonDeleteAction
- */
-public class SystemDeleteDialog extends SystemPromptDialog
- implements ISystemPropertyConstants,
- ISelectionChangedListener
-{
- private String warningMessage, warningTip;
- private String promptLabel;
- private SystemDeleteTableProvider sdtp;
- //private Label prompt;
- private Table table;
- private TableViewer tableViewer;
- private GridData tableData;
-
- // column headers
- private String columnHeaders[] = {
- "",
- SystemResources.RESID_DELETE_COLHDG_OLDNAME,
- SystemResources.RESID_DELETE_COLHDG_TYPE
- };
-
- // column layout
- private ColumnLayoutData columnLayouts[] =
- {
- new ColumnPixelData(19, false),
- new ColumnWeightData(150,150,true),
- new ColumnWeightData(120,120,true)
- };
-
- // give each column a property value to identify it
- private static String[] tableColumnProperties =
- {
- ISystemPropertyConstants.P_OK,
- IBasicPropertyConstants.P_TEXT,
- ISystemPropertyConstants.P_TYPE,
- };
-
- /**
- * Constructor for SystemUpdateConnectionDialog
- */
- public SystemDeleteDialog(Shell shell)
- {
- super(shell, SystemResources.RESID_DELETE_TITLE);
- super.setOkButtonLabel(SystemResources.RESID_DELETE_BUTTON);
- setHelp(RSEUIPlugin.HELPPREFIX+"ddlt0000");
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
- return fMessageLine;
- }
-
- /**
- * Specify a warning message to show at the top of the dialog
- */
- public void setWarningMessage(String msg, String tip)
- {
- this.warningMessage = msg;
- this.warningTip = tip;
- }
-
- /**
- * Specify the text to show for the label prompt. The default is
- * "Delete selected resources?"
- */
- public void setPromptLabel(String text)
- {
- this.promptLabel = text;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return tableViewer.getControl();
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // PROMPT
- if (promptLabel == null) {
- Object input = getInputObject();
-
- if (input != null && input instanceof IStructuredSelection) {
- int size = ((IStructuredSelection)input).size();
-
- if (size > 1) {
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns);
- }
- else {
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT_SINGLE, nbrColumns);
- }
- }
- // should never get here
- else {
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns);
- }
- }
- else {
- /*prompt =*/ SystemWidgetHelpers.createVerbiage(composite, promptLabel, nbrColumns, false, 200);
- }
-
- // WARNING
- if (warningMessage != null)
- {
- // filler line
- SystemWidgetHelpers.createLabel(composite, "", nbrColumns);
- // create image
- Image image = getShell().getDisplay().getSystemImage(SWT.ICON_WARNING);
- Label imageLabel = null;
- if (image != null)
- {
- imageLabel = new Label(composite, 0);
- image.setBackground(imageLabel.getBackground());
- imageLabel.setImage(image);
- imageLabel.setLayoutData(new GridData(
- GridData.HORIZONTAL_ALIGN_CENTER |
- GridData.VERTICAL_ALIGN_BEGINNING));
- }
- Label warningLabel = SystemWidgetHelpers.createLabel(composite, warningMessage);
- if (warningTip != null)
- {
- warningLabel.setToolTipText(warningTip);
- if (imageLabel!=null) {
- imageLabel.setToolTipText(warningTip);
- }
- }
- // filler line
- SystemWidgetHelpers.createLabel(composite, "", nbrColumns);
- }
-
- // TABLE
- tableViewer = createTableViewer(composite, nbrColumns);
- createColumns();
- tableViewer.setColumnProperties(tableColumnProperties);
-
- sdtp = new SystemDeleteTableProvider();
-
- int width = tableData.widthHint;
- int nbrRows = Math.min(getRows().length,8);
- int rowHeight = table.getItemHeight() + table.getGridLineWidth();
- int sbHeight = table.getHorizontalBar().getSize().y;
- int height = (nbrRows * rowHeight) + sbHeight;
-
- tableData.heightHint = height;
- table.setLayoutData(tableData);
- table.setSize(width, height);
-
- tableViewer.setLabelProvider(sdtp);
- tableViewer.setContentProvider(sdtp);
-
- Object input = getInputObject();
- tableViewer.setInput(input);
-
- return composite;
- }
-
- private TableViewer createTableViewer(Composite parent, int nbrColumns)
- {
- table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.HIDE_SELECTION);
- table.setLinesVisible(true);
- tableViewer = new TableViewer(table);
- tableData = new GridData();
- tableData.horizontalAlignment = GridData.FILL;
- tableData.grabExcessHorizontalSpace = true;
- tableData.widthHint = 350;
- tableData.heightHint = 30;
- tableData.verticalAlignment = GridData.CENTER;
- tableData.grabExcessVerticalSpace = true;
- tableData.horizontalSpan = nbrColumns;
- table.setLayoutData(tableData);
- return tableViewer;
- }
-
- private void createColumns()
- {
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
- table.setHeaderVisible(true);
- for (int i = 0; i < columnHeaders.length; i++)
- {
- layout.addColumnData(columnLayouts[i]);
- TableColumn tc = new TableColumn(table, SWT.NONE,i);
- tc.setResizable(columnLayouts[i].resizable);
- tc.setText(columnHeaders[i]);
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- }
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- super.setInputObject(inputObject);
- }
-
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- return true;
- }
-
- /**
- * Returns the rows of deletable items.
- */
- public SystemDeleteTableRow[] getRows()
- {
- return (SystemDeleteTableRow[])sdtp.getElements(getInputObject());
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableProvider.java
deleted file mode 100644
index 94c00e6ff..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableProvider.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-/**
- * This class is the table provider class for the delete dialog
- */
-public class SystemDeleteTableProvider implements ITableLabelProvider, IStructuredContentProvider
-{
-
- static final int COLUMN_IMAGE = 0;
- static final int COLUMN_NAME = 1;
- static final int COLUMN_TYPE = 2;
- protected Map imageTable = new Hashtable(20);
- protected Object[] children = null;
-
- /**
- * Constructor for SystemDeleteTableProvider
- */
- public SystemDeleteTableProvider()
- {
- super();
- }
-
- private SystemDeleteTableRow getTableRow(Object element)
- {
- return (SystemDeleteTableRow)element;
- }
-
- private Image getImageFromDescriptor(ImageDescriptor descriptor)
- {
- if (descriptor == null)
- return null;
- //obtain the cached image corresponding to the descriptor
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- //System.out.println("...image = " + image);
- return image;
- }
-
- /**
- * @see ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int column)
- {
- if (column == COLUMN_IMAGE)
- return getImageFromDescriptor(getTableRow(element).getImageDescriptor());
- else
- return null;
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int column)
- {
- String text = "";
- if (column == COLUMN_NAME)
- text = getTableRow(element).getName();
- else if (column == COLUMN_TYPE)
- text = getTableRow(element).getType();
- //System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element));
- return text;
- }
-
- /**
- * @see IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- /**
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose()
- {
- // The following we got from WorkbenchLabelProvider
- if (imageTable != null)
- {
- Collection imageValues = imageTable.values();
- if (imageValues!=null)
- {
- Iterator images = imageValues.iterator();
- if (images!=null)
- while (images.hasNext())
- ((Image)images.next()).dispose();
- imageTable = null;
- }
- }
- }
-
- /**
- * @see IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- /**
- * @see IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- /**
- * Return rows. Input must be an IStructuredSelection.
- */
- public Object[] getElements(Object inputElement)
- {
- if (children == null)
- {
- IStructuredSelection iss = (IStructuredSelection)inputElement;
- children = new SystemDeleteTableRow[iss.size()];
- Iterator i = iss.iterator();
- int idx = 0;
- while (i.hasNext())
- {
- children[idx] = new SystemDeleteTableRow(i.next(), idx);
- idx++;
- }
- }
- return children;
- }
-
- /**
- * Return the 0-based row number of the given element.
- */
- public int getRowNumber(SystemDeleteTableRow row)
- {
- return row.getRowNumber();
- }
-
- /**
- *
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableRow.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableRow.java
deleted file mode 100644
index e166955c2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemDeleteTableRow.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewResources;
-
-
-/**
- * Represents one row in the table in the SystemDeleteDialog dialog.
- */
-public class SystemDeleteTableRow
-{
-
- private Object element;
- private String name;
- private String type;
- private ImageDescriptor imageDescriptor;
- private ISystemViewElementAdapter adapter;
- private ISystemRemoteElementAdapter remoteAdapter;
- private int rowNbr = 0;
-
- public SystemDeleteTableRow(Object element, int rowNbr)
- {
- if (element instanceof SystemSimpleContentElement)
- element = ((SystemSimpleContentElement)element).getData();
- this.element = element;
- this.adapter = getAdapter(element);
- this.remoteAdapter = getRemoteAdapter(element);
- this.rowNbr = rowNbr;
- //this.oldName = getAdapter(element).getText(element);
- if (adapter != null)
- this.name = adapter.getName(element);
- else
- {
- if (element instanceof ISystemTypedObject)
- this.name = ((ISystemTypedObject)element).getName();
- else if (element instanceof IResource)
- this.name = ((IResource)element).getName();
- }
- ISystemViewElementAdapter typeAdapter = adapter;
- Object typeElement = element;
- if (typeElement instanceof ISystemFilterPoolReference)
- {
- typeElement = ((ISystemFilterPoolReference)typeElement).getReferencedFilterPool();
- typeAdapter = getAdapter(typeElement);
- }
- if (typeAdapter != null)
- this.type = typeAdapter.getType(typeElement);
- else
- {
- if (element instanceof ISystemTypedObject)
- this.type = ((ISystemTypedObject)element).getType();
- else if (element instanceof IResource)
- {
- if ((element instanceof IFolder) || (element instanceof IProject))
- this.type = SystemViewResources.RESID_PROPERTY_FILE_TYPE_FOLDER_VALUE;
- else
- this.type = SystemViewResources.RESID_PROPERTY_FILE_TYPE_FILE_VALUE;
- }
- else
- this.type = element.getClass().getName();
- }
- if (adapter != null)
- this.imageDescriptor = adapter.getImageDescriptor(element);
- else if (element instanceof ISystemTypedObject)
- this.imageDescriptor = ((ISystemTypedObject)element).getImageDescriptor();
- else if (element instanceof IFolder)
- this.imageDescriptor = //PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FOLDER_ID);
- else if (element instanceof IFile)
- this.imageDescriptor = RSEUIPlugin.getDefault().getWorkbench().getEditorRegistry().getImageDescriptor(name);
- }
-
- /**
- * Return the name of the item to be deleted
- * @return display name of the item.
- */
- public String getName()
- {
- return name;
- }
- /**
- * Return the resource type of the item to be deleted
- * @return resource type of the item
- */
- public String getType()
- {
- return type;
- }
- /**
- * Return the 0-based row number of this item
- * @return 0-based row number
- */
- public int getRowNumber()
- {
- return rowNbr;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- */
- public ImageDescriptor getImageDescriptor()
- {
- return imageDescriptor;
- }
-
- /**
- * Get the input object this row represents
- */
- public Object getElement()
- {
- return element;
- }
- /**
- * Get the input object adapter for the input object this row represents
- */
- public ISystemViewElementAdapter getAdapter()
- {
- return adapter;
- }
- /**
- * Get the input object remote adapter for the input object this row represents
- */
- public ISystemRemoteElementAdapter getRemoteAdapter()
- {
- return remoteAdapter;
- }
- /**
- * Return true if this is a remote object
- */
- public boolean isRemote()
- {
- return (remoteAdapter != null);
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
- public String toString()
- {
- return name;
- }
-
-
- /* THESE CAUSE GRIEF IF TWO OBJECTS WITH SAME NAME ARE SHOWN
- public boolean equals(Object o)
- {
- if (o instanceof SystemRenameTableRow)
- return ((SystemRenameTableRow)o).getOldName().equalsIgnoreCase(getOldName());
- else if (o instanceof SystemDeleteTableRow)
- return ((SystemDeleteTableRow)o).getOldName().equalsIgnoreCase(getOldName());
- else if (o instanceof String)
- return ((String)o).equalsIgnoreCase(getOldName());
- else
- return super.equals(o);
- }
- public int hashCode()
- {
- return getOldName().hashCode();
- }
- */
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemFilterTableDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemFilterTableDialog.java
deleted file mode 100644
index dff540ed6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemFilterTableDialog.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.window.Window;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.StringComparePatternMatcher;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableView;
-import org.eclipse.rse.ui.view.SystemTableViewProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * @author dmcknigh
- */
-public class SystemFilterTableDialog extends SystemPromptDialog implements KeyListener, IDoubleClickListener
-{
- class InitialInputRunnable implements Runnable
- {
- public void run()
- {
- initInput();
- }
- }
-
- private SystemTableView _viewer;
- private Table table;
- private List _inputs;
- private IAdaptable _currentInput;
- private String _lastFilter;
- private String _lastType;
-
- private String[] _viewFilterStrings;
- private String[] _typeFilterStrings;
-
- private ISubSystem _subSystem;
-
- private Combo _inputText;
- private Button _browseButton;
-
- private Combo _typeCombo;
- private Combo _filterCombo;
-
- private String selected = null;
- private boolean _allowInputChange = true;
-
-
- public SystemFilterTableDialog(Shell shell, String title, ISubSystem subSystem, String input, String[] viewFilterStrings, String[] typeFilterStrings, boolean allowInputChange)
- {
- super(shell, title);
- _subSystem = subSystem;
- setNeedsProgressMonitor(true);
- _inputs = new ArrayList();
- _inputs.add(input);
- _viewFilterStrings = viewFilterStrings;
- _typeFilterStrings = typeFilterStrings;
- _allowInputChange = allowInputChange;
- }
-
-
- public SystemFilterTableDialog(Shell shell, String title, ISubSystem subSystem, List inputs, String[] viewFilterStrings, String[] typeFilterStrings, boolean allowInputChange)
- {
- super(shell, title);
- _subSystem = subSystem;
- setNeedsProgressMonitor(true);
- _inputs = inputs;
-
- _viewFilterStrings = viewFilterStrings;
- _typeFilterStrings = typeFilterStrings;
- _allowInputChange = allowInputChange;
- }
-
-
- protected ISystemViewElementAdapter getAdatperFor(IAdaptable obj)
- {
- return (ISystemViewElementAdapter)obj.getAdapter(ISystemViewElementAdapter.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.dialogs.SystemPromptDialog#createInner(org.eclipse.swt.widgets.Composite)
- */
- protected Control createInner(Composite parent)
- {
- Composite c = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- c.setLayout(layout);
- layout.numColumns =1;
- GridData gd = new GridData(GridData.FILL_BOTH);
- c.setLayoutData(gd);
-
- Composite inputC = new Composite(c, SWT.NONE);
- GridLayout ilayout = new GridLayout();
- inputC.setLayout(ilayout);
-
- if (_allowInputChange)
- {
- ilayout.numColumns =4;
- }
- else
- {
- ilayout.numColumns = 3;
- }
-
- GridData igd = new GridData(GridData.FILL_BOTH);
- inputC.setLayoutData(igd);
-
- // input
- Label objFilterLabel= SystemWidgetHelpers.createLabel(inputC, "Input");
- _inputText = new Combo(inputC, SWT.DROP_DOWN | SWT.READ_ONLY);
- _inputText.addListener(SWT.Selection, this);
-
-
- for (int i = 0; i < _inputs.size(); i++)
- {
- String input = (String)_inputs.get(i);
- if (input != null)
- {
- _inputText.add(input);
- }
- }
- _inputText.select(0);
-
- if (_allowInputChange)
- {
- _browseButton = SystemWidgetHelpers.createPushButton(inputC, SystemResources.BUTTON_BROWSE, this);
- }
-
- Composite filterC = new Composite(c, SWT.NONE);
- GridLayout flayout = new GridLayout();
- filterC.setLayout(flayout);
- flayout.numColumns =4;
-
- GridData fgd = new GridData(GridData.FILL_BOTH);
- filterC.setLayoutData(fgd);
-
- // type filter strings
- Label typeFilterLabel= SystemWidgetHelpers.createLabel(filterC, SystemPropertyResources.RESID_PROPERTY_TYPE_LABEL);
- _typeCombo = new Combo(filterC, SWT.DROP_DOWN | SWT.READ_ONLY);
- for (int i = 0; i < _typeFilterStrings.length; i++)
- {
- if (null != _typeFilterStrings[i])
- {
- _typeCombo.add(_typeFilterStrings[i]);
- }
- }
- _typeCombo.select(0);
- _typeCombo.addKeyListener(this);
- _typeCombo.addListener(SWT.Selection, this);
-
- // view filter strings
- Label viewFilterLabel= SystemWidgetHelpers.createLabel(filterC, SystemResources.RESID_FILTERSTRING_STRING_LABEL);
- _filterCombo = SystemWidgetHelpers.createCombo(filterC, this);
- _filterCombo.setText(_viewFilterStrings[0]);
- for (int i = 0; i < _viewFilterStrings.length; i++)
- {
- if (null != _viewFilterStrings[i])
- {
- _filterCombo.add(_viewFilterStrings[i]);
- }
- }
- _filterCombo.addKeyListener(this);
-
- // table
- table = new Table(c, SWT.BORDER);
- _viewer = new SystemTableView(table, this);
- _viewer.showColumns(false);
- _viewer.addDoubleClickListener(this);
-
- TableLayout tlayout = new TableLayout();
- table.setLayout(tlayout);
- table.setHeaderVisible(false);
- table.setLinesVisible(false);
-
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gridData.heightHint = 200;
- gridData.widthHint = 200;
- table.setLayoutData(gridData);
-
-
-
-
- enableOkButton(false);
-
- return c;
- }
-
-
- protected void initInput()
- {
- if (_currentInput == null)
- {
- String input = (String)_inputs.get(0);
- try
- {
- _currentInput = (IAdaptable)_subSystem.getObjectWithAbsoluteName(input);
-
- ISystemViewElementAdapter adapter = getAdatperFor(_currentInput);
- if (adapter != null)
- {
- applyViewFilter(false);
- _viewer.setInput(_currentInput);
- _viewer.refresh();
- }
- }
- catch (Exception e)
- {
-
- }
- }
- }
-
- protected void applyViewFilter(boolean refresh)
- {
- String[] vfilters = new String[1];
-
- String typeFilter = _typeCombo.getText().toUpperCase();
-
- vfilters[0] = _filterCombo.getText().toUpperCase();
- if (!vfilters[0].endsWith("*"))
- vfilters[0] += "*";
-
- if (_lastFilter != vfilters[0])
- {
- StringComparePatternMatcher matcher = new StringComparePatternMatcher(_lastFilter != null ?_lastFilter.toUpperCase() : null);
- if (_lastFilter == null || !matcher.stringMatches(vfilters[0]))
- {
- _lastFilter = vfilters[0];
- _lastType = typeFilter;
- if (_currentInput != null)
- {
- getAdatperFor(_currentInput).setFilterString(_lastFilter);
- }
-
- }
- else
- {
- _lastFilter = vfilters[0];
- _lastType = typeFilter;
- }
- ((SystemTableViewProvider)_viewer.getContentProvider()).flushCache();
- String[] tfilters = new String[1];
- tfilters[0] = _lastFilter + typeFilter;
- _viewer.setViewFilters(tfilters);
- }
- else if (_lastType != typeFilter)
- {
- _lastType = typeFilter;
- String[] tfilters = new String[1];
- tfilters[0] = _lastFilter + typeFilter;
- _viewer.setViewFilters(tfilters);
- }
-
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.dialogs.SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- Display.getCurrent().asyncExec(new InitialInputRunnable());
- //initInput();
- return _filterCombo;
- }
-
- public void handleEvent(Event e)
- {
- Widget source = e.widget;
-
- if (source == _typeCombo)
- {
- applyViewFilter(true);
- }
- else if (source == _filterCombo)
- {
- if (_lastFilter == null || !_lastFilter.equals(_filterCombo.getText() + "*"))
- {
- applyViewFilter(true);
- }
- }
- else if (source == _browseButton)
- {
- SystemSelectAnythingDialog dlg = new SystemSelectAnythingDialog(getShell(), SystemResources.ACTION_SELECT_INPUT_DLG);
- dlg.setInputObject(_currentInput);
- if (dlg.open() == Window.OK)
- {
- _currentInput = (IAdaptable)dlg.getSelectedObject();
- ISystemViewElementAdapter adapter = getAdatperFor(_currentInput);
- String objName = adapter.getAbsoluteName(_currentInput);
- if (!_inputs.contains(objName))
- {
- _inputs.add(0, objName);
- }
-
- _inputText.setText(objName);
- applyViewFilter(false);
- _viewer.setInput(_currentInput);
- _viewer.refresh();
- }
- }
- else if (source == _inputText)
- {
- int selected = _inputText.getSelectionIndex();
- String inputStr = (String)_inputs.get(selected);
- try
- {
- IAdaptable input = (IAdaptable)_subSystem.getObjectWithAbsoluteName(inputStr);
- if (input != _currentInput)
- {
- _currentInput = input;
- ISystemViewElementAdapter adapter = getAdatperFor(_currentInput);
- _inputText.setText(inputStr);
- applyViewFilter(false);
- _viewer.setInput(_currentInput);
- _viewer.refresh();
- }
- }
- catch (Exception e2)
- {
- }
- }
- }
-
- public void keyPressed(KeyEvent e)
- {
- }
-
- public void keyReleased(KeyEvent e)
- {
- if (e.widget == _filterCombo)
- {
- String vfilter = _filterCombo.getText();
- if (!vfilter.endsWith("*"))
- vfilter += "*";
- if (_lastFilter == null || !_lastFilter.equals(vfilter))
- {
- //System.out.println("handling event");
- // System.out.println("\tchar ="+e.character);
- applyViewFilter(true);
- _filterCombo.clearSelection();
- _filterCombo.setFocus();
- }
- }
- }
- public void doubleClick(DoubleClickEvent event)
- {
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
- if (element == null)
- return;
- processOK();
- close();
- }
-
-
- protected boolean processOK()
- {
- TableItem[] thisRow = table.getSelection();
- if (null != thisRow && thisRow.length == 1)
- {
- selected = thisRow[0].getText(0);
- }
- return true;
- }
-
- public String getSelected()
- {
- return selected;
- }
-
-
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPersistencePrompt.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPersistencePrompt.java
deleted file mode 100644
index 1338c36e2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPersistencePrompt.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import java.util.List;
-
-import org.eclipse.rse.core.PasswordPersistenceManager;
-import org.eclipse.rse.core.model.SystemSignonInformation;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * SystemPasswordPersistencePrompt is used with the save password preference page
- * to prompt the user to add or change password information.
- */
-public final class SystemPasswordPersistencePrompt extends SystemPromptDialog implements ModifyListener
-{
-
-
-
- private Text hostname, userid, password, passwordVerify;
- private Combo systemType;
- private SystemSignonInformation signonInfo;
- private boolean change;
- private String originalHostname, originalUserid, originalSystemType;
-
- private List existingEntries;
-
- /**
- * Constructor for SystemPasswordPersistencePrompt.
- * @param shell
- * @param title
- */
- public SystemPasswordPersistencePrompt(Shell shell, String title, List existingEntries, boolean change) {
- super(shell, title);
- this.change = change;
- this.existingEntries = existingEntries;
- setInitialOKButtonEnabledState(false);
- }
-
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent) {
-
- Composite page = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Hostname prompt
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_HOSTNAME_LABEL);
- hostname = SystemWidgetHelpers.createTextField(page, null, SystemResources.RESID_PREF_SIGNON_HOSTNAME_TOOLTIP);
- if (originalHostname != null)
- hostname.setText(originalHostname);
- hostname.addModifyListener(this);
-
- // System type prompt
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_SYSTYPE_LABEL, SystemResources.RESID_PREF_SIGNON_SYSTYPE_TOOLTIP);
- systemType = SystemWidgetHelpers.createReadonlyCombo(page, null);
- systemType.setItems(PasswordPersistenceManager.getInstance().getRegisteredSystemTypes());
- if (originalSystemType != null)
- systemType.setText(originalSystemType);
- systemType.addModifyListener(this);
-
- // User ID prompt
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_USERID_LABEL);
- userid = SystemWidgetHelpers.createTextField(page, null, SystemResources.RESID_PREF_SIGNON_USERID_TOOLTIP);
- if (originalUserid != null)
- userid.setText(originalUserid);
- userid.addModifyListener(this);
-
- // Password prompt
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_PASSWORD_LABEL);
- password = SystemWidgetHelpers.createTextField(page, null, SystemResources.RESID_PREF_SIGNON_PASSWORD_TOOLTIP);
- password.setEchoChar('*');
- password.addModifyListener(this);
-
- // Confirm password prompt
- SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_PASSWORD_VERIFY_LABEL);
- passwordVerify = SystemWidgetHelpers.createTextField(page, null,SystemResources.RESID_PREF_SIGNON_PASSWORD_TOOLTIP);
- passwordVerify.setEchoChar('*');
- passwordVerify.addModifyListener(this);
-
- return page;
- }
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl() {
- return hostname;
- }
-
- public SystemSignonInformation getSignonInformation() {
- return signonInfo;
- }
-
- /**
- * @see org.eclipse.rse.ui.dialogs.SystemPromptDialog#processOK()
- */
- protected boolean processOK() {
- // Check for blank fields
- String sHostName = hostname.getText();
- if (sHostName == null || sHostName.trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- okButton.setEnabled(false);
- hostname.setFocus();
- return false;
- }
-
- String sSystemType = systemType.getText();
- if (sSystemType == null || sSystemType.trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- okButton.setEnabled(false);
- systemType.setFocus();
- return false;
- }
-
- String sUserID = userid.getText();
- if (sUserID == null || sUserID.trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- okButton.setEnabled(false);
- userid.setFocus();
- return false;
- }
-
- String sPwd1 = password.getText();
- if (sPwd1 == null || sPwd1.trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- okButton.setEnabled(false);
- password.setFocus();
- return false;
- }
-
- String sPwd2 = passwordVerify.getText();
- if (sPwd2 == null || sPwd2.trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- okButton.setEnabled(false);
- passwordVerify.setFocus();
- return false;
- }
-
- // Check if new and verify passwords match
- if (!sPwd1.equals(sPwd2))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_MISMATCH));
- okButton.setEnabled(false);
- password.setFocus();
- password.setSelection(0, sPwd1.length());
- return false;
- }
-
- signonInfo = new SystemSignonInformation(hostname.getText(), userid.getText(), password.getText(), systemType.getText());
-
- if (change)
- {
- if (exists(signonInfo.getHostname(), signonInfo.getUserid(), signonInfo.getSystemType()))
- {
- if (!signonInfo.getSystemType().equals(originalSystemType) ||
- !signonInfo.getHostname().equalsIgnoreCase(originalHostname) ||
- //!signonInfo.getHostname().equalsIgnoreCase(RSEUIPlugin.getQualifiedHostName(originalHostname)) ||
- !signonInfo.getUserid().equals(originalUserid))
- {
- // User changed hostname, systemtype or userid and the change conflicts with an existing entry
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_EXISTS);
- msg.makeSubstitution(sUserID, sHostName);
- setErrorMessage(msg);
- okButton.setEnabled(false);
- hostname.setFocus();
- return false;
- }
- }
- }
- else
- {
- // Adding a new entry, make sure it doesn't already exist
- if (exists(signonInfo.getHostname(), signonInfo.getUserid(), signonInfo.getSystemType()))
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_EXISTS);
- msg.makeSubstitution(sUserID, sHostName);
- setErrorMessage(msg);
- okButton.setEnabled(false);
- hostname.setFocus();
- return false;
- }
- }
-
- return super.processOK();
- }
-
- /**
- * Check if a password is already saved for the given hostname, user ID and system type
- */
- private boolean exists(String hostname, String userID, String systemType)
- {
- SystemSignonInformation info;
- PasswordPersistenceManager manager = PasswordPersistenceManager.getInstance();
- boolean found = false;
-
- for (int i = 0; !found && i < existingEntries.size(); i++)
- {
- info = (SystemSignonInformation) existingEntries.get(i);
- if (hostname.equalsIgnoreCase(info.getHostname()) &&
- systemType.equals(info.getSystemType()))
- {
- if (!manager.isUserIDCaseSensitive(info.getSystemType()))
- {
- found = userID.equalsIgnoreCase(info.getUserid());
- }
- else
- {
- found = userID.equals(info.getUserid());
- }
- }
- }
-
- return found;
- }
-
- /**
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- if (change)
- {
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "pwdi0002");
- password.setFocus();
- }
- else
- {
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "pwdi0001");
- hostname.setFocus();
- }
- }
-
- /**
- * Set the input data to prepopulate the change dialog
- */
- public void setInputData(String systemtype, String hostname, String userid)
- {
- originalSystemType = systemtype;
- originalHostname = hostname;
- originalUserid = userid;
- }
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- if (e.getSource() == hostname && hostname.getText().trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- hostname.setFocus();
- okButton.setEnabled(false);
- }
- else if (e.getSource() == userid && userid.getText().trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- userid.setFocus();
- okButton.setEnabled(false);
- }
- else if (e.getSource() == systemType && systemType.getText().trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- systemType.setFocus();
- okButton.setEnabled(false);
- }
- else if (e.getSource() == password && password.getText().trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- password.setFocus();
- okButton.setEnabled(false);
- }
- else if (e.getSource() == passwordVerify && passwordVerify.getText().trim().equals(""))
- {
- setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
- passwordVerify.setFocus();
- okButton.setEnabled(false);
- }
- else
- {
- clearErrorMessage();
-
- if (hostname.getText().trim().equals("") ||
- userid.getText().trim().equals("") ||
- systemType.getText().trim().equals("") ||
- password.getText().trim().equals("") ||
- passwordVerify.getText().trim().equals(""))
- {
- // clear error messages but button stays disabled
- okButton.setEnabled(false);
- }
- else
- {
- okButton.setEnabled(true);
- }
- }
-
- }
-
- /**
- * @see org.eclipse.jface.window.Window#open()
- */
- public int open()
- {
- return super.open();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java
deleted file mode 100644
index 17c3a3a1a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompt user for password.
- * This class is final due to the sensitive nature of the information being prompted for.
- */
-public final class SystemPasswordPromptDialog extends SystemPromptDialog implements ISystemPasswordPromptDialog {
-
- // labels are not as big as text fields so we need to set the height for the system type
- // and hostname labels so they are equally spaced with the user ID and password entry fields
-// private static final int LABEL_HEIGHT = 17;
-
- private Text textPassword;
- private Text textUserId;
- private Button userIdPermanentCB;
- private Button savePasswordCB;
- private String originalUserId;
- private String userId;
- private String password;
- private boolean userIdPermanent = false;
- private boolean savePassword = false;
- private boolean forceToUpperCase;
- private boolean userIdChanged = false;
- private boolean validate = true;
- private ISystemValidator userIdValidator;
- private ISystemValidator passwordValidator;
- private ISignonValidator signonValidator;
- private IConnectorService connectorService = null;
-
- /**
- * Constructor for SystemPasswordPromptDialog
- * @param shell The shell in which to base this dialog.
- */
- public SystemPasswordPromptDialog(Shell shell) {
- super(shell, SystemResources.RESID_PASSWORD_TITLE);
- setHelp(RSEUIPlugin.HELPPREFIX + "pwdp0000");
- }
-
- /**
- * Set the connector service from which the user is attempting to do a connect action.
- * This is used to query the system type, host name and user id to display to the user for
- * contextual information.
- * <p>
- * This must be called prior to opening this dialog.
- * @param connectorService the connector service associated with this dialog
- */
- public void setSystemInput(IConnectorService connectorService) {
- this.connectorService = connectorService;
- }
-
- /**
- * Sets the validator for the userId. If not null it will be called per keystroke.
- * <p>
- * This must be called prior to opening this dialog if something other than the default is needed.
- * @param v a validator
- */
- public void setUserIdValidator(ISystemValidator v) {
- userIdValidator = v;
- }
-
- /**
- * Sets the validator for the password. If not null it will be called per keystroke.
- * The default validator is null.
- * <p>
- * This must be called prior to opening this dialog if something other than the default is needed.
- * @param v a validator
- */
- public void setPasswordValidator(ISystemValidator v) {
- passwordValidator = v;
- }
-
- /**
- * Sets the validator for the signon.
- * The default validator is null.
- * If not null the validator will be called when the user presses OK.
- * <p>
- * This must be called prior to opening this dialog if something other than the default is needed.
- * @param v a signon validator
- */
- public void setSignonValidator(ISignonValidator v) {
- signonValidator = v;
- }
-
- /**
- * Sets the option to force the userId and password to uppercase. This use should be rare.
- * Use this with caution.
- * <p>
- * The default is false.
- * This must be called prior to opening this dialog if something other than the default is needed.
- * @param force true if the user id and password are to be forced to uppercase
- */
- public void setForceToUpperCase(boolean force) {
- this.forceToUpperCase = force;
- }
-
- /**
- * Call this to query the force-to-uppercase setting
- * @return the setting for forcing the user id and password to upper case
- */
- public boolean getForceToUpperCase() {
- return forceToUpperCase;
- }
-
- /**
- * Creates the dialog controls.
- * @param parent the containing composite control in which our controls will be created. It is assumed
- * to have a grid layout.
- * @return the composite control we create that nests inside the parent
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent) {
-
- // top level composite
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
-
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(composite, 2);
-
- // yantzi: artemis 6.0, at request of zOS team I am changing the system type and hostname
- // to labels so they are clearer to read than non-editable entry fields
-
- // dwd: cannot set height hints on labels since that causes cut off text for large fonts used by those with impaired vision
-
- // System type
- String text = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_READONLY_LABEL);
- Label label = SystemWidgetHelpers.createLabel(composite_prompts, text);
- GridData gd = new GridData();
- label.setLayoutData(gd);
- label = SystemWidgetHelpers.createLabel(composite_prompts, connectorService.getHostType());
- gd = new GridData();
- label.setLayoutData(gd);
-
- // Host name
- text = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_HOSTNAME_READONLY_LABEL);
- label = SystemWidgetHelpers.createLabel(composite_prompts, text);
- gd = new GridData();
- label.setLayoutData(gd);
- label = SystemWidgetHelpers.createLabel(composite_prompts, connectorService.getHostName());
- gd = new GridData();
- label.setLayoutData(gd);
-
- // UserId
- if (connectorService.supportsUserId()) {
- textUserId = SystemWidgetHelpers.createLabeledTextField(composite_prompts, this, SystemResources.RESID_CONNECTION_USERID_LABEL, SystemResources.RESID_CONNECTION_USERID_TIP);
- }
-
- // Password prompt
- if (connectorService.supportsPassword()) {
- textPassword = SystemWidgetHelpers.createLabeledTextField(composite_prompts, this, SystemResources.RESID_PASSWORD_LABEL, SystemResources.RESID_PASSWORD_TIP);
- textPassword.setEchoChar('*');
- }
-
- // UserId_make_permanent checkbox
- // DY: align user ID checkbox with entry fields
- // yantzi:5.1 move checkboxes to be below entry fields
- if (connectorService.supportsUserId()) {
- SystemWidgetHelpers.createLabel(composite_prompts, "");
- userIdPermanentCB = SystemWidgetHelpers.createCheckBox(composite_prompts, 1, this, SystemResources.RESID_PASSWORD_USERID_ISPERMANENT_LABEL,
- SystemResources.RESID_PASSWORD_USERID_ISPERMANENT_TIP);
- userIdPermanentCB.setEnabled(false);
- }
-
- // Save signon information checkbox
- // DY: align password checkbox with entry fields
- if (connectorService.supportsPassword()) {
- SystemWidgetHelpers.createLabel(composite_prompts, "");
- savePasswordCB = SystemWidgetHelpers.createCheckBox(composite_prompts, 1, this, SystemResources.RESID_PASSWORD_SAVE_LABEL, SystemResources.RESID_PASSWORD_SAVE_TOOLTIP);
- savePasswordCB.setSelection(savePassword);
- // disable until the user enters something for consistency with the save user ID checkbox
- savePasswordCB.setEnabled(false);
- }
-
- initializeInput();
-
- // add keystroke listeners...
- if (textUserId != null) {
- textUserId.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- processUserIdField();
- }
- });
- }
- if (textPassword != null) {
- textPassword.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- processPasswordField();
- }
- });
- }
-
- return composite;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl() {
- okButton.setEnabled(true);
- processUserIdField();
- if (textUserId != null) {
- if (userId.length() == 0 || textPassword == null) {
- return textUserId;
- }
- }
- if (textPassword != null) {
- textPassword.selectAll();
- return textPassword;
- }
- if (okButton.isEnabled()) return okButton;
- return cancelButton;
- }
-
- /**
- * Initialize values using input data
- */
- private void initializeInput() {
- originalUserId = connectorService.getUserId();
- userId = originalUserId;
- if (connectorService.supportsUserId() && (userId == null || userId.length() == 0)) {
- userId = SystemPreferencesManager.getPreferencesManager().getDefaultUserId(connectorService.getHostType());
- }
- if (textUserId != null && userId != null) {
- textUserId.setText(userId);
- }
- if (textPassword != null && password != null) {
- textPassword.setText(password);
- }
- }
-
- /**
- * Retrieves the userId entered by user
- */
- private void internalGetUserId() {
- if (textUserId != null) {
- userId = textUserId.getText().trim();
- }
- }
-
- /**
- * Retrieves the password entered by user
- */
- private void internalGetPassword() {
- if (textPassword != null) {
- password = textPassword.getText().trim();
- }
- }
-
- /**
- * Retrieves the value of the "save user id" checkbox
- */
- private void internalGetIsUserIdChangePermanent() {
- if (userIdPermanentCB != null) {
- userIdPermanent = userIdPermanentCB.isEnabled() && userIdPermanentCB.getSelection();
- }
- }
-
- /**
- * Retrieves the value of the "save password" checkbox
- */
- private void internalGetIsSavePassword() {
- if (savePasswordCB != null) {
- savePassword = savePasswordCB.isEnabled() && savePasswordCB.getSelection();
- }
- }
-
- /**
- * This method is called whenever the text changes in the user id input field.
- * Checks the user id field and if there are no errors, other fields on the dialog.
- * If an error was reported it is displayed on the message line.
- * @see #setUserIdValidator(ISystemValidator)
- */
- private void processUserIdField() {
- clearErrorMessage();
- SystemMessage m = checkUserId();
- if (m == null) {
- m = checkPassword();
- }
- if (m != null) {
- setErrorMessage(m);
- }
- okButton.setEnabled(m == null);
- if (userId == null || originalUserId == null) {
- userIdChanged = (userId != originalUserId);
- } else {
- userIdChanged = !userId.equals(originalUserId);
- }
- if (userIdPermanentCB != null) {
- userIdPermanentCB.setEnabled(userIdChanged);
- }
- }
-
- /**
- * Performs the actual validation check for the user id.
- * Delegates the request to an <code>ISystemValidator</code> object.
- * @return the message returned by the validator or null.
- */
- private SystemMessage checkUserId() {
- internalGetUserId();
- SystemMessage m = null;
- if (connectorService.supportsUserId() && validate) {
- if (userIdValidator != null) {
- m = userIdValidator.validate(userId);
- } else if (connectorService.requiresUserId() && userId.length() == 0) {
- m = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY);
- }
- }
- return m;
- }
-
- /**
- * This method is called whenever the text changes in the password input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setPasswordValidator(ISystemValidator)
- */
- private void processPasswordField() {
- clearErrorMessage();
- SystemMessage m = checkPassword();
- if (m == null) {
- m = checkUserId();
- }
- if (m != null) {
- setErrorMessage(m);
- }
- okButton.setEnabled(m == null);
- if (savePasswordCB != null) {
- savePasswordCB.setEnabled(!(connectorService.requiresPassword() && password.length() == 0));
- }
- }
-
- /**
- * Checks the value of the password instance variable.
- */
- private SystemMessage checkPassword() {
- internalGetPassword();
- SystemMessage m = null;
- if (connectorService.supportsPassword() && validate) {
- if (passwordValidator != null) {
- m = passwordValidator.validate(password);
- } else if (connectorService.requiresPassword() && password.length() == 0) {
- m = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PASSWORD_EMPTY);
- }
- }
- return m;
- }
-
- /**
- * @return the userId entered by user
- */
- public String getUserId() {
- return userId;
- }
-
- /**
- * @return the password may have been modified by the user.
- */
- public String getPassword() {
- return password;
- }
-
- /**
- * Sets the password, may be null if no password is available.
- * @param password the password to provide for the password field.
- */
- public void setPassword(String password) {
- this.password = password;
- }
-
- /**
- * @return true if the user changed the user id
- */
- public boolean getIsUserIdChanged() {
- return userIdChanged;
- }
-
- /**
- * @return true if the user elected to make the changed user Id a permanent change.
- */
- public boolean getIsUserIdChangePermanent() {
- return userIdPermanent;
- }
-
- /**
- * @return true if the user elected to make the changed user Id a permanent change.
- */
- public boolean getIsSavePassword() {
- return savePassword;
- }
-
- /**
- * Preselect the save password checkbox. Default value is to not
- * select the save password checkbox.
- * @param save true if the save password box should be checked.
- */
- public void setSavePassword(boolean save) {
- savePassword = save;
- }
-
- /**
- * Verifies all input. Sets the error message if there are any conditions that are found.
- */
- private void verify() {
- Control controlInError = null;
- processUserIdField();
- if (getErrorMessage() != null) {
- controlInError = textUserId;
- } else {
- processPasswordField();
- if (getErrorMessage() != null) {
- controlInError = textPassword;
- }
- }
- if (getErrorMessage() != null) {
- controlInError.setFocus(); // validate methods already displayed error message
- }
- }
-
- /**
- * Called when user presses OK button.
- * @return true to close dialog, false to not close dialog.
- */
- protected boolean processOK() {
- setBusyCursor(true);
- internalGetPassword();
- internalGetUserId();
- internalGetIsUserIdChangePermanent();
- internalGetIsSavePassword();
- if (forceToUpperCase) {
- userId = userId.toUpperCase();
- password = password.toUpperCase();
- validate = false;
- textUserId.setText(userId);
- textPassword.setText(password);
- validate = true;
- }
-
- verify();
- setBusyCursor(false); // phil
-
- // If all inputs are OK then validate signon
- if (getErrorMessage() == null && (signonValidator != null)) {
- SystemMessage m = signonValidator.isValid(this, userId, password);
- setErrorMessage(m);
- }
- boolean closeDialog = (getErrorMessage() == null);
- return closeDialog;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java
deleted file mode 100644
index bd5193cd9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java
+++ /dev/null
@@ -1,1849 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.messages.SystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Base dialog class. Use this whenever more than a simple string
- * prompt is needed (which InputDialog gives you).
- * <p>
- * By default we configure the dialog as modal. If you do not want this,
- * call setBlockOnOpen(false) after instantiating.
- * <p>
- * This base class offers the following ease-of-use features:
- * <ul>
- * <li>automatic support for typical buttons OK, Browse and Cancel.
- * <ul>
- * <li>just override the processOk, processBrowse and processCancel methods to process them
- * <li>constructor option whether to enable Browse or not
- * <li>ability to override default labels for all three.
- * </ul>
- * <li>automatic support for a message line
- * <ul>
- * <li>can turn it off
- * <li>methods for writing messages to the message line
- * </ul>
- * <li>override just one method (<b>createInner</b>) to populate the client area
- * <li>support for automatically assigning unique mnemonics to all buttons
- * <ul>
- * <li>easier to code, easier to translate
- * <li>this is always done for you, so do not put your own mnemonics in your button text!
- * </ul>
- * <li>support for an input object for change mode vs "new" mode:
- * <ul>
- * <li>in change mode, callers pass this in via ctor or setInputObject method
- * <li>in your child class, get it via inherited getInputObject and cast to what it is you are expecting
- * </ul>
- * <li>support for output object:
- * <ul>
- * <li>when ok pressed, built up the output object and then call inherited setOutputObject object method
- * <li>dialog callers can then retrieve it via getOuputObject method.
- * </ul>
- * <li>support for {@link #wasCancelled()} method so callers can easily determine how user exited the dialog
- * <li>special affinity if you use an imbedded WorkWith widget:
- * <ul>
- * <li>call WorkWith's setPromptDialog(this) method to tell it the parent dialog is a PromptDialog
- * <li>WorkWith widget will use PromptDialog's message line vs its own
- * <li>WorkWith widget will know how to reassign mnemonics for its buttons when style is switched.
- * </ul>
- * <li>optional support (mri) for additional buttons (which your code handles):
- * <ul>
- * <li>Add
- * <li>Browse
- * <li>Test
- * <li>Details>>
- * </ul>
- * <li>optional support for a built-in progress monitor just like wizards have. Call {@link #setNeedsProgressMonitor(boolean)}
- * <li>a simple {@link #setBusyCursor(boolean)} method to toggle the cursor between busy and normal
- * </ul>
- *
- * <p>To use this class: </p>
- * <ol>
- * <li>Subclass it, specifying the dialog title in the constructor. Optionally, also call {@link #setHelp(String)} to set the dialog's help in the constructor.
- * <li>Override {@link #createInner(Composite)} to populate the contents
- * <li>Override {@link #processOK()} to process the pressing of the OK button
- * </ol>
- * <p>For error checking, add modify listeners to entry fields and if needed selection listeners to buttons, then in your event handler </p>
- * <ol>
- * <li>Call {@link #setErrorMessage(SystemMessage)} to display an error if detected. Pass null to clear previous error.
- * <li>Call {@link #setPageComplete(boolean)} with true if there are no errors and all required data is supplied. This enables/disables OK.
- * <li>The same two error-reporting strategies described in {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage} apply here.
- * </ol>
- */
-public abstract class SystemPromptDialog
- extends org.eclipse.jface.dialogs.Dialog
- implements Listener, IDialogConstants, ISystemPromptDialog,
- ISystemMessageLine, org.eclipse.jface.dialogs.IDialogPage, IRunnableContext, Runnable
-{
-
- protected boolean okPressed = false;
- protected boolean cancelAllPressed = false;
- protected boolean showBrowseButton = false;
- protected boolean showTestButton = false;
- protected boolean showAddButton = false;
- protected boolean showDetailsButton = false;
- protected boolean pack = false;
- protected boolean initialOKButtonEnabledState = true;
- protected boolean initialAddButtonEnabledState = false;
- protected boolean initialDetailsButtonEnabledState = true;
- protected boolean detailsButtonHideMode = false;
- protected boolean showOkButton = true;
- protected boolean showCancelAllButton = false;
- protected Shell overallShell = null;
- protected Composite parentComposite, dialogAreaComposite;
- protected Composite buttonsComposite;
- protected Button okButton, cancelButton, cancelAllButton, testButton, browseButton, addButton, detailsButton;
- protected String title, labelOk, labelBrowse, labelTest, labelCancel, labelCancelAll, labelAdd, labelDetailsShow, labelDetailsHide;
- protected String tipOk, tipBrowse, tipTest, tipCancel, tipCancelAll, tipAdd, tipDetailsShow, tipDetailsHide;
- protected boolean noShowAgainOption;
- protected Button noShowAgainButton;
- protected String detailsShowLabel;
- protected String detailsHideLabel;
- protected String helpId;
- //protected Hashtable helpIdPerControl;
- protected Image titleImage;
- protected Object inputObject, outputObject; // input and output objects
- protected SystemMessageLine fMessageLine;
- protected SystemMessage pendingMessage, pendingErrorMessage;
- protected int minWidth, minHeight;
- protected int marginWidth = 3;
- protected int marginHeight = 3;
- protected int verticalSpacing = 2;
- protected int horizontalSpacing = 3;
-
- //protected Composite parent;
- //protected Composite contentsComposite, buttonsComposite;
- protected Mnemonics dialogMnemonics; // list of all unique mnemonics used in this dialog
- protected ISystemValidator outputObjectValidator;
-
- protected long activeRunningOperations = 0;
- protected boolean operationCancelableState;
- protected boolean needsProgressMonitor;
- protected ProgressMonitorPart progressMonitorPart;
- protected Cursor waitCursor;
- protected Cursor arrowCursor;
- protected MessageDialog windowClosingDialog;
- protected SelectionAdapter cancelListener;
-
- // preference stuff for option to not show the dialog again
- protected IPreferenceStore prefStore;
- protected String prefId;
- protected boolean prefValAsSelected;
-
- private static final String FOCUS_CONTROL = "focusControl";//$NON-NLS-1$
-
- protected static final int BROWSE_ID = 50;
- protected static final int TEST_ID = 60;
- protected static final int ADD_ID = 70;
- protected static final int DETAILS_ID = 80;
- protected static final int CANCEL_ALL_ID = 90;
-
- protected static final boolean BROWSE_BUTTON_YES = true;
- protected static final boolean BROWSE_BUTTON_NO = false;
- protected static final boolean TEST_BUTTON_YES = true;
- protected static final boolean TEST_BUTTON_NO = false;
- protected static final boolean ADD_BUTTON_YES = true;
- protected static final boolean ADD_BUTTON_NO = false;
- protected static final boolean DETAILS_BUTTON_YES = true;
- protected static final boolean DETAILS_BUTTON_NO = false;
-
- /**
- * Constructor one: ok and cancel buttons
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @see #setInputObject(Object)
- */
- public SystemPromptDialog(Shell shell, String title)
- {
- this(shell, title, null, false);
- }
- /**
- * Constructor two: ok and cancel buttons and an icon for the dialog title area
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @param titleImage - the icon for the dialog's title area.
- * @see #setInputObject(Object)
- */
- public SystemPromptDialog(Shell shell, String title, Image titleImage)
- {
- this(shell, title, null, false, titleImage);
- }
- /**
- * Constructor three: ok and cancel buttons, plus explicit setting of input object
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @param inputObject - the contextual input data, which can be queried via {@link #getInputObject()}.
- */
- public SystemPromptDialog(Shell shell, String title, Object inputObject)
- {
- this(shell, title, inputObject, false);
- }
- /**
- * Constructor four: ok, browse and cancel buttons
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @param browse - true if to show a Browse button, false if no Browse button desired.
- * @see #setInputObject(Object)
- */
- public SystemPromptDialog(Shell shell, String title, boolean browse)
- {
- this(shell, title, null, browse);
- }
- /**
- * Constructor five: ok, browse and cancel buttons, plus explicit setting of input object
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @param inputObject - the contextual input data, which can be queried via {@link #getInputObject()}.
- * @param browse - true if to show a Browse button, false if no Browse button desired.
- */
- public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse)
- {
- this(shell, title, inputObject, browse, null);
- }
- /**
- * Constructor six: ok, browse and cancel buttons, plus explicit setting of input object and
- * an icon for the dialog title area
- * @param shell - parent window this dialog is modal to.
- * @param title - the title for the dialog. Typically translated.
- * @param inputObject - the contextual input data, which can be queried via {@link #getInputObject()}.
- * @param browse - true if to show a Browse button, false if no Browse button desired.
- * @param titleImage - the icon for the dialog's title area.
- */
- public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse,
- Image titleImage)
- {
- super(shell);
- setShellStyle(SWT.RESIZE | getShellStyle()); // dwd
- this.title = title;
- this.titleImage = titleImage;
- this.inputObject = inputObject;
- this.showBrowseButton = browse;
- super.setBlockOnOpen(true);
- }
- /**
- * Constructor six: an input object. true/false for browse button, true/false for test button, a title image
- */
- public SystemPromptDialog(Shell shell, String title, Object inputObject, boolean browse, boolean test,
- Image titleImage)
- {
- super(shell);
- setShellStyle(SWT.RESIZE | getShellStyle()); // dwd
- this.title = title;
- this.titleImage = titleImage;
- this.inputObject = inputObject;
- this.showBrowseButton = browse;
- this.showTestButton = test;
- super.setBlockOnOpen(true);
- }
-
-
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- overallShell = shell;
- if (title != null)
- shell.setText(title);
- //if (titleImage != null)
- // shell.setImage(titleImage); // ?correct method?
- //shell.setSize(300,200); // default w,h
- }
-
- /**
- * Specify if a progress monitor is desired in this dialog. Should be called right after instantiation.
- * The default is false. If true is specified, area on the dialog is reserved for the progress monitor,
- * and the monitor can be retrieved via {@link #getProgressMonitor()}.
- * <p>Support is patterned after WizardDialog in JFace.
- */
- public void setNeedsProgressMonitor(boolean needs)
- {
- this.needsProgressMonitor = needs;
- }
-
- /**
- * For setting the default overall help for the dialog.
- * This can be overridden per control by calling {@link #setHelp(Control, String)}.
- */
- public void setHelp(String helpId)
- {
- if (parentComposite != null)
- {
- SystemWidgetHelpers.setHelp(parentComposite, helpId);
- SystemWidgetHelpers.setHelp(buttonsComposite, helpId);
- //SystemWidgetHelpers.setCompositeHelp(parentComposite, helpId, helpIdPerControl);
- //SystemWidgetHelpers.setCompositeHelp(buttonsComposite, helpId, helpIdPerControl);
- }
- this.helpId = helpId;
- }
- /**
- * For retrieving the help Id
- */
- public String getHelpContextId()
- {
- return helpId;
- }
- /**
- * For setting control-specific help for a control on the wizard page.
- * <p>
- * This overrides the default set in the call to {@link #setHelp(String)}.
- */
- public void setHelp(Control c, String helpId)
- {
- SystemWidgetHelpers.setHelp(c, helpId);
- //if (helpIdPerControl == null)
- // helpIdPerControl = new Hashtable();
- //helpIdPerControl.put(c, helpId);
- }
-
- /**
- * For explicitly setting input object. Called by SystemDialogAction
- */
- public void setInputObject(Object inputObject)
- {
- this.inputObject = inputObject;
- }
- /**
- * For explicitly getting input object
- */
- public Object getInputObject()
- {
- return inputObject;
- }
-
- /**
- * For explicitly getting output object after dialog is dismissed. Set by the
- * dialog's processOK method.
- */
- public Object getOutputObject()
- {
- return outputObject;
- }
-
- /**
- * Allow caller to determine if window was cancelled or not.
- * Will return <code>false</code> if Cancel All was pressed.
- */
- public boolean wasCancelled()
- {
- return !okPressed;
- }
-
- public boolean wasCancelledAll() {
- return cancelAllPressed;
- }
-
- /**
- * If validation of the output object is desired, set the validator here.
- * It will be used when the child class calls setOutputObject().
- */
- public void setOutputObjectValidator(ISystemValidator outputObjectValidator)
- {
- this.outputObjectValidator = outputObjectValidator;
- }
-
- /**
- * Return the output object validator
- */
- public ICellEditorValidator getOutputObjectValidator()
- {
- return outputObjectValidator;
- }
-
- /**
- * Get the ISystemMessageLine control reference.
- */
- public ISystemMessageLine getMessageLine()
- {
- return fMessageLine;
- }
-
- /**
- * For explicitly setting output object. Call this in your processOK method.
- * If an output object validator has been set via setOutputObjectValidator, then
- * this will call its isValid method on the outputObject and will return the error
- * message if any that it issues. A return of null always means no errors and
- * hence it is ok to dismiss the dialog.
- */
- protected SystemMessage setOutputObject(Object outputObject)
- {
- this.outputObject = outputObject;
- if ((outputObjectValidator != null) && (outputObject instanceof String))
- return outputObjectValidator.validate((String)outputObject);
- else
- return null;
- }
-
- /**
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- public void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(waitCursor);
- }
- else
- {
- setDisplayCursor(null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
-
- // --------------------------
- // OK BUTTON CONFIGURATION...
- // --------------------------
- /**
- * Disable showing of Ok button
- */
- public void setShowOkButton(boolean showOk)
- {
- this.showOkButton = showOk;
- }
-
- /**
- * For explicitly setting ok button label
- */
- public void setOkButtonLabel(String label)
- {
- this.labelOk = label;
- }
-
- /**
- * For explicitly setting ok button tooltip text
- */
- public void setOkButtonToolTipText(String tip)
- {
- this.tipOk = tip;
- }
-
- /**
- * For explicitly enabling/disabling ok button.
- */
- public void enableOkButton(boolean enable)
- {
- if (okButton != null)
- okButton.setEnabled(enable);
- }
- /**
- * Return ok button widget
- */
- public Button getOkButton()
- {
- return okButton;
- }
- /**
- * Set initial enabled state of ok button.
- * Call this from createContents, which is called before the ok button is created.
- */
- public void setInitialOKButtonEnabledState(boolean enabled)
- {
- initialOKButtonEnabledState = enabled;
- }
- /**
- * To be overridden by children.
- * Called when user presses OK button.
- * Child dialog class should set output object.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- return true;
- }
-
- // ------------------------------
- // CANCEL BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * For explicitly setting cancel button label
- */
- public void setCancelButtonLabel(String label)
- {
- this.labelCancel = label;
- }
- /**
- * For explicitly setting cancel button tooltip text
- */
- public void setCancelButtonToolTipText(String tip)
- {
- this.tipCancel = tip;
- }
- /**
- * For explicitly enabling/disabling cancel button.
- */
- public void enableCancelButton(boolean enable)
- {
- if (cancelButton != null)
- cancelButton.setEnabled(enable);
- }
- /**
- * Return cancel button widget.
- * Be careful <i>not</i> to call the deprecated inherited method getCancelButton()!
- */
- public Button getCancelOrCloseButton()
- {
- return cancelButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses CANCEL button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processCancel()
- {
- return true;
- }
-
- // ------------------------------
- // CANCEL ALL BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * Enable or disable showing of Cancel All button
- */
- public void setShowCancelAllButton(boolean showCancelAll)
- {
- this.showCancelAllButton = showCancelAll;
- }
-
- /**
- * For explicitly setting cancel button label
- */
- public void setCancelAllButtonLabel(String label)
- {
- this.labelCancelAll = label;
- }
- /**
- * For explicitly setting cancel button tooltip text
- */
- public void setCancelAllButtonToolTipText(String tip)
- {
- this.tipCancelAll = tip;
- }
- /**
- * For explicitly enabling/disabling cancel button.
- */
- public void enableCancelAllButton(boolean enable)
- {
- if (cancelAllButton != null)
- cancelAllButton.setEnabled(enable);
- }
- /**
- * Return cancel button widget.
- * Be careful <i>not</i> to call the deprecated inherited method getCancelButton()!
- */
- public Button getCancelAllButton()
- {
- return cancelAllButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses CANCEL button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processCancelAll()
- {
- return true;
- }
-
- // ------------------------------
- // BROWSE BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * Explicitly specify if Browse Button to be shown
- */
- public void setShowBrowseButton(boolean show)
- {
- this.showBrowseButton = show;
- }
- /**
- * For explicitly setting browse button label
- */
- public void setBrowseButtonLabel(String label)
- {
- this.labelBrowse = label;
- }
- /**
- * For explicitly setting Browse button tooltip text
- */
- public void setBrowseButtonToolTipText(String tip)
- {
- this.tipBrowse = tip;
- }
- /**
- * For explicitly enabling/disabling Browse button.
- */
- public void enableBrowseButton(boolean enable)
- {
- if (browseButton != null)
- browseButton.setEnabled(enable);
- }
- /**
- * Return browse button widget
- */
- public Button getBrowseButton()
- {
- return browseButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses BROWSE button.
- * Return false always!
- */
- protected boolean processBrowse()
- {
- return false;
- }
-
- // ------------------------------
- // TEST BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * Explicitly specify if Test Button to be shown
- */
- public void setShowTestButton(boolean show)
- {
- this.showTestButton = show;
- }
- /**
- * For explicitly setting test button label
- */
- public void setTestButtonLabel(String label)
- {
- this.labelTest = label;
- }
- /**
- * For explicitly setting Test button tooltip text
- */
- public void setTestButtonToolTipText(String tip)
- {
- this.tipTest = tip;
- }
- /**
- * For explicitly enabling/disabling Test button.
- */
- public void enableTestButton(boolean enable)
- {
- if (testButton != null)
- testButton.setEnabled(enable);
- }
- /**
- * Return test button widget
- */
- public Button getTestButton()
- {
- return testButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses TEST button.
- * Return false always!
- */
- protected boolean processTest()
- {
- return false;
- }
-
- // ------------------------------
- // ADD BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * Explicitly specify if Add Button to be shown
- */
- public void setShowAddButton(boolean show)
- {
- this.showAddButton = show;
- }
- /**
- * For explicitly setting Add button label
- */
- public void setAddButtonLabel(String label)
- {
- this.labelAdd = label;
- }
- /**
- * For explicitly setting Add button tooltip text
- */
- public void setAddButtonToolTipText(String tip)
- {
- this.tipAdd = tip;
- }
- /**
- * For explicitly enabling/disabling Add button.
- */
- public void enableAddButton(boolean enable)
- {
- if (addButton != null)
- addButton.setEnabled(enable);
- else
- initialAddButtonEnabledState = enable;
- }
- /**
- * Return Add button widget
- */
- public Button getAddButton()
- {
- return addButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses ADD button.
- * Return false always!
- */
- protected boolean processAdd()
- {
- return false;
- }
-
- // ------------------------------
- // DETAILS BUTTON CONFIGURATION...
- // ------------------------------
- /**
- * Explicitly specify if Details Button to be shown.
- * There is support to automatically toggle the text.
- * @param true if the Details button is to be shown
- * @param true if the button should initially be in "hide mode" versus "hide mode"
- */
- public void setShowDetailsButton(boolean show, boolean hideMode)
- {
- this.showDetailsButton = show;
- this.detailsButtonHideMode = hideMode;
- }
- /**
- * For explicitly setting Details button label
- */
- public void setDetailsButtonLabel(String showLabel, String hideLabel)
- {
- this.labelDetailsShow = showLabel;
- this.labelDetailsHide = hideLabel;
- }
- /**
- * For explicitly setting Details button tooltip text
- */
- public void setDetailsButtonToolTipText(String showTip, String hideTip)
- {
- this.tipDetailsShow = showTip;
- this.tipDetailsHide = hideTip;
- }
- /**
- * For explicitly enabling/disabling Details button.
- */
- public void enableDetailsButton(boolean enable)
- {
- if (detailsButton != null)
- detailsButton.setEnabled(enable);
- else
- initialDetailsButtonEnabledState = enable;
- }
- /**
- * Return Details button widget
- */
- public Button getDetailsButton()
- {
- return detailsButton;
- }
- /**
- * To be overridden by children.
- * Called when user presses DETAILS button.
- * <p>
- * Note the text is automatically toggled for you! You need only
- * do whatever the functionality is that you desire
- *
- * @param hideMode the current state of the details toggle, prior to this request. If you return true from
- * this method, this state and the button text will be toggled.
- *
- * @return true if the details state toggle was successful, false if it failed.
- */
- protected boolean processDetails(boolean hideMode)
- {
- return true;
- }
-
-
-
- /**
- * Get the list of all unique mnemonics used by buttons on this dialog. This is only
- * set at the time createButtonBar is called by the parent, and this is after the createContents
- * method call. It will return null until then. So, it is not available for you at constructor time.
- * Use setUniqueMnemonic(Button) on the returned object if you want to add a mnemonic to
- * button after the fact.
- */
- public Mnemonics getDialogMnemonics()
- {
- return dialogMnemonics;
- }
-
- /**
- * Create message line.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- //System.out.println("INSIDE CREATEMESSAGELINE");
- fMessageLine= new SystemMessageLine(c);
- fMessageLine.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- Display.getCurrent().asyncExec(this);
- return fMessageLine;
- }
- /**
- * For asynch exec we defer some operations until other pending events are processed.
- * For now, this is used to display pending error messages
- */
- public void run()
- {
- if (pendingErrorMessage != null)
- setErrorMessage(pendingErrorMessage);
- else if (pendingMessage != null)
- setMessage(pendingMessage);
- pendingErrorMessage = pendingMessage = null;
- }
-
- /**
- * Handles events generated by controls on this page.
- * Should be overridden by child.
- * Only public because of interface requirement!
- */
- public void handleEvent(Event e)
- {
- if (e.type == SWT.Selection) {
-
- if (e.widget == noShowAgainButton) {
- boolean isNoShowSelected = noShowAgainButton.getSelection();
-
- if ((prefStore != null) && (prefId != null)) {
-
- if (prefValAsSelected) {
- prefStore.setValue(prefId, isNoShowSelected);
- }
- else {
- prefStore.setValue(prefId, !isNoShowSelected);
- }
- }
- }
- }
- }
-
- /**
- * Swing-like method to auto-set the size of this dialog by
- * looking at the preferred sizes of all constituents.
- * @deprecated
- */
- protected void pack()
- {
- // pack = true; // defer until controls are all created.
- }
-
- /**
- * Called by createContents method.
- * Create this dialog's widgets inside a composite.
- * Child classes must override this.
- */
- protected abstract Control createInner(Composite parent);
-
- /**
- * Return the Control to be given initial focus.
- * Child classes must override this, but can return null.
- */
- protected abstract Control getInitialFocusControl();
-
-
-
- /**
- * Override of parent method.
- * Called by IDE when button is pressed.
- */
- protected void buttonPressed(int buttonId)
- {
- okPressed = false;
- if (buttonId == OK_ID)
- {
- //setReturnId(buttonId);
- setReturnCode(OK);
- if (processOK())
- {
- okPressed = true;
- close();
- }
- }
- /* Now handled by the cancelListener
- else if (buttonId == CANCEL_ID)
- {
- if (processCancel())
- super.buttonPressed(buttonId);
- }*/
- else if (buttonId == BROWSE_ID)
- {
- processBrowse();
- }
- else if (buttonId == TEST_ID)
- {
- processTest();
- }
- else if (buttonId == ADD_ID)
- {
- processAdd();
- }
- else if (buttonId == DETAILS_ID)
- {
- if (processDetails(detailsButtonHideMode))
- {
- detailsButtonHideMode = !detailsButtonHideMode;
- detailsButton.setText(detailsButtonHideMode ? detailsShowLabel : detailsHideLabel);
- if (detailsButtonHideMode && (tipDetailsShow != null))
- detailsButton.setToolTipText(tipDetailsShow);
- else if (!detailsButtonHideMode && (tipDetailsHide != null))
- detailsButton.setToolTipText(tipDetailsHide);
- }
- }
- else if (buttonId == CANCEL_ALL_ID) {
-
- if (processCancelAll()) {
- cancelAllPressed = true;
- close();
- }
- }
- }
-
- /**
- * Intercept of parent, so we can create the msg line above the button bar.
- */
- protected Control createButtonBar(Composite parent)
- {
- createMessageLine(parent);
- return super.createButtonBar(parent);
- }
-
- /**
- * Adjust the width hint of a button to account for the presumed addition of a mnemonic.
- * @param button the button whose width is to be adjusted.
- */
- protected void adjustButtonWidth(Button button) {
- String text = button.getText();
- // adjust the width hint to allow for a mnemonic to be added.
- if (text != null) {
- if (text.indexOf('&') < 0) {
- Object layoutData = button.getLayoutData();
- if (layoutData instanceof GridData) {
- GridData gd = (GridData) layoutData;
- if (gd.widthHint != SWT.DEFAULT) {
- gd.widthHint += convertWidthInCharsToPixels(3);
- }
- }
- }
- }
- }
-
- /**
- * Add buttons to the dialog's button bar.
- *
- * Subclasses may override.
- *
- * @param parent the button bar composite
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- //System.out.println("Inside createButtonsForButtonBar");
- //System.out.println("Vertical spacing="+((GridLayout)parent.getLayout()).verticalSpacing);
- //System.out.println("Margin height="+((GridLayout)parent.getLayout()).marginHeight);
- ((GridLayout)parent.getLayout()).verticalSpacing = verticalSpacing;
- //((GridLayout)parent.getLayout()).horizontalSpacing = horizontalSpacing;
- ((GridLayout)parent.getLayout()).marginWidth = marginWidth;
- ((GridLayout)parent.getLayout()).marginHeight = marginHeight;
- //System.out.println("INSIDE CREATEBUTTONSFORBUTTONBAR");
-
- // create requested buttons...
-
- if (showOkButton)
- {
- String okLabel = (labelOk!=null)?labelOk: IDialogConstants.OK_LABEL;
- okButton = createButton(parent, IDialogConstants.OK_ID, okLabel, true);
- okButton.setEnabled(initialOKButtonEnabledState);
- if (tipOk != null)
- okButton.setToolTipText(tipOk);
- }
- if (showBrowseButton)
- {
- String browseLabel = (labelBrowse!=null)?labelBrowse: SystemResources.BUTTON_BROWSE;
- browseButton = createButton(parent, BROWSE_ID, browseLabel, false);
- if (tipBrowse != null)
- browseButton.setToolTipText(tipBrowse);
- }
- if (showTestButton)
- {
- String testLabel = (labelTest!=null)?labelTest: SystemResources.BUTTON_TEST;
- testButton = createButton(parent, TEST_ID, testLabel, false);
- if (tipTest != null)
- testButton.setToolTipText(tipTest);
- }
- if (showAddButton)
- {
- String addLabel = (labelAdd!=null)?labelAdd: SystemResources.BUTTON_ADD;
- addButton = createButton(parent, ADD_ID, addLabel, !showOkButton);
- if (tipAdd != null)
- addButton.setToolTipText(tipAdd);
- addButton.setEnabled(initialAddButtonEnabledState);
- }
- if (showDetailsButton)
- {
- detailsShowLabel = Mnemonics.removeMnemonic((labelDetailsShow!=null)?labelDetailsShow: IDialogConstants.SHOW_DETAILS_LABEL);
- detailsHideLabel = Mnemonics.removeMnemonic((labelDetailsHide!=null)?labelDetailsHide: IDialogConstants.HIDE_DETAILS_LABEL);
- String detailsLabel = detailsButtonHideMode ? detailsShowLabel : detailsHideLabel;
- detailsButton = createButton(parent, DETAILS_ID, detailsLabel, false);
- adjustButtonWidth(detailsButton);
- if (detailsButtonHideMode && (tipDetailsShow != null))
- detailsButton.setToolTipText(tipDetailsShow);
- else if (!detailsButtonHideMode && (tipDetailsHide != null))
- detailsButton.setToolTipText(tipDetailsHide);
- detailsButton.setEnabled(initialDetailsButtonEnabledState);
- }
-
- String cancelLabel = (labelCancel!=null)?labelCancel: IDialogConstants.CANCEL_LABEL;
- cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, cancelLabel, false);
- if (tipCancel != null)
- cancelButton.setToolTipText(tipCancel);
- cancelListener= new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (activeRunningOperations <= 0)
- {
- if (processCancel())
- doCancel();
- }
- else
- cancelButton.setEnabled(false);
- }
- };
- cancelButton.addSelectionListener(cancelListener);
-
- if (showCancelAllButton) {
- String cancelAllLabel = (labelCancelAll != null) ? labelCancelAll: SystemResources.BUTTON_CANCEL_ALL;
- cancelAllButton = createButton(parent, CANCEL_ALL_ID, cancelAllLabel, false);
-
- if (tipCancelAll != null) {
- cancelAllButton.setToolTipText(tipCancelAll);
- }
- }
-
- buttonsComposite = parent;
- if (helpId != null)
- SystemWidgetHelpers.setHelp(buttonsComposite, helpId);
- //SystemWidgetHelpers.setCompositeHelp(buttonsComposite, helpId);
- }
-
- private void doCancel()
- {
- super.buttonPressed(CANCEL_ID);
- }
-
- /**
- * Set minimum width and height for this dialog.
- * Pass zero for either to not affect it.
- */
- public void setMinimumSize(int width, int height)
- {
- minWidth = width;
- minHeight = height;
- }
- /**
- * Override of parent.
- */
- protected Control createContents(Composite parent)
- {
- //System.out.println("INSIDE SYSTEMPROMPTDIALOG#CREATECONTENTS");
-
- Control c = super.createContents(parent);
-
- this.parentComposite = (Composite)c;
- if (helpId != null)
- SystemWidgetHelpers.setHelp(parentComposite, helpId);
- //SystemWidgetHelpers.setCompositeHelp(parentComposite, helpId, helpIdPerControl);
-
- // OK, parent method created dialog area and button bar.
- // Time now to do our thing...
-
- // Insert a progress monitor if requested
- if (needsProgressMonitor)
- {
-
- boolean showSeparators = false;
- // Build the first separator line
- Label separator = null;
- if (showSeparators)
- {
- separator= new Label(parentComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
- GridLayout pmlayout= new GridLayout();
- pmlayout.numColumns= 1;
-
- progressMonitorPart= new ProgressMonitorPart(parentComposite, pmlayout, SWT.DEFAULT);
- progressMonitorPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- progressMonitorPart.setVisible(false);
-
- // Build the second separator line
- if (showSeparators)
- {
- separator= new Label(parentComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
- if (RSEUIPlugin.isTheSystemRegistryActive())
- {
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(getShell(),this);
- // add a dispose listener for the shell
- getShell().addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent e)
- {
- //System.out.println("Inside dispose for SystemPromptDialog");
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- }
- });
- }
- }
-
- //createMessageLine((Composite)c); now done before buttons are created. d54501
-
- Control initialFocusControl = getInitialFocusControl();
- if (initialFocusControl != null)
- initialFocusControl.setFocus();
-
- //buttonsComposite = buttons; // remember the buttons part of the dialog so we can add mnemonics
- /*
- * OK now is a good time to add the mnemonics!
- * This is because both the contents and buttons have been created.
- */
- dialogMnemonics = SystemWidgetHelpers.setMnemonics((Composite)getButtonBar());
- applyMnemonics(dialogMnemonics, (Composite)getDialogArea());
-
- /*
- * OK, now that mnemonics for the buttons are set, query the mnemonic for the details button and its
- * two states... defect 42904
- */
- if (showDetailsButton)
- {
- if (detailsButtonHideMode)
- {
- detailsShowLabel = detailsButton.getText();
- char m = Mnemonics.getMnemonic(detailsShowLabel);
- detailsHideLabel = Mnemonics.applyMnemonic(detailsHideLabel, m);
- }
- else
- {
- detailsHideLabel = detailsButton.getText();
- char m = Mnemonics.getMnemonic(detailsHideLabel);
- detailsShowLabel = Mnemonics.applyMnemonic(detailsShowLabel, m);
- }
- }
- if (labelCancel != null)
- labelCancel = cancelButton.getText(); // reset to include the mnemonic, in case we need to restore it
-
- if (pack)
- {
- Shell shell = getShell();
- shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
- }
- // return composite created by call to parent's method
- return c;
- }
-
- /**
- * Apply mnemonic to the composite.
- * @param c the composite.
- */
- protected void applyMnemonics(Mnemonics mnemonics, Composite c) {
- SystemWidgetHelpers.setMnemonics(mnemonics, c);
- }
-
- /**
- * Called by parent.
- * Create overall dialog page layout.
- */
- protected Control createDialogArea(Composite parent)
- {
- //System.out.println("INSIDE CREATEDIALOGAREA");
- Composite c = new Composite(parent, SWT.NONE);
- this.dialogAreaComposite = c;
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight= marginWidth;
- layout.marginWidth = marginHeight;
- layout.verticalSpacing = verticalSpacing;
- layout.horizontalSpacing= horizontalSpacing;
- c.setLayout(layout);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Control inner = createInner(c); // allows for child classes to override.
-
- // if user wants the option to not show the dialog again
- if (noShowAgainOption) {
- noShowAgainButton = createNoShowAgainButton(c);
- }
-
- /*
- * And now is the time to auto-size if so requested...
- */
- if (minWidth > 0)
- {
- boolean newData = false;
- GridData data = (GridData)inner.getLayoutData();
- if (data == null)
- {
- newData = true;
- data = new GridData();
- }
- data.widthHint = minWidth;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- if (newData)
- inner.setLayoutData(data);
- }
- if (minHeight > 0)
- {
- boolean newData = false;
- GridData data = (GridData)inner.getLayoutData();
- if (data == null)
- {
- newData = true;
- data = new GridData();
- }
- data.heightHint = minHeight;
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = GridData.FILL;
- if (newData)
- inner.setLayoutData(data);
- }
- //this.parent = c;
- //contentsComposite = c; // remember the contents part of the dialog so we can add mnemonics
- return c;
- }
-
- /**
- * Set option to not show this dialog again and specify the preference that should be set
- * according to whether the user selects to show the dialog again or no. The caller can
- * query this preference to find out what the user selection is.
- * @param noShowAgainOption <code>true</code> to show the option in the dialog, <code>false</code> to not show it.
- * @param prefStore the preference store.
- * @param prefId the preference id for which a boolean value will be stored according to the user's selection.
- * @param prefValAsSelected whether to mirror the user selection in the preference. If this is set to
- * <code>true</code>, then the value stored in the preference is <code>true</code> if the user selects the option,
- * and <code>false</code> if the user does not select the option. If this is set to <code>false</code>, then the
- * value stored in the preference will be <code>false</code> if the user selects the option, and <code>true</code>
- * if the user does not select the option
- */
- public void setNoShowAgainOption(boolean noShowAgainOption, IPreferenceStore prefStore, String prefId, boolean prefValAsSelected) {
- this.noShowAgainOption = noShowAgainOption;
- this.prefStore = prefStore;
- this.prefId = prefId;
- this.prefValAsSelected = prefValAsSelected;
- }
-
- /**
- * Creates a button to allow option to not show this dialog again.
- * @return the button that allows option to not show this dialog again.
- */
- protected Button createNoShowAgainButton(Composite c) {
- Button b = new Button(c, SWT.CHECK);
- b.setText(SystemResources.RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL);
- b.setToolTipText(SystemResources.RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP);
- b.addListener(SWT.Selection, this);
- return b;
- }
-
- /**
- * Call this to disable the Apply button if the input is not complete or not valid.
- */
- public void setPageComplete(boolean complete)
- {
- if (okButton != null)
- okButton.setEnabled(complete);
- else
- initialOKButtonEnabledState = complete;
- }
-
- // -----------------
- // HELPER METHODS...
- // -----------------
- /**
- * Add a separator line. This is a physically visible line.
- */
- protected Label addSeparatorLine(Composite parent, int nbrColumns)
- {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- separator.setLayoutData(data);
- return separator;
- }
- /**
- * Add a spacer line
- */
- protected Label addFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- filler.setLayoutData(data);
- return filler;
- }
- /**
- * Add a spacer line that grows in height to absorb extra space
- */
- protected Label addGrowableFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- filler.setLayoutData(data);
- return filler;
- }
-
- /**
- * Expose inherited protected method convertWidthInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertWidthInCharsToPixels(int chars)
- {
- return convertWidthInCharsToPixels(chars);
- }
- /**
- * Expose inherited protected method convertHeightInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertHeightInCharsToPixels(int chars)
- {
- return convertHeightInCharsToPixels(chars);
- }
-
- // -----------------------------
- // ISystemMessageLine METHODS...
- // -----------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- if (fMessageLine != null)
- fMessageLine.clearErrorMessage();
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- if (fMessageLine != null)
- fMessageLine.clearMessage();
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- if (fMessageLine != null)
- return fMessageLine.getErrorMessage();
- else
- return null;
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- if (fMessageLine != null)
- return fMessageLine.getSystemErrorMessage();
- else
- return null;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- if (fMessageLine != null)
- return fMessageLine.getMessage();
- else
- return null;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- if (fMessageLine != null)
- fMessageLine.setErrorMessage(message);
- else
- SystemMessageDialog.displayErrorMessage(getShell(),message);
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- if (fMessageLine != null)
- {
- if (message != null)
- fMessageLine.setErrorMessage(message);
- else
- fMessageLine.clearErrorMessage();
- }
- else //if (message != null)
- {
- //(new SystemMessageDialog(getShell(),message)).open();
- pendingErrorMessage = message;
- }
- }
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- if (fMessageLine != null)
- {
- if (message != null)
- fMessageLine.setMessage(message);
- else
- fMessageLine.clearMessage();
- }
- }
-
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- if (fMessageLine != null)
- fMessageLine.setMessage(message);
- else if (message != null)
- //(new SystemMessageDialog(getShell(),message)).open();
- pendingMessage = message;
- }
-
-
- /**
- * Convenience method to set an error message from an exception
- */
- public void setErrorMessage(Throwable exc)
- {
- if (fMessageLine != null)
- fMessageLine.setErrorMessage(exc);
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED);
- msg.makeSubstitution(exc);
- (new SystemMessageDialog(getShell(),msg)).open();
- }
- }
-
- // -------------------------------------------------------------------------------
- // IDialogPage interface methods, which we only implement to enable dialog help...
- // -------------------------------------------------------------------------------
- public void setDescription(String description) {}
- public String getDescription() {return null;}
- public Image getImage() {return titleImage;}
- public void performHelp() {}
- public void setVisible(boolean visible) {}
- public void dispose() {}
- public Control getControl() {return parentComposite;}
- public void setControl(Control c) {}
- public void createControl(Composite parent) {}
- public void setImageDescriptor(ImageDescriptor id) {}
- /**
- * Get the dialog's title
- */
- public String getTitle()
- {
- return title;
- }
- /**
- * Set the dialog's title
- */
- public void setTitle(String title)
- {
- this.title = title;
- if (overallShell != null)
- overallShell.setText(title);
- }
-
-
- // --------------------------------------------
- // Methods to support a progress monitor...
- // using WizardDialog as an example.
- // --------------------------------------------
-
- /**
- * Returns the progress monitor for this dialog (if it has one).
- *
- * @return the progress monitor, or <code>null</code> if
- * this dialog does not have one
- */
- public IProgressMonitor getProgressMonitor()
- {
- return progressMonitorPart;
- }
-
- /**
- * About to start a long running operation tiggered through
- * the dialog. Shows the progress monitor and disables the dialog's
- * buttons and controls.
- *
- * @param enableCancelButton <code>true</code> if the Cancel button should
- * be enabled, and <code>false</code> if it should be disabled
- * @return the saved UI state
- */
- protected Object aboutToStart(boolean enableCancelButton)
- {
- Map savedState = null;
- operationCancelableState = enableCancelButton;
- if ((getShell() != null) && (activeRunningOperations <= 0))
- {
- // Save focus control
- Control focusControl = getShell().getDisplay().getFocusControl();
- if (focusControl != null && focusControl.getShell() != getShell())
- focusControl = null;
- cancelButton.removeSelectionListener(cancelListener);
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(waitCursor);
-
- // Set the arrow cursor to the cancel component.
- arrowCursor= new Cursor(d, SWT.CURSOR_ARROW);
- cancelButton.setCursor(arrowCursor);
-
- // Set the cancel button label to "Cancel" if it isn't already
- if (labelCancel != null)
- cancelButton.setText("&" + IDialogConstants.CANCEL_LABEL);
-
- // Deactivate shell
- savedState = saveUIState(needsProgressMonitor && enableCancelButton);
- if (focusControl != null)
- savedState.put(FOCUS_CONTROL, focusControl);
-
- // Attach the progress monitor part to the cancel button
- if (needsProgressMonitor)
- {
- progressMonitorPart.attachToCancelComponent(cancelButton);
- progressMonitorPart.setVisible(true);
- }
- }
- return savedState;
- }
-
- /**
- * Creates and returns a new wizard closing dialog without opening it.
- */
- protected MessageDialog createWizardClosingDialog()
- {
- MessageDialog result= new MessageDialog(getShell(),
- JFaceResources.getString("WizardClosingDialog.title"),//$NON-NLS-1$
- null,
- JFaceResources.getString("WizardClosingDialog.message"),//$NON-NLS-1$
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL}, 0 );
- return result;
- }
-
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- public boolean close()
- {
- if (okToClose())
- return hardClose();
- else
- return false;
- }
- /**
- * Checks whether it is alright to close this wizard dialog
- * and perform standard cancel processing. If there is a
- * long running operation in progress, this method posts an
- * alert message saying that the wizard cannot be closed.
- *
- * @return <code>true</code> if it is alright to close this dialog, and
- * <code>false</code> if it is not
- */
- protected boolean okToClose()
- {
- if (activeRunningOperations > 0)
- {
- synchronized (this)
- {
- windowClosingDialog = createWizardClosingDialog();
- }
- windowClosingDialog.open();
- synchronized (this)
- {
- windowClosingDialog = null;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Closes this window. Really closes it. Calls super.close()
- *
- * @return <code>true</code> if the window is (or was already) closed,
- * and <code>false</code> if it is still open
- */
- protected boolean hardClose()
- {
- return super.close();
- }
-
- /**
- * Restores the enabled/disabled state of the given control.
- *
- * @param w the control
- * @param h the map (key type: <code>String</code>, element type:
- * <code>Boolean</code>)
- * @param key the key
- * @see #saveEnableStateAndSet
- */
- protected void restoreEnableState(Control w, Map h, String key)
- {
- if (w != null) {
- Boolean b = (Boolean) h.get(key);
- if (b != null)
- w.setEnabled(b.booleanValue());
- }
- }
- /**
- * Restores the enabled/disabled state of the wizard dialog's
- * buttons and the tree of controls for the currently showing page.
- *
- * @param state a map containing the saved state as returned by
- * <code>saveUIState</code>
- * @see #saveUIState
- */
- protected void restoreUIState(Map state)
- {
- //protected Button okButton, cancelButton, testButton, browseButton, addButton, detailsButton;
- restoreEnableState(okButton, state, "ok");
- restoreEnableState(testButton, state, "test");
- restoreEnableState(browseButton, state, "browse");
- restoreEnableState(cancelButton, state, "cancel");
- restoreEnableState(addButton, state, "add");
- restoreEnableState(detailsButton,state, "details");
- SystemControlEnableState pageState = (SystemControlEnableState) state.get("page");//$NON-NLS-1$
- pageState.restore();
- }
-
- /**
- * Captures and returns the enabled/disabled state of the wizard dialog's
- * buttons and the tree of controls for the currently showing page. All
- * these controls are disabled in the process, with the possible excepton of
- * the Cancel button.
- *
- * @param keepCancelEnabled <code>true</code> if the Cancel button should
- * remain enabled, and <code>false</code> if it should be disabled
- * @return a map containing the saved state suitable for restoring later
- * with <code>restoreUIState</code>
- * @see #restoreUIState
- */
- protected Map saveUIState(boolean keepCancelEnabled)
- {
- Map savedState= new HashMap(10);
- saveEnableStateAndSet(okButton, savedState, "ok", false);
- saveEnableStateAndSet(testButton, savedState, "test", false);
- saveEnableStateAndSet(browseButton, savedState, "browse", false);
- saveEnableStateAndSet(cancelButton, savedState, "cancel", keepCancelEnabled);
- saveEnableStateAndSet(addButton, savedState, "add", false);
- saveEnableStateAndSet(detailsButton,savedState, "details",false);
- //savedState.put("page", ControlEnableState.disable(getControl()));
- savedState.put("page", SystemControlEnableState.disable(dialogAreaComposite));
- return savedState;
- }
-
- /**
- * Saves the enabled/disabled state of the given control in the
- * given map, which must be modifiable.
- *
- * @param w the control, or <code>null</code> if none
- * @param h the map (key type: <code>String</code>, element type:
- * <code>Boolean</code>)
- * @param key the key
- * @param enabled <code>true</code> to enable the control,
- * and <code>false</code> to disable it
- * @see #restoreEnableState(Control,Map,String)
- */
- protected void saveEnableStateAndSet(Control w, Map h, String key, boolean enabled)
- {
- if (w != null) {
- h.put(key, new Boolean(w.isEnabled()));
- w.setEnabled(enabled);
- }
- }
-
- /**
- * Sets the given cursor for all shells currently active
- * for this window's display.
- *
- * @param c the cursor
- */
- protected void setDisplayCursor(Cursor c)
- {
- setDisplayCursor(getShell(), c);
- }
- /**
- * Sets the given cursor for all shells currently active for the given shell's display.
- *
- * @param c the cursor
- */
- public static void setDisplayCursor(Shell shell, Cursor c)
- {
- if (c == null)
- {
- // attempt to fix problem that the busy cursor sometimes stays. Phil
- // DKM - commenting this out since the attempt to fix problem didn't work
- // and it causes accessibility problems when expanding a system via keyboard
- // shell.forceActive();
- // shell.forceFocus();
- }
- if (shell != null && shell.getDisplay() != null)
- {
- Shell[] shells = shell.getDisplay().getShells();
- for (int i = 0; i < shells.length; i++)
- {
- shells[i].setCursor(c);
- }
- }
- }
-
-
- /**
- * For IRunnableContext.
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
- throws InvocationTargetException, InterruptedException
- {
- // The operation can only be canceled if it is executed in a separate thread.
- // Otherwise the UI is blocked anyway.
- Object state = aboutToStart(fork && cancelable);
- activeRunningOperations++;
- if (activeRunningOperations > 1)
- {
- //System.out.println("Nested operation!");
- //(new Exception()).fillInStackTrace().printStackTrace();
- }
- try {
- ModalContext.run(runnable, fork, getProgressMonitor(), getShell().getDisplay());
- } finally {
- activeRunningOperations--;
- stopped(state);
- }
- }
- /**
- * A long running operation triggered through the wizard
- * was stopped either by user input or by normal end.
- * Hides the progress monitor and restores the enable state
- * wizard's buttons and controls.
- *
- * @param savedState the saved UI state as returned by <code>aboutToStart</code>
- * @see #aboutToStart
- */
- private void stopped(Object savedState)
- {
- if ((getShell() != null) && (activeRunningOperations <= 0))
- {
- if (needsProgressMonitor)
- {
- progressMonitorPart.setVisible(false);
- progressMonitorPart.removeFromCancelComponent(cancelButton);
- }
- Map state = (Map)savedState;
- restoreUIState(state);
- cancelButton.addSelectionListener(cancelListener);
- setDisplayCursor(null);
- cancelButton.setCursor(null);
- if (labelCancel != null)
- cancelButton.setText(labelCancel);
- waitCursor.dispose();
- waitCursor = null;
- arrowCursor.dispose();
- arrowCursor = null;
- Control focusControl = (Control)state.get(FOCUS_CONTROL);
- if (focusControl != null)
- focusControl.setFocus();
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java
deleted file mode 100644
index 8fda6dee2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
-import org.eclipse.rse.ui.view.SystemActionViewerFilter;
-import org.eclipse.rse.ui.view.SystemResourceSelectionForm;
-import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
-{
- private SystemResourceSelectionForm _form;
- private SystemResourceSelectionInputProvider _inputProvider;
- private Object _preSelection;
- private IValidatorRemoteSelection _selectionValidator;
- private boolean _multipleSelectionMode;
- private boolean _showPropertySheet = false;
- //private IHost _outputConnection;
- private SystemActionViewerFilter _customViewerFilter;
- private String _message, _tip;
-
-
- public SystemRemoteResourceDialog(Shell shell, String title, SystemResourceSelectionInputProvider inputProvider)
- {
- super(shell, title);
- _inputProvider = inputProvider;
- }
-
- protected Control createInner(Composite parent)
- {
- _form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbage(), _multipleSelectionMode, getMessageLine());
- initForm();
- createMessageLine(parent);
- return _form.getInitialFocusControl();
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- ISystemMessageLine msgLine = super.createMessageLine(c);
- _form.setMessageLine(msgLine);
- return fMessageLine;
- }
-
- public void initForm()
- {
- _form.setPreSelection(_preSelection);
- if (_customViewerFilter != null)
- {
- _form.applyViewerFilter(_customViewerFilter);
- }
- else
- {
- _form.applyViewerFilter(getViewerFilter());
- }
- _form.setSelectionValidator(_selectionValidator);
- _form.setShowPropertySheet(_showPropertySheet);
- _form.setSelectionTreeToolTipText(getTreeTip());
- if (_message != null)
- _form.setMessage(_message);
- if (_tip != null)
- _form.setSelectionTreeToolTipText(_tip);
- }
-
- public void setDefaultSystemConnection(IHost connection, boolean onlyConnection)
- {
- _inputProvider.setSystemConnection(connection, onlyConnection);
- }
-
- public void setSystemTypes(String[] types)
- {
- _inputProvider.setSystemTypes(types);
- }
-
- protected Control getInitialFocusControl()
- {
- return _form.getInitialFocusControl();
- }
-
- public void setPreSelection(Object selection)
- {
- _preSelection = selection;
- if (_form != null)
- {
- _form.setPreSelection(selection);
- }
- }
-
- public void setSelectionValidator(IValidatorRemoteSelection validator)
- {
- _selectionValidator = validator;
- }
-
- public void setCustomViewerFilter(SystemActionViewerFilter viewerFilter)
- {
- _customViewerFilter = viewerFilter;
- }
-
- /**
- * Set multiple selection mode. Default is single selection mode
- * <p>
- * If you turn on multiple selection mode, you must use the getSelectedObjects()
- * method to retrieve the list of selected objects.
- * <p>
- * Further, if you turn this on, it has the side effect of allowing the user
- * to select any remote object. The assumption being if you are prompting for
- * files, you also want to allow the user to select a folder, with the meaning
- * being that all files within the folder are implicitly selected.
- *
- * @see #getSelectedObjects()
- */
- public void setMultipleSelectionMode(boolean multiple)
- {
- _multipleSelectionMode = multiple;
-
- }
-
- /**
- * Set the message shown at the top of the form
- */
- public void setMessage(String message)
- {
- _message = message;
- if (_form != null)
- {
- _form.setMessage(message);
- }
- }
- /**
- * Set the tooltip text for the remote systems tree from which an item is selected.
- */
- public void setSelectionTreeToolTipText(String tip)
- {
- _tip = tip;
- if (_tip != null)
- {
- _form.setSelectionTreeToolTipText(tip);
- }
- }
-
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload always shows the property sheet
- * <p>
- * Default is false
- */
- public void setShowPropertySheet(boolean show)
- {
- _showPropertySheet = show;
- }
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload shows a Details>>> button so the user can decide if they want to see the
- * property sheet.
- * <p>
- * @param show True if show the property sheet within the dialog
- * @param initialState True if the property is to be initially displayed, false if it is not
- * to be displayed until the user presses the Details button.
- */
- public void setShowPropertySheet(boolean show, boolean initialState)
- {
- if (show)
- {
- _showPropertySheet = initialState;
- setShowDetailsButton(true, !initialState);
- }
- }
-
- /**
- * Return selected file or folder
- */
- public Object getSelectedObject()
- {
- if (getOutputObject() instanceof Object[])
- return ((Object[])getOutputObject())[0];
- else
- return getOutputObject();
- }
- /**
- * Return all selected objects. This method will return an array of one
- * unless you have called setMultipleSelectionMode(true)!
- * @see #setMultipleSelectionMode(boolean)
- */
- public Object[] getSelectedObjects()
- {
- if (getOutputObject() instanceof Object[])
- return (Object[])getOutputObject();
- else if (getOutputObject() != null)
- return new Object[] {getOutputObject()};
- else
- return null;
- }
-
- public IHost getSelectedConnection()
- {
- return _form.getSelectedConnection();
- }
-
- /**
- * Private method.
- * <p>
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- boolean closeDialog = _form.verify();
- if (closeDialog)
- {
- //_outputConnection = _form.getSelectedConnection();
- if (_multipleSelectionMode)
- setOutputObject(_form.getSelectedObjects());
- else
- setOutputObject(_form.getSelectedObject());
- }
- else
- setOutputObject(null);
- return closeDialog;
- }
- /**
- * Private method.
- * <p>
- * Called when user presses DETAILS button.
- * <p>
- * Note the text is automatically toggled for us! We need only
- * do whatever the functionality is that we desire
- *
- * @param hideMode the current state of the details toggle, prior to this request. If we return true from
- * this method, this state and the button text will be toggled.
- *
- * @return true if the details state toggle was successful, false if it failed.
- */
- protected boolean processDetails(boolean hideMode)
- {
- _form.toggleShowPropertySheet(getShell(), getContents());
- return true;
- }
-
- public abstract SystemActionViewerFilter getViewerFilter();
- public abstract String getVerbage();
- public abstract String getTreeTip();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameDialog.java
deleted file mode 100644
index 3706bc846..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameDialog.java
+++ /dev/null
@@ -1,688 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
-import org.eclipse.rse.ui.validators.ValidatorConnectionName;
-import org.eclipse.rse.ui.validators.ValidatorUniqueString;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Dialog for renaming multiple resources.
- * <p>
- * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.ui.actions.SystemCommonRenameAction}
- * action.
- * <p>
- * To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed.
- * If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
- * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking.
- * <p>
- * If the input objects do not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you
- * should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
- * specify a validator that is called to verify the typed new name is valid. Further, to show the type value
- * of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
- * <p>
- * This dialog does not do the actual renames. Rather, it will return an array of the user-typed new names. These
- * are queriable via {@link #getNewNames()}, after testing that {@link #wasCancelled()} is false. The array entries
- * will match the input order.
- *
- * @see org.eclipse.rse.ui.actions.SystemCommonRenameAction
- */
-public class SystemRenameDialog extends SystemPromptDialog
- implements ISystemPropertyConstants,
- ISelectionChangedListener,
- TraverseListener,
- ICellEditorListener, Runnable, FocusListener
-{
-
- private SystemMessage errorMessage;
- private TextCellEditor cellEditor;
- private int currRow = 0;
- private GridData tableData = null;
- private boolean ignoreSelection = false;
- private Hashtable uniqueNameValidatorPerParent = new Hashtable();
-
- private String verbage;
-
- private SystemRenameTableProvider srtp;
- private Table table;
- private TableViewer tableViewer;
- private static final int COLUMN_NEWNAME = SystemRenameTableProvider.COLUMN_NEWNAME;
- private String columnHeaders[] = {
- "",SystemResources.RESID_RENAME_COLHDG_OLDNAME, //$NON-NLS-1$
- SystemResources.RESID_RENAME_COLHDG_NEWNAME,
- SystemResources.RESID_RENAME_COLHDG_TYPE
- };
- private ColumnLayoutData columnLayouts[] =
- {
- new ColumnPixelData(19, false),
- new ColumnWeightData(125,125,true),
- new ColumnWeightData(150,150,true),
- new ColumnWeightData(120,120,true)
- };
- // give each column a property value to identify it
- private static String[] tableColumnProperties =
- {
- ISystemPropertyConstants.P_ERROR,
- IBasicPropertyConstants.P_TEXT,
- ISystemPropertyConstants.P_NEWNAME,
- ISystemPropertyConstants.P_TYPE,
- };
- // inner class to support cell editing
- private ICellModifier cellModifier = new ICellModifier()
- {
- public Object getValue(Object element, String property)
- {
- SystemRenameTableRow row = (SystemRenameTableRow)element;
- String value = ""; //$NON-NLS-1$
- if (property.equals(P_TEXT))
- value = row.getName();
- else
- value = row.getNewName();
- //System.out.println("inside getvalue: " + row + "; " + property + " = " + value);
- return value;
- }
-
- public boolean canModify(Object element, String property)
- {
- boolean modifiable = property.equals(P_NEWNAME);
- if ((cellEditor != null) && (cellEditor.getControl() != null))
- {
- SystemRenameTableRow row = (SystemRenameTableRow)element;
- int limit = row.getNameLengthLimit();
- if (limit == -1)
- limit = 1000;
- ((Text)cellEditor.getControl()).setTextLimit(limit);
- }
- return modifiable;
- }
- /**
- * Modifies a marker as a result of a successfully completed direct editing.
- */
- public void modify(Object element, String property, Object value)
- {
- SystemRenameTableRow row = (SystemRenameTableRow)(((TableItem)element).getData());
- //System.out.println("inside modify: " + row+"; "+property+", "+value);
- if (property.equals(P_NEWNAME))
- {
- row.setNewName((String)value);
- tableViewer.update(row, null);
- }
- }
- };
-
-
- /**
- * Constructor for SystemRenameDialog
- */
- public SystemRenameDialog(Shell shell)
- {
- this(shell, SystemResources.RESID_RENAME_TITLE);
- }
- /**
- * Constructor when you have your own title
- */
- public SystemRenameDialog(Shell shell, String title)
- {
- super(shell, title);
-
- //pack();
- setHelp(RSEUIPlugin.HELPPREFIX+"drnm0000"); //$NON-NLS-1$
- }
- /**
- * Set the verbage to show above the table. The default is "Enter new name for each resource"
- */
- public void setVerbage(String verbage)
- {
- this.verbage = verbage;
- }
- /**
- * Set the validator for the new name,as supplied by the adaptor for name checking.
- * Overrides the default which is to query it from the object's adapter.
- */
- public void setNameValidator(ISystemValidator nameValidator)
- {
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- ISystemMessageLine msgLine = super.createMessageLine(c);
- return fMessageLine;
- }
-
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- SystemRenameTableRow[] rows = getRows();
- tableViewer.setSelection(new StructuredSelection(rows[0]),true);
- tableViewer.editElement(rows[0], COLUMN_NEWNAME);
- return null;
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 1;
- Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- if (verbage != null)
- SystemWidgetHelpers.createVerbiage(composite, verbage, nbrColumns, false, 200);
- else
- SystemWidgetHelpers.createVerbiage(composite, SystemResources.RESID_RENAME_VERBAGE, nbrColumns, false, 200);
-
- table = createTable(composite);
- tableViewer = new TableViewer(table);
- createColumns();
- tableViewer.setColumnProperties(tableColumnProperties);
- tableViewer.setCellModifier(cellModifier);
- CellEditor editors[] = new CellEditor[columnHeaders.length];
- cellEditor = new TextCellEditor(table);
- cellEditor.addListener(this);
- editors[COLUMN_NEWNAME] = cellEditor;
- tableViewer.setCellEditors(editors);
- cellEditor.getControl().addTraverseListener(this);
- //System.out.println("CELL EDITOR CONTROL: " + cellEditor.getControl());
-
- srtp = new SystemRenameTableProvider();
- int width = tableData.widthHint;
- int nbrRows = Math.min(getRows().length,8);
- int rowHeight = table.getItemHeight() + table.getGridLineWidth();
- int sbHeight = table.getHorizontalBar().getSize().y;
- int height = (nbrRows * rowHeight) + sbHeight;
- //System.out.println("#rows = "+nbrRows+", sbHeight = " + sbHeight+", totalHeight="+height);
- tableData.heightHint = height;
- table.setLayoutData(tableData);
- table.setSize(width, height);
- tableViewer.setLabelProvider(srtp);
- tableViewer.setContentProvider(srtp);
- //System.out.println("Input Object: "+getInputObject());
- tableViewer.setInput(getInputObject());
-
- tableViewer.addSelectionChangedListener(this);
- tableViewer.getTable().addFocusListener(this);
-
- // test if we need a unique name validator
- Shell shell = getShell();
- Display display = shell.getDisplay();
- if (display != null)
- display.asyncExec(this);
- else
- run();
-
- return composite;
- }
-
-
- private Table createTable(Composite parent)
- {
- //table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER);
- table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- table.setLinesVisible(true);
- tableData = new GridData();
- tableData.horizontalAlignment = GridData.FILL;
- tableData.grabExcessHorizontalSpace = true;
- tableData.widthHint = 450;
- tableData.heightHint= 30;
- tableData.verticalAlignment = GridData.CENTER;
- tableData.grabExcessVerticalSpace = true;
- table.setLayoutData(tableData);
-
- //table.addTraverseListener(this);
- //getShell().addTraverseListener(this);
-
-
- return table;
- }
- private void createColumns()
- {
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
- table.setHeaderVisible(true);
- for (int i = 0; i < columnHeaders.length; i++)
- {
- layout.addColumnData(columnLayouts[i]);
- TableColumn tc = new TableColumn(table, SWT.NONE,i);
- tc.setResizable(columnLayouts[i].resizable);
- tc.setText(columnHeaders[i]);
- //tc.addSelectionListener(headerListener);
- }
- }
- public void selectionChanged(SelectionChangedEvent event)
- {
- //System.out.println("Selection changed. ignoreSelection? "+ignoreSelection);
- if (ignoreSelection)
- return;
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- if (selection.isEmpty())
- {
- currRow = -1;
- return;
- }
- SystemRenameTableRow selectedRow = (SystemRenameTableRow)selection.getFirstElement();
- int rowIdx = srtp.getRowNumber(selectedRow);
- if (rowIdx == currRow)
- return;
- currRow = rowIdx;
- tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME);
- }
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- //System.out.println("INSIDE SETINPUTOBJECT: " + inputObject);
- super.setInputObject(inputObject);
- }
-
- /**
- * Called when user presses OK button.
- * This does not do the actual renames, but rather updates the new name array.
- * You need to query this via {@link #getNewNames()}, after ensuring the dialog was not
- * cancelled by calling {@link #wasCancelled()}.
- */
- protected boolean processOK()
- {
- // the following is for defect 41565 where the changed name is not used when enter pressed after typing
- if ((currRow >=0) && (currRow <= (getRows().length - 1)))
- {
- String newName = ((Text)cellEditor.getControl()).getText();
- //System.out.println("Testing. newName = "+newName);
- getRows()[currRow].setNewName(newName);
- }
- //else
- // System.out.println("currRow = "+currRow);
-
- boolean closeDialog = verify();
- if (closeDialog)
- {
- }
- return closeDialog;
- }
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- SystemMessage errMsg = null;
- SystemMessage firstErrMsg = null;
- SystemRenameTableRow firstErrRow = null;
- clearErrorMessage();
- SystemRenameTableRow[] rows = getRows();
- Vector newNames = new Vector();
- // first, clear pending errors...
- for (int idx=0; (idx<rows.length); idx++)
- rows[idx].setErrorMessage(null);
- // check 1: all entries have a new name, and the new name is unique for this list.
- for (int idx=0; (firstErrMsg==null) && (idx<rows.length); idx++)
- //for (int idx=0; (idx<rows.length); idx++)
- {
- errMsg = null;
- String oldName = rows[idx].getName();
- String newName = rows[idx].getNewName();
- String canonicalNewName = rows[idx].getCanonicalNewName(); // defect 42145
- //if (oldName.equalsIgnoreCase(newName)) // does not consider case for linux or unix or quoted names on iseries
- if (rows[idx].newNameEqualsOldName())
- errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_RENAME_OLDEQUALSNEW).makeSubstitution(oldName);
- //errMsg = SystemMessage.sub(RSEUIPlugin.getString(MSG_VALIDATE_RENAME_OLDEQUALSNEW),SystemMessage.MSG_SUB1,newName);
- //else if (newNames.contains(newName)) defect 42145
- else if (newNames.contains(canonicalNewName))
- errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_RENAME_NOTUNIQUE).makeSubstitution(newName);
- //errMsg = SystemMessage.sub(RSEUIPlugin.getString(MSG_VALIDATE_RENAME_NOTUNIQUE),SystemMessage.MSG_SUB1,newName);
- else
- {
- ISystemValidator nameValidator = rows[idx].getNameValidator();
- if (nameValidator != null)
- errMsg = nameValidator.validate(newName);
- if (errMsg == null)
- {
- ValidatorUniqueString vun = rows[idx].getUniqueNameValidator();
- if (vun != null)
- errMsg = vun.validate(newName);
- }
- if ((errMsg == null) && (rows[idx].getElement() instanceof IHost))
- {
- boolean ok = ValidatorConnectionName.validateNameNotInUse(newName, getShell());
- if (!ok)
- errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED);
- }
-
- }
- if (errMsg == null)
- {
- //newNames.addElement(newName);
- newNames.addElement(canonicalNewName); // defect 42145
- }
- if ((errMsg != null) && (firstErrMsg == null))
- {
- firstErrMsg = errMsg;
- firstErrRow = rows[idx];
- }
- rows[idx].setErrorMessage(errMsg); // todo: convert to handle SystemMessage object
- }
- if (firstErrMsg != null)
- {
- setErrorMessage(firstErrMsg);
- tableViewer.update(rows,null);
- tableViewer.setSelection(new StructuredSelection(firstErrRow),true);
- tableViewer.editElement(firstErrRow,COLUMN_NEWNAME);
- }
- return (firstErrMsg == null);
- }
-
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setNameValidator(ISystemValidator)
- */
- protected SystemMessage validateNameInput()
- {
- errorMessage= null;
- if (errorMessage == null)
- clearErrorMessage();
- else
- setErrorMessage(errorMessage);
- setPageComplete();
- return errorMessage;
- }
-
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
- if (errorMessage == null)
- pageComplete = true;
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
- /**
- * Required by TraverseListener.
- * We want to know when the tab key is pressed so we can give edit focus to the next name
- */
- public void keyTraversed(TraverseEvent e)
- {
- int detail = e.detail;
- //System.out.println("in keyTraversed: " + keycode + ", " + detail + ", " + doit);
- e.doit = false;
- ignoreSelection = true;
-
- Control focusControl = Display.getCurrent().getFocusControl();
-
- //System.out.println("...Key pressed. currRow = "+currRow);
-
- // DEFECT 41807 STATED USERS SHOULD BE ALLOWED TO TAB TO THE BUTTONS
- if (detail == SWT.TRAVERSE_TAB_NEXT)
- {
- if (currRow != getRows().length-1)
- {
- ++currRow;
- //System.out.println("...D TAB pressed. currRow = "+currRow);
- //tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true);
- tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME);
- }
- else
- {
- tableViewer.editElement(getRows()[0], COLUMN_NEWNAME);
- currRow = 0;
- e.doit = true;
- }
- }
- else if (detail == SWT.TRAVERSE_TAB_PREVIOUS)
- {
- if (currRow != 0)
- {
- if (currRow > 0)
- --currRow;
- else
- currRow = 0;
- //System.out.println("...D BACKTAB pressed. currRow = "+currRow);
- //tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true);
- tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME);
- }
- else
- {
- tableViewer.editElement(getRows()[getRows().length-1], COLUMN_NEWNAME);
- currRow = getRows().length-1;
- e.doit = true;
- }
- }
- else
- e.doit = true;
- ignoreSelection = false;
- }
-
- /**
- * Returns the rows of rename items.
- */
- public SystemRenameTableRow[] getRows()
- {
- return (SystemRenameTableRow[])srtp.getElements(getInputObject());
- }
-
- /**
- * Returns an array of the new names.
- */
- public String[] getNewNames()
- {
- SystemRenameTableRow[] rows = getRows();
- String[] names = new String[rows.length];
- for (int idx=0; idx<rows.length; idx++)
- names[idx] = rows[idx].getNewName();
- return names;
- }
-
- // CELL EDITOR METHODS
- public void applyEditorValue()
- {
- //System.out.println("CELLEDITOR: INSIDE APPLYEDITORVALUE");
- }
- public void cancelEditor()
- {
- //System.out.println("CELLEDITOR: INSIDE CANCELEDITOR");
- }
- public void editorValueChanged(boolean oldValidState,boolean newValidState)
- {
- //System.out.println("CELLEDITOR: INSIDE EDITORVALUECHANGED: "+oldValidState+","+newValidState);
- }
-
- /**
- * Runnable method
- */
- public void run()
- {
- SystemRenameTableRow[] rows = getRows();
- ValidatorUniqueString uniqueNameValidator = null;
- Object inputElement = null;
- ISystemValidator nameValidator = null;
- for (int idx=0; idx<rows.length; idx++)
- {
- nameValidator = rows[idx].getNameValidator();
- inputElement = rows[idx].getElement();
- uniqueNameValidator = setUniqueNameValidator(inputElement, nameValidator);
- rows[idx].setUniqueNameValidator(uniqueNameValidator);
- }
- }
-
- /**
- * Given an input element and externally-suppplied name validator for it, determine if we
- * need to augment that validator with one that will check for uniqueness, and if so
- * create and register that uniqueness validator
- */
- protected ValidatorUniqueString setUniqueNameValidator(Object inputElement, ISystemValidator nameValidator)
- {
- ValidatorUniqueString uniqueNameValidator = null;
- ISystemRemoteElementAdapter ra = getRemoteAdapter(inputElement);
- boolean debug = false;
- String parentName = null;
- if (ra != null)
- parentName = ra.getAbsoluteParentName(inputElement);
- if ((ra != null) && (parentName != null))
- {
- uniqueNameValidator = (ValidatorUniqueString)uniqueNameValidatorPerParent.get(parentName);
- if (uniqueNameValidator != null)
- {
- if (debug)
- System.out.println("Existing name list found for parent " + parentName);
- return uniqueNameValidator;
- }
- else if (debug)
- System.out.println("No existing name list found for parent " + parentName);
- }
- if ((ra != null) && (parentName != null))
- {
- String[] names = null;
- boolean caseSensitive = ra.getSubSystem(inputElement).getSubSystemConfiguration().isCaseSensitive();
- boolean needUniqueNameValidator = !(nameValidator instanceof ISystemValidatorUniqueString);
- if (!needUniqueNameValidator)
- {
- String[] existingNames = ((ISystemValidatorUniqueString)nameValidator).getExistingNamesList();
- needUniqueNameValidator = ((existingNames == null) || (existingNames.length==0));
- }
- if (needUniqueNameValidator)
- {
- // Set the busy cursor to all shells.
- super.setBusyCursor(true);
- try {
- names = ra.getRemoteParentNamesInUse(getShell(), inputElement);
- } catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);}
- if ((names != null) && (names.length>0))
- {
- uniqueNameValidator = new ValidatorUniqueString(names,caseSensitive);
- uniqueNameValidator.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- uniqueNameValidatorPerParent.put(parentName, uniqueNameValidator);
- if (debug)
- {
- System.out.println("Name validator set. Names = ");
- for (int idx=0; idx<names.length; idx++)
- System.out.println("..."+idx+": "+names[idx]);
- }
- }
- // Restore cursor
- super.setBusyCursor(false);
- }
- }
- return uniqueNameValidator;
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- if (!(o instanceof IAdaptable))
- return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
- return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
- }
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
- */
- public void focusGained(FocusEvent e)
- {
- /*
- IStructuredSelection selection = (IStructuredSelection)tableViewer.getSelection();
- if (selection.isEmpty())
- {
- currRow = -1;
- return;
- }
- SystemRenameTableRow selectedRow = (SystemRenameTableRow)selection.getFirstElement();
- int rowIdx = srtp.getRowNumber(selectedRow);
- if (rowIdx == currRow)
- return;
- currRow = rowIdx;
- tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME);
- */
- //System.out.println("Focus gained");
- }
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
- */
- public void focusLost(FocusEvent e)
- {
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameSingleDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameSingleDialog.java
deleted file mode 100644
index 690d9ecf1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameSingleDialog.java
+++ /dev/null
@@ -1,713 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
-import org.eclipse.rse.ui.validators.ValidatorConnectionName;
-import org.eclipse.rse.ui.validators.ValidatorUniqueString;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-
-
-/**
- * Dialog for renaming a single resource. Used when only one item selected.
- * <p>
- * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.ui.actions.SystemCommonRenameAction}
- * action.
- * <p>
- * To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed.
- * If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
- * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking.
- * <p>
- * If the input object does not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you
- * should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
- * specify a validator that is called to verify the user-typed new name is valid. Further, to show the type value
- * of the input object, it should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
- * <p>
- * This dialog does not do the actual renames. Rather, it will return the user-typed new name. This is
- * queriable via {@link #getNewName()}, after testing that {@link #wasCancelled()} is false.
- *
- * @see org.eclipse.rse.ui.actions.SystemCommonRenameAction
- */
-public class SystemRenameSingleDialog extends SystemPromptDialog
- implements ISystemPropertyConstants,
- Runnable
-{
-
- public static final boolean COLLISION_MODE = true;
-
- private Button overwriteRadio;
- //private Button renameRadio;
- private boolean overwriteMode = true;
-
- private Composite renameGroup;
-
- private Text newName;
- private String promptLabel, promptTip;
- private String newNameString;
- private String inputName = ""; //$NON-NLS-1$
- private Label resourceTypePrompt, resourceTypeValue, verbageLabel, renameLabel;
- private SystemMessage errorMessage;
- private ISystemValidator nameValidator;
- private ValidatorUniqueString uniqueNameValidator;
- private boolean initialized = false;
- private boolean copyCollisionMode = false;
- private boolean isRemote = true;
- private ISystemViewElementAdapter adapter = null;
- private Object inputElement = null;
- private String description = null;
-
- /**
- * Constructor
- */
- public SystemRenameSingleDialog(Shell shell)
- {
- this(shell, SystemResources.RESID_RENAME_TITLE);
- String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE;
- if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev
- setTitle(singleTitle);
- }
- /**
- * Constructor with a title
- */
- public SystemRenameSingleDialog(Shell shell, String title)
- {
- super(shell, title);
-
- //pack();
- setBlockOnOpen(true);
- setHelp(RSEUIPlugin.HELPPREFIX+"drns0000"); //$NON-NLS-1$
- }
-
- /**
- * Constructor with an input object and validator
- * This constructor is in copy/move dialogs when there is a collision
- * @param shell The parent dialog
- * @param copyCollisionMode true if this is being called because of a name collision on a copy or move operation
- * @param inputObject The object that is being renamed, or on a copy/move the object in the target container which already exists. Used to get the old name and the name validator
- * @param nameValidator The name validator to use. Can be null, in which case it is queried from the adapter of the input object
- */
- public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator)
- {
- this(shell);
- setInputObject(inputObject);
- setCopyCollisionMode(copyCollisionMode);
- setNameValidator(nameValidator);
-
- }
-
- /**
- * Set the label and tooltip of the prompt. The default is "New name:"
- */
- public void setPromptLabel(String label, String tooltip)
- {
- this.promptLabel = label;
- this.promptTip = tooltip;
- }
-
- /**
- * Indicate this dialog is the result of a copy/move name collision.
- * Affects the title, verbage at the top of the dialog, and context help.
- */
- public void setCopyCollisionMode(boolean copyCollisionMode)
- {
- if (copyCollisionMode)
- {
- if (this.inputObject != null && this.inputObject instanceof IHost)
- {
- setHelp(RSEUIPlugin.HELPPREFIX+"dccc0000"); //$NON-NLS-1$
- }
- else
- {
- setHelp(RSEUIPlugin.HELPPREFIX+"drns0001"); //$NON-NLS-1$
- }
- setTitle(SystemResources.RESID_COLLISION_RENAME_TITLE);
- }
- else if (this.copyCollisionMode) // from true to false
- {
- setHelp(RSEUIPlugin.HELPPREFIX+"drns0000"); //$NON-NLS-1$
- String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE;
- if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev
- setTitle(singleTitle);
- else
- setTitle(SystemResources.RESID_RENAME_TITLE); // older string we know exists
- }
- this.copyCollisionMode = copyCollisionMode;
- }
- /**
- * Query if this dialog is the result of a copy/move name collision.
- * Affects the title, verbage at the top of the dialog, and context help.
- */
- public boolean getCopyCollisionMode()
- {
- return copyCollisionMode;
- }
-
-
- /**
- * Set the validator for the new name,as supplied by the adaptor for name checking.
- * Overrides the default which is to query it from the object's adapter.
- */
- public void setNameValidator(ISystemValidator nameValidator)
- {
- this.nameValidator = nameValidator;
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
- //form.setMessageLine(msgLine);
- return fMessageLine;
- }
-
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- //uSystem.out.println("here! " + (newName == null));
- return newName;
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 1;
- Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- Object inputObject = getInputObject();
-
- if (copyCollisionMode)
- {
- // VERBAGE
- verbageLabel = SystemWidgetHelpers.createLabel(composite, " ", nbrColumns); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite, " ", nbrColumns); //filler //$NON-NLS-1$
- }
- else if (description != null)
- {
- // VERBAGE
- verbageLabel = SystemWidgetHelpers.createLabel(composite, description, nbrColumns);
- SystemWidgetHelpers.createLabel(composite, " ", nbrColumns); //filler //$NON-NLS-1$
- }
-
- if (copyCollisionMode)
- {
- overwriteRadio = SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_TOOLTIP);
- overwriteRadio.setSelection(true);
- /*renameRadio =*/ SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_TOOLTIP);
- }
-
- int nbrRenameColumns = 2;
- // BEGIN RENAME
- renameGroup = SystemWidgetHelpers.createComposite(composite, nbrRenameColumns);
-
- // RESOURCE TYPE
- resourceTypePrompt = SystemWidgetHelpers.createLabel(
- renameGroup, SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_LABEL);
- resourceTypeValue = SystemWidgetHelpers.createLabel(renameGroup, ""); //$NON-NLS-1$
- resourceTypeValue.setToolTipText(SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_TOOLTIP);
-
-
- // PROMPT
- if (promptLabel == null)
- {
- String labelText = copyCollisionMode ? SystemResources.RESID_COLLISION_RENAME_LABEL : SystemResources.RESID_SIMPLE_RENAME_PROMPT_LABEL;
- labelText = SystemWidgetHelpers.appendColon(labelText);
- renameLabel = SystemWidgetHelpers.createLabel(renameGroup, labelText);
- newName = SystemWidgetHelpers.createTextField(renameGroup, null);
- }
- else
- {
- renameLabel = SystemWidgetHelpers.createLabel(renameGroup, promptLabel);
- newName = SystemWidgetHelpers.createTextField(renameGroup, null);
- if (promptTip != null)
- newName.setToolTipText(promptTip);
- }
-
- // END RENAME
-
-
-
- if (inputObject != null)
- {
- initializeInput();
- }
-
- // init ok to disabled, until they type a new name
- setPageComplete(false);
-
- // add keystroke listeners...
- newName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateNameInput();
- }
- }
- );
-
- if (copyCollisionMode)
- {
- enableRename(false);
- }
-
-
- return composite;
- }
-
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- //System.out.println("INSIDE SETINPUTOBJECT: " + inputObject + ", "+inputObject.getClass().getName());
- super.setInputObject(inputObject);
- if (newName != null)
- {
- initializeInput();
- }
- }
-
- private void initializeInput()
- {
- if (!initialized)
- {
- inputElement = getInputElement(inputObject);
- adapter = getAdapter(inputElement);
- if (adapter != null)
- inputName = adapter.getName(inputElement);
- else if (inputElement instanceof ISystemTypedObject)
- inputName = ((ISystemTypedObject)inputElement).getName();
- else if (inputElement instanceof IResource)
- inputName = ((IResource)inputElement).getName();
- else if (inputElement instanceof String)
- inputName = (String)inputElement;
- newName.setText(inputName);
-
- if (copyCollisionMode)
- {
- verbageLabel.setText(SystemMessage.sub(SystemResources.RESID_COLLISION_RENAME_VERBAGE, "&1", inputName));
- }
-
-
-
- if ((nameValidator == null) && (adapter != null))
- nameValidator = adapter.getNameValidator(inputElement);
- if (nameValidator != null)
- {
- int maxLen = nameValidator.getMaximumNameLength();
- if (maxLen != -1)
- newName.setTextLimit(maxLen);
- }
- // test if we need a unique name validator
- Shell shell = getShell();
- Display display = shell.getDisplay();
- if (display != null)
- display.asyncExec(this);
- else
- run();
-
- // the rename action for system filter pool reference selections is really
- // a rename of the actual pool, versus the reference...
- if (inputElement instanceof ISystemFilterPoolReference)
- {
- inputElement = ((ISystemFilterPoolReference)inputElement).getReferencedFilterPool();
- adapter = getAdapter(inputElement);
- }
-
- if (adapter != null)
- resourceTypeValue.setText(adapter.getType(inputElement));
- else if (inputElement instanceof ISystemTypedObject)
- resourceTypeValue.setText(((ISystemTypedObject)inputElement).getType());
- else if (inputElement instanceof IResource)
- {
- if ((inputElement instanceof IFolder) || (inputElement instanceof IProject))
- resourceTypeValue.setText(SystemViewResources.RESID_PROPERTY_FILE_TYPE_FOLDER_VALUE);
- else
- resourceTypeValue.setText(SystemViewResources.RESID_PROPERTY_FILE_TYPE_FILE_VALUE);
- }
- initialized = true;
- }
- }
-
- /**
- * Runnable method
- */
- public void run()
- {
- uniqueNameValidator = getUniqueNameValidator(inputElement, nameValidator);
- }
-
- /**
- * Given an input element and externally-suppplied name validator for it, determine if we
- * need to augment that validator with one that will check for uniqueness, and if so
- * create and return that uniqueness validator
- */
- protected ValidatorUniqueString getUniqueNameValidator(Object inputElement, ISystemValidator nameValidator)
- {
- ValidatorUniqueString uniqueNameValidator = null;
- ISystemRemoteElementAdapter ra = getRemoteAdapter(inputElement);
- if (ra != null)
- {
- isRemote = true;
- String[] names = null;
- boolean debug = false;
- boolean caseSensitive = ra.getSubSystem(inputElement).getSubSystemConfiguration().isCaseSensitive();
- boolean needUniqueNameValidator = !(nameValidator instanceof ISystemValidatorUniqueString);
- if (!needUniqueNameValidator)
- {
- String[] existingNames = ((ISystemValidatorUniqueString)nameValidator).getExistingNamesList();
- needUniqueNameValidator = ((existingNames == null) || (existingNames.length==0));
- }
- if (needUniqueNameValidator)
- {
- // Set the busy cursor to all shells.
- super.setBusyCursor(true);
- try {
- Shell shell = getShell();
- IRunnableContext irc = RSEUIPlugin.getTheSystemRegistry().getRunnableContext();
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- names = ra.getRemoteParentNamesInUse(shell, inputElement);
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
- } catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);}
- if ((names != null) && (names.length>0))
- {
- uniqueNameValidator = new ValidatorUniqueString(names,caseSensitive);
- uniqueNameValidator.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- if (debug)
- {
- System.out.println("Name validator set. Names = ");
- for (int idx=0; idx<names.length; idx++)
- System.out.println("..."+idx+": "+names[idx]);
- }
- }
- // Restore cursor
- super.setBusyCursor(false);
- }
- }
- else
- isRemote = false;
- newName.setFocus();
- return uniqueNameValidator;
- }
-
- /**
- * Returns the selected element given the current input, which is
- * an IStructuredSelection.
- */
- protected Object getInputElement(Object inputObject)
- {
- if (inputObject instanceof IStructuredSelection)
- {
- inputObject = ((IStructuredSelection)inputObject).getFirstElement();
- }
- if (inputObject instanceof SystemSimpleContentElement)
- {
- inputObject = ((SystemSimpleContentElement)inputObject).getData();
- }
- return inputObject;
- }
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- newNameString = newName.getText();
- if (!isRemote)
- newNameString = newNameString.trim();
- else
- newNameString = trimTrailing(newNameString); // defect 43173
- boolean closeDialog = verify();
- if (closeDialog)
- {
- if (inputElement instanceof IHost)
- {
- closeDialog = ValidatorConnectionName.validateNameNotInUse(newNameString, getShell());
- if (!closeDialog)
- newName.setFocus();
- }
- }
- if (closeDialog)
- {
- setOutputObject(newNameString);
- }
- return closeDialog;
- }
- /**
- * Trim leading blanks
- */
- public static String trimTrailing(String text)
- {
- return ("."+text).trim().substring(1); //$NON-NLS-1$
- }
-
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- if (copyCollisionMode && overwriteMode)
- return true;
-
- SystemMessage errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
- errMsg = validateNameInput(newNameString);
- if (errMsg != null) {
- controlInError = newName;
- controlInError.setFocus();
- }
- else if (isRemote && checkIfWillBeFilteredOut(inputElement, newNameString)) {
- return false;
- }
- return (errMsg == null);
- }
-
- /**
- * If renaming a remote object, which is listed in a tree view under an expanded filter,
- * this tests to see if the rename will cause that object to suddenly not meet the filtering
- * criteria of the parent filter, and hence disappear. If so, issue warning message before
- * proceeding.
- * @return true if will be filtered out and user chose to cancel operation
- */
- protected boolean checkIfWillBeFilteredOut(Object remoteObject, String newName)
- {
- // after breaking my pick on this, I have decide it simply is too much work, and
- // too error-prone, to do. The reason is that we really cannot accurately determine
- // if the new name will meet the criteria of the filter, short of re-resolving the
- // filter and looking for the new name. That is just too expensive, I think. Phil.
- // See defect 42094.
- return false;
- /*
- boolean ok = false;
- // step 1: check if we are invoked from a tree view
- if (inputTreeViewer == null)
- return false;
- // step 2: check if the parent of the selected object is a filter
- if (inputTreeViewer.getSelectedParent() instanceof SystemFilterReference)
- {
- SystemFilterReference parentFilterRef = (SystemFilterReference)inputTreeViewer.getSelectedParent();
- SystemFilter parentFilter = parentFilterRef.getReferencedFilter();
- // step 3: check if the new name meets the criteria of the filter
- SubSystem ss = getRemoteAdapter(remoteObject).getSubSystem(remoteObject);
- boolean matches = ss.doesFilterMatch(parentFilter, newName);
- if (!matches)
- {
- // todo: issue warning msg 1311, and allow user to cancel operation
- }
- }
- return ok;
- */
- }
-
- /**
- * Called directly as user types.
- */
- protected SystemMessage validateNameInput()
- {
- newNameString = newName.getText();
- if (!isRemote)
- newNameString = newNameString.trim();
- else
- newNameString = trimTrailing(newNameString); // defect 43173
-
-
- return validateNameInput(newNameString);
- }
- /**
- * Called directly from verify.
- */
- protected SystemMessage validateNameInput(String theNewName)
- {
- errorMessage= null;
-
- if (theNewName == null)
- {
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY);
- }
- else
- {
- if (nameValidator != null)
- errorMessage= nameValidator.validate(theNewName);
- else if (theNewName.length() == 0)
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY);
- if (errorMessage == null)
- {
- if (adapter != null && adapter.namesAreEqual(inputElement, theNewName))
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_RENAME_OLDEQUALSNEW).makeSubstitution(inputName);
- }
- }
-
- if ((errorMessage == null) && (uniqueNameValidator != null))
- errorMessage = uniqueNameValidator.validate(theNewName);
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- else
- clearErrorMessage();
- setPageComplete();
- return errorMessage;
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
-
- if (copyCollisionMode && overwriteMode)
- {
- return true;
- }
-
-
- if (errorMessage == null)
- {
- String theNewName = newName.getText().trim();
- pageComplete = (theNewName.length() > 0);
- if (pageComplete && adapter != null)
- {
- pageComplete = !adapter.namesAreEqual(inputElement, theNewName);
- //System.out.println("back from namesAreEqual: " + pageComplete);
-
- }
- }
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
- /**
- * Returns the user-entered new name
- */
- public String getNewName()
- {
- return newNameString;
- }
-
- /**
- * Returns the user-entered new name as an array for convenience to ISystemRenameTarget hosts.
- */
- public String[] getNewNameArray()
- {
- String[] newNames = new String[1];
- newNames[0] = newNameString;
- return newNames;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public String getDescription()
- {
- return this.description;
- }
-
- public void handleEvent(Event e)
- {
- Widget source = e.widget;
- if (source == overwriteRadio)
- {
- enableRename(!overwriteRadio.getSelection());
- }
- }
-
- private void enableRename(boolean flag)
- {
- if (newName != null)
- {
- renameLabel.setEnabled(flag);
- newName.setEnabled(flag);
-
- resourceTypePrompt.setEnabled(flag);
- resourceTypeValue.setEnabled(flag);
-
- overwriteMode = !flag;
- setPageComplete();
-
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableProvider.java
deleted file mode 100644
index a37931280..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableProvider.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.graphics.Image;
-
-/**
- *
- */
-public class SystemRenameTableProvider implements ITableLabelProvider, IStructuredContentProvider
-{
- static final int COLUMN_ERROR = 0;
- static final int COLUMN_OLDNAME = 1;
- static final int COLUMN_NEWNAME = 2;
- static final int COLUMN_TYPE = 3;
- private Map imageTable = new Hashtable(20);
- private Object[] children = null;
- private ISystemValidator inputValidator = null;
-
- /**
- * Constructor for SystemRenameTableProvider
- */
- public SystemRenameTableProvider()
- {
- super();
- }
-
- /**
- * Set the validator for the new name,as supplied by the adaptor for name checking.
- * Overrides the default which is to query it from the object's adapter.
- */
- public void setNameValidator(ISystemValidator nameValidator)
- {
- inputValidator = nameValidator;
- }
-
- private SystemRenameTableRow getTableRow(Object element)
- {
- return (SystemRenameTableRow)element;
- }
-
- private Image getImageFromDescriptor(ImageDescriptor descriptor)
- {
- if (descriptor == null)
- return null;
- //obtain the cached image corresponding to the descriptor
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- //System.out.println("...image = " + image);
- return image;
- }
-
- /**
- * @see ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int column)
- {
- if (column == COLUMN_ERROR)
- {
- SystemRenameTableRow row = getTableRow(element);
- if (row.getError())
- {
- Image errorImage = JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_ERROR);
- //RSEUIPlugin.getDefault().getImage(ISystemConstants.ICON_SYSTEM_ERROR_ID);
- return errorImage;
- }
- else
- return null;
- }
- else if (column == COLUMN_OLDNAME)
- return getImageFromDescriptor(getTableRow(element).getImageDescriptor());
- else
- return null;
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int column)
- {
- String text = "";
- if (column == COLUMN_OLDNAME)
- text = getTableRow(element).getName();
- else if (column == COLUMN_NEWNAME)
- text = getTableRow(element).getNewName();
- else if (column == COLUMN_TYPE)
- text = getTableRow(element).getType();
- //System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element));
- return text;
- }
-
- /**
- * @see IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- /**
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose()
- {
- // The following we got from WorkbenchLabelProvider
- if (imageTable != null)
- {
- Collection imageValues = imageTable.values();
- if (imageValues!=null)
- {
- Iterator images = imageValues.iterator();
- if (images!=null)
- while (images.hasNext())
- ((Image)images.next()).dispose();
- imageTable = null;
- }
- }
- }
-
- /**
- * @see IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- /**
- * @see IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- /**
- * Return rows. Input must be an IStructuredSelection.
- */
- public Object[] getElements(Object inputElement)
- {
- if (children == null)
- {
- IStructuredSelection iss = (IStructuredSelection)inputElement;
- children = new SystemRenameTableRow[iss.size()];
- Iterator i = iss.iterator();
- int idx = 0;
- while (i.hasNext())
- {
- children[idx] = new SystemRenameTableRow(i.next(),idx);
- if (inputValidator != null)
- ((SystemRenameTableRow)children[idx]).setNameValidator(inputValidator);
- idx++;
- }
- }
- return children;
- }
-
- /**
- *
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
-
-
- }
-
- /**
- * Return the 0-based row number of the given element.
- */
- public int getRowNumber(SystemRenameTableRow row)
- {
- int matchRow = row.getRowNumber();
- /*
- int matchRow = -1;
- boolean match = false;
- for (int idx=0; !match && (matchRow<children.length); idx++)
- {
- //match = children[idx].equals(row);
- match = (children[idx] == row);
- if (match)
- matchRow = idx;
- }
- */
- //System.out.println("getRowNumber for "+row+": "+matchRow);
- return matchRow;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableRow.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableRow.java
deleted file mode 100644
index 39bd87e16..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRenameTableRow.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorUniqueString;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-
-
-
-/**
- * Represents one row in the table in the SystemRenameDialog dialog.
- */
-public class SystemRenameTableRow extends SystemDeleteTableRow
-{
- private String newName;
- private SystemMessage errorMsg = null;
- private ISystemValidator inputValidator = null;
- private ValidatorUniqueString inputUniqueNameValidator = null;
- private Object parent;
- private int nameLengthLimit = -1;
-
- /**
- * Constructor
- * @param element that is being displayed in the tree, and which the
- * user selected the rename action. This represents a single item.
- */
- public SystemRenameTableRow(Object element, int rowNbr)
- {
- super(element,rowNbr);
- this.newName = getName();
- this.inputValidator = getAdapter(element).getNameValidator(element);
- if (inputValidator != null) {
- nameLengthLimit = inputValidator.getMaximumNameLength();
- }
- }
-
- /**
- * Set the new name for this element. Called by the CellModifier
- * for the rename dialog.
- */
- public void setNewName(String name)
- {
- //System.out.println("Inside setNewName: from " + newName + ", to " + name);
- if (name != null)
- {
- if (isRemote()) // defect 43173
- newName = trimTrailing(name); // defect 43041
- else
- newName = name.trim();
- }
- else
- newName = null;
- }
-
- /**
- * Trim leading blanks
- */
- public static String trimTrailing(String text)
- {
- return ("."+text).trim().substring(1);
- }
-
- /**
- * Return the new name for this element, as set by setNewName
- */
- public String getNewName()
- {
- return newName;
- }
-
- /**
- * Get the parent of this remote object that is being renamed
- */
- public Object getParent()
- {
- return parent;
- }
-
- /**
- * Set the parent of this remote object that is being renamed
- */
- public void setParent(Object parent)
- {
- this.parent = parent;
- }
-
- /**
- * Get the canonical name of this row. Sometimes, the name alone is not enough to do uniqueness
- * checking on. For example, two connections or filter pools can have the same name if they are
- * in different profiles. Two iSeries QSYS objects can have the same name if their object types
- * are different.
- * <p>
- * This method returns a name that can be used for uniqueness checking because it is qualified
- * sufficiently to make it unique.
- * <p>
- * Defers to the object's adapter
- */
- public String getCanonicalNewName()
- {
- // this is all for defect 42145
- Object element = super.getElement();
- ISystemViewElementAdapter adapter = super.getAdapter();
- String cName = newName;
- if (adapter != null)
- cName = adapter.getCanonicalNewName(element, newName);
- else
- cName = newName;
- //System.out.println("Inside getCanonicalNewName: newName: " + newName + ", canonical: " + cName);
- return cName;
- }
- /**
- * Compares the given new name to this row's current name, taking into consideration case if appropriate.
- * Defers to the object's adapter
- */
- public boolean newNameEqualsOldName()
- {
- Object element = super.getElement();
- ISystemViewElementAdapter adapter = super.getAdapter();
- if (adapter != null)
- return adapter.namesAreEqual(element, newName);
- else
- return getName().equals(newName);
- }
-
- /**
- * Return the name length limit, if available via the name validator supplied by the adapter.
- * Returns -1 if not available.
- */
- public int getNameLengthLimit()
- {
- return nameLengthLimit;
- }
-
- /**
- * Set the validator for the new name,as supplied by the adaptor for name checking.
- * Overrides the default which is to query it from the object's adapter.
- */
- public void setNameValidator(ISystemValidator nameValidator)
- {
- inputValidator = nameValidator;
- }
-
- /**
- * Set the uniqueness validator for the new name,as supplied by the remote adaptor.
- */
- public void setUniqueNameValidator(ValidatorUniqueString uniqueNameValidator)
- {
- inputUniqueNameValidator = uniqueNameValidator;
- }
-
- /**
- * Return the validator for the new name,as supplied by the adaptor for
- * this element type.
- * <p>
- * By default queries it from the object's adapter, unless setNameValidator has been
- * called.
- */
- public ISystemValidator getNameValidator()
- {
- return inputValidator;
- }
-
- /**
- * Return the uniqueness validator for the new name,as supplied by the call to setUniqueNameValidator
- */
- public ValidatorUniqueString getUniqueNameValidator()
- {
- return inputUniqueNameValidator;
- }
-
- /**
- * Return true if this row is currently in error
- */
- public boolean getError()
- {
- return errorMsg != null;
- }
- /**
- * Return text of error if this row is currently in error
- */
- public SystemMessage getErrorMessage()
- {
- return errorMsg;
- }
- /**
- * Set error message for this row.
- * Pass null to clear it.
- */
- public void setErrorMessage(SystemMessage errorMsg)
- {
- this.errorMsg = errorMsg;
- }
-
- public String toString()
- {
- return getNewName();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemResolveFilterStringDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemResolveFilterStringDialog.java
deleted file mode 100644
index 299d9d411..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemResolveFilterStringDialog.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.SystemResolveFilterStringAPIProviderImpl;
-import org.eclipse.rse.ui.view.SystemViewForm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Dialog for testing a filter string. Typically called from a create/update filter string dialog.
- * <p>
- * Caller must supply the subsystem which owns this existing or potential filter string.
- * <p>
- * This dialog contains a dropdown for selecting connections to use in the test. Only connections which
- * contain subsystems with the same parent factory as the given subsystem factory are shown.
- *
- */
-public class SystemResolveFilterStringDialog extends SystemTestFilterStringDialog
-{
-
- /**
- * Constructor
- * @param shell The shell to hang the dialog off of
- * @param subsystem The contextual subsystem that owns this filter string
- * @param filterString The filter string that is to be tested.
- */
- public SystemResolveFilterStringDialog(Shell shell, ISubSystem subsystem, String filterString)
- {
- super(shell, subsystem, filterString);
- setShowOkButton(true);
- }
-
- /**
- * Constructor when unique title desired
- * @param shell The shell to hang the dialog off of
- * @param title The title to give the dialog
- * @param subsystem The contextual subsystem that owns this filter string
- * @param filterString The filter string that is to be tested.
- */
- public SystemResolveFilterStringDialog(Shell shell, String title, ISubSystem subsystem, String filterString)
- {
- super(shell, title, subsystem, filterString);
- setShowOkButton(true);
- }
-
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int gridColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, gridColumns);
-
- // connection selection combo
- connectionCombo = SystemWidgetHelpers.createConnectionCombo(composite_prompts, null, null, subsystem.getSubSystemConfiguration(),
- null, null, subsystem.getHost(), gridColumns, false);
-
- // Composite promptComposite = composite_prompts;
- Composite promptComposite = connectionCombo;
- prompt = SystemWidgetHelpers.createLabel(promptComposite, SystemResources.RESID_TESTFILTERSTRING_PROMPT_LABEL, SystemResources.RESID_TESTFILTERSTRING_PROMPT_TOOLTIP);
- promptValue = SystemWidgetHelpers.createLabel(promptComposite, SystemResources.RESID_TESTFILTERSTRING_PROMPT_LABEL, SystemResources.RESID_TESTFILTERSTRING_PROMPT_TOOLTIP);
-
- promptValue.setToolTipText(filterString); // Since the dialog is not resizable, this is the way to show the whole string
-
- String label = filterString;
-
- if ( label.length() > 30)
- label = label.substring(0,30) + " ..."; // Use ... to show that not entire string is displayed
- promptValue.setText(label);
-
- GridData data = new GridData();
- data.widthHint = 200;
- promptValue.setLayoutData(data);
-
- // Tree viewer
- inputProvider = new SystemResolveFilterStringAPIProviderImpl(subsystem, filterString);
- tree = new SystemViewForm(getShell(), composite_prompts, SWT.NULL, inputProvider, true, getMessageLine(), gridColumns, 1);
-
- // add selection listeners
- //tree.addSelectionChangedListener(this);
- connectionCombo.addSelectionListener(this);
-
- return composite_prompts;
- } // end createInner()
-
-
-} // end class SystemResolveFilterStringDialog \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectAnythingDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectAnythingDialog.java
deleted file mode 100644
index cdce86d13..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectAnythingDialog.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.rse.ui.view.ISystemViewInputProvider;
-import org.eclipse.rse.ui.view.SystemViewForm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-public class SystemSelectAnythingDialog extends SystemPromptDialog
- implements ISystemPropertyConstants, ISelectionChangedListener
-{
- private SystemViewForm _view = null;
- private Object _selected = null;
- public SystemSelectAnythingDialog(Shell shell, String title)
- {
- super(shell, title);
- }
-
- public Control createInner(Composite parent)
- {
-
- _view = new SystemViewForm(getShell(), parent, SWT.NONE, getInputProvider(), true, this);
- _view.getSystemView().addSelectionChangedListener(this);
- //_view.getSystemView().ref
-
- return _view.getTreeControl();
- }
-
- public boolean close()
- {
- _view.removeSelectionChangedListener(this);
- _view.dispose();
- return super.close();
- }
-
- /**
- * Returns the initial input provider for the viewer.
- * Tries to deduce the appropriate input provider based on current input.
- */
- protected ISystemViewInputProvider getInputProvider()
- {
- ISystemViewInputProvider inputProvider = RSEUIPlugin.getTheSystemRegistry();
-
- return inputProvider;
- }
-
- public Control getInitialFocusControl()
- {
- return _view.getTreeControl();
- }
-
- public Object getSelectedObject()
- {
- //IStructuredSelection selection = (IStructuredSelection)_view.getSelection();
- //return selection.getFirstElement();
- return _selected;
- }
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- IStructuredSelection selection = (IStructuredSelection)e.getSelection();
-
- _selected = selection.getFirstElement();
-
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectConnectionDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectConnectionDialog.java
deleted file mode 100644
index bd9001f68..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectConnectionDialog.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.ISystemPageCompleteListener;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.widgets.SystemSelectConnectionForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Dialog for allowing users to select an existing connection, or optionally create a new one.
- * There are a number of methods to configure the dialog so only connections of a particular system type,
- * or containing subsystems from a particular subsystem factory or class of subsystem factories, are shown.
- * <p>
- * Call these methods to configure the functionality of the dialog
- * <ul>
- * <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)}
- * <li>{@link #setShowNewConnectionPrompt(boolean)}
- * <li>{@link #setSystemTypes(String[])}
- * <li>{@link #setAutoExpandDepth(int)}
- * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
- * <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)}
- * <li>{@link #setShowPropertySheet(boolean)}
- * <li>{@link #enableAddMode(ISystemAddFileListener)}
- * <li>{@link #setMultipleSelectionMode(boolean)}
- * <li>{@link #setSelectionValidator(IValidatorRemoteSelection)}
- * </ul>
- * <p>
- * Call these methods to configure the text on the dialog
- * <ul>
- * <li>{@link #setMessage(String)}
- * <li>{@link #setSelectionTreeToolTipText(String)}
- * </ul>
- * <p>
- * After running, call these methods to get the output:
- * <ul>
- * <li>{@link #getSelectedObject()} or {@link #getSelectedObjects()}
- * <li>{@link #getSelectedConnection()}
- * </ul>
- *
- */
-public class SystemSelectConnectionDialog
- extends SystemPromptDialog implements ISystemPageCompleteListener
-{
- public static final boolean FILE_MODE = true;
- public static final boolean FOLDER_MODE = false;
- private SystemSelectConnectionForm form;
-
-
- /**
- * Constructor
- *
- * @param shell The shell to hang the dialog off of
- *
- */
- public SystemSelectConnectionDialog(Shell shell)
- {
- this(shell, SystemResources.RESID_SELECTCONNECTION_TITLE);
- }
- /**
- * Constructor when you want to supply your own title.
- *
- * @param shell The shell to hang the dialog off of
- * @param title The title to give the dialog
- */
- public SystemSelectConnectionDialog(Shell shell, String title)
- {
- super(shell, title);
- super.setBlockOnOpen(true); // always modal
- form = getForm(shell);
- setShowPropertySheet(true, false); // default
- }
-
- // ------------------
- // PUBLIC METHODS...
- // ------------------
- /**
- * Set the connection to default the selection to
- */
- public void setDefaultConnection(IHost conn)
- {
- form.setDefaultConnection(conn);
- }
- /**
- * Restrict to certain system types
- * @param systemTypes the system types to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemTypes(String[] systemTypes)
- {
- form.setSystemTypes(systemTypes);
- }
- /**
- * Restrict to a certain system type
- * @param systemType the system type to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemType(String systemType)
- {
- form.setSystemType(systemType);
- }
- /**
- * Set to true if a "New Connection..." special connection is to be shown for creating new connections
- */
- public void setShowNewConnectionPrompt(boolean show)
- {
- form.setShowNewConnectionPrompt(show);
- }
- /**
- * Set the instruction label shown at the top of the dialog
- */
- public void setInstructionLabel(String message)
- {
- form.setMessage(message);
- }
-
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload always shows the property sheet
- * <p>
- * Default is false
- */
- public void setShowPropertySheet(boolean show)
- {
- form.setShowPropertySheet(show);
- }
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * This overload shows a Details>>> button so the user can decide if they want to see the
- * property sheet.
- * <p>
- * Default is true, false
- * <p>
- * @param show True if show the property sheet within the dialog
- * @param initialState True if the property is to be initially displayed, false if it is not
- * to be displayed until the user presses the Details button.
- */
- public void setShowPropertySheet(boolean show, boolean initialState)
- {
- if (show)
- {
- form.setShowPropertySheet(initialState);
- setShowDetailsButton(true, !initialState);
- }
- }
-
- /**
- * Set multiple selection mode. Default is single selection mode
- * <p>
- * If you turn on multiple selection mode, you must use the getSelectedObjects()
- * method to retrieve the list of selected objects.
- * <p>
- * Further, if you turn this on, it has the side effect of allowing the user
- * to select any remote object. The assumption being if you are prompting for
- * files, you also want to allow the user to select a folder, with the meaning
- * being that all files within the folder are implicitly selected.
- *
- * @see #getSelectedObjects()
- */
- public void setMultipleSelectionMode(boolean multiple)
- {
- form.setMultipleSelectionMode(multiple);
- }
-
- // ------------------
- // OUTPUT METHODS...
- // ------------------
-
- /**
- * Return selected file or folder
- */
- public Object getSelectedObject()
- {
- if (getOutputObject() instanceof Object[])
- return ((Object[])getOutputObject())[0];
- else
- return getOutputObject();
- }
- /**
- * Return all selected objects. This method will return an array of one
- * unless you have called setMultipleSelectionMode(true)!
- * @see #setMultipleSelectionMode(boolean)
- */
- public Object[] getSelectedObjects()
- {
- if (getOutputObject() instanceof Object[])
- return (Object[])getOutputObject();
- else if (getOutputObject() != null)
- return new Object[] {getOutputObject()};
- else
- return null;
- }
-
- /**
- * Return selected connection
- */
- public IHost getSelectedConnection()
- {
- return form.getSelectedConnection();
- }
- /**
- * Return selected connections in multiple selection mode
- */
- public IHost[] getSelectedConnections()
- {
- return form.getSelectedConnections();
- }
-
- /**
- * Return the multiple selection mode as set by setMultipleSelectionMode(boolean)
- */
- public boolean getMultipleSelectionMode()
- {
- return form.getMultipleSelectionMode();
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
- /**
- * Private method.
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return form.getInitialFocusControl();
- }
-
- /**
- * Private method.
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- return form.createContents(parent);
- }
-
- /**
- * Private method.
- * Get the contents.
- */
- protected SystemSelectConnectionForm getForm(Shell shell)
- {
- //System.out.println("INSIDE GETFORM");
- //if (form == null)
- //{
- form = new SystemSelectConnectionForm(shell,getMessageLine());
- form.addPageCompleteListener(this);
- // reset output variables just to be safe
- setOutputObject(null);
- //}
- return form;
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- ISystemMessageLine msgLine = super.createMessageLine(c);
- if (form != null)
- form.setMessageLine(msgLine);
- return msgLine;
- }
-
-
- /**
- * Private method.
- * <p>
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- boolean closeDialog = form.verify();
- if (closeDialog)
- {
- if (getMultipleSelectionMode())
- setOutputObject(form.getSelectedConnections());
- else
- setOutputObject(form.getSelectedConnection());
- }
- else
- setOutputObject(null);
- return closeDialog;
- }
-
- /**
- * Private method.
- * <p>
- * Called when user presses DETAILS button.
- * <p>
- * Note the text is automatically toggled for us! We need only
- * do whatever the functionality is that we desire
- *
- * @param hideMode the current state of the details toggle, prior to this request. If we return true from
- * this method, this state and the button text will be toggled.
- *
- * @return true if the details state toggle was successful, false if it failed.
- */
- protected boolean processDetails(boolean hideMode)
- {
- form.toggleShowPropertySheet(getShell(), getContents());
- return true;
- }
-
-
- /**
- * We have to override close to ensure that we reset the form to null
- */
- public boolean close()
- {
- if (super.close())
- {
- if (form != null)
- {
- form.dispose();
- }
- form = null;
- return true;
- }
- return false;
- }
-
- /**
- * The callback method.
- * This is called whenever setPageComplete is called by the form code.
- * @see {@link SystemBaseForm#addPageCompleteListener(ISystemPageCompleteListener)}
- */
- public void setPageComplete(boolean complete)
- {
- super.setPageComplete(complete);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectFileTypesDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectFileTypesDialog.java
deleted file mode 100644
index ef49ae040..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSelectFileTypesDialog.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.rse.ui.GenericMessages;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorMapping;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.FileEditorMappingContentProvider;
-import org.eclipse.ui.dialogs.FileEditorMappingLabelProvider;
-
-
-/**
- * A public implementation of the eclipse Select Types dialog.
- * <p>
- * File types are extension names without the dot.
- * For example "java" and "class".
- * <p>
- * Call getResult() to get the array of selected types.
- */
-public class SystemSelectFileTypesDialog
- extends SystemPromptDialog
- //extends TypeFilteringDialog
- implements ISystemMessageLine
-{
-
- protected Collection initialSelections;
-
- // instruction to show user
- protected String instruction;
-
- // the final collection of selected elements, or null if this dialog was canceled
- protected Object[] result;
-
- // the visual selection widget group
- protected CheckboxTableViewer listViewer;
-
- // sizing constants
- protected final static int SIZING_SELECTION_WIDGET_HEIGHT = 250;
- protected final static int SIZING_SELECTION_WIDGET_WIDTH = 300;
-
- // TODO: Cannot use WorkbenchMessages -- it's internal
- protected final static String TYPE_DELIMITER = GenericMessages.TypesFiltering_typeDelimiter;
- protected Text userDefinedText;
-
- protected IFileEditorMapping[] currentInput;
-
- /**
- * Constructor when there are no existing types
- * @param shell The window hosting this dialog
- */
- public SystemSelectFileTypesDialog(Shell shell)
- {
- this(shell, new ArrayList());
- }
-
- /**
- * Constructor when there are existing types.
- * @param shell The window hosting this dialog
- * @param currentTypes The current types as a java.util.Collection. Typically ArrayList is used
- */
- public SystemSelectFileTypesDialog(Shell shell, Collection currentTypes)
- {
- // TODO: Cannot use WorkbenchMessages -- it's internal
- super(shell, GenericMessages.TypesFiltering_title);
- this.initialSelections = currentTypes;
- // TODO: Cannot use WorkbenchMessages -- it's internal
- setInstruction(GenericMessages.TypesFiltering_message);
-
- // TODO - hack to make this work in 3.1
- String id = PlatformUI.PLUGIN_ID + ".type_filtering_dialog_context";
- setHelp(id);
- }
-
- /**
- * Constructor when there are existing types.
- * @param shell The window hosting this dialog
- * @param currentTypes The current types as an array of Strings
- */
- public SystemSelectFileTypesDialog(Shell shell, String[] currentTypes)
- {
- this(shell, Arrays.asList(currentTypes));
- }
-
- /**
- * Method declared on Dialog.
- */
- protected Control createInner(Composite parent)
- {
- // page group
- Composite composite = (Composite)createInnerComposite(parent);
- createInstructionArea(composite);
-
- listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
- data.widthHint = SIZING_SELECTION_WIDGET_WIDTH;
- listViewer.getTable().setLayoutData(data);
-
- listViewer.setLabelProvider(FileEditorMappingLabelProvider.INSTANCE);
- listViewer.setContentProvider(FileEditorMappingContentProvider.INSTANCE);
-
- addSelectionButtons(composite);
- createUserEntryGroup(composite);
- initializeViewer();
-
- // initialize page
- if (this.initialSelections != null && !this.initialSelections.isEmpty())
- checkInitialSelections();
-
- return composite;
- }
- /**
- * Return the Control to be given initial focus.
- * Child classes must override this, but can return null.
- */
- protected Control getInitialFocusControl()
- {
- return listViewer.getControl();
- }
-
- private Control createInnerComposite(Composite parent)
- {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- return composite;
- }
-
- /**
- * Sets the instruction text for this dialog.
- *
- * @param instr the instruction text
- */
- public void setInstruction(String instr)
- {
- this.instruction = instr;
- }
- /**
- * Creates the message area for this dialog.
- * <p>
- * This method is provided to allow subclasses to decide where the message
- * will appear on the screen.
- * </p>
- *
- * @param parent the parent composite
- * @return the message label
- */
- protected Label createInstructionArea(Composite composite)
- {
- Label label = new Label(composite,SWT.NONE);
- label.setText(instruction);
- return label;
- }
-
- /**
- * Add the selection and deselection buttons to the dialog.
- * @param composite org.eclipse.swt.widgets.Composite
- */
- private void addSelectionButtons(Composite composite)
- {
- Composite buttonComposite = new Composite(composite, SWT.RIGHT);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- buttonComposite.setLayout(layout);
- GridData data =
- new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- composite.setData(data);
-
- //Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, GenericMessages.getString("WizardTransferPage.selectAll"), false); //$NON-NLS-1$
- Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID,
- SystemResources.RESID_SELECTFILES_SELECTALL_BUTTON_ROOT_LABEL, false);
-
- SelectionListener listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- listViewer.setAllChecked(true);
- }
- };
- selectButton.addSelectionListener(listener);
-
-
- //Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, GenericMessages.getString("WizardTransferPage.deselectAll"), false); //$NON-NLS-1$
- Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
- SystemResources.RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_LABEL, false);
-
- listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- listViewer.setAllChecked(false);
- }
- };
- deselectButton.addSelectionListener(listener);
- }
- /**
- * Add the currently-specified extensions.
- */
- protected void addUserDefinedEntries(java.util.List result)
- {
- StringTokenizer tokenizer = new StringTokenizer(userDefinedText.getText(), TYPE_DELIMITER);
- //Allow the *. and . prefix and strip out the extension
- while (tokenizer.hasMoreTokens())
- {
- String currentExtension = tokenizer.nextToken().trim();
- if (!currentExtension.equals(""))
- {
- if (currentExtension.startsWith("*."))//$NON-NLS-1$
- result.add(currentExtension.substring(2));
- else
- {
- if (currentExtension.startsWith("."))//$NON-NLS-1$
- result.add(currentExtension.substring(1));
- else
- result.add(currentExtension);
- }
- }
- }
- }
- /**
- * Visually checks the previously-specified elements in this dialog's list
- * viewer.
- */
- protected void checkInitialSelections()
- {
-
- IFileEditorMapping editorMappings[] =
- PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
- ArrayList selectedMappings = new ArrayList();
-
- for (int i = 0; i < editorMappings.length; i++)
- {
- IFileEditorMapping mapping = editorMappings[i];
- if (this.initialSelections.contains(mapping.getExtension()))
- {
- listViewer.setChecked(mapping, true);
- selectedMappings.add(mapping.getExtension());
- }
- }
-
- //Now add in the ones not selected to the user defined list
- Iterator initialIterator = this.initialSelections.iterator();
- StringBuffer entries = new StringBuffer();
- while(initialIterator.hasNext())
- {
- String nextExtension = (String) initialIterator.next();
- if(!selectedMappings.contains(nextExtension))
- {
- entries.append(nextExtension);
- entries.append(',');
- }
- }
- this.userDefinedText.setText(entries.toString());
- }
-
- /**
- * Create the group that shows the user defined entries for the dialog.
- * @param parent the parent this is being created in.
- */
- private void createUserEntryGroup(Composite parent)
- {
- // destination specification group
- Composite userDefinedGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- userDefinedGroup.setLayout(layout);
- userDefinedGroup.setLayoutData(
- new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
-
- // TODO: Cannot use WorkbenchMessages -- it's internal
- new Label(userDefinedGroup, SWT.NONE).setText(GenericMessages.TypesFiltering_otherExtensions);
-
- // user defined entry field
- userDefinedText = new Text(userDefinedGroup, SWT.SINGLE | SWT.BORDER);
- GridData data =
- new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- userDefinedText.setLayoutData(data);
-
- userDefinedText.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent event)
- {
- if (event.widget == userDefinedText)
- {
- //okButton.setEnabled(validateFileType(userDefinedText.getText().trim()));
- setPageComplete(validateFileType(userDefinedText.getText().trim()));
- }
- }
- });
-
- }
- /**
- * Return the input to the dialog.
- */
- protected IFileEditorMapping[] getInput()
- {
- //Filter the mappings to be just those with a wildcard extension
- if (currentInput == null)
- {
- java.util.List wildcardEditors = new ArrayList();
- IFileEditorMapping [] allMappings =
- PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
- for (int i = 0; i < allMappings.length; i++)
- {
- if (allMappings[i].getName().equals("*"))//$NON-NLS-1$
- wildcardEditors.add(allMappings[i]);
- }
- currentInput = new IFileEditorMapping[wildcardEditors.size()];
- wildcardEditors.toArray(currentInput);
- }
- return currentInput;
- }
- /**
- * Initializes this dialog's viewer after it has been laid out.
- */
- private void initializeViewer()
- {
- listViewer.setInput(getInput());
- }
- /**
- * User pressed OK.
- */
- protected boolean processOK()
- {
- if (!validateFileType(userDefinedText.getText().trim()))
- return false;
-
- // Get the input children.
- IFileEditorMapping[] children = getInput();
- java.util.List list = new ArrayList();
- // Build a list of selected children.
- for (int i = 0; i < children.length; ++i)
- {
- IFileEditorMapping element = children[i];
- if (listViewer.getChecked(element))
- list.add(element.getExtension());
- }
- addUserDefinedEntries(list);
- setResult(list);
- return true;
- }
- /**
- * Set the selections made by the user, or <code>null</code> if
- * the selection was canceled.
- *
- * @param the list of selected elements, or <code>null</code> if Cancel was
- * pressed
- */
- protected void setResult(java.util.List newResult)
- {
- if (newResult == null)
- {
- result = null;
- }
- else
- {
- result = new Object[newResult.size()];
- newResult.toArray(result);
- }
- }
-
- /**
- * Validate the user input for a file type
- */
- protected boolean validateFileType(String filename)
- {
- // We need kernel api to validate the extension or a filename
-
- // check for empty name and extension
- if (filename.length() == 0)
- {
- clearErrorMessage();
- return true;
- }
-
- // check for empty extension if there is no name
- int index = filename.indexOf('.');
- if (index == filename.length() - 1)
- {
- if (index == 0 || (index == 1 && filename.charAt(0) == '*'))
- {
- // TODO: Cannot use WorkbenchMessages -- it's internal
- setErrorMessage(GenericMessages.FileExtension_extensionEmptyMessage);
- return false;
- }
- }
-
- int startScan = 0;
- if (filename.startsWith("*."))
- startScan = 2;
-
- // check for characters before *
- // or no other characters
- // or next character not '.'
- index = filename.indexOf('*', startScan);
- if (index > -1)
- {
- if (filename.length() == 1)
- {
- // TODO: Cannot use WorkbenchMessages -- it's internal
- setErrorMessage(GenericMessages.FileExtension_extensionEmptyMessage);
- return false;
- }
- if (index != 0 || filename.charAt(1) != '.')
- {
- // TODO: Cannot use WorkbenchMessages -- it's internal
- setErrorMessage(GenericMessages.FileExtension_fileNameInvalidMessage);
- return false;
- }
- }
-
- clearErrorMessage();
- return true;
- }
-
- /**
- * Returns the list of selections made by the user, or <code>null</code> if
- * the selection was canceled.
- *
- * @return the array of selected elements, or <code>null</code> if Cancel was
- * pressed
- */
- public Object[] getResult()
- {
- return result;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentElement.java
deleted file mode 100644
index 61d3bd210..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentElement.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-/**
- * When we populate a TreeViewer in a dialog, we need a simple
- * representation of the objects to populate the tree.
- * <p>
- * Works in concert with {@link org.eclipse.rse.ui.dialogs.SystemSimpleContentProvider}
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleContentElement
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleSelectDialog
- */
-public class SystemSimpleContentElement
-{
- private String name;
- private Object data;
- private SystemSimpleContentElement parent;
- private SystemSimpleContentElement[] children;
- private ImageDescriptor imageDescriptor;
- private boolean selected = false;
- private boolean isDeletable = true;
- private boolean isRenamable = true;
- private boolean isReadonly = false;
-
- /**
- * Constructor when given children as an array.
- * @param name - the display name to show for this element
- * @param data - the real object which is to be contained by this element
- * @param parent - the parent element of this element. Pass null for the root.
- * @param children - an array of SystemSimpleContentElement objects that are to be the children of this element. Can be null.
- */
- public SystemSimpleContentElement(String name, Object data,
- SystemSimpleContentElement parent, SystemSimpleContentElement[] children)
- {
- setName(name);
- setData(data);
- setParent(parent);
- setChildren(children);
- }
- /**
- * Constructor when given children as a vector.
- * @param name - the display name to show for this element
- * @param data - the real object which is to be contained by this element
- * @param parent - the parent element of this element. Pass null for the root.
- * @param children - a vector of SystemSimpleContentElement objects that are to be the children of this element. Can be null.
- */
- public SystemSimpleContentElement(String name, Object data,
- SystemSimpleContentElement parent, Vector children)
- {
- setName(name);
- setData(data);
- setParent(parent);
- setChildren(children);
- }
-
- /**
- * Return the display name for this element
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Set the display name for this element
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
- /**
- * Return the real object which this element wraps or represents
- */
- public Object getData()
- {
- return data;
- }
-
- /**
- * Set the real object which this element wraps or represents
- */
- public void setData(Object data)
- {
- this.data = data;
- }
-
- /**
- * Get the parent element
- */
- public SystemSimpleContentElement getParent()
- {
- return parent;
- }
-
- /**
- * Set the parent element
- */
- public void setParent(SystemSimpleContentElement parent)
- {
- this.parent = parent;
- }
-
- /**
- * Walk up the parent tree until we find the root
- */
- public SystemSimpleContentElement getRoot()
- {
- SystemSimpleContentElement currParent = parent;
- while (currParent.getParent() != null)
- currParent = currParent.getParent();
- return currParent;
- }
-
- /**
- * Return the child elements, or null if no children
- */
- public SystemSimpleContentElement[] getChildren()
- {
- return children;
- }
-
- /**
- * Return true if this element has children
- */
- public boolean hasChildren()
- {
- return ((children!=null) && (children.length>0));
- }
-
- /**
- * Set the child elements of this element, as an array of SystemSimpleContentElement elements
- */
- public void setChildren(SystemSimpleContentElement[] children)
- {
- this.children = children;
- }
-
- /**
- * Set the child elements of this element, as a vector of SystemSimpleContentElement elements
- */
- public void setChildren(Vector childrenVector)
- {
- if (childrenVector != null)
- {
- children = new SystemSimpleContentElement[childrenVector.size()];
- for (int idx=0; idx<childrenVector.size(); idx++)
- children[idx] = (SystemSimpleContentElement)childrenVector.elementAt(idx);
- }
- else
- children = null;
- }
-
- /**
- * Set selected state.
- * Used in SimpleSimpleSelectDialog to pre-check item in CheckboxTreeViewer
- */
- public void setSelected(boolean selected)
- {
- this.selected = selected;
- }
- /**
- * Return true if this element has been flagged as selected.
- */
- public boolean isSelected()
- {
- return selected;
- }
-
- /**
- * Set whether this item is renamable or not. Default is true.
- * Used to enable/disable rename action.
- */
- public void setRenamable(boolean renamable)
- {
- this.isRenamable = renamable;
- }
- /**
- * Return true if this item is renamable or not. Default is true.
- */
- public boolean isRenamable()
- {
- return isRenamable;
- }
-
- /**
- * Set whether this item is deletable or not. Default is true.
- * Used to enable/disable rename action.
- */
- public void setDeletable(boolean deletable)
- {
- this.isDeletable = deletable;
- }
- /**
- * Return true if this item is deletable. Will be true unless setDeletable(false) has been called.
- */
- public boolean isDeletable()
- {
- return isDeletable;
- }
-
- /**
- * Set whether this node is readonly or not. If readonly, users cannot change its selected state.
- */
- public void setReadOnly(boolean readonly)
- {
- this.isReadonly = readonly;
- }
- /**
- * Return whether this node is readonly or not. Readonly nodes cannot be selected/deselected by the user.
- */
- public boolean isReadOnly()
- {
- return isReadonly;
- }
-
- /**
- * Set the image to display for this element, in the tree viewer
- */
- public void setImageDescriptor(ImageDescriptor imageDescriptor)
- {
- this.imageDescriptor = imageDescriptor;
- }
-
- /**
- * Get the image to display for this element, in the tree viewer
- */
- public ImageDescriptor getImageDescriptor()
- {
- if (imageDescriptor != null)
- return imageDescriptor;
- else
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FOLDER_ID);
- //return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
- }
-
- /**
- * Delete the given child element.
- */
- public void deleteChild(SystemSimpleContentElement child)
- {
- if (children != null)
- {
- int nbrChildren = children.length;
- if ((nbrChildren == 1) && (child.equals(children[0])))
- children = null;
- else
- {
- SystemSimpleContentElement[] newChildren = new SystemSimpleContentElement[nbrChildren-1];
- int newIdx = 0;
- for (int idx=0; idx<children.length; idx++)
- if (!(children[idx].equals(child)))
- newChildren[newIdx++] = children[idx];
- children = newChildren;
- }
- }
- }
-
- /**
- * Add the given child element at the given zero-based position
- */
- public void addChild(SystemSimpleContentElement child, int pos)
- {
- if (children == null)
- {
- children = new SystemSimpleContentElement[1];
- children[0] = child;
- }
- else
- {
- int newNbr = children.length + 1;
- SystemSimpleContentElement[] newChildren = new SystemSimpleContentElement[newNbr];
- int oldIdx = 0;
- for (int idx=0; idx<newNbr; idx++)
- if (idx == pos)
- newChildren[idx] = child;
- else
- newChildren[idx] = children[oldIdx++];
- children = newChildren;
- }
- }
-
- /**
- * Maps to getName()
- */
- public String toString()
- {
- return getName();
- }
-
- /**
- * Find element corresponding to given data
- */
- public static SystemSimpleContentElement getDataElement(SystemSimpleContentElement root, Object data)
- {
- SystemSimpleContentElement[] children = root.getChildren();
- SystemSimpleContentElement match = null;
- if ((children!=null)&&(children.length>0))
- {
- for (int idx=0; (match==null)&&(idx<children.length); idx++)
- if (children[idx].getData() == data)
- match = children[idx];
- }
- if ((match==null)&&(children!=null)&&(children.length>0))
- {
- for (int idx=0; (match==null)&&(idx<children.length); idx++)
- match = getDataElement(children[idx], data);
- }
- return match;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentProvider.java
deleted file mode 100644
index 038d890c5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleContentProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * When we need to populate a TreeViewer in a dialog,
- * we can use the {@link org.eclipse.rse.ui.dialogs.SystemSimpleContentElement} class to
- * represent each element, and then use this provider
- * to drive the tree.
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleContentElement
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleSelectDialog
- */
-public class SystemSimpleContentProvider extends LabelProvider
- implements ITreeContentProvider, ILabelProvider
-{
- private Map imageTable = new Hashtable(5);
-
- /**
- * Constructor for SystemSelectFilterPoolContentProvider
- */
- public SystemSimpleContentProvider()
- {
- super();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object element)
- {
- return getElement(element).getChildren();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element)
- {
- return getElement(element).getParent();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element)
- {
- Object[] children = getChildren(element);
- if (children == null)
- return false;
- else
- return children.length > 0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object element)
- {
- return getChildren(element);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
-
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
-
- // -------------------------
- // ILabelProvider methods...
- // -------------------------
- /**
- * Returns the image for the given object.
- */
- public Image getImage(Object element)
- {
- ImageDescriptor descriptor = getElement(element).getImageDescriptor();
- if (descriptor == null)
- return null;
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- return image;
- }
- /**
- * Returns the label text for the given object.
- */
- public String getText(Object element)
- {
- return getElement(element).getName();
- }
-
-
- // -------------------------
- // Local/private methods...
- // -------------------------
- /**
- * Casts the given object to SystemSimpleContentElement
- */
- protected SystemSimpleContentElement getElement(Object element)
- {
- return (SystemSimpleContentElement)element;
- }
-
- /**
- * Returns the image for the given object, given its image descriptor
- */
- protected Image getImageFromDescriptor(ImageDescriptor descriptor)
- {
- if (descriptor == null)
- return null;
- //obtain the cached image corresponding to the descriptor
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- return image;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleCopyDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleCopyDialog.java
deleted file mode 100644
index 69708f7c8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleCopyDialog.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.ISystemCopyTargetSelectionCallback;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Dialog for selecting a target location on a copy operation.
- */
-public class SystemSimpleCopyDialog
- extends SystemPromptDialog
- implements //ISystemPropertyConstants,
- ISelectionChangedListener
-{
- private String promptString;
- //private Label prompt;
- private TreeViewer tree;
- private SystemSimpleContentProvider provider = new SystemSimpleContentProvider();
- private SystemSimpleContentElement copyTreeContent, initialSelection;
- private ISystemCopyTargetSelectionCallback caller = null;
- public static final int MODE_COPY = 0;
- public static final int MODE_MOVE = 1;
- private Object targetContainer = null;
-
- /**
- * Constructor
- */
- public SystemSimpleCopyDialog(Shell shell, String prompt, int mode, ISystemCopyTargetSelectionCallback caller,
- SystemSimpleContentElement copyTreeContent, SystemSimpleContentElement selection)
- {
- //super(shell, title);
- super(shell, (mode==MODE_COPY ? SystemResources.RESID_COPY_TITLE : SystemResources.RESID_MOVE_TITLE));
- this.caller = caller;
- if (prompt == null)
- if (mode == MODE_COPY)
- prompt = SystemResources.RESID_COPY_PROMPT;
- else
- prompt = SystemResources.RESID_MOVE_PROMPT;
- promptString = prompt;
- this.copyTreeContent = copyTreeContent;
- this.initialSelection = selection;
- //setCancelButtonLabel(RSEUIPlugin.getString(BUTTON_CLOSE));
- //pack();
- }
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
- return fMessageLine;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return tree.getControl();
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 1;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // PROMPT
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite_prompts, promptString);
-
- // WORK-WITH TREE
- tree = new TreeViewer(new Tree(composite_prompts, SWT.SINGLE | SWT.BORDER));
- GridData treeData = new GridData();
- treeData.horizontalAlignment = GridData.FILL;
- treeData.grabExcessHorizontalSpace = true;
- treeData.widthHint = 300;
- treeData.heightHint= 200;
- treeData.verticalAlignment = GridData.CENTER;
- treeData.grabExcessVerticalSpace = true;
- tree.getTree().setLayoutData(treeData);
-
- tree.setContentProvider(provider);
- tree.setLabelProvider(provider);
-
- // populate tree
- if (copyTreeContent != null)
- tree.setInput(copyTreeContent);
-
- // expand and pre-check
- if (initialSelection != null)
- tree.setSelection(new StructuredSelection(initialSelection),true);
-
- // preset the OK button
- setPageComplete();
-
- // add selection listener to tree
- tree.addSelectionChangedListener(this);
-
-
- //ActionContributionItem[] actionItems = createActionContributionItems();
- //Composite buttons = createButtonBar(composite_prompts, actionItems);
-
- //RSEUIPlugin.getDefault().getSystemRegistry().addSystemResourceChangeListener(this);
-
- return composite_prompts;
- }
-
- /**
- * ISelectionChangedListener method. Called when user changes selection in tree
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- SystemSimpleContentElement element = (SystemSimpleContentElement)sel.getFirstElement();
- element.setSelected(true);
- setPageComplete();
- }
-
- /**
- * Return current selection
- */
- public SystemSimpleContentElement getSelectedElement()
- {
- IStructuredSelection sel = (IStructuredSelection)tree.getSelection();
- if ((sel == null) || sel.isEmpty())
- return null;
- else
- return (SystemSimpleContentElement)sel.getFirstElement();
- }
- /**
- * Return true if something selected
- */
- public boolean isSelectionEmpty()
- {
- IStructuredSelection sel = (IStructuredSelection)tree.getSelection();
- return sel.isEmpty();
- }
-
- public void clearSelection()
- {
- tree.setSelection((ISelection)null);
- }
-
-
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- boolean closeDialog = verify();
- if (closeDialog)
- {
- SystemSimpleContentElement seldObj = getSelectedElement();
- if (seldObj != null)
- {
- targetContainer = seldObj.getData();
- setOutputObject(targetContainer);
- }
- else
- {
- closeDialog = false;
- setPageComplete(false);
- }
- }
- return closeDialog;
- }
-
- public boolean close()
- {
- //RSEUIPlugin.getDefault().getSystemRegistry().removeSystemResourceChangeListener(this);
- return super.close();
- }
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- String errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
-
- if (errMsg != null)
- controlInError.setFocus();
- return (errMsg == null);
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = !isSelectionEmpty();
- if (pageComplete)
- {
- pageComplete = caller.isValidTargetParent(getSelectedElement());
- }
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
- /**
- * Callback from new action to get index of initial manager to select
- *
- public int getFilterPoolManagerSelection()
- {
- int selection = 0;
- SystemSimpleContentElement element = getSelectedElement();
- Object elementData = element.getData();
- if (elementData != null)
- {
- if (elementData instanceof SystemFilterPoolManager)
- selection = getManagerIndex((SystemFilterPoolManager)elementData);
- else if (elementData instanceof SystemFilterPool)
- selection = getManagerIndex(((SystemFilterPool)elementData).getSystemFilterPoolManager());
- }
- //System.out.println("In getFilterPoolManagerSelection(). Returning "+selection);
- return selection;
- }
- */
-
- // -----------------
- // OUTPUT METHODS...
- // -----------------
- /**
- * Get the selected target container
- */
- public Object getTargetContainer()
- {
- return targetContainer;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleSelectDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleSelectDialog.java
deleted file mode 100644
index bb5ce7518..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemSimpleSelectDialog.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Dialog that uses a checkbox tree viewer to prompt users to select hierarchical items.
- * Works in concert with {@link org.eclipse.rse.ui.dialogs.SystemSimpleContentElement}
- * and {@link org.eclipse.rse.ui.dialogs.SystemSimpleContentProvider}.
- * <p>
- * The {@link #setInputObject(SystemSimpleContentElement)} method is used to populate the selection tree:
- * <ul>
- * <li>The passed object must be of type SystemSimpleContentElement
- * <li>The method getChildren will be called on that object to get initial visible elements
- * <li>As user expands each item, getChildren() is progressively called
- * <li>The initial selection state of each item is determined by calling isSelected on that item
- * </ul>
- * <p>
- * The trick to using this is to first populate a hierarchy of SystemSimpleContentElement elements,
- * each one wrapping one of your own model objects, and then passing to this constructor the root
- * element.
- * <p>
- * Upon successful completion of this dialog (wasCancelled() returns false), the model is
- * updated to reflect the selections. Call getUpdatedContent() to return the root node, if need be,
- * and then walk the nodes. The selected items are those that return true
- * to {@link org.eclipse.rse.ui.dialogs.SystemSimpleContentElement#isSelected()}.
- *
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleContentElement
- * @see org.eclipse.rse.ui.dialogs.SystemSimpleContentProvider
- */
-public class SystemSimpleSelectDialog extends SystemPromptDialog
- implements ISystemPropertyConstants,
- ICheckStateListener
-{
- private String promptString;
- //private Label prompt;
- private CheckboxTreeViewer tree;
- private SystemSimpleContentProvider provider = new SystemSimpleContentProvider();
- private SystemSimpleContentElement preSelectedRoot = null;
- private boolean initialized = false;
-
- /**
- * Constructor
- */
- public SystemSimpleSelectDialog(Shell shell, String title, String prompt)
- {
- super(shell, title);
- promptString = prompt;
- //pack();
- }
-
- /**
- * Set the root to preselect
- */
- public void setRootToPreselect(SystemSimpleContentElement preSelectedRoot)
- {
- this.preSelectedRoot = preSelectedRoot;
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
- //form.setMessageLine(msgLine);
- return fMessageLine;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- //checkNewTreeElements(provider.getElements(getInputObject()));
- //select the first element in the list
- //Object[] elements = (provider.getElements(getInputObject());
- //Object primary= elements.length > 0 ? elements[0] : null;
- //if (primary != null)
- // tree.setSelection(new StructuredSelection(primary));
-
- return tree.getControl();
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 1;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // PROMPT
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite_prompts, promptString);
-
- // CHECKBOX SELECT TREE
- tree = new CheckboxTreeViewer(new Tree(composite_prompts, SWT.CHECK | SWT.BORDER));
- GridData treeData = new GridData();
- treeData.horizontalAlignment = GridData.FILL;
- treeData.grabExcessHorizontalSpace = true;
- treeData.widthHint = 300;
- treeData.heightHint= 300;
- treeData.verticalAlignment = GridData.FILL;
- treeData.grabExcessVerticalSpace = true;
- tree.getTree().setLayoutData(treeData);
-
- tree.setContentProvider(provider);
- tree.setLabelProvider(provider);
-
- // populate tree
- Object inputObject = getInputObject();
- if (inputObject != null)
- initializeInput((SystemSimpleContentElement)inputObject);
-
- // expand and pre-check
- tree.expandAll();
- tree.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
-
- if (preSelectedRoot != null)
- tree.reveal(preSelectedRoot);
-
- // add selection listener to tree
- tree.addCheckStateListener(this);
-
- return composite_prompts;
- }
-
- /**
- * ICheckStateChangedListener method. Called when user changes selection in tree
- */
- public void checkStateChanged(CheckStateChangedEvent event)
- {
- SystemSimpleContentElement element = (SystemSimpleContentElement)event.getElement();
-
- if (element.isReadOnly())
- {
- tree.setChecked(element, element.isSelected());
- return;
- }
-
- boolean checked = event.getChecked();
- element.setSelected(checked);
-
- SystemSimpleContentElement parent = element.getParent();
- if (parent != null)
- {
- boolean gray = getShouldBeGrayed(parent);
- boolean check= getShouldBeChecked(parent);
- tree.setChecked(parent, check);
- tree.setGrayed(parent, gray);
- //System.out.println("...setting parent grayed, checked to " + gray + ", " + check);
- }
-
-
- // On check, check all children
- if (checked)
- {
- tree.setSubtreeChecked(element, true);
- checkSubtreeModel(element, true);
- //System.out.println("...setting setSubtreeChecked true for " + element);
- return;
- }
- // On uncheck & gray, remain check but ungray
- // and check all its children
- if (tree.getGrayed(element))
- {
- tree.setChecked(element, true);
- tree.setGrayed(element, false);
- tree.setSubtreeChecked(element, true);
- checkSubtreeModel(element, true);
- //System.out.println("...setting setChecked(true), setGrayed(false) for " + element);
- //System.out.println("...setting setSubtreeChecked true for " + element);
- return;
- }
- // On uncheck & not gray, uncheck all its children
- tree.setSubtreeChecked(element, false);
- checkSubtreeModel(element, false);
- //System.out.println("...setting setSubtreeChecked false for " + element);
- }
-
- private void checkSubtreeModel(SystemSimpleContentElement parent, boolean check)
- {
- parent.setSelected(check);
- SystemSimpleContentElement[] childElements = parent.getChildren();
- if (childElements != null)
- {
- for (int idx=0; idx<childElements.length; idx++)
- {
- //childElements[idx].setSelected(check);
- checkSubtreeModel(childElements[idx],check);
- }
- }
- }
-
-
- /**
- * Override of parent. We only support a specific type of input, so we test for it and
- * throw it out if we don't get it. This is necessary to defeat some default action.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- if (inputObject instanceof SystemSimpleContentElement)
- setInputObject((SystemSimpleContentElement)inputObject);
- else
- System.out.println("UNEXPECTED INPUT IN SYSTEMSELECTINPUTDIALOG: "+inputObject);
- }
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(SystemSimpleContentElement inputObject)
- {
- //System.out.println("INSIDE SETINPUTOBJECT: " + inputObject + ", "+inputObject.getClass().getName());
- super.setInputObject(inputObject);
- initializeInput(inputObject);
- }
-
- /**
- * Set the tree input, initialize checked state
- */
- private void initializeInput(SystemSimpleContentElement inputObject)
- {
- if ((tree != null) && !initialized)
- {
- tree.setInput(inputObject);
- SystemSimpleContentElement[] gray = getPreGrayedElements(inputObject,null);
- SystemSimpleContentElement[] check= getPreSelectedElements(inputObject,null);
- SystemSimpleContentElement[] disable= getReadOnlyElements(inputObject,null);
- tree.setCheckedElements(check);
- tree.setGrayedElements(gray);
- if ((disable != null) && (disable.length>0))
- {
- for (int idx=0; idx<disable.length; idx++)
- {
- SystemSimpleContentElement currElement = disable[idx];
- tree.setGrayed(currElement, true); // so it appears readonly
- }
- }
-
- if (preSelectedRoot != null)
- tree.setSelection(new StructuredSelection(preSelectedRoot), true);
-
- initialized = true;
- }
- }
-
- /**
- * Determine, recursively, the tree elements pre-determined to be read-only
- */
- private SystemSimpleContentElement[] getReadOnlyElements(SystemSimpleContentElement input, Vector oldV)
- {
- Vector v = (oldV==null) ? new Vector() : oldV;
- SystemSimpleContentElement[] children = (SystemSimpleContentElement[])provider.getElements(input);
- if (children != null)
- for (int idx = 0; idx<children.length; idx++)
- {
- if (children[idx].isReadOnly())
- {
- v.addElement(children[idx]);
- //System.out.println("Adding readOnly element: " + children[idx]);
- }
- getReadOnlyElements(children[idx], v);
- }
-
- if (oldV != null)
- return null;
-
- SystemSimpleContentElement[] readonlyArray = new SystemSimpleContentElement[v.size()];
- for (int idx=0; idx<readonlyArray.length; idx++)
- readonlyArray[idx] = (SystemSimpleContentElement)v.elementAt(idx);
- return readonlyArray;
- }
-
- /**
- * Determine, recursively, the tree elements pre-determined for selection
- */
- private SystemSimpleContentElement[] getPreSelectedElements(SystemSimpleContentElement input, Vector oldV)
- {
- Vector v = (oldV==null) ? new Vector() : oldV;
- SystemSimpleContentElement[] children = (SystemSimpleContentElement[])provider.getElements(input);
- if (children != null)
- for (int idx = 0; idx<children.length; idx++)
- {
- if (children[idx].isSelected())
- {
- v.addElement(children[idx]);
- //System.out.println("Adding checked element: " + children[idx]);
- }
- getPreSelectedElements(children[idx], v);
- }
-
- if (oldV != null)
- return null;
-
- SystemSimpleContentElement[] selected = new SystemSimpleContentElement[v.size()];
- for (int idx=0; idx<selected.length; idx++)
- selected[idx] = (SystemSimpleContentElement)v.elementAt(idx);
- return selected;
- }
-
- /**
- *
- */
- private SystemSimpleContentElement[] getPreGrayedElements(SystemSimpleContentElement input, Vector oldV)
- {
- Vector v = (oldV==null) ? new Vector() : oldV;
- SystemSimpleContentElement[] children = (SystemSimpleContentElement[])provider.getElements(input);
- boolean allSame = true;
- boolean currState = false;
- boolean hasGrayChildren = false;
- if ((children != null) && (children.length>0))
- {
- currState = children[0].isSelected();
- for (int idx = 0; idx<children.length; idx++)
- {
- if (allSame && (currState != children[idx].isSelected()))
- allSame = false;
- //if (children[idx].isSelected())
- // v.addElement(children[idx]);
- int oldSize = v.size();
- getPreGrayedElements(children[idx], v); // recursively check children's children
- if (v.size() != oldSize) // add any new items?
- hasGrayChildren = true;
- }
- if (!allSame || hasGrayChildren) // some children checked, others not checked? Or any child grayed out?
- {
- v.addElement(input); // gray out this parent
- input.setSelected(true); // select this parent
- //System.out.println("Adding grayed element: " + input);
- }
- else if (allSame && currState)
- input.setSelected(true); // select this parent
- } // if no children, do not gray
-
- if (oldV != null)
- return null;
-
- SystemSimpleContentElement[] grayed = new SystemSimpleContentElement[v.size()];
- for (int idx=0; idx<grayed.length; idx++)
- grayed[idx] = (SystemSimpleContentElement)v.elementAt(idx);
- return grayed;
- }
-
- /**
- * Dynamically determine grayed state of parent element
- */
- public boolean getShouldBeGrayed(SystemSimpleContentElement parent)
- {
- SystemSimpleContentElement[] children = parent.getChildren();
- boolean gray = false;
-
- if ((children == null) || (children.length == 0))
- return gray;
-
- boolean allSame = true;
- boolean currState = children[0].isSelected();
- boolean hasGrayChildren = false;
-
- for (int idx=0; idx<children.length; idx++)
- {
- if (allSame && (children[idx].isSelected() != currState))
- allSame = false;
- if (getShouldBeGrayed(children[idx]))
- hasGrayChildren = true;
- }
-
- if (!allSame || hasGrayChildren) // some children checked, others not checked? Or any child grayed out?
- gray = true;
-
- return gray;
- }
-
- /**
- * Dynamically determine checked state of parent element
- */
- public boolean getShouldBeChecked(SystemSimpleContentElement parent)
- {
- boolean checked = false;
-
- SystemSimpleContentElement[] children = parent.getChildren();
- boolean gray = false;
-
- if ((children == null) || (children.length == 0))
- return gray;
-
- boolean anyChecked = false;
- for (int idx=0; idx<children.length; idx++)
- {
- if (children[idx].isSelected())
- anyChecked = true;
- else
- {
- }
- }
-
- if (anyChecked)
- checked = true;
-
- return checked;
- }
-
- /**
- * Return updated input model
- */
- public SystemSimpleContentElement getUpdatedContent()
- {
- return (SystemSimpleContentElement)super.getInputObject();
- }
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- //newNameString = newName.getText().trim();
- boolean closeDialog = verify();
- if (closeDialog)
- {
- }
- return closeDialog;
- }
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- String errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
-
- if (errMsg != null)
- controlInError.setFocus();
- return (errMsg == null);
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = true;
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemTestFilterStringDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemTestFilterStringDialog.java
deleted file mode 100644
index 4bdde6152..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemTestFilterStringDialog.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.SystemTestFilterStringAPIProviderImpl;
-import org.eclipse.rse.ui.view.SystemViewForm;
-import org.eclipse.rse.ui.widgets.SystemHostCombo;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Dialog for testing a filter string. Typically called from a create/update filter string dialog.
- * <p>
- * Caller must supply the subsystem which owns this existing or potential filter string.
- * <p>
- * This dialog contains a dropdown for selecting connections to use in the test. Only connections which
- * contain subsystems with the same parent factory as the given subsystem factory are shown.
- *
- */
-public class SystemTestFilterStringDialog
- extends SystemPromptDialog
- implements ISelectionChangedListener, SelectionListener
-{
- protected ISubSystem subsystem = null;
- protected ISystemRegistry sr = null;
- protected String subsystemFactoryId = null;
- protected String filterString = null;
- protected SystemTestFilterStringAPIProviderImpl inputProvider = null;
- // GUI widgets
- protected Label prompt, promptValue;
- protected SystemViewForm tree;
- protected SystemHostCombo connectionCombo;
-
- /**
- * Constructor
- * @param shell The shell to hang the dialog off of
- * @param subsystem The contextual subsystem that owns this filter string
- * @param filterString The filter string that is to be tested.
- */
- public SystemTestFilterStringDialog(Shell shell, ISubSystem subsystem, String filterString)
- {
- this(shell, SystemResources.RESID_TESTFILTERSTRING_TITLE, subsystem, filterString);
- }
- /**
- * Constructor when unique title desired
- * @param shell The shell to hang the dialog off of
- * @param title The title to give the dialog
- * @param subsystem The contextual subsystem that owns this filter string
- * @param filterString The filter string that is to be tested.
- */
- public SystemTestFilterStringDialog(Shell shell, String title, ISubSystem subsystem, String filterString)
- {
- super(shell, title);
- setCancelButtonLabel(SystemResources.BUTTON_CLOSE);
- setShowOkButton(false);
- setBlockOnOpen(true); // always modal
- this.subsystem = subsystem;
- this.filterString = filterString;
- this.subsystemFactoryId = subsystem.getSubSystemConfiguration().getId();
- sr = RSEUIPlugin.getTheSystemRegistry();
- setNeedsProgressMonitor(true);
- //pack();
- }
-
- // ------------------
- // PUBLIC METHODS...
- // ------------------
- // ------------------
- // PRIVATE METHODS...
- // ------------------
- /**
- * Private method.
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- //return tree.getTreeControl();
- return connectionCombo.getCombo();
- }
-
- /**
- * Private method.
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int gridColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, gridColumns);
-
- // connection selection combo
- connectionCombo = SystemWidgetHelpers.createConnectionCombo(composite_prompts, null, null, subsystem.getSubSystemConfiguration(),
- null, null, subsystem.getHost(), gridColumns, false);
-
- // filter string prompt
- // Composite promptComposite = composite_prompts;
- Composite promptComposite = connectionCombo;
- prompt = SystemWidgetHelpers.createLabel(promptComposite, SystemResources.RESID_TESTFILTERSTRING_PROMPT_LABEL, SystemResources.RESID_TESTFILTERSTRING_PROMPT_TOOLTIP);
- promptValue = SystemWidgetHelpers.createLabel(promptComposite, SystemResources.RESID_TESTFILTERSTRING_PROMPT_LABEL, SystemResources.RESID_TESTFILTERSTRING_PROMPT_TOOLTIP);
-
- promptValue.setToolTipText(filterString); // Since the dialog is not resizable, this is the way to show the whole string
-
- // Make sure the label width is not longer than the window width
- // Otherwise the combo box dropdown arrow above it will be pushed beyond the window and invisible
- //promptValue.setText(filterString);
-
- String label = filterString;
-
- if ( label.length() > 30)
- label = label.substring(0,30) + " ..."; // Use ... to show that not entire string is displayed
- promptValue.setText( label);
-
- //Point point = promptValue.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //GridData data = new GridData();
- //data.widthHint = point.x < 230 ? point.x : 230;
- GridData data = new GridData();
- data.widthHint = 200;
- promptValue.setLayoutData(data);
-
- // TREE
- inputProvider = new SystemTestFilterStringAPIProviderImpl(subsystem, filterString);
- tree = new SystemViewForm(getShell(), composite_prompts, SWT.NULL, inputProvider, false, getMessageLine(), gridColumns, 1);
-
- // add selection listeners
- //tree.addSelectionChangedListener(this);
- connectionCombo.addSelectionListener(this);
-
- return composite_prompts;
- }
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- super.setInputObject(inputObject);
- }
-
- /**
- * When re-using this dialog between runs, call this to reset its contents.
- * Assumption: original input subsystem factory Id doesn't change between runs
- */
- public void reset(ISubSystem subsystem, String filterString)
- {
- this.subsystem = subsystem;
- this.filterString = filterString;
- //this.subsystemFactoryId = subsystem.getParentSubSystemConfiguration().getId();
- inputProvider.setSubSystem(subsystem);
- inputProvider.setFilterString(filterString);
- tree.reset(inputProvider);
- }
-
- /**
- * ISelectionChangedListener interface method
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- public void widgetSelected(SelectionEvent event)
- {
- Object src = event.getSource();
- //if (src == connectionCombo.getCombo())
- {
- //System.out.println("connection changed");
- IHost newConnection = connectionCombo.getHost();
- ISubSystem[] newSubSystems = sr.getSubSystems(subsystemFactoryId, newConnection);
- ISubSystem newSubSystem = null;
- if ((newSubSystems != null) && (newSubSystems.length>0))
- {
- newSubSystem = newSubSystems[0];
- subsystemFactoryId = subsystem.getSubSystemConfiguration().getId();
- }
- inputProvider.setSubSystem(newSubSystem);
- tree.reset(inputProvider);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemUpdateConnectionDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemUpdateConnectionDialog.java
deleted file mode 100644
index efbee4518..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemUpdateConnectionDialog.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.model.ISystemRegistryUI;
-import org.eclipse.rse.ui.ISystemConnectionFormCaller;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Dialog for updating a connection.
- * THIS DIALOG AND ITS ACTION ARE NO LONGER USED. THEY ARE REPLACED WITH A PROPERTIES DIALOG.
- */
-public class SystemUpdateConnectionDialog extends SystemPromptDialog implements ISystemConnectionFormCaller
-{
- protected SystemConnectionForm form;
- protected String parentHelpId;
-
- /**
- * Constructor for SystemUpdateConnectionDialog
- */
- public SystemUpdateConnectionDialog(Shell shell)
- {
- super(shell, SystemResources.RESID_CHGCONN_TITLE);
- parentHelpId = RSEUIPlugin.HELPPREFIX + "dcon0000"; //$NON-NLS-1$
- getForm();
- //pack();
- }
-
- /**
- * Overrride this if you want to supply your own form. This may be called
- * multiple times so please only instantatiate if the form instance variable
- * is null, and then return the form instance variable.
- * @see org.eclipse.rse.ui.SystemConnectionForm
- */
- public SystemConnectionForm getForm()
- {
- //System.out.println("INSIDE GETFORM");
- if (form == null)
- {
- form = new SystemConnectionForm(getMessageLine(),this);
- }
- return form;
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- ISystemMessageLine msgLine = super.createMessageLine(c);
- form.setMessageLine(msgLine);
- return fMessageLine;
- }
-
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- Control control = form.getInitialFocusControl();
- return control;
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- Control c = form.createContents(parent, SystemConnectionForm.UPDATE_MODE, parentHelpId);
- return c;
- }
-
- /**
- * Override of parent. Must pass selected object onto the form for initializing fields.
- * Called by SystemDialogAction's default run() method after dialog instantiated.
- */
- public void setInputObject(Object inputObject)
- {
- super.setInputObject(inputObject);
- form.initializeInputFields((IHost)inputObject);
-
- IHost conn = (IHost)inputObject;
- ISystemValidator connectionNameValidators[] = new ISystemValidator[1];
- connectionNameValidators[0] = SystemConnectionForm.getConnectionNameValidator(conn);
- form.setConnectionNameValidators(connectionNameValidators);
- }
-
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- boolean closeDialog = form.verify(true);
- if (closeDialog)
- {
- IHost conn = (IHost)getInputObject();
- ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.updateHost( getShell(),conn,conn.getSystemType(),form.getConnectionName(),
- form.getHostName(), form.getConnectionDescription(),
- form.getDefaultUserId(), form.getUserIdLocation() );
- }
- return closeDialog;
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION FORM...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java
deleted file mode 100644
index c299f1ee9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.wizards.ISystemWizard;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Base wizard dialog class. Extends Eclipse WizardDialog class to add
- * support for the ISystemPromptDialog interface methods. These make it
- * easy to pass an input object to your wizard, if your wizard implements
- * ISystemWizard.
- * <p>This class is most effective when used together with {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard} and
- * with {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction}. Indeed,
- * if you use SystemBaseWizardAction, this class is automatically used for the dialog. It supports
- * propogation of information from the action, to the wizard, to the wizard dialog and to the wizard pages.
- * </p>
- * <p>The advantages to using this class versus the base JFace WizardDialog class is:
- * </p>
- * <ul>
- * <li>Supports settings of an input object, which is propogated to the wizard and its pages.
- * <li>Supports querying of an output object, as set by the wizard.
- * <li>Supports a {@link #wasCancelled()} method for callers to know if the wizard was dismissed or cancelled by the user.
- * <li>Supports setting of the overall contextual help, which is propogated to each page.
- * <li>Supports an {@link #updateSize(IWizardPage)} method that can be called by a page when it dynamically grows the page size.
- * <li>When a progress monitor is not required, the real estate for the monitor is reclaimed, reducing the size of the wizard
- * <li>Whan a progress monitor is required, registers this with the RSE system registry, so it is using for long-running remote communications requests.
- * </ul>
- *
- * <p>To use this class, simply instantiate it, passing a wizard that implements {@link org.eclipse.rse.ui.wizards.ISystemWizard},
- * which {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard} does. If you use {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction},
- * then this is done for you.
- *
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizard
- * @see org.eclipse.rse.ui.actions.SystemBaseWizardAction
- */
-public class SystemWizardDialog
- extends WizardDialog
- implements ISystemPromptDialog
-{
- protected ISystemWizard wizard;
- protected String helpId;
-
- /**
- * Constructor
- */
- public SystemWizardDialog(Shell shell, ISystemWizard wizard)
- {
- super(shell, wizard);
- this.wizard = wizard;
- wizard.setSystemWizardDialog(this);
- }
- /**
- * Constructor two. Use when you have an input object at instantiation time.
- */
- public SystemWizardDialog(Shell shell, ISystemWizard wizard, Object inputObject)
- {
- super(shell,wizard);
- this.wizard = wizard;
- setInputObject(inputObject);
- wizard.setSystemWizardDialog(this);
- }
-
- /**
- * For explicitly setting input object. Called by SystemDialogAction
- */
- public void setInputObject(Object inputObject)
- {
- wizard.setInputObject(inputObject);
- }
- /**
- * For explicitly getting input object.
- */
- public Object getInputObject()
- {
- return wizard.getInputObject();
- }
-
- /**
- * For explicitly getting output object after wizard is dismissed. Set by the
- * dialog's processOK method.
- */
- public Object getOutputObject()
- {
-
- return wizard.getOutputObject();
- }
-
- /**
- * Allow caller to determine if wizard was cancelled or not.
- */
- public boolean wasCancelled()
- {
- //System.out.println("Inside wasCancelled of SystemWizardDialog: " + wizard.wasCancelled());
- return wizard.wasCancelled();
- }
-
- /**
- * Set the help context id for this wizard dialog
- */
- public void setHelp(String id)
- {
- helpId = id;
- if (wizard != null) {
- wizard.setHelp(id);
- }
- }
-
- /**
- * Get the help context id for this wizard dialog, as set in setHelp
- */
- public String getHelpContextId()
- {
- return helpId;
- }
-
- /**
- * Intercept of parent method so we can automatically register the wizard's progress monitor
- * with the SystemRegistry for all framework progress monitor requests, if user has specified
- * they need a progress monitor for this wizard.
- */
- protected Control createDialogArea(Composite parent)
- {
- boolean needsMonitor = wizard.needsProgressMonitor();
- Control ctrl = super.createDialogArea(parent);
- if (!needsMonitor)
- {
- IProgressMonitor pm = getProgressMonitor();
- ((ProgressMonitorPart)pm).dispose();
- }
- if (needsMonitor && RSEUIPlugin.isTheSystemRegistryActive())
- {
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(getShell(), this);
- // add a dispose listener
- getShell().addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent e)
- {
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- }
- });
- }
- return ctrl;
- }
-
- /**
- * Exposes this nice new 2.0 capability to the public.
- */
- public void updateSize(IWizardPage page)
- {
- super.updateSize(page);
- }
-
- /**
- * Expose inherited protected method convertWidthInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertWidthInCharsToPixels(int chars)
- {
- return convertWidthInCharsToPixels(chars);
- }
- /**
- * Expose inherited protected method convertHeightInCharsToPixels as a publicly
- * excessible method
- */
- public int publicConvertHeightInCharsToPixels(int chars)
- {
- return convertHeightInCharsToPixels(chars);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWorkWithHistoryDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWorkWithHistoryDialog.java
deleted file mode 100644
index ddf755e1e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWorkWithHistoryDialog.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.dialogs;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ArmEvent;
-import org.eclipse.swt.events.ArmListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-
-
-/**
- * A dialog that allows the user to manipulate the history associated with
- * a widget.
- * <p>
- * The history strings are shown in a simple list, and the user can delete
- * items from the list or re-order items in the list.
- */
-public class SystemWorkWithHistoryDialog extends SystemPromptDialog implements ISystemIconConstants, Listener, ArmListener
-{
- private String[] historyInput;
- private String[] historyOutput;
- private String[] defaultHistory;
- //private Label verbage;
- private List historyList;
- private Button rmvButton, clearButton, mupButton, mdnButton;
- private Group group;
- protected Menu popupMenu;
- protected MenuItem clearMI, rmvMI, mupMI, mdnMI;
-
-
- /**
- * Constructor for SystemWorkWithHistoryDialog
- */
- public SystemWorkWithHistoryDialog(Shell shell, String[] history)
- {
- super(shell, SystemResources.RESID_WORKWITHHISTORY_TITLE);
- historyInput = history;
-
- //pack();
- setHelp(RSEUIPlugin.HELPPREFIX+"dwwh0000");
- setInitialOKButtonEnabledState(false); //d41471
- }
-
- /**
- * Set the items to default the history to. These are sacred and can't be
- * deleted in this dialog.
- */
- public void setDefaultHistory(String[] items)
- {
- this.defaultHistory = items; // pc41439
- }
- /**
- * Return true if the given string is among the default history items
- */
- private boolean inDefaultHistory(String toTest) // pc41439
- {
- boolean inDefault = false;
- if (defaultHistory != null)
- for (int idx=0; !inDefault && (idx<defaultHistory.length); idx++)
- if (defaultHistory[idx].equals(toTest))
- inDefault = true;
- return inDefault;
- }
- /**
- * Return true any of the currently selected strings are among the default history items
- */
- private boolean selectedInDefaultHistory() /// pc41439
- {
- boolean inDefault = false;
- if (defaultHistory != null)
- {
- String[] currSelection = historyList.getSelection();
- if (currSelection != null)
- for (int idx=0; !inDefault && (idx<currSelection.length); idx++)
- inDefault = inDefaultHistory(currSelection[idx]);
- }
- return inDefault;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return historyList;
- }
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // verbage
- /*verbage =*/ SystemWidgetHelpers.createLabel(composite,SystemResources.RESID_WORKWITHHISTORY_VERBAGE, nbrColumns);
-
- // History list
- init(composite, nbrColumns);
-
- return composite;
- }
- /**
- * Create and initialize labeled group
- */
- protected Group init(Composite parent, int nbrColumns)
- {
- group = SystemWidgetHelpers.createGroupComposite(parent,nbrColumns,SystemResources.RESID_WORKWITHHISTORY_PROMPT);
- //((GridData)group.getLayoutData()).horizontalSpan =horizontalSpan;
- //((GridData)group.getLayoutData()).verticalSpan =verticalSpan;
- // CREATE THE LIST BOX
- historyList = SystemWidgetHelpers.createListBox(group,null,null,false);
- ((GridData)historyList.getLayoutData()).widthHint = 200;
- //((GridData)list.getLayoutData()).horizontalSpan = listboxspan;
- //((GridData)list.getLayoutData()).heightHint = SWT.DEFAULT;
- //((GridData)list.getLayoutData()).heightHint = buttonHeight * maxButtonsHigh;
- ((GridData)group.getLayoutData()).grabExcessVerticalSpace = true;
-
- popupMenu = new Menu(historyList);
-
- Composite rightHandSide = SystemWidgetHelpers.createComposite(group,1);
- clearButton = createPushButton(rightHandSide,SystemResources.ACTION_HISTORY_CLEAR_LABEL, SystemResources.ACTION_HISTORY_CLEAR_TOOLTIP);
- rmvButton = createPushButton(rightHandSide,SystemResources.ACTION_HISTORY_DELETE_LABEL, SystemResources.ACTION_HISTORY_DELETE_TOOLTIP);
- mupButton = createPushButton(rightHandSide,SystemResources.ACTION_HISTORY_MOVEUP_LABEL, SystemResources.ACTION_HISTORY_MOVEUP_TOOLTIP);
- mdnButton = createPushButton(rightHandSide,SystemResources.ACTION_HISTORY_MOVEDOWN_LABEL, SystemResources.ACTION_HISTORY_MOVEDOWN_LABEL);
-
- clearMI = createMenuItem(SystemResources.ACTION_HISTORY_CLEAR_LABEL, SystemResources.ACTION_HISTORY_CLEAR_TOOLTIP);
- rmvMI = createMenuItem(SystemResources.ACTION_HISTORY_DELETE_LABEL, SystemResources.ACTION_HISTORY_DELETE_TOOLTIP);
- mupMI = createMenuItem(SystemResources.ACTION_HISTORY_MOVEUP_LABEL, SystemResources.ACTION_HISTORY_MOVEUP_TOOLTIP);
- mdnMI = createMenuItem(SystemResources.ACTION_HISTORY_MOVEDOWN_LABEL, SystemResources.ACTION_HISTORY_MOVEDOWN_TOOLTIP);
-
- historyList.setMenu(popupMenu);
- historyList.setItems(historyInput);
-
- clearButton.setEnabled((historyInput!=null) && (historyInput.length>0));
- rmvButton.setEnabled(false);
- mupButton.setEnabled(false);
- mdnButton.setEnabled(false);
- clearMI.setEnabled((historyInput!=null) && (historyInput.length>0));
- rmvMI.setEnabled(false);
- mupMI.setEnabled(false);
- mdnMI.setEnabled(false);
-
- // add selection listeners...
- historyList.addSelectionListener(
- new SelectionListener()
- {
- public void widgetDefaultSelected(SelectionEvent e)
- {
- //processRemoveButton(); // equate to selecting Remove...
- okButton.setEnabled(true); //d41471
- enableDisableAllActions();
- }
- public void widgetSelected(SelectionEvent e)
- {
- okButton.setEnabled(true); //d41471
- enableDisableAllActions();
- }
- }
- );
- return group;
- } // end init common
- /**
- * Helper method for a separator menu item
- */
- protected MenuItem addSeparator(Menu parent)
- {
- MenuItem mi = new MenuItem(parent,SWT.SEPARATOR);
- return mi;
- }
- /**
- * Helper method for creating cascading menu item
- */
- protected MenuItem createMenuItem(String label, String description)
- {
- MenuItem mi = new MenuItem(popupMenu,SWT.NULL);
- mi.setText(label);
- mi.setData(description);
- mi.addArmListener(this);
- mi.addListener(SWT.Selection, this);
- return mi;
- }
- /**
- * Helper method for creating a pushbutton with tooltip text.
- * This method takes resolved label and tooltip values
- */
- protected Button createPushButton(Composite c, String label, String tooltip)
- {
- Button button = SystemWidgetHelpers.createPushButton(c, this, label, tooltip);
- return button;
- }
- /**
- * Helper method to enable/disable all actions (buttons, menuitems)
- * based on current selections in list or current text contents.
- */
- private void enableDisableAllActions()
- {
- boolean itemSelected = (historyList.getSelectionCount() > 0);
- boolean defaultItemSelected = itemSelected && selectedInDefaultHistory();
- // Remove action
- rmvButton.setEnabled(itemSelected && !defaultItemSelected);
- rmvMI.setEnabled(itemSelected && !defaultItemSelected);
- // Move Up action
- mupButton.setEnabled(itemSelected && !historyList.isSelected(0));
- mupMI.setEnabled(mupButton.isEnabled());
- // Move Down action
- mdnButton.setEnabled(itemSelected && !historyList.isSelected((historyList.getItemCount())-1));
- mupMI.setEnabled(mdnButton.isEnabled());
-
- int emptyListCount = 0;
- if (defaultHistory != null)
- emptyListCount = defaultHistory.length;
- clearButton.setEnabled(historyList.getItemCount() > emptyListCount);
- }
-
- protected boolean processOK()
- {
- historyOutput = historyList.getItems();
- return true;
- }
-
- // --------------------------------- //
- // METHODS FOR INTERFACES...
- // --------------------------------- //
- /**
- * Handles events generated by controls on this page.
- */
- public void handleEvent(Event e)
- {
- //get widget that generates the event
- clearMessage();
- Widget source = e.widget;
- if ((source == clearButton) ||
- (source == clearMI))
- {
- historyList.removeAll();
- if (defaultHistory != null)
- historyList.setItems(defaultHistory); // pc41439
- okButton.setEnabled(true); //d41471
- enableDisableAllActions(); //d41421
- }
- else if ((source == rmvButton) ||
- (source == rmvMI))
- {
- int seld[] = historyList.getSelectionIndices();
- if (seld.length > 0)
- {
- historyList.remove(seld);
- enableDisableAllActions(); //d41421
- }
- }
- else if ((source == mupButton) ||
- (source == mupMI))
- {
- int oldIndex = historyList.getSelectionIndex();
- if (oldIndex > 0)
- {
- String seldObj = historyList.getSelection()[0];
- historyList.remove(oldIndex);
- historyList.add(seldObj,oldIndex-1);
- historyList.select(oldIndex-1);
- historyList.showSelection();
- enableDisableAllActions(); //d41421
- }
- }
- else if ((source == mdnButton) ||
- (source == mdnMI))
- {
- int oldIndex = historyList.getSelectionIndex();
- if ((oldIndex >= 0) && (oldIndex < (historyList.getItemCount()-1)))
- {
- String seldObj = historyList.getSelection()[0];
- historyList.remove(oldIndex);
- historyList.add(seldObj,oldIndex+1);
- //historyList.select(oldIndex+1);
- // historyList.showSelection();
- historyList.select(oldIndex+2); //d41427 To get around eclipse bug which does
- historyList.showSelection(); //d41427 not show the selected one as expected.
- historyList.select(oldIndex+1); //d41427 Need to advance one more to show it
- enableDisableAllActions(); //d41421
- }
- }
-
- }
- /**
- * Called by system when menu item is "armed" or in select state.
- * We use this to show the menu item description.
- */
- public void widgetArmed(ArmEvent e)
- {
- clearMessage();
- Widget w = e.widget;
- if (w instanceof MenuItem)
- {
- MenuItem mi = (MenuItem)w;
- String desc = (String)mi.getData();
- setMessage(desc);
- }
- }
-
- // -----------------------
- // CALLER QUERY METHODS...
- // -----------------------
-
- /**
- * Return the updated history
- */
- public String[] getHistory()
- {
- return historyOutput;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemChangeFilterPaneEditPaneSupplier.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemChangeFilterPaneEditPaneSupplier.java
deleted file mode 100644
index fe964afdd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemChangeFilterPaneEditPaneSupplier.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The SystemChangeFilterPane class is used in both SystemChangeFilterDialog and
- * in SystemChangeFilterPropertyPage. The pane relies on both of these to supply
- * the edit pane (for historical reasons, so we don't break previous contracts).
- * This interface is implemented by both classes, for supplying that edit pane.
- */
-public interface ISystemChangeFilterPaneEditPaneSupplier
-{
- /**
- * Return the filter string edit pane.
- */
- public SystemFilterStringEditPane getFilterStringEditPane(Shell shell);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemFilterStringEditPaneListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemFilterStringEditPaneListener.java
deleted file mode 100644
index d00af2225..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/ISystemFilterStringEditPaneListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-/**
- * This listener interface is implemented by any code desired to be kept aware
- * of all user changes to a filter string in the SystemFilterStringEditPane.
- */
-public interface ISystemFilterStringEditPaneListener
-{
-
- /**
- * Callback method. The user has changed the filter string. It may or may not
- * be valid. If not, the given message is non-null. If it is, and you want it,
- * call getSystemFilterString() in the edit pane.
- */
- public void filterStringChanged(SystemMessage message);
-
- /**
- * Callback method. We are about to do a verify,the side effect of which is to
- * change the current state of the dialog, which we don't want. This tells the
- * dialog to back up that state so it can be restored.
- */
- public void backupChangedState();
-
- /**
- * Callback method. After backup and change events this is called to restore state
- */
- public void restoreChangedState();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemChangeFilterPane.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemChangeFilterPane.java
deleted file mode 100644
index b4c45df07..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemChangeFilterPane.java
+++ /dev/null
@@ -1,1437 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterActionCopyString;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterActionDeleteString;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterActionMoveStringDown;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterActionMoveStringUp;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterActionPasteString;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
-import org.eclipse.rse.ui.validators.ValidatorFilterString;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.rse.ui.widgets.ISystemEditPaneStates;
-import org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * Since we have decided to allow the same editing in both the Change Filter dialog
- * and the Properties page, we have to abstract the meat of the change filter dialog
- * into a re-usable composite. That is what this is, and it is used by both the
- * dialog and the property page.
- */
-public class SystemChangeFilterPane extends SystemBaseForm
- implements SelectionListener, ISystemFilterStringEditPaneListener, IMenuListener
-{
-
- protected Button applyButton, revertButton, testButton;
- protected SystemEditPaneStateMachine sm;
- protected List listView;
- protected Label filterNameLabel, filterPoolNameLabel, fsLabel;
- // context menu actions support
- private SystemChangeFilterActionCopyString copyAction;
- private SystemChangeFilterActionPasteString pasteAction;
- private SystemChangeFilterActionDeleteString deleteAction;
- private SystemChangeFilterActionMoveStringUp moveUpAction;
- private SystemChangeFilterActionMoveStringDown moveDownAction;
- private MenuManager menuMgr;
- private Clipboard clipboard;
- private boolean menuListenerAdded;
-
- // inputs
- protected ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier;
- protected ISystemFilter inputFilter;
- protected ISystemFilterPoolReferenceManagerProvider refProvider;
- protected ISystemFilterPoolManagerProvider provider;
- protected String namePromptLabel, namePromptTip;
- protected String poolPromptLabel, poolPromptTip;
- protected String listPromptLabel, listPromptTip;
- protected String newEntryLabel;
-
- protected ISystemValidator filterStringValidator = null;
- protected SystemMessage duplicateFilterStringMsg;
- protected boolean wantTestButton;
- protected boolean editable = true;
-
- // state
- protected boolean caseSensitiveStrings = false;
- protected boolean allowDuplicateStrings = false;
- protected boolean ignoreEvents = false;
- protected boolean resetting = false;
- protected boolean giveEditorFocus = true;
- protected boolean showingNew = true;
- protected boolean supportsMultipleStrings = true;
- protected String[] listItems;
-
- /**
- * Constructor.
- */
- public SystemChangeFilterPane(Shell shell, ISystemMessageLine msgLine, ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier)
- {
- super(shell, msgLine);
- this.editPaneSupplier = editPaneSupplier;
-
-
- // default mri values
- namePromptLabel = SystemResources.RESID_CHGFILTER_NAME_LABEL;
- namePromptTip = SystemResources.RESID_CHGFILTER_NAME_TOOLTIP;
- poolPromptLabel = SystemResources.RESID_CHGFILTER_POOL_LABEL;
- poolPromptTip = SystemResources.RESID_CHGFILTER_POOL_TOOLTIP;
- listPromptLabel = SystemResources.RESID_CHGFILTER_LIST_LABEL;
- listPromptTip = SystemResources.RESID_CHGFILTER_LIST_TOOLTIP;
- }
-
- // INPUT/CONFIGURATION
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool reference manager provider. Will be non-null if the
- * current selection is a reference to a filter pool or filter, or a reference manager
- * provider.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- this.refProvider = provider;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool manager provider. Will be non-null if the
- * current selection is a filter pool or filter, or reference to them, or a manager provider.
- * Generally this is called when the setSystemFilterPoolReferenceManagerProvider can't be called
- * for some reason.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- this.provider = provider;
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the Parent Filter Pool prompt label and tooltip text.
- */
- public void setParentPoolPromptLabel(String label, String tip)
- {
- this.poolPromptLabel = label;
- this.poolPromptTip = tip;
- }
- /**
- * Return the parent filter pool prompt label, as set by {@link #setParentPoolPromptLabel(String, String)}
- */
- public String getParentPoolPromptLabel()
- {
- return poolPromptLabel;
- }
- /**
- * Return the parent filter pool prompt tip, as set by {@link #setParentPoolPromptLabel(String, String)}
- */
- public String getParentPoolPromptTip()
- {
- return poolPromptTip;
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the name prompt label and tooltip text.
- */
- public void setNamePromptLabel(String label, String tip)
- {
- this.namePromptLabel = label;
- this.namePromptTip = tip;
- }
- /**
- * Return the name prompt label as set by {@link #setNamePromptLabel(String, String)}
- */
- public String getNamePromptLabel()
- {
- return namePromptLabel;
- }
- /**
- * Return the name prompt tip as set by {@link #setNamePromptLabel(String, String)}
- */
- public String getNamePromptTip()
- {
- return namePromptTip;
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the label shown in group box around the filter string list, and the tooltip text for the
- * list box.
- */
- public void setListLabel(String label, String tip)
- {
- this.listPromptLabel = label;
- this.listPromptTip = tip;
- }
- /**
- * Return list label as set by {@link #setListLabel(String, String)}
- */
- public String getListLabel()
- {
- return listPromptLabel;
- }
- /**
- * Return list tip as set by {@link #setListLabel(String, String)}
- */
- public String getListTip()
- {
- return listPromptTip;
- }
-
- /**
- * Set the string to show as the first item in the list.
- * The default is "New filter string"
- */
- public void setNewListItemText(String label)
- {
- this.newEntryLabel = label;
- }
- /**
- * Return the text for the list item, as set by {@link #setNewListItemText(String)},
- * or the default if not set.
- */
- public String getNewListItemText()
- {
- return (newEntryLabel != null) ? newEntryLabel : SystemResources.RESID_CHGFILTER_LIST_NEWITEM;
- }
-
- /**
- * <i>Configuration method</i><br>
- * Call this to specify a validator for the filter string. It will be called per keystroke.
- * A default validator is supplied otherwise: ValidatorFilterString.
- * <p>
- * Your validator should extend ValidatorFilterString to inherited the uniqueness error checking.
- * <p>
- * Alternatively, if all you want is a unique error message for the case when duplicates are found,
- * call setDuplicateFilterStringErrorMessage, and it will be used in the default validator.
- */
- public void setFilterStringValidator(ISystemValidator v)
- {
- filterStringValidator = v;
- }
- /**
- * Return the result of {@link #setFilterStringValidator(ISystemValidator)}.
- */
- public ISystemValidator getFilterStringValidator()
- {
- return filterStringValidator;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the error message to use when the user is editing or creating a filter string, and the
- * Apply processing detects a duplicate filter string in the list.
- */
- public void setDuplicateFilterStringErrorMessage(SystemMessage msg)
- {
- this.duplicateFilterStringMsg = msg;
- }
- /**
- * Return results of {@link #setDuplicateFilterStringErrorMessage(SystemMessage)}
- */
- public SystemMessage getDuplicateFilterStringErrorMessage()
- {
- return duplicateFilterStringMsg;
- }
- /**
- * <i>Configuration method</i><br>
- * Specify if you want to include a test button or not. Appears with "Apply" and "Reset"
- */
- public void setWantTestButton(boolean wantTestButton)
- {
- this.wantTestButton = wantTestButton;
- }
- /**
- * Return whether a test button is wanted or not, as set by {@link #setWantTestButton(boolean)}
- */
- public boolean getWantTestButton()
- {
- return wantTestButton;
- }
-
- /**
- * Set if the edit pane is not to be editable
- */
- public void setEditable(boolean editable)
- {
- this.editable = editable;
- this.showingNew = editable;
- }
- /**
- * Return whether the edit pane is editable, as set by {@link #setEditable(boolean)}
- */
- public boolean getEditable()
- {
- return editable;
- }
- /**
- * Set if the user is to be allowed to create multiple filter strings or not. Default is true
- */
- public void setSupportsMultipleStrings(boolean multi)
- {
- this.showingNew = multi;
- this.supportsMultipleStrings = multi;
- }
- /**
- * Return whether the user is to be allowed to create multiple filter strings or not. Default is true
- */
- public boolean getSupportsMultipleStrings()
- {
- return supportsMultipleStrings;
- //return (!showingNew && editable);
- }
-
- // LIFECYCLE
- /**
- * Intercept of parent so we can set the input filter, and deduce whether
- * strings are case sensitive and if duplicates are allowed.<br>
- * Not typically overridden, but if you do, be sure to call super!
- */
- public void setInputObject(Object inputObject)
- {
- //System.out.println("INSIDE SETINPUTOBJECT: " + inputObject);
- super.setInputObject(inputObject);
- inputFilter = getSystemFilter(inputObject);
- caseSensitiveStrings = inputFilter.areStringsCaseSensitive();
- allowDuplicateStrings = inputFilter.supportsDuplicateFilterStrings();
- }
-
- /**
- * Returns the control (the list view) to recieve initial focus control
- */
- public Control getInitialFocusControl()
- {
- return listView;
- }
- /**
- * Populates the content area
- */
- public Control createContents(Composite parent)
- {
- SystemWidgetHelpers.setHelp(parent, RSEUIPlugin.HELPPREFIX+"dufr0000");
-
- if (getShell()==null)
- setShell(parent.getShell());
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
- editpane.setSystemFilterPoolReferenceManagerProvider(refProvider);
- editpane.setSystemFilterPoolManagerProvider(provider);
- editpane.setChangeFilterMode(true);
-
- // Inner composite
- int nbrColumns = 2;
- Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // composite at top to hold readonly info
- //Composite topComposite = SystemWidgetHelpers.createFlushComposite(composite, 2);
- //((GridData)topComposite.getLayoutData()).horizontalSpan = nbrColumns;
- Composite topComposite = composite;
- // filter name
- SystemWidgetHelpers.createLabel(topComposite, namePromptLabel);
- filterNameLabel = SystemWidgetHelpers.createLabel(topComposite, "");
- filterNameLabel.setToolTipText(namePromptTip);
- filterNameLabel.setText(inputFilter.getName());
- // filter pool
- SystemWidgetHelpers.createLabel(topComposite, poolPromptLabel);
- filterPoolNameLabel = SystemWidgetHelpers.createLabel(topComposite, "");
- filterPoolNameLabel.setToolTipText(namePromptTip);
- ISystemFilterPool parentPool = inputFilter.getParentFilterPool();
- filterPoolNameLabel.setText(parentPool.getName());
-
- addFillerLine(composite, nbrColumns);
-
- // create list view on left
- if (supportsMultipleStrings)
- {
- listView = SystemWidgetHelpers.createListBox(composite, listPromptLabel, null, false, 1);
- //listView.setToolTipText(listPromptTip); VERY ANNOYING
- GridData data = (GridData)listView.getLayoutData();
- data.grabExcessHorizontalSpace = false;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.widthHint = 130;
- }
- String[] strings = inputFilter.getFilterStrings();
- if (strings == null)
- strings = new String[] {};
- int delta = (showingNew ? 1 : 0);
- listItems = new String[delta+strings.length];
- if (showingNew)
- listItems[0] = getNewListItemText(); // "New filter string" or caller-supplied
- for (int idx=0; idx<strings.length; idx++)
- listItems[idx+delta] = strings[idx];
- if (listView != null)
- listView.setItems(listItems);
-
- // we want the tree view on the left to extend to the bottom of the page, so on the right
- // we create a 1-column composite that will hold the edit pane on top, and the apply/revert
- // buttons on the bottom...
- Composite rightSideComposite = SystemWidgetHelpers.createFlushComposite(composite, 1);
- if (listView == null)
- {
- GridData data = (GridData)rightSideComposite.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = nbrColumns;
- }
-
- // now add a top spacer line and visual separator line, for the right side
- if (listView != null)
- {
- addFillerLine(rightSideComposite, 1);
- fsLabel = SystemWidgetHelpers.createLabel(rightSideComposite, "");
- addSeparatorLine(rightSideComposite,1);
- }
-
- // now populate top of right-side composite with edit pane...
- Control editPaneComposite = editpane.createContents(rightSideComposite);
- if (!allowDuplicateStrings && (filterStringValidator == null))
- {
- String[] existingStrings = inputFilter.getFilterStrings();
- if (existingStrings!=null)
- {
- filterStringValidator = new ValidatorFilterString(existingStrings, caseSensitiveStrings);
- if (duplicateFilterStringMsg != null)
- ((ValidatorFilterString)filterStringValidator).setDuplicateFilterStringErrorMessage(duplicateFilterStringMsg);
- }
- }
-
- // now add a bottom visual separator line
- addSeparatorLine(rightSideComposite,1);
-
- // now populate bottom of right-side composite with apply/revert buttons within their own composite
- int nbrColumns_buttonComposite = 3;
- Composite applyResetButtonComposite = SystemWidgetHelpers.createFlushComposite(rightSideComposite, nbrColumns_buttonComposite);
- if (!wantTestButton)
- {
- ((GridData)applyResetButtonComposite.getLayoutData()).horizontalIndent = 200; // shift buttons to the right
- // now populate the buttons composite with apply and revert buttons
- Label filler = SystemWidgetHelpers.createLabel(applyResetButtonComposite, "");
- ((GridData)filler.getLayoutData()).grabExcessHorizontalSpace = true;
- ((GridData)filler.getLayoutData()).horizontalAlignment = GridData.FILL;
- }
- if (wantTestButton)
- {
- testButton = SystemWidgetHelpers.createPushButton(applyResetButtonComposite, this,
- SystemResources.RESID_CHGFILTER_BUTTON_TEST_LABEL,SystemResources.RESID_CHGFILTER_BUTTON_TEST_TOOLTIP);
- editpane.setTestButton(testButton);
- testButton.addSelectionListener(this);
- }
- applyButton = SystemWidgetHelpers.createPushButton(applyResetButtonComposite, this, SystemResources.RESID_CHGFILTER_BUTTON_APPLY_LABEL, SystemResources.RESID_CHGFILTER_BUTTON_APPLY_TOOLTIP);
- revertButton = SystemWidgetHelpers.createPushButton(applyResetButtonComposite, this, SystemResources.RESID_CHGFILTER_BUTTON_REVERT_LABEL,SystemResources.RESID_CHGFILTER_BUTTON_REVERT_TOOLTIP);
-
- // now add a spacer to soak up left-over height...
- addGrowableFillerLine(rightSideComposite, 1);
-
- // create state machine to manage edit pane
- sm = new SystemEditPaneStateMachine(rightSideComposite, applyButton, revertButton);
- sm.setUnsetMode();
-
- composite.layout(true);
-
- // add listeners
- if (listView!=null)
- listView.addSelectionListener(this);
- applyButton.addSelectionListener(this);
- revertButton.addSelectionListener(this);
- editpane.addChangeListener(this);
-
- // add special listeners for accessibility -- do not change focus when navigating list with keys
- if (listView != null)
- {
- listView.addMouseListener(new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) {
- giveEditorFocus = true;
- }
- public void mouseDown(MouseEvent e) {
- giveEditorFocus = true;
- }
- public void mouseUp(MouseEvent e) {
- giveEditorFocus = true;
- }
- });
- listView.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- giveEditorFocus = false;
- }
- public void keyReleased(KeyEvent e) {
- giveEditorFocus = false;
- }
- });
- }
-
- // add context menu
- // -----------------------------
- // Enable right-click popup menu
- // -----------------------------
- if (listView != null)
- {
- menuMgr = new MenuManager("#ChangeFilterPopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- Menu menu = menuMgr.createContextMenu(listView);
- listView.setMenu(menu);
- }
-
- // preselect list item..
- // edit mode..
- if ((listItems.length > 1) || !showingNew)
- {
- if (listView!=null)
- {
- if (showingNew)
- listView.select(1);
- else
- listView.select(0);
- }
- sm.setEditMode();
- editpane.setFilterString(listItems[showingNew ? 1 : 0], 1);
- }
- // new...
- else
- {
- if (listView!=null)
- listView.select(0);
- sm.setNewMode();
- editpane.setFilterString(null, 0);
- }
- editpane.configureHeadingLabel(fsLabel);
- setPageComplete(editpane.isComplete());// side effect is initial enablement of test button
-
- if (!editable)
- {
- if (listView!=null)
- listView.setEnabled(false);
- if (strings.length > 0)
- editpane.setFilterString(strings[0], 0);
- editPaneComposite.setEnabled(false);
- //editpane.setEditable(false);
- setPageComplete(true);
- }
- else if (!getSupportsMultipleStrings())
- setPageComplete(true);
-
- return composite;
- }
- /*
- * Intercept of parent so we can reset the default button
- *
- protected void createButtonsForButtonBar(Composite parent)
- {
- super.createButtonsForButtonBar(parent);
- getShell().setDefaultButton(applyButton); // defect 46129
- }*/
- /**
- * Return our edit pane, by referring back to our caller. You can use this,
- * but do not override it!
- */
- protected SystemFilterStringEditPane getFilterStringEditPane(Shell shell)
- {
- return editPaneSupplier.getFilterStringEditPane(shell);
- }
-
- /**
- * Return the Apply button
- */
- public Button getApplyButton()
- {
- return applyButton;
- }
- /**
- * Return the Revert button
- */
- public Button getRevertButton()
- {
- return revertButton;
- }
-
- /**
- * Call when user presses OK button on containing dialog or pane.
- * This is when we save all the changes the user made.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- public boolean processOK()
- {
- if (!editable)
- return true;
- if (!verify(true))
- return false;
- /*
- ignoreEvents = true;
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
- if (sm.isSaveRequired())
- {
- if (editpane.verify()!=null)
- {
- ignoreEvents = false;
- sm.setChangesMade(); // defect 45773
- return false; // pending errors. Cannot save, so cannot close!
- }
- saveFilterString(editpane.getFilterString(),editpane.getCurrentSelectionIndex());
- }
- else if (!sm.getNewSetByDelete()) //d47125
- {
- if (editpane.verify() != null)
- {
- ignoreEvents = false;
- return false;
- }
- }
- ignoreEvents = false;
- if (!allowDuplicateStrings && (listView != null))
- {
- String duplicate = checkForDuplicates();
- if (duplicate != null)
- {
- SystemMessage errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_DUPLICATES).makeSubstitution(duplicate);
- getMessageLine().setErrorMessage(errMsg);
- listView.setFocus();
- return false;
- }
- }
- */
- ISystemFilterPool pool = inputFilter.getParentFilterPool(); // recurses for nested filter
- ISystemFilterPoolManager mgr = pool.getSystemFilterPoolManager();
- if (listView != null)
- listItems = listView.getItems();
- String[] filterStrings = null;
- if (showingNew)
- {
- filterStrings = new String[listItems.length - 1];
- for (int idx=0; idx<filterStrings.length; idx++)
- filterStrings[idx] = listItems[idx+1];
- }
- else
- {
- filterStrings = listItems;
- }
-
- try {
- mgr.updateSystemFilter(inputFilter, inputFilter.getName(), filterStrings);
- }
- catch (SystemMessageException exc)
- {
- getMessageLine().setErrorMessage(exc.getSystemMessage());
- return false;
- }
- catch (Exception exc)
- {
- //displayErrorMessage("Error updating filter: " + exc.getMessage());
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UPDATEFILTER_FAILED);
- String excText = exc.getMessage();
- if (excText == null)
- excText = exc.getClass().getName();
- msg.makeSubstitution(excText,exc);
- getMessageLine().setErrorMessage(msg);
- return false;
- }
- //return super.processOK();
- return true;
- }
- /**
- * Perform the same validation that is done when OK is pressed.
- * @param doSave - true to actually save pending changes in filter string editor (eg, when called when actually processing OK).
- */
- public boolean verify(boolean doSave)
- {
- ignoreEvents = true;
- getMessageLine().clearErrorMessage();
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
- if (editpane.canSaveImplicitly() && sm.isSaveRequired())
- {
- if (editpane.verify()!=null)
- {
- ignoreEvents = false;
- sm.setChangesMade(); // defect 45773
- return false; // pending errors. Cannot save, so cannot close!
- }
- if (doSave)
- saveFilterString(editpane.getFilterString(),editpane.getCurrentSelectionIndex());
- }
- else if (!sm.getNewSetByDelete()) //d47125
- {
- if (editpane.verify() != null)
- {
- ignoreEvents = false;
- return false;
- }
- }
- ignoreEvents = false;
- if (!allowDuplicateStrings && (listView != null))
- {
- String duplicate = checkForDuplicates();
- if (duplicate != null)
- {
- SystemMessage errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_DUPLICATES).makeSubstitution(duplicate);
- getMessageLine().setErrorMessage(errMsg);
- listView.setFocus();
- return false;
- }
- }
- return true;
- }
-
- /**
- * Call when user presses Cancel button in containing dialog. We simply blow away all their changes!
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- public boolean processCancel()
- {
- /*
- if (sm.isSaveRequired())
- {
- if (editpane.verify()!=null)
- return false; // pending errors. Cannot save, so cannot close!
- saveFilterString();
- }
- */
- //return super.processCancel();
- return true;
- }
-
- /**
- * Handles events generated by controls on this page.
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (resetting)
- return;
- Widget source = e.widget;
- if (source == applyButton)
- {
- getMessageLine().clearMessage();
- applyPressed();
- }
- else if (source == revertButton)
- {
- getMessageLine().clearMessage();
- revertPressed();
- }
- else if (source == testButton)
- {
- getMessageLine().clearMessage();
- getFilterStringEditPane(getShell()).processTest(getShell());
- }
-
- else if (source == listView)
- {
- // check for unresolved errors...
- if (getFilterStringEditPane(getShell()).areErrorsPending())
- {
- e.doit = false; // dang, this doesn't work!
- resetting = true; // d45795
- listView.select(getFilterStringEditPane(getShell()).getCurrentSelectionIndex()); // d45795
- resetting = false; // d45795
- return;
- }
- // check if we can save implicitly and if there are pending changes
- else if (getFilterStringEditPane(getShell()).canSaveImplicitly() && sm.isSaveRequired())
- {
- getMessageLine().clearMessage();
-
- // if error, do not change selection and we keep pending changes state
- if (getFilterStringEditPane(getShell()).verify() != null)
- {
- e.doit = false; // dang, this doesn't work!
- sm.setChangesMade();
- resetting = true; // d45795
- listView.select(getFilterStringEditPane(getShell()).getCurrentSelectionIndex()); // d45795
- resetting = false; // d45795
- applyButton.setEnabled(false); // d45795
- return;
- }
-
- // no errors
- saveFilterString(getFilterStringEditPane(getShell()).getFilterString(),
- getFilterStringEditPane(getShell()).getCurrentSelectionIndex());
- }
- else {
- getMessageLine().clearMessage();
- }
-
- // proceed with selection change request...
- processListSelect();
-
- // KM: defect 53009
- // need to check if Create button can be enabled if new filter string is selected
- if (isNewSelected()) {
- handleNewFilterStringItemSelection();
- }
- }
- }
- /**
- * An item selected in list. Process it
- */
- private void processListSelect()
- {
- sm.setNewSetByDelete(false); //d47125
- int newIndex = listView.getSelectionIndex();
- if (isNewSelected() || (newIndex == -1))
- {
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
- editpane.setFilterString(null, 0);
-
- if (isNewSelected()) {
- sm.setNewMode();
- }
- else
- sm.setUnsetMode();
- if (testButton != null)
- testButton.setEnabled(false);
- }
- else
- {
- getFilterStringEditPane(getShell()).setFilterString(getCurrentSelection(), newIndex);
- sm.setEditMode();
- if (testButton != null)
- testButton.setEnabled(true);
- }
- getFilterStringEditPane(getShell()).configureHeadingLabel(fsLabel);
- if (giveEditorFocus)
- {
- Control c = getFilterStringEditPane(getShell()).getInitialFocusControl();
- if ((c!=null) && !c.isDisposed() && c.isVisible())
- c.setFocus();
- }
- }
- /**
- * User pressed Apply to save the pending changes the current filter string
- */
- protected void applyPressed()
- {
- ignoreEvents = true;
-
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
- if (editpane.verify() == null)
- {
- boolean ok = true;
- String editedFilterString = editpane.getFilterString();
- if (filterStringValidator != null)
- {
- String[] names = (listView!=null) ? listView.getItems() : listItems;
- if (!allowDuplicateStrings && (filterStringValidator instanceof ISystemValidatorUniqueString))
- ((ISystemValidatorUniqueString)filterStringValidator).setExistingNamesList(names);
- SystemMessage errorMessage = filterStringValidator.validate(editedFilterString);
- if (errorMessage != null)
- {
- ok = false;
- getMessageLine().setErrorMessage(errorMessage);
- }
- }
-
- if (ok)
- {
- sm.applyPressed();
- saveFilterString(editedFilterString, editpane.getCurrentSelectionIndex());
- }
- }
-
- ignoreEvents = false;
- }
-
- /**
- * User pressed Revert to discard the pending changes the current filter string
- */
- protected void revertPressed()
- {
- ignoreEvents = true;
- sm.resetPressed();
- boolean newMode = (isNewSelected() || listView == null || (listView.getSelectionIndex() == -1));
- if (newMode)
- getFilterStringEditPane(getShell()).setFilterString(null, 0);
- else
- getFilterStringEditPane(getShell()).setFilterString(getCurrentSelection(), listView.getSelectionIndex());
- getMessageLine().clearErrorMessage();
- setPageComplete(true);
- if (testButton != null)
- testButton.setEnabled(!newMode);
- ignoreEvents = false;
- }
-
- /**
- * Handles events generated by controls on this page.
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- /**
- * The completeness of the page has changed.
- * We direct it to the Apply button versus just the OK button
- */
- public void setPageComplete(boolean complete)
- {
- // d45795
- if (applyButton != null)
- {
- if (!complete)
- applyButton.setEnabled(false);
- // else: we never enable it because the state machine does that anyway on any user-input change
- }
- super.setPageComplete(complete);
- }
-
- // ------------
- // List methods
- // ------------
-
- /**
- * Return true if currently selected item is "New"
- */
- protected boolean isNewSelected()
- {
- if (showingNew && (listView!=null))
- return (listView.getSelectionIndex() == 0);
- else
- return false;
- }
-
- /**
- * Return currently selected filter string
- */
- protected String getCurrentSelection()
- {
- if (showingNew)
- {
- if (listView.getSelectionCount() >= 1)
- return listView.getSelection()[0];
- else
- return null;
- }
- else if (listView != null)
- {
- if (listView.getSelectionCount() >= 0)
- return listView.getSelection()[0];
- else
- return null;
- }
- else
- {
- return listItems[0];
- }
- }
-
- // LIFECYCLE OF STRINGS
-
- /**
- * Create a new filter string from the contents of the filter string edit pane
- */
- protected String createFilterString()
- {
- String newFilterString = getFilterStringEditPane(getShell()).getFilterString();
- listView.add(newFilterString);
- int selectionIndex = listView.getItemCount()-1;
- listView.select(selectionIndex);
- sm.setEditMode();
- getFilterStringEditPane(getShell()).setFilterString(newFilterString, selectionIndex);
- getFilterStringEditPane(getShell()).configureHeadingLabel(fsLabel);
- return newFilterString;
- }
- /**
- * Update the current selection with the values in the edit pane
- */
- protected void saveFilterString(String editedFilterString, int currSelectionIndex)
- {
- //System.out.println("inside savefilterstring. current sel index = " + currSelectionIndex);
- if (currSelectionIndex == -1)
- return;
- else if (showingNew && (currSelectionIndex == 0))
- createFilterString();
- else
- {
- //System.out.println("Updating list item " + currSelectionIndex + " to " + editedFilterString);
- if (listView != null)
- listView.setItem(currSelectionIndex, editedFilterString);
- else
- listItems[0] = editedFilterString;
- }
- }
-
-
- // private methods
-
- private ISystemFilter getSystemFilter(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilter)
- return (ISystemFilter)selectedObject;
- else
- return ((ISystemFilterReference)selectedObject).getReferencedFilter();
- }
-
- // ----------------------------------------------
- // EDIT PANE CHANGE LISTENER INTERFACE METHODS...
- // ----------------------------------------------
- /**
- * Callback method from the edit pane. The user has changed the filter string. It may or may not
- * be valid. If not, the given message is non-null. If it is, and you want it,
- * call getSystemFilterString() in the edit pane.
- */
- public void filterStringChanged(SystemMessage message)
- {
- if (message != null)
- getMessageLine().setErrorMessage(message);
- else
- getMessageLine().clearErrorMessage();
- if (testButton != null)
- testButton.setEnabled(message == null);
- if (!ignoreEvents) // this is set on while verifying, indicating these are not real change events per se
- {
- sm.setChangesMade();
- }
- setPageComplete(message == null);
- }
- /**
- * Callback method. We are about to do a verify,the side effect of which is to
- * change the current state of the dialog, which we don't want. This tells the
- * dialog to back up that state so it can be restored.
- */
- public void backupChangedState()
- {
- sm.backup();
- }
- /**
- * Callback method. After backup and change events this is called to restore state
- */
- public void restoreChangedState()
- {
- sm.restore();
- }
-
- // ------------------------------
- // CONTEXT MENU ACTION SUPPORT...
- // ------------------------------
- /**
- * Called when the context menu is about to open.
- * Calls {@link #fillContextMenu(IMenuManager)}
- */
- public void menuAboutToShow(IMenuManager menu)
- {
-
- fillContextMenu(menu);
- if (!menuListenerAdded)
- {
- if (menu instanceof MenuManager)
- {
- Menu m = ((MenuManager)menu).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- //ml.setShowToolTipText(true, wwDialog.getMessageLine()); does not work for some reason
- m.addMenuListener(ml);
- }
- }
- }
- }
-
- /**
- * This is method is called to populate the popup menu
- */
- public void fillContextMenu(IMenuManager menu)
- {
- String currentString = getCurrentSelection();
- IStructuredSelection selection= null;
- if (currentString != null)
- selection = new StructuredSelection(currentString);
- // Partition into groups...
- createStandardGroups(menu);
- ISystemAction action = null;
- boolean isNewSelected = isNewSelected();
- //System.out.println("new selected? " + isNewSelected);
- if ((selection != null) && !isNewSelected)
- {
- action = getDeleteAction(selection);
- menu.appendToGroup(action.getContextMenuGroup(), action);
-
- action = getCopyAction(selection);
- menu.appendToGroup(action.getContextMenuGroup(), action);
-
- action = getMoveUpAction(selection);
- menu.appendToGroup(action.getContextMenuGroup(), action);
-
- action = getMoveDownAction(selection);
- menu.appendToGroup(action.getContextMenuGroup(), action);
- }
- //if (!isNewSelected)
- {
- action = getPasteAction(selection);
- menu.appendToGroup(action.getContextMenuGroup(), action);
- }
- }
- /**
- * Creates the Systems plugin standard groups in a context menu.
- */
- public void createStandardGroups(IMenuManager menu)
- {
- if (!menu.isEmpty())
- return;
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- }
-
- /**
- * Get the delete action
- */
- private SystemChangeFilterActionDeleteString getDeleteAction(ISelection selection)
- {
- if (deleteAction == null)
- deleteAction = new SystemChangeFilterActionDeleteString(this);
- deleteAction.setShell(getShell());
- deleteAction.setSelection(selection);
- return deleteAction;
- }
-
- /**
- * Get the move up action
- */
- private SystemChangeFilterActionMoveStringUp getMoveUpAction(ISelection selection)
- {
- if (moveUpAction == null)
- moveUpAction = new SystemChangeFilterActionMoveStringUp(this);
- moveUpAction.setShell(getShell());
- moveUpAction.setSelection(selection);
- return moveUpAction;
- }
- /**
- * Get the move down action
- */
- private SystemChangeFilterActionMoveStringDown getMoveDownAction(ISelection selection)
- {
- if (moveDownAction == null)
- moveDownAction = new SystemChangeFilterActionMoveStringDown(this);
- moveDownAction.setShell(getShell());
- moveDownAction.setSelection(selection);
- return moveDownAction;
- }
- /**
- * Get the copy action
- */
- private SystemChangeFilterActionCopyString getCopyAction(ISelection selection)
- {
- if (copyAction == null)
- copyAction = new SystemChangeFilterActionCopyString(this);
- copyAction.setShell(getShell());
- copyAction.setSelection(selection);
- return copyAction;
- }
- /**
- * Get the paste action
- */
- private SystemChangeFilterActionPasteString getPasteAction(ISelection selection)
- {
- if (pasteAction == null)
- pasteAction = new SystemChangeFilterActionPasteString(this);
- pasteAction.setShell(getShell());
- if (selection != null)
- pasteAction.setSelection(selection);
- return pasteAction;
- }
- // -------------------------------------------------------------
- // CALLBACK METHODS FROM THE RIGHT CLICK CONTEXT MENU ACTIONS...
- // -------------------------------------------------------------
-
- /**
- * Decide if we can do the delete or not.
- * Will decide the enabled state of the delete action.
- */
- public boolean canDelete()
- {
- return (sm.getMode() == ISystemEditPaneStates.MODE_EDIT) && !sm.areChangesPending() && !isNewSelected() && (listView.getSelectionIndex()!=-1) &&
- (listView.getItemCount()>2); // defect 46149
- }
- /**
- * Perform the delete action
- */
- public void doDelete()
- {
- int idx = listView.getSelectionIndex();
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONFIRM_DELETE);
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), msg);
- try{
- if (msgDlg.openQuestion())
- {
- listView.remove(idx); // remove item from list
- // defect 46097...
- listView.select(0);
- processListSelect();
- sm.setNewSetByDelete(true); //d47125
-
- // KM: defect 53009
- // since we have new set by delete action, the verify method
- // will ignore actual verification, and just check for duplicates
- boolean ok = verify(false);
-
- // set page to complete
- // but this does not affect Create button
- setPageComplete(ok);
-
- // if the verify above went ok, i.e. no duplicates found, then
- // need to check if Create button can be enabled if new filter string is selected
- if (ok && isNewSelected()) {
- handleNewFilterStringItemSelection();
- }
- }
- } catch (Exception exc) {}
- }
-
- /**
- * Handles new filter string selection from the filter string list.
- * Enables/disables Create button depending on whether the
- * default filter string is valid.
- */
- protected void handleNewFilterStringItemSelection() {
-
- ignoreEvents = true;
-
- SystemFilterStringEditPane editpane = getFilterStringEditPane(getShell());
-
- // we check if there are any existing errors
- // shouldn't be unless setting the default filter string for new filter string item
- // in processListSelect() above caused a problem
- boolean anyErrors = editpane.areErrorsPending();
-
- // if no errors currently, then do a verify
- if (!anyErrors) {
-
- // verify the default filter string
- boolean result = (editpane.verify() == null);
-
- // enable Create button if there are no errors
- if (result) {
- applyButton.setEnabled(true);
- }
- // otherwise clear pending errors, since verify() call could have
- // resulted in errors showing through
- else {
- editpane.clearErrorsPending();
- getMessageLine().clearErrorMessage();
- }
- }
-
- // yantzi: RSE 6.2, added call to setPageComplete to enable the OK button, otherwise
- // it is disabled when the user deletes a filter or selects the newfilterstring dialog
- setPageComplete(true);
-
- ignoreEvents = false;
- }
-
- /**
- * Decide if we can do the move up or not.
- * Will decide the enabled state of the move up action.
- */
- public boolean canMoveUp()
- {
- boolean can = (sm.getMode() == ISystemEditPaneStates.MODE_EDIT) && !sm.areChangesPending() && !isNewSelected() && (listView.getSelectionIndex()!=-1);
- if (can)
- {
- int idx = listView.getSelectionIndex();
- can = (idx > 1); // skip new at index 0, skip first actual string
- }
- return can;
- }
- /**
- * Perform the move up action
- */
- public void doMoveUp()
- {
- int idx = listView.getSelectionIndex();
- String currentString = getCurrentSelection();
- listView.remove(idx); // remove item from list
- listView.add(currentString,idx-1);
- }
- /**
- * Decide if we can do the move down or not.
- * Will decide the enabled state of the move down action.
- */
- public boolean canMoveDown()
- {
- boolean can = (sm.getMode() == ISystemEditPaneStates.MODE_EDIT) && !sm.areChangesPending() && !isNewSelected() && (listView.getSelectionIndex()!=-1);
- if (can)
- {
- int idx = listView.getSelectionIndex();
- can = (idx <= (listView.getItemCount()-2)); // -1 is to be zero-based. Another -1 is to discount "New".
- }
- return can;
- }
- /**
- * Perform the move down action
- */
- public void doMoveDown()
- {
- int idx = listView.getSelectionIndex();
- String currentString = getCurrentSelection();
- listView.remove(idx); // remove item from list
- listView.add(currentString,idx+1);
- }
-
- /**
- * Decide if we can do the copy or not.
- * Will decide the enabled state of the copy action.
- */
- public boolean canCopy()
- {
- boolean can = (sm.getMode() == ISystemEditPaneStates.MODE_EDIT) && !sm.areChangesPending() && !isNewSelected() && (listView.getSelectionIndex()!=-1);
- return can;
- }
- /**
- * Actually do the copy of the current filter string to the clipboard.
- */
- public void doCopy()
- {
- if (clipboard == null)
- clipboard = new Clipboard(getShell().getDisplay());
-
- String selection = getCurrentSelection();
- TextTransfer transfer = TextTransfer.getInstance();
- clipboard.setContents(new Object[] {selection}, new Transfer[] {transfer});
- }
- /**
- * Decide if we can do the paste or not.
- * Will decide the enabled state of the copy action.
- */
- public boolean canPaste()
- {
- if (clipboard == null)
- return false;
- TextTransfer textTransfer = TextTransfer.getInstance();
- String textData = (String)clipboard.getContents(textTransfer);
- return ((textData != null) && (textData.length() > 0));
- }
- /**
- * Actually do the copy of the current filter string to the clipboard.
- * If an existing string is selected, it is pasted before it. Else. it is appended to the end of the list.
- */
- public void doPaste()
- {
- if (clipboard == null)
- return;
- TextTransfer textTransfer = TextTransfer.getInstance();
- String textData = (String)clipboard.getContents(textTransfer);
-
- String newCopy = new String(textData);
- int newLocation = listView.getSelectionIndex();
- if (newLocation <= 0)
- {
- listView.add(newCopy);
- newLocation = listView.getItemCount()-1;
- listView.select(newLocation);
- }
- else
- {
- listView.add(newCopy, newLocation);
- listView.select(newLocation);
- }
- processListSelect(); // defect 45790...
- setPageComplete(verify(false));
- }
-
- // --------------
- // ERROR CHECKING
- // --------------
-
- /**
- * This hook method is called when ok is pressed. It checks for blatantly duplicate filter strings.
- * @return filterstring duplicate if there ARE duplicates. NULL if there are no duplicates
- */
- protected String checkForDuplicates()
- {
- if (listView == null)
- return null;
- String strings[] = (listView != null) ? listView.getItems() : listItems;
- String duplicate = null;
- boolean noDupes = true;
- for (int idx=1; noDupes && (idx < strings.length); idx++)
- {
- for (int ydx=1; noDupes && (ydx < strings.length); ydx++)
- {
- if (idx != ydx)
- {
- if (compareFilterStrings(caseSensitiveStrings, strings[idx], strings[ydx]))
- {
- noDupes = false;
- duplicate = strings[idx];
- }
- }
- }
- }
- return duplicate;
- }
- /**
- * Compares one filter string to another, while searching for duplicates.
- * Override if you want to do more intelligent compares. This one checks
- * for equality. The case-sensitivity is specified by the caller.
- */
- public boolean compareFilterStrings(boolean caseSensitive, String filterString1, String filterString2)
- {
- boolean cs = caseSensitive;
- if (cs)
- return filterString1.equals(filterString2);
- else
- return filterString1.equalsIgnoreCase(filterString2);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInputs.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInputs.java
deleted file mode 100644
index 00671d496..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInputs.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-/**
- * A class capturing the attributes commonly needed by dialogs that
- * work with filters.
- */
-public class SystemFilterDialogInputs
-{
-
-
- public String title;
- public String prompt;
- public String filterNamePrompt;
- public String filterNameTip;
- public Object preSelectObject;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInterface.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInterface.java
deleted file mode 100644
index 8e10490df..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogInterface.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterAction;
-
-
-/**
- * Common interface for dialogs or wizards that work with filters.
- */
-public interface SystemFilterDialogInterface
-{
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterDialogActionCaller(SystemFilterAbstractFilterAction caller);
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterDialogOutputs getFilterDialogOutputs();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogOutputs.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogOutputs.java
deleted file mode 100644
index 4e92703cb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterDialogOutputs.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-//import org.eclipse.rse.core.ui.actions.*;
-import org.eclipse.rse.core.filters.ISystemFilter;
-
-
-/**
- * A class capturing the attributes commonly returned by dialogs that
- * work with filters.
- */
-public class SystemFilterDialogOutputs
-{
-
-
- public String filterName;
- public String filterPoolName;
- public ISystemFilter newFilter;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInputs.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInputs.java
deleted file mode 100644
index 603587dec..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInputs.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-//import org.eclipse.rse.core.*;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-
-
-
-/**
- * A class capturing the attributes commonly needed by dialogs that
- * work with filter pools.
- */
-public class SystemFilterPoolDialogInputs extends SystemFilterDialogInputs
-{
-
-
- public ISystemFilterPoolManagerProvider poolManagerProvider = null;
- public ISystemFilterPoolManager[] poolManagers = null;
- public ISystemFilterPoolReferenceManager refManager = null;
- public int mgrSelection = 0;
- public String poolNamePrompt;
- public String poolNameTip;
- public String poolMgrNamePrompt;
- public String poolMgrNameTip;
-
- public SystemSimpleContentElement filterPoolTreeRoot;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInterface.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInterface.java
deleted file mode 100644
index bbc737908..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogInterface.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-
-
-/**
- * Common interface for dialogs or wizards that work with filter pools.
- */
-public interface SystemFilterPoolDialogInterface
-{
-
-
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterPoolDialogActionCaller(SystemFilterAbstractFilterPoolAction caller);
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs();
- /**
- * Set the help context id for this wizard
- */
- public void setHelpContextId(String id);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogOutputs.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogOutputs.java
deleted file mode 100644
index 634dffda3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolDialogOutputs.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-//import org.eclipse.rse.core.*;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-
-
-
-/**
- * A class capturing the attributes commonly returned by dialogs that
- * work with filter pools.
- */
-public class SystemFilterPoolDialogOutputs
-{
-
-
- public String filterPoolName;
- public String filterPoolManagerName;
- public SystemSimpleContentElement filterPoolTreeRoot;
- public ISystemFilterPool newPool;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolManagerUIProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolManagerUIProvider.java
deleted file mode 100644
index c1d7f0a4d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterPoolManagerUIProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-
-public interface SystemFilterPoolManagerUIProvider
-{
- public ISystemFilterPoolManager[] getFilterPoolManagers();
- public SystemSimpleContentElement getTreeModel();
- public SystemSimpleContentElement getTreeModelPreSelection(SystemSimpleContentElement root);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java
deleted file mode 100644
index f97f040c9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import java.util.Vector;
-
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-
-/**
- * This class prompts the user to create or edit the contents of a single
- * filter string. This edit pane is used in many places, so creating a decent
- * looking subclass is important:
- * <ul>
- * <li>The first page of the New Filter wizard
- * <li>The only page of the New Filter String wizard
- * <li>The right side of the Change Filter dialog, when "new" or an existing filter string is selected
- * </ul>
- * So what is the "contract" the edit pane has to fulfill?
- * <ul>
- * <li>work in "new" or "edit" mode. In the latter case it is given a String as input. This needs to be
- * switchable on the fly. This is typically automated by use of a "state machine".
- * <li>give as output a new or updated String
- * <li>allow interested parties to know when the contents have been changed, as they change,
- * and whether there are errors in those changes
- * </ul>
- * Contractually, here are the methods called by the main page of the new filter wizard:
- * <ul>
- * <li>addChangeListener ... no need to ever override
- * <li>setSystemFilterPoolReferenceManagerProvider ... no need to ever override
- * <li>setType ... no need to ever override
- * <li>setFilterStringValidator ... no need to ever override
- * <li>isComplete ... no need to ever override
- * <li>createContents ... you will typically override
- * <li>verify ... you will typically override
- * <li>getInitialFocusControl ... you will typically override
- * <li>getFilterString ... you will typically override
- * <li>areFieldsComplete ... you will typically override
- * </ul>
- */
-public class SystemFilterStringEditPane implements SelectionListener
-{
- // inputs
- protected Shell shell;
- protected String inputFilterString;
- protected Vector listeners = new Vector();
- protected ISystemFilterPoolReferenceManagerProvider refProvider = null;
- protected ISystemFilterPoolManagerProvider provider = null;
- protected String type;
- protected boolean newMode = true;
- protected boolean changeFilterMode = false;
- protected boolean ignoreChanges;
- //protected boolean editable = true;
-
- // default GUI
- protected Label labelString;
- protected Text textString;
- protected Button dlgTestButton;
- // state
- protected SystemMessage errorMessage;
- protected boolean skipEventFiring;
- protected int currentSelectionIndex;
-
- /**
- * Constructor for SystemFilterStringEditPane.
- * @param shell - the shell of the wizard or dialog host this
- */
- public SystemFilterStringEditPane(Shell shell)
- {
- super();
- this.shell = shell;
-
- }
-
- // ------------------------------
- // HELPER METHODS...
- // ------------------------------
-
- /**
- * <i>Helper method. Do not override.</i><br>
- * Return the shell given us in the ctor
- */
- protected Shell getShell()
- {
- return shell;
- }
- /**
- * <i>Helper method. Do not override.</i><br>
- * Return the input filter string as given us in setFilterString
- */
- protected String getInputFilterString()
- {
- return inputFilterString;
- }
-
- /**
- * <i>Helper method. Do not override.</i><br>
- * Add a separator line. This is a physically visible line.
- */
- protected void addSeparatorLine(Composite parent, int nbrColumns)
- {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- separator.setLayoutData(data);
- }
- /**
- * <i>Helper method. Do not override.</i><br>
- * Add a spacer line
- */
- protected void addFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- filler.setLayoutData(data);
- }
- /**
- * <i>Helper method. Do not override.</i><br>
- * Add a spacer line that grows in height to absorb extra space
- */
- protected void addGrowableFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- filler.setLayoutData(data);
- }
- // ------------------------------
- // CONFIGURATION/INPUT METHODS...
- // ------------------------------
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Set the input filter string, in edit mode.
- * Or pass null if reseting to new mode.
- * @param filterString - the filter string to edit or null if new mode
- * @param selectionIndex - the index of the currently selected filter string. Only used for getCurrentSelectionIndex().
- */
- public void setFilterString(String filterString, int selectionIndex)
- {
- this.inputFilterString = filterString;
- this.currentSelectionIndex = selectionIndex;
- newMode = (filterString == null);
- setIgnoreChanges(true);
- resetFields();
- clearErrorsPending();
- if (inputFilterString != null)
- doInitializeFields();
- setIgnoreChanges(false);
- }
-
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Set the input filter string only without any initialzing.
- */
- public void setInputFilterString(String filterString)
- {
- this.inputFilterString = filterString;
- }
-
-
- /**
- * <i>Lifecyle method. Call, but do not override.</i><br>
- * Turn on ignore changes mode. Subclasses typically can just query the inherited
- * field ignoreChanges, unless they need to set the ignoreChanges mode in their
- * own composite widgets, in which case they can override and intercept this.
- */
- protected void setIgnoreChanges(boolean ignoreChanges)
- {
- this.ignoreChanges = ignoreChanges;
- }
-
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Identify a listener interested in any changes made to the filter string,
- * as they happen
- */
- public void addChangeListener(ISystemFilterStringEditPaneListener l)
- {
- listeners.add(l);
- }
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Remove a listener interested in any changes made to the filter string,
- * as they happen
- */
- public void removeChangeListener(ISystemFilterStringEditPaneListener l)
- {
- listeners.remove(l);
- }
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Sets the contextual system filter pool reference manager provider. That is, it will
- * be the currently selected subsystem if New Filter is launched from a subsystem.
- * <p>
- * Will be non-null if the current selection is a reference to a
- * filter pool or filter, or a reference manager provider.
- * <p>
- * This is not used by default but made available for subclasses.
- * @see #setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider)
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- this.refProvider = provider;
- }
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Sets the contextual system filter pool manager provider. That is, it will
- * be the subsystem factory of the given subsystem, filter pool or filter. Used
- * when there is no way to set setSystemFilterPoolReferenceManagerProvider, because
- * there isn't one derivable from the selection.
- * <p>
- * Will be non-null if the current selection is a reference to a
- * filter pool or filter, or a filter pool or filter, or a manager provider itself.
- * <p>
- * This is not used by default but made available for subclasses.
- * @see #setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider)
- */
- public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- this.provider = provider;
- }
-
- /**
- * <i>Getter method, for the use of subclasses. Do not override.</i><br>
- * Return the contextual system filter pool reference manager provider (ie subsystem) that
- * this was launched from. Will be null if not launched from a subsystem, or reference to a
- * filter pool or filter.
- * <p>
- * This is not used by default but made available for subclasses.
- */
- public ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider()
- {
- return refProvider;
- }
- /**
- * <i>Getter method, for the use of subclasses. Do not override.</i><br>
- * Return the contextual system filter pool manager provider (ie subsystemFactory) that
- * this was launched from. Will be null if not launched from a subsystem factory, or
- * a filter pool or filter (or reference).
- * <p>
- * This is not used by default but made available for subclasses.
- */
- public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider()
- {
- return provider;
- }
-
- /**
- * <i>Helper method you do not need to ever override.</i><br>
- * Set the type of filter we are creating. Types are not used by the base filter
- * framework but are a way for tools to create typed filters and have unique
- * actions per filter type.
- * <p>
- * This simply sets the <samp>type</samp> instance variable, so that subclassing code may
- * access it if it needs to know what type of filter is being created. This method is
- * called by the setType method in the SystemNewFilterWizard wizard.
- */
- public void setType(String type)
- {
- this.type = type;
- }
-
- /**
- * <i>Configuration method, called from Change Filter dialog. Do not override.</i><br>
- * Called by Change Filter dialog to set on our changeFilterMode flag in case we wish to
- * distinguish between new filter and change filter modes
- */
- public void setChangeFilterMode(boolean changeMode)
- {
- this.changeFilterMode = changeMode;
- }
- /**
- * <i>Configuration method, called from Change Filter dialog and New Filter wizard. Do not override.</i><br>
- * Called by Change Filter dialog or New Filter wizard when caller has indicated
- * they want a test button. This is used to set the testButton instance variable.
- * Subclasses show enable/disable it as changes are made, according to valid state.
- */
- public void setTestButton(Button button)
- {
- this.dlgTestButton = button;
- }
- /**
- * <i><b>Overridable</b> method, if subclass supports a Test button.</i><br>
- * Called by owning dialog when common Test button is pressed.
- * Does nothing by default.
- */
- public void processTest(Shell shell)
- {
- System.out.println("Someone forgot to override processTest in SystemFilterStringEditPane!");
- }
-
- /*
- * Set if the edit pane is not to be editable
- *
- public void setEditable(boolean editable)
- {
- this.editable = editable;
- }*/
- /*
- * Return whether the edit pane is editable, as set by {@link #setEditable(boolean)}
- *
- public boolean getEditable()
- {
- return editable;
- }*/
-
- // ------------------------------
- // DATA EXTRACTION METHODS
- // ------------------------------
-
- /**
- * <i><b>Overridable</b> getter method.</i><br>
- * Get the filter string in its current form.
- * This should be overridden if createContents is overridden.
- * <p>This is the functional opposite of doInitializeFields, which tears apart the input string in update mode,
- * to populate the GUIs. This method creates the filter string from the information in the GUI.
- */
- public String getFilterString()
- {
- if (textString != null)
- return textString.getText().trim();
- else
- return inputFilterString;
- }
- /**
- * <i>Getter method. Do not override.</i><br>
- * Get the selection index of the filter string we are currently editing.
- * Used in Change Filter dialog.
- */
- public int getCurrentSelectionIndex()
- {
- return currentSelectionIndex;
- }
-
- /**
- * <i><b>Overridable</b> getter method.</i><br>
- * For page 2 of the New Filter wizard, if it is possible to
- * deduce a reasonable default name from the user input here,
- * then return it here. Else, just return null (the default).
- */
- public String getDefaultFilterName()
- {
- return null;
- }
-
- /**
- * <i><b>Overridable</b> configuration method, called from Change Filter dialog and New Filter wizard.</i><br>
- * <b>YOU MUST TEST IF THE GIVEN LABEL IS NULL!</b><br>
- * In the Change Filter dialog, this edit pane is shown on the right side, beside
- * the filter string selection list. Above it is a label, that shows something
- * like "Selected Filter String" in edit mode, or "New Filter String" in new mode.
- * <p>
- * This method gives subclasses the opportunity to specify unique values for this label.
- * In addition to setting the text, the tooltip text should also be set.
- * <p>
- * Defaults are supplied.
- */
- public void configureHeadingLabel(Label label)
- {
- if (label == null)
- return;
- if (!newMode)
- {
- label.setText(SystemResources.RESID_CHGFILTER_FILTERSTRING_LABEL);
- label.setToolTipText(SystemResources.RESID_CHGFILTER_FILTERSTRING_TOOLTIP);
- }
- else
- {
- label.setText(SystemResources.RESID_CHGFILTER_NEWFILTERSTRING_LABEL);
- label.setToolTipText(SystemResources.RESID_CHGFILTER_NEWFILTERSTRING_TOOLTIP);
- }
- }
-
- // ------------------------------
- // LIFECYCLE METHODS...
- // ------------------------------
-
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Populate the pane with the GUI widgets. This is where we populate the client area.
- * @param parent - the composite that will be the parent of the returned client area composite
- * @return Control - a client-area composite populated with widgets.
- *
- * @see org.eclipse.rse.ui.SystemWidgetHelpers
- */
- public Control createContents(Composite parent)
- {
-
- // Inner composite
- int nbrColumns = 1;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
- ((GridLayout)composite_prompts.getLayout()).marginWidth = 0;
-
- // FILTER STRING PROMPT
- textString = SystemWidgetHelpers.createLabeledTextField(composite_prompts,null,getFilterStringPromptLabel(), getFilterStringPromptTooltip());
- labelString = SystemWidgetHelpers.getLastLabel();
- ((GridData)textString.getLayoutData()).widthHint=300;
-
- resetFields();
- doInitializeFields();
-
- textString.setFocus();
-
- // add keystroke listeners...
- textString.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateStringInput();
- }
- }
- );
- return composite_prompts;
- }
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Return the control to recieve initial focus. Should be overridden if you override createContents
- */
- public Control getInitialFocusControl()
- {
- return textString;
- }
-
-
-
-
- protected String getFilterStringPromptLabel()
- {
- return SystemResources.RESID_FILTERSTRING_STRING_LABEL;
- }
-
- protected String getFilterStringPromptTooltip()
- {
- return SystemResources.RESID_FILTERSTRING_STRING_TIP;
- }
-
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Initialize the input fields based on the inputFilterString, and perhaps refProvider.
- * This can be called before createContents, so test for null widgets first!
- * Prior to this being called, resetFields is called to set the initial default state prior to input
- */
- protected void doInitializeFields()
- {
- if (textString == null)
- return; // do nothing
- if (inputFilterString != null)
- textString.setText(inputFilterString);
- }
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * This is called in the change filter dialog when the user selects "new", or selects another string.
- * You must override this if you override createContents. Be sure to test if the contents have even been created yet!
- */
- protected void resetFields()
- {
- if (textString != null)
- {
- textString.setText("");
- }
- }
- /**
- * <i>Lifecycle method. Do not override.</i><br>
- * Instead, override {@link #areFieldsComplete()}.
- * <p>
- * This is called by the wizard page when first shown, to decide if the default information
- * is complete enough to enable finish. It doesn't do validation, that will be done when
- * finish is pressed.
- */
- public boolean isComplete()
- {
- boolean complete = true;
- if (errorMessage != null) // pending errors?
- complete = false; // clearly not complete.
- else
- complete = areFieldsComplete();
- if (dlgTestButton != null)
- dlgTestButton.setEnabled(complete);
- return complete;
- }
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Must be overridden if createContents is overridden.
- * <p>
- * This is called by the isComplete, to decide if the default information
- * is complete enough to enable finish. It doesn't do validation, that will be done when
- * finish is pressed.
- */
- protected boolean areFieldsComplete()
- {
- if (textString == null)
- return false;
- else
- return (textString.getText().trim().length()>0);
- }
-
- /**
- * <i>Lifecycle method. Do not override.</i><br>
- * Are errors pending? Used in Change Filter dialog to prevent changing the filter string selection
- */
- public boolean areErrorsPending()
- { // d45795
- return (errorMessage != null);
- }
- /**
- * <i>Lifecycle method. Do not override.</i><br>
- * Clear any errors pending. Called when Reset is pressed.
- */
- public void clearErrorsPending()
- {
- errorMessage = null;
- }
-
- // ------------------------------
- // PRIVATE METHODS
- // ------------------------------
- /**
- * <i><b>Private</b> method. Do not call or override.</i><br>
- * Fire an event to all registered listeners, that the user has changed the
- * filter string. Include the error message, if in error, so it can be displayed to the user.
- * <p>
- * Because this is used to enable/disable the Next and Finish buttons it is important
- * to call it when asked to do verification, even if nothing has changed.
- * <p>
- * It is more efficient, however, to defer the event firing during a full verification
- * until after the last widget has been verified. To enable this, set the protected
- * variable "skipEventFiring" to true at the top of your verify event, then to "false"
- * at the end. Then do fireChangeEvent(errorMessage);
- */
- protected void fireChangeEvent(SystemMessage error)
- {
- if (skipEventFiring)
- return;
- for (int idx=0; idx<listeners.size(); idx++)
- {
- ISystemFilterStringEditPaneListener l = (ISystemFilterStringEditPaneListener)listeners.elementAt(idx);
- l.filterStringChanged(error);
- }
- }
-
- /**
- * Tell interested callers to backup changes-pending state, as we are about
- * to fire a change event, after which we will want to restore state.
- */
- protected void fireBackupChangeEvent()
- {
- for (int idx=0; idx<listeners.size(); idx++)
- {
- ISystemFilterStringEditPaneListener l = (ISystemFilterStringEditPaneListener)listeners.elementAt(idx);
- l.backupChangedState();
- }
- }
- /**
- * <i><b>Private</b> method. Do not call or override.</i><br>
- * Tell interested callers to restore changes-pending state, as we are done
- * firing a change event and in this case we don't want that state change side effect.
- */
- protected void fireRestoreChangeEvent()
- {
- for (int idx=0; idx<listeners.size(); idx++)
- {
- ISystemFilterStringEditPaneListener l = (ISystemFilterStringEditPaneListener)listeners.elementAt(idx);
- l.restoreChangedState();
- }
- }
- // ---------------------------------------------
- // METHODS FOR VERIFYING INPUT PER KEYSTROKE ...
- // ---------------------------------------------
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Validates filter string as entered so far in the text field.
- * Not called if you override createContents() and verify()
- */
- protected SystemMessage validateStringInput()
- {
- if (ignoreChanges)
- return errorMessage;
- errorMessage= null;
- //if (validator != null)
- // errorMessage = validateFilterString(textString.getText());
- if ((textString!=null) && (textString.getText().trim().length() == 0))
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_EMPTY);
- fireChangeEvent(errorMessage);
- //setPageComplete();
- //setErrorMessage(errorMessage);
- return errorMessage;
- }
-
- /*
- * Validates filter string using the supplied generic validator.
- * Child classes who do their own syntax validation can call this method
- * to also do uniqueness validation. They are responsible for calling fireChangeEvent though.
- * @see #setFilterStringValidator(ISystemValidator)
- *
- protected SystemMessage validateFilterString(String filterString)
- {
- if (validator != null)
- return validator.validate(filterString);
- else
- return null;
- }*/
-
- // ---------------------------------
- // METHODS FOR VERIFICATION...
- // ---------------------------------
-
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * Does complete verification of input fields. If this
- * method returns null, there are no errors and the dialog or wizard can close.
- * <p>Default implementation calls {@link #validateStringInput()}.
- *
- * @return error message if there is one, else null if ok
- */
- public SystemMessage verify()
- {
- errorMessage = null;
- Control controlInError = null;
- errorMessage = validateStringInput();
- if (errorMessage != null)
- controlInError = textString;
- if (errorMessage != null)
- {
- if (controlInError != null)
- controlInError.setFocus();
- }
- //setPageComplete();
- return errorMessage;
- }
-
- // ------------------
- // EVENT LISTENERS...
- // ------------------
-
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * User has selected something
- */
- public void widgetSelected(SelectionEvent event)
- {
- }
- /**
- * <i><b>Overridable</b> lifecycle method.</i><br>
- * User has selected something via enter/dbl-click
- */
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-
-
- // -----------------------
- // Saving related method
- // -----------------------
- /**
- * Returns whether filter string can be saved implicitly. This is called in the Change dialog
- * and property page to check whether filter string can be saved if the user does not
- * explicitly click on Create/Apply button. So, for example, if this method returns <code>false</code>,
- * and the user has pending changes when he clicks on another entry in the filter string list, we will
- * not ask user to save pending changes.
- * By default, returns <code>true</code>
- * @return <code>true</code> to query user to save pending changes, <code>false</code> otherwise.
- */
- public boolean canSaveImplicitly() {
- return true;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterUIHelpers.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterUIHelpers.java
deleted file mode 100644
index 25a85dcb2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterUIHelpers.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-
-
-/**
- *
- */
-public class SystemFilterUIHelpers
-{
-
- /**
- * Find element corresponding to given data
- */
- public static SystemSimpleContentElement getDataElement(SystemSimpleContentElement root, Object data)
- {
- SystemSimpleContentElement[] children = root.getChildren();
- SystemSimpleContentElement match = null;
- if ((children!=null)&&(children.length>0))
- {
- for (int idx=0; (match==null)&&(idx<children.length); idx++)
- if (children[idx].getData() == data)
- match = children[idx];
- }
- if ((match==null)&&(children!=null)&&(children.length>0))
- {
- for (int idx=0; (match==null)&&(idx<children.length); idx++)
- match = getDataElement(children[idx], data);
- }
- return match;
- }
-
- /**
- * Create and return data model to populate selection tree with
- */
- public static SystemSimpleContentElement getFilterPoolModel(ISystemFilterPoolManagerProvider mgrProvider,
- ISystemFilterPoolManager mgrs[])
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Filter pools",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- if (mgrs == null)
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement rootElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- rootElement.setRenamable(false);
- rootElement.setDeletable(false);
- rootElement.setImageDescriptor(getFilterPoolManagerImage(mgrProvider, mgrs[idx]));
- Vector elements = new Vector();
- ISystemFilterPool[] pools = mgrs[idx].getSystemFilterPools();
- populateFilterPoolContentElementVector(pools, elements, rootElement);
- rootElement.setChildren(elements);
- veryRootChildren.addElement(rootElement);
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
- /**
- * Internal use only
- */
- protected static void populateFilterPoolContentElementVector(ISystemFilterPool[] pools,
- Vector elements,
- SystemSimpleContentElement parentElement)
- {
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPool pool = pools[idx];
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, parentElement, (Vector)null);
- cElement.setImageDescriptor(getFilterPoolImage(pool.getProvider(),pool));
- cElement.setDeletable(pool.isDeletable());
- cElement.setRenamable(!pool.isNonRenamable());
- cElement.setReadOnly(pool.getOwningParentName()!=null);
- //cElement.setSelected(setFilterPoolSelection(pool));
- elements.addElement(cElement);
- }
- }
-
-
- /**
- * Get the filter pool manager image
- */
- public static ImageDescriptor getFilterPoolManagerImage(ISystemFilterPoolManagerProvider poolMgrProvider, ISystemFilterPoolManager poolMgr)
- {
- ImageDescriptor poolMgrImage = null;
- if (poolMgrProvider == null)
- poolMgrProvider = poolMgr.getProvider();
- if (poolMgrProvider != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- poolMgrImage = adapter.getSystemFilterPoolManagerImage();
- }
- if (poolMgrImage == null)
- poolMgrImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID);
- return poolMgrImage;
- }
-
-
- /**
- * Get the filter pool image
- */
- public static ImageDescriptor getFilterPoolImage(ISystemFilterPoolManagerProvider poolMgrProvider, ISystemFilterPool pool)
- {
- ImageDescriptor poolImage = null;
- if (poolMgrProvider == null)
- poolMgrProvider = pool.getProvider();
- if (poolMgrProvider != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- poolImage = adapter.getSystemFilterPoolImage(pool);
- }
- if (poolImage == null)
- poolImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID);
- return poolImage;
- }
-
- /**
- * Get the filter image
- */
- public static ImageDescriptor getFilterImage(ISystemFilterPoolManagerProvider poolMgrProvider, ISystemFilter filter)
- {
- ImageDescriptor filterImage = null;
- if (poolMgrProvider == null)
- poolMgrProvider = filter.getProvider();
- if (poolMgrProvider != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- filterImage = adapter.getSystemFilterImage(filter);
- }
- if (filterImage == null)
- filterImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID);
- return filterImage;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterWorkWithFilterPoolsTreeViewer.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterWorkWithFilterPoolsTreeViewer.java
deleted file mode 100644
index 520bdaca2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterWorkWithFilterPoolsTreeViewer.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterWorkWithFilterPoolsDialog;
-import org.eclipse.rse.ui.view.SystemView;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-
-
-/**
- * This subclass of the standard JFace tree viewer is used to
- * show a tree view of filter pools within filterpool managers,
- * for a work-with experience.
- */
-public class SystemFilterWorkWithFilterPoolsTreeViewer
- extends TreeViewer
- implements IMenuListener
-{
-
- private SystemFilterWorkWithFilterPoolsDialog caller;
- private Shell shell;
- private IAction[] contextMenuActions;
- private MenuManager menuMgr;
-
- /**
- * Constructor for SystemFilterWorkWithFilterPoolsTreeViewer
- */
- public SystemFilterWorkWithFilterPoolsTreeViewer(Shell shell, SystemFilterWorkWithFilterPoolsDialog caller, Composite arg0)
- {
- super(arg0);
- init(shell, caller);
- }
-
- /**
- * Constructor for SystemFilterWorkWithFilterPoolsTreeViewer
- */
- public SystemFilterWorkWithFilterPoolsTreeViewer(Shell shell, SystemFilterWorkWithFilterPoolsDialog caller, Composite arg0, int arg1)
- {
- super(arg0, arg1);
- init(shell, caller);
- }
-
- /**
- * Constructor for SystemFilterWorkWithFilterPoolsTreeViewer
- */
- public SystemFilterWorkWithFilterPoolsTreeViewer(Shell shell,
- SystemFilterWorkWithFilterPoolsDialog caller,
- Tree tree)
- {
- super(tree);
- init(shell, caller);
- }
-
- /**
- * Initialize
- */
- public void init(Shell shell, SystemFilterWorkWithFilterPoolsDialog caller)
- {
- this.caller = caller;
- this.shell = shell;
- // -----------------------------
- // Enable right-click popup menu
- // -----------------------------
- menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- Menu menu = menuMgr.createContextMenu(getTree());
- getTree().setMenu(menu);
- }
-
- /**
- * Set the context menu actions to show in the popup
- */
- public void setContextMenuActions(IAction[] actions)
- {
- this.contextMenuActions = actions;
- }
-
- /**
- * Override of refresh from parent
- */
- public void refresh()
- {
- if (!caller.refreshTree())
- super.refresh();
- //super.refresh();
- }
-
- /**
- * Called when the context menu is about to open.
- */
- public void menuAboutToShow(IMenuManager menu)
- {
- ISystemAction ourAction = null;
- if (contextMenuActions != null)
- {
- //SystemMenuManager ourMenu = createStandardGroups(menu);
- SystemView.createStandardGroups(menu);
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
- for (int idx=0; idx<contextMenuActions.length; idx++)
- {
- if (contextMenuActions[idx] instanceof ISystemAction)
- {
- ourAction = (ISystemAction)contextMenuActions[idx];
- ourMenu.add(ISystemContextMenuConstants.GROUP_REORGANIZE, ourAction);
-
- if (ourAction instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)ourAction;
- item.setShell(shell);
- item.setSelection(getSelection());
- }
- }
- else
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, ourAction);
- }
- }
- }
-
- /*
- * Creates the Systems plugin standard groups in a context menu.
- *
- public SystemMenuManager createStandardGroups(IMenuManager menu)
- {
- if (menu.isEmpty())
- {
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
- //menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand TO->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SHOW)); // show->type hierarchy, in-navigator
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- //menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // user or BP/ISV additions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_STARTSERVER)); // start/stop remote server actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
- }
- return new SystemMenuManager(menu);
- }*/
-
- /**
- * Private helper method to add an Action to a given menu.
- * To give the action the opportunity to grey out, we call selectionChanged, but
- * only if the action implements ISelectionChangedListener
- */
- protected void menuAdd(MenuManager menu, IAction action)
- {
- if (action instanceof ISelectionChangedListener)
- ((ISelectionChangedListener)action).selectionChanged(new SelectionChangedEvent(this,getSelection()));
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/ISystemNewFilterActionConfigurator.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/ISystemNewFilterActionConfigurator.java
deleted file mode 100644
index b91a306da..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/ISystemNewFilterActionConfigurator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-
-/**
- * Sometimes configuring a filter action can take a reasonably substantial amount of
- * processing. For this reason, we would desire to defer that configuration, when simply
- * filling a popup menu, until such time as the user has select to run the action. This
- * reduces time and memory in the vast majority of cases.
- * <p>
- * To achieve this, code which populates a context menu can implement this interface, and
- * pass it to the new filter wizard action. That action will then call back to the caller
- * via this interface, when the action is run.
- */
-public interface ISystemNewFilterActionConfigurator
-{
-
- /**
- * The user has selected to run this action. Please configure it!
- * @param newFilterAction - the action to be configured
- * @param callerData - context data that you supplied when registering this callback
- */
- public void configureNewFilterAction(ISubSystemConfiguration factory, SystemNewFilterAction newFilterAction, Object callerData);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterAction.java
deleted file mode 100644
index 851672fad..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterAction.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the Change Filter dialog
- */
-public class SystemChangeFilterAction extends SystemBaseDialogAction
-
-{
-
- private SystemChangeFilterDialog dlg = null;
- private String dlgTitle = null;
- private SystemFilterStringEditPane editPane;
-
- /**
- * Constructor for default action label and image
- */
- public SystemChangeFilterAction(Shell parent)
- {
- this( parent, SystemResources.ACTION_UPDATEFILTER_LABEL, SystemResources.ACTION_UPDATEFILTER_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CHANGEFILTER_ID));
- }
-
- public SystemChangeFilterAction(Shell parent, String label, String tooltip)
- {
- this(parent, label, tooltip, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CHANGEFILTER_ID));
- }
-
- public SystemChangeFilterAction(Shell parent, String label, String tooltip, ImageDescriptor image)
- {
- super(label, tooltip, image, parent);
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- setHelp(RSEUIPlugin.HELPPREFIX+"acfr0000");
- }
-
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseDialogAction #setDialogHelp(String)
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
- /**
- * Set the title for the dialog that displays
- */
- public void setDialogTitle(String title)
- {
- this.dlgTitle = title;
- }
- /**
- * Set the help id for the dialog that displays
- */
- public void setDialogHelpContextId(String id)
- {
- setDialogHelp(id);
- }
- /**
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
- /**
- * Return the edit pane specified via {@link #setFilterStringEditPane(SystemFilterStringEditPane)}
- */
- public SystemFilterStringEditPane getFilterStringEditPane()
- {
- return editPane;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- //System.out.println("checkObjectType: " + (selectedObject instanceof SystemFilterReference));
- if (selectedObject instanceof ISystemFilter)
- {
- return !((ISystemFilter)selectedObject).isNonChangable();
- }
- else if (selectedObject instanceof ISystemFilterReference)
- {
- return !((ISystemFilterReference)selectedObject).getReferencedFilter().isNonChangable();
- }
- else
- return false;
- }
-
- /**
- * This method creates and configures the filter dialog. It defers to
- * {@link #getFilterDialog(Shell)} to create it, and then configures it here.
- * So, do not override this, but do feel free to override getFilterDialog.
- */
- public Dialog createDialog(Shell shell)
- {
- dlg = getFilterDialog(shell);
- dlg.setSystemFilterPoolReferenceManagerProvider(getSystemFilterPoolReferenceManagerProvider());
- dlg.setSystemFilterPoolManagerProvider(getSystemFilterPoolManagerProvider());
- if (editPane != null)
- dlg.setFilterStringEditPane(editPane);
- configureFilterDialog(dlg);
- ISystemFilter filter = getSelectedFilter();
- if (filter != null)
- if (filter.isSingleFilterStringOnly())
- dlg.setSupportsMultipleStrings(false);
- return dlg;
- }
-
- /**
- * Overridable extension point to get our filter dialog. Only override this if you
- * subclass SystemChangeFilterDialog. Else, override configureFilterDialog.
- */
- protected SystemChangeFilterDialog getFilterDialog(Shell shell)
- {
- if (dlgTitle == null)
- return new SystemChangeFilterDialog(shell);
- else
- return new SystemChangeFilterDialog(shell, dlgTitle);
- }
-
- /**
- * This method is called internally, but had to be made public. You can ignore it.
- */
- public void callConfigureFilterDialog(SystemChangeFilterDialog dlg)
- {
- configureFilterDialog(dlg);
- }
-
- /**
- * Overridable extension point to configure the filter dialog. Typically you don't need
- * to subclass our default dialog.
- * <p>
- * Note since the dialog has not been opened yet, you cannot assume its shell is ready,
- * so call getParentShell() versus getShell().
- */
- protected void configureFilterDialog(SystemChangeFilterDialog dlg)
- {
- Shell shell = dlg.getShell();
- if (shell == null)
- shell = dlg.getParentShell();
- // code goes here...
- }
-
- /**
- * Required by parent but we do not use it so return null;
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-
- /**
- * Get the contextual system filter pool reference manager provider. Will return non-null if the
- * current selection is not a reference to a filter pool or filter, or a reference manager
- * provider.
- */
- public ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider()
- {
- Object firstSelection = getFirstSelection();
- if (firstSelection != null)
- {
- if (firstSelection instanceof ISystemFilterReference)
- return ((ISystemFilterReference)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolReferenceManagerProvider)
- return (ISystemFilterPoolReferenceManagerProvider)firstSelection;
- }
- return null;
- }
- /**
- * Get the contextual system filter pool manager provider. Will return non-null if the
- * current selection is not a reference to a filter pool or filter, or a reference manager
- * provider, or a manager provider.
- */
- public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider()
- {
- Object firstSelection = getFirstSelection();
- if (firstSelection != null)
- {
- if (firstSelection instanceof ISystemFilterReference)
- return ((ISystemFilterReference)firstSelection).getReferencedFilter().getProvider();
- else if (firstSelection instanceof ISystemFilter)
- return ((ISystemFilter)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)firstSelection).getReferencedFilterPool().getProvider();
- else if (firstSelection instanceof ISystemFilterPool)
- return ((ISystemFilterPool)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolManagerProvider)
- return (ISystemFilterPoolManagerProvider)firstSelection;
- }
- return null;
- }
-
- /**
- * Get the selected filter
- */
- public ISystemFilter getSelectedFilter()
- {
- Object firstSelection = getFirstSelection();
- if (firstSelection != null)
- {
- if (firstSelection instanceof ISystemFilterReference)
- return ((ISystemFilterReference)firstSelection).getReferencedFilter();
- else if (firstSelection instanceof ISystemFilter)
- return ((ISystemFilter)firstSelection);
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionCopyString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionCopyString.java
deleted file mode 100644
index 534f2eb2b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionCopyString.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-
-/**
- * The action is used within the Change Filter dialog, in the context menu of the selected filter string.
- * It is used to copy the selected filter string to the clipboard for subsequent paste.
- */
-public class SystemChangeFilterActionCopyString extends SystemBaseAction
-
-{
- private SystemChangeFilterPane parentDialog;
-
- /**
- * Constructor
- */
- public SystemChangeFilterActionCopyString(SystemChangeFilterPane parentDialog)
- {
- super(SystemResources.ACTION_COPY_FILTERSTRING_LABEL,SystemResources.ACTION_COPY_FILTERSTRING_TOOLTIP,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
- null);
- allowOnMultipleSelection(false);
- this.parentDialog = parentDialog;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr2000");
- }
-
- /**
- * We override from parent to do unique checking.
- * We intercept to ensure this is isn't the "new" filter string
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return parentDialog.canCopy();
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- parentDialog.doCopy();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionDeleteString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionDeleteString.java
deleted file mode 100644
index 931834b37..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionDeleteString.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The action is used within the Change Filter dialog, in the context menu of the selected filter string.
- * It is used to delete the selected filter string
- */
-public class SystemChangeFilterActionDeleteString extends SystemBaseAction
-
-{
-
- private SystemChangeFilterPane parentDialog;
-
- /**
- * Constructor
- */
- public SystemChangeFilterActionDeleteString(SystemChangeFilterPane parentDialog)
- {
- super(SystemResources.ACTION_DELETE_LABEL,SystemResources.ACTION_DELETE_TOOLTIP,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)
- ,null);
- allowOnMultipleSelection(false);
- this.parentDialog = parentDialog;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr1000");
- }
-
- /**
- * We override from parent to do unique checking.
- * We intercept to ensure this is isn't the "new" filter string
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return parentDialog.canDelete();
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- parentDialog.doDelete();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringDown.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringDown.java
deleted file mode 100644
index 442be5bde..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringDown.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-
-
-/**
- * The action is used within the Change Filter dialog, in the context menu of the selected filter string.
- * It is used to move the selected filter string up by one in the list
- */
-public class SystemChangeFilterActionMoveStringDown extends SystemBaseAction
-{
-
- private SystemChangeFilterPane parentDialog;
-
- /**
- * Constructor
- */
- public SystemChangeFilterActionMoveStringDown(SystemChangeFilterPane parentDialog)
- {
- super(SystemResources.ACTION_MOVEDOWN_LABEL,SystemResources.ACTION_MOVEDOWN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID),
- null);
- allowOnMultipleSelection(false);
- this.parentDialog = parentDialog;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr5000");
- }
-
- /**
- * We override from parent to do unique checking.
- * We intercept to ensure this is isn't the last filter string in the list
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return parentDialog.canMoveDown();
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- parentDialog.doMoveDown();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringUp.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringUp.java
deleted file mode 100644
index 141741220..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionMoveStringUp.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-
-
-/**
- * The action is used within the Change Filter dialog, in the context menu of the selected filter string.
- * It is used to move the selected filter string down by one in the list
- */
-public class SystemChangeFilterActionMoveStringUp extends SystemBaseAction
-{
-
- private SystemChangeFilterPane parentDialog;
-
- /**
- * Constructor
- */
- public SystemChangeFilterActionMoveStringUp(SystemChangeFilterPane parentDialog)
- {
- super(SystemResources.ACTION_MOVEUP_LABEL,SystemResources.ACTION_MOVEUP_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID),
- null);
- allowOnMultipleSelection(false);
- this.parentDialog = parentDialog;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr4000");
- }
-
- /**
- * We override from parent to do unique checking.
- * We intercept to ensure this is isn't the fist filter string
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return parentDialog.canMoveUp();
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- parentDialog.doMoveUp();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionPasteString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionPasteString.java
deleted file mode 100644
index 8331d7847..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemChangeFilterActionPasteString.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The action is used within the Change Filter dialog, in the context menu of the selected filter string.
- * It is used to paste the copied filter string from the clipboard to the list.
- */
-public class SystemChangeFilterActionPasteString extends SystemBaseAction
-{
- private SystemChangeFilterPane parentDialog;
-
- /**
- * Constructor
- */
- public SystemChangeFilterActionPasteString(SystemChangeFilterPane parentDialog)
- {
- super(SystemResources.ACTION_PASTE_LABEL,SystemResources.ACTION_PASTE_TOOLTIP,
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
- null);
- allowOnMultipleSelection(false);
- this.parentDialog = parentDialog;
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr3000");
- }
-
- /**
- * We override from parent to do unique checking.
- * We intercept to ensure there is something in the clipboard to copy
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- return parentDialog.canPaste();
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- parentDialog.doPaste();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterAction.java
deleted file mode 100644
index c6fe91374..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterAction.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
-import org.eclipse.rse.ui.filters.SystemFilterDialogInputs;
-import org.eclipse.rse.ui.filters.SystemFilterDialogInterface;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Base class capturing the attributes and operations common to dialog actions
- * that work on system filters.
- */
-public abstract class SystemFilterAbstractFilterAction
- extends SystemBaseDialogAction
-
-{
-
-
- protected SystemFilterDialogInputs dlgInputs;
-
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterAbstractFilterAction(Shell parent, String title)
- {
- super(title, null, parent);
- allowOnMultipleSelection(false);
- init();
- }
-
- /**
- * Constructor when given the translated action label and tooltip
- */
- public SystemFilterAbstractFilterAction(Shell parent, String title, String tooltip)
- {
- super(title, tooltip, null, parent);
- allowOnMultipleSelection(false);
- init();
- }
-
- /**
- * Common initialization code
- */
- protected void init()
- {
- dlgInputs = new SystemFilterDialogInputs();
- }
-
- // ----------------------------
- // HELP ID SETTINGS...
- // ----------------------------
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- // ----------------------------
- // ATTRIBUTE GETTERS/SETTERS...
- // ----------------------------
-
- /**
- * Set the dialog title.
- * Either call this or override getDialogTitle()
- */
- public void setDialogTitle(String title)
- {
- dlgInputs.title = title;
- }
- /**
- * Get the dialog title.
- * By default, uses what was given in setDialogTitle, or an english default if nothing set.
- */
- public String getDialogTitle()
- {
- return dlgInputs.title;
- }
-
- /**
- * Set the dialog prompt text.
- * Either call this or override getDialogPrompt()
- */
- public void setDialogPrompt(String prompt)
- {
- dlgInputs.prompt = prompt;
- }
- /**
- * Get the dialog prompt.
- * By default, uses what was given in setDialogPrompt
- */
- public String getDialogPrompt()
- {
- return dlgInputs.prompt;
- }
-
- /**
- * Set the dialog's filter name prompt text and tooltip
- * Either call this or override getDialogFilterNamePrompt/Tip()
- */
- public void setDialogFilterNamePrompt(String prompt, String tip)
- {
- dlgInputs.filterNamePrompt = prompt;
- dlgInputs.filterNameTip = tip;
- }
- /**
- * Get the dialog's filter name prompt text.
- * By default, uses what was given in setDialogFilterNamePrompt.
- */
- public String getDialogFilterFilterNamePrompt()
- {
- return dlgInputs.filterNamePrompt;
- }
- /**
- * Get the dialog's filter name tooltip text.
- * By default, uses what was given in setDialogFilterNamePrompt.
- */
- public String getDialogFilterNameTip()
- {
- return dlgInputs.filterNameTip;
- }
-
- /**
- * Set the dialog's pre-select information.
- * Either call this or override getDialogPreSelectInput()
- */
- public void setDialogPreSelectInput(Object selectData)
- {
- dlgInputs.preSelectObject = selectData;
- }
- /**
- * Get the dialog's pre-select information.
- * By default, uses what was given in setDialogPreSelectInput.
- */
- public Object getDialogPreSelectInput()
- {
- return dlgInputs.preSelectObject;
- }
-
-
- // -------------------------
- // PARENT CLASS OVERRIDES...
- // -------------------------
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- return true;
- //return (selectedObject instanceof SystemFilterPoolReferenceManagerProvider); // override as appropriate
- }
-
- /**
- * Extends run in parent class to call doOKprocessing if the result of calling
- * getDialogValue() resulted in a non-null value.
- */
- public void run()
- {
- super.run();
- if (getValue() != null)
- doOKprocessing(getValue());
- }
-
-
- /**
- * Overrides parent method to allow creating of a dialog meeting our interface,
- * so we can pass instance of ourselves to it for callbacks to get our data.
- * <p>
- * If your dialog does not implement our interface, override this method!
- */
- protected Dialog createDialog(Shell parent)
- {
- SystemFilterDialogInterface fDlg = createFilterDialog(parent);
- fDlg.setFilterDialogActionCaller(this);
- return (Dialog)fDlg;
- }
-
- /**
- * Where you create the dialog meeting our interface. If you override
- * createDialog, then override this to return null
- */
- public abstract SystemFilterDialogInterface createFilterDialog(Shell parent);
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to retrieve the data
- * from the dialog. For InputDialog dialogs, this is simply
- * a matter of return dlg.getValue();
- * <p>
- * This is called by the run method after the dialog returns. Callers
- * of this object can subsequently retrieve it by calling getValue.
- *
- * @param dlg The dialog object, after it has returned from open.
- */
- protected abstract Object getDialogValue(Dialog dlg);
-
- /**
- * Method called when ok pressed on dialog and after getDialogValue has set the
- * value attribute appropriately.
- * <p>
- * Only called if user pressed OK on dialog.
- * <p>
- * @param dlgValue The output of getDialogValue().
- */
- public abstract void doOKprocessing(Object dlgValue);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolAction.java
deleted file mode 100644
index 3c978d0cf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolAction.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInputs;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Base class capturing the attributes and operations common to dialog actions
- * that work on system filter pools.
- */
-public abstract class SystemFilterAbstractFilterPoolAction
- extends SystemBaseDialogAction
-
-{
-
-
- protected SystemFilterPoolDialogInputs dlgInputs;
- protected String mgrNamePreselect;
-
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterAbstractFilterPoolAction(Shell parent, String title)
- {
- super(title, null, parent);
- allowOnMultipleSelection(false);
- init();
- }
-
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterAbstractFilterPoolAction(Shell parent, String title, String tooltip)
- {
- super(title, tooltip, null, parent);
- allowOnMultipleSelection(false);
- init();
- }
-
-
-
- /**
- * Constructor when given the resource bundle and key for the action label
- */
- public SystemFilterAbstractFilterPoolAction(Shell parent, ImageDescriptor image, String label, String tooltip)
- {
- super(label, tooltip, image, parent);
- allowOnMultipleSelection(false);
- init();
- }
-
- /**
- * Common initialization code
- */
- protected void init()
- {
- dlgInputs = new SystemFilterPoolDialogInputs();
- }
-
- // ----------------------------
- // HELP ID SETTINGS...
- // ----------------------------
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- // --------------------------------------
- // SELECTION CHANGED INTERCEPT METHODS...
- // --------------------------------------
-
- /**
- * This is called by the UI calling the action, if that UI is not a selection provider.
- * That is, this is an alternative to calling selectionChanged when there is no SelectionChangedEvent.
- * @see #selectionChanged(SelectionChangedEvent event)
- */
- public void setSelection(ISelection selection)
- {
- super.setSelection(selection);
- Object firstSelection = getFirstSelection();
- if (isEnabled() && (firstSelection != null))
- {
- if (firstSelection instanceof SystemSimpleContentElement)
- firstSelection = ((SystemSimpleContentElement)firstSelection).getData();
-
- if (firstSelection instanceof ISystemFilterPoolManagerProvider)
- setFilterPoolManagerProvider((ISystemFilterPoolManagerProvider)firstSelection);
- else if (firstSelection instanceof ISystemFilterPoolManager)
- setFilterPoolManagerProvider(((ISystemFilterPoolManager)firstSelection).getProvider());
- else if (firstSelection instanceof ISystemFilterPool)
- setFilterPoolManagerProvider(((ISystemFilterPool)firstSelection).getProvider());
- else if (firstSelection instanceof ISystemFilter)
- setFilterPoolManagerProvider(((ISystemFilter)firstSelection).getProvider());
- else if (firstSelection instanceof ISystemFilterString)
- setFilterPoolManagerProvider(((ISystemFilterString)firstSelection).getProvider());
-
- else if (firstSelection instanceof ISystemFilterPoolReferenceManagerProvider)
- setFilterPoolReferenceManager(((ISystemFilterPoolReferenceManagerProvider)firstSelection).getSystemFilterPoolReferenceManager());
- else if (firstSelection instanceof ISystemFilterPoolReferenceManager)
- setFilterPoolReferenceManager((ISystemFilterPoolReferenceManager)firstSelection);
- else if (firstSelection instanceof ISystemFilterPoolReference)
- setFilterPoolReferenceManager(((ISystemFilterPoolReference)firstSelection).getFilterPoolReferenceManager());
- else if (firstSelection instanceof ISystemFilterReference)
- setFilterPoolReferenceManager(((ISystemFilterReference)firstSelection).getFilterPoolReferenceManager());
- else if (firstSelection instanceof ISystemFilterStringReference)
- setFilterPoolReferenceManager(((ISystemFilterStringReference)firstSelection).getFilterPoolReferenceManager());
- }
- }
-
- // ----------------------------
- // ATTRIBUTE GETTERS/SETTERS...
- // ----------------------------
-
- /**
- * Set the input filter pool manager provider from which to get the list of filter pool managers.
- * Either call this or call setFilterPoolManagers or override getFilterPoolManagerProvider().
- */
- public void setFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- dlgInputs.poolManagerProvider = provider;
- //setFilterPoolManagers(provider.getSystemFilterPoolManagers());
- }
-
- /**
- * Get the input filter pool manager provider from which to get the list of filter pool managers.
- */
- public ISystemFilterPoolManagerProvider getFilterPoolManagerProvider()
- {
- //if (dlgInputs.poolManagerProvider != null)
- return dlgInputs.poolManagerProvider;
- //else if ((dlgInputs.poolManagers != null) && (dlgInputs.poolManagers.length > 0))
- //return dlgInputs.poolManagers[0].getProvider();
- //else
- //return null;
- }
-
- /**
- * Set the input filter pool managers from which to allow selections of filter pools.
- * Either call this or call setFilterPoolManagerProvider or override getFilterPoolManagers().
- */
- public void setFilterPoolManagers(ISystemFilterPoolManager[] managers)
- {
- dlgInputs.poolManagers = managers;
- }
-
- /**
- * Returns the filter pool managers from which to show filter pools for selection.
- * <p>
- * By default, tries the following in this order:
- * <ol>
- * <li>calls getFilterPoolManagerProvider if setFilterPoolManagerProvider was called
- * <li>uses what was given in setFilterPoolManagers
- * <li>uses what was given in setFilterPoolReferenceManager, calling its getSystemFilterPoolManagers
- * <li>checks if the current selection is a filterPoolReferenceManager, and if so uses the managers it references from.
- * </ol>
- */
- public ISystemFilterPoolManager[] getFilterPoolManagers()
- {
- ISystemFilterPoolManager[] mgrs = null;
- ISystemFilterPoolManagerProvider provider = getFilterPoolManagerProvider();
- if (mgrs == null)
- mgrs = dlgInputs.poolManagers;
- if ((mgrs==null) && (provider != null))
- mgrs = provider.getSystemFilterPoolManagers(); // get it in real time.
- if (mgrs == null)
- {
- ISystemFilterPoolReferenceManager refmgr = getFilterPoolReferenceManager();
- if (refmgr != null)
- mgrs = refmgr.getSystemFilterPoolManagers();
- }
- if (mgrs == null)
- {
- ISystemFilterPoolReferenceManagerProvider sfprmp = getReferenceManagerProviderSelection();
- if (sfprmp != null)
- mgrs = sfprmp.getSystemFilterPoolReferenceManager().getSystemFilterPoolManagers();
- }
- return mgrs;
- }
- /**
- * Return the current selection if it implements SystemFilterPoolReferenceManagerProvider
- */
- protected ISystemFilterPoolReferenceManagerProvider getReferenceManagerProviderSelection()
- {
- Object obj = getFirstSelection();
- if ((obj instanceof ISystemFilterPoolReferenceManagerProvider))
- return (ISystemFilterPoolReferenceManagerProvider)obj;
- else
- return null;
- }
- /**
- * Set the zero-based index of the manager name to preselect.
- * The default is zero.
- * Either call this or override getFilterPoolManagerNameSelectionIndex or call setFilterPoolManagerNamePreSelection(String)
- */
- public void setFilterPoolManagerNameSelectionIndex(int index)
- {
- dlgInputs.mgrSelection = index;
- }
- /**
- * Returns the zero-based index of the manager name to preselect.
- * Returns what was set in setFilterPoolManagerNamePreSelection or setFilterPoolManagerNameSelectionIndex by default.
- */
- public int getFilterPoolManagerNameSelectionIndex()
- {
- int pos = -1;
- if (mgrNamePreselect != null)
- {
- ISystemFilterPoolManager[] mgrs = getFilterPoolManagers();
- if (mgrs != null)
- {
- for (int idx=0; (pos<0) && (idx<mgrs.length); idx++)
- if (mgrs[idx].getName().equals(mgrNamePreselect))
- pos = idx;
- }
- }
- if (pos < 0)
- return dlgInputs.mgrSelection;
- else
- {
- //System.out.println("Found a match for mgr name '"+mgrNamePreselect+"' so preselect index is "+pos);
- return pos;
- }
- }
- /**
- * Set the name of the filter pool manager to pre-select
- */
- public void setFilterPoolManagerNamePreSelection(String name)
- {
- this.mgrNamePreselect = name;
- }
-
- /**
- * Set the input filter pool reference manager which is holding the references this
- * dialog is allowing the user to select.
- * <p>
- * If you call this, then this action has everything it needs to know to be fully self-contained.
- * It will totally handle updating the reference manager with the user's selections and
- * deselections.
- */
- public void setFilterPoolReferenceManager(ISystemFilterPoolReferenceManager refManager)
- {
- dlgInputs.refManager = refManager;
- }
- /**
- * Returns the filter pool reference manager which contains the list of selected filter pools
- * that this dialog is showing and allowing the user to change.
- * <p>
- * If not set, then the subclass needs to override doOKprocessing.
- */
- public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
- {
- return dlgInputs.refManager;
- }
-
- /**
- * Set the dialog title.
- * Either call this or override getDialogTitle()
- */
- public void setDialogTitle(String title)
- {
- dlgInputs.title = title;
- }
- /**
- * Get the dialog title.
- * By default, uses what was given in setDialogTitle, or an english default if nothing set.
- */
- public String getDialogTitle()
- {
- return dlgInputs.title;
- }
-
- /**
- * Set the dialog prompt text.
- * Either call this or override getDialogPrompt()
- */
- public void setDialogPrompt(String prompt)
- {
- dlgInputs.prompt = prompt;
- }
- /**
- * Get the dialog prompt.
- * By default, uses what was given in setDialogPrompt
- */
- public String getDialogPrompt()
- {
- return dlgInputs.prompt;
- }
-
- /**
- * Set the dialog's filter pool name prompt text and tooltip
- * Either call this or override getDialogFilterPoolNamePrompt/Tip()
- */
- public void setDialogFilterPoolNamePrompt(String prompt, String tip)
- {
- dlgInputs.poolNamePrompt = prompt;
- dlgInputs.poolNameTip = tip;
- }
- /**
- * Get the dialog's filter pool name prompt text.
- * By default, uses what was given in setDialogFilterPoolNamePrompt.
- */
- public String getDialogFilterPoolNamePrompt()
- {
- return dlgInputs.poolNamePrompt;
- }
- /**
- * Get the dialog's filter pool name tooltip text.
- * By default, uses what was given in setDialogFilterPoolNamePrompt.
- */
- public String getDialogFilterPoolNameTip()
- {
- return dlgInputs.poolNameTip;
- }
-
- /**
- * Set the dialog's filter pool manager name prompt text and tooltip
- * Either call this or override getDialogFilterPoolManagerNamePrompt/Tip()
- */
- public void setDialogFilterPoolManagerNamePrompt(String prompt, String tip)
- {
- dlgInputs.poolMgrNamePrompt = prompt;
- dlgInputs.poolMgrNameTip = tip;
- }
- /**
- * Get the dialog's filter pool manager name prompt text.
- * By default, uses what was given in setDialogFilterPoolManagerNamePrompt.
- */
- public String getDialogFilterPoolManagerNamePrompt()
- {
- return dlgInputs.poolMgrNamePrompt;
- }
- /**
- * Get the dialog's filter pool manager name tooltip text.
- * By default, uses what was given in setDialogFilterPoolManagerNamePrompt.
- */
- public String getDialogFilterPoolManagerNameTip()
- {
- return dlgInputs.poolMgrNameTip;
- }
-
- /**
- * Set the dialog's pre-select information.
- * Either call this or override getDialogPreSelectInput()
- */
- public void setDialogPreSelectInput(Object selectData)
- {
- dlgInputs.preSelectObject = selectData;
- }
- /**
- * Get the dialog's pre-select information.
- * By default, uses what was given in setDialogPreSelectInput.
- */
- public Object getDialogPreSelectInput()
- {
- return dlgInputs.preSelectObject;
- }
-
-
- // -------------------------
- // PARENT CLASS OVERRIDES...
- // -------------------------
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- return (selectedObject instanceof ISystemFilterPoolReferenceManagerProvider); // override as appropriate
- }
-
-
- /**
- * Walk elements deciding pre-selection
- */
- protected void preSelect(SystemSimpleContentElement inputElement)
- {
- SystemSimpleContentElement[] mgrElements = inputElement.getChildren();
- for (int idx=0; idx<mgrElements.length; idx++)
- {
- //SystemFilterPoolManager mgr = (SystemFilterPoolManager)mgrElements[idx].getData();
- SystemSimpleContentElement[] poolElements = mgrElements[idx].getChildren();
- for (int jdx=0; jdx<poolElements.length; jdx++)
- {
- //if (poolElements[jdx].isSelected())
- poolElements[jdx].setSelected(
- getFilterPoolPreSelection((ISystemFilterPool)poolElements[jdx].getData()));
- }
- }
- }
- /**
- * Decide per pool if it should be selected or not.
- * Default behaviour is to select it if it is currently referenced.
- */
- protected boolean getFilterPoolPreSelection(ISystemFilterPool pool)
- {
- return pool.getReferenceCount() > 0;
- }
-
- /**
- * Extends run in parent class to call doOKprocessing if the result of calling
- * getDialogValue() resulted in a non-null value.
- */
- public void run()
- {
- super.run();
- if (getValue() != null)
- doOKprocessing(getValue());
- }
-
-
- /**
- * Overrides parent method to allow creating of a dialog meeting our interface,
- * so we can pass instance of ourselves to it for callbacks to get our data.
- * <p>
- * If your dialog does not implement our interface, override this method!
- */
- protected Dialog createDialog(Shell parent)
- {
- SystemFilterPoolDialogInterface fpDlg = createFilterPoolDialog(parent);
- fpDlg.setFilterPoolDialogActionCaller(this);
- return (Dialog)fpDlg;
- }
-
- /**
- * Where you create the dialog meeting our interface. If you override
- * createDialog, then override this to return null
- */
- public abstract SystemFilterPoolDialogInterface createFilterPoolDialog(Shell parent);
-
- /**
- * If you decide to use the supplied run method as is,
- * then you must override this method to retrieve the data
- * from the dialog. For InputDialog dialogs, this is simply
- * a matter of returning dlg.getValue();
- * <p>
- * This is called by the run method after the dialog returns. Callers
- * of this object can subsequently retrieve it by calling getValue.
- *
- * @param dlg The dialog object, after it has returned from open.
- */
- protected abstract Object getDialogValue(Dialog dlg);
-
- /**
- * Method called when ok pressed on dialog and after getDialogValue has set the
- * value attribute appropriately.
- * <p>
- * Only called if user pressed OK on dialog.
- * <p>
- * @param dlgValue The output of getDialogValue().
- */
- public abstract void doOKprocessing(Object dlgValue);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolWizardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolWizardAction.java
deleted file mode 100644
index 8c25200ed..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterPoolWizardAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterPoolWizardDialog;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterPoolWizardInterface;
-import org.eclipse.swt.widgets.Shell;
-
-
-public abstract class SystemFilterAbstractFilterPoolWizardAction
- extends SystemFilterAbstractFilterPoolAction
-{
-
-
-
- /**
- * Constructor for SystemFilterAbstactFilterPoolWizardAction
- */
- public SystemFilterAbstractFilterPoolWizardAction(Shell parent, String title)
- {
- super(parent, title);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- }
-
-
-
- /**
- * Constructor for SystemFilterAbstactFilterPoolWizardAction
- */
- public SystemFilterAbstractFilterPoolWizardAction(Shell parent, ImageDescriptor image,
- String label, String tooltip)
- {
- super(parent, image, label, tooltip);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- }
-
- /**
- * @see SystemFilterAbstractFilterPoolAction#doOKprocessing(Object)
- */
- public void doOKprocessing(Object dlgValue)
- {
- }
-
- /**
- * @see SystemFilterAbstractFilterPoolAction#getDialogValue(Dialog)
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-
- /**
- * @see SystemFilterAbstractFilterPoolAction#createFilterPoolDialog(Shell)
- */
- public SystemFilterPoolDialogInterface createFilterPoolDialog(Shell parent)
- {
- SystemFilterPoolWizardInterface newWizard = getFilterPoolWizard();
- SystemFilterPoolDialogInterface dialog =
- new SystemFilterPoolWizardDialog(parent, newWizard);
- return dialog;
- }
-
- /**
- * Return the wizard so we can customize it prior to showing it.
- */
- public abstract SystemFilterPoolWizardInterface getFilterPoolWizard();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterWizardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterWizardAction.java
deleted file mode 100644
index 7a6909fd3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterAbstractFilterWizardAction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.filters.SystemFilterDialogInterface;
-import org.eclipse.rse.ui.filters.dialogs.ISystemFilterWizard;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterWizardDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-public abstract class SystemFilterAbstractFilterWizardAction
- extends SystemFilterAbstractFilterAction
-{
-
-
-
- /**
- * Constructor for SystemFilterAbstactFilterWizardAction
- */
- public SystemFilterAbstractFilterWizardAction(Shell parent, String title)
- {
- super(parent, title);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- }
-
- /**
- * Constructor for SystemFilterAbstactFilterWizardAction
- */
- public SystemFilterAbstractFilterWizardAction(Shell parent, String label, String tooltip)
- {
- super(parent, label, tooltip);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- }
-
- /**
- * @see SystemFilterAbstractFilterAction#doOKprocessing(Object)
- */
- public void doOKprocessing(Object dlgValue)
- {
- }
-
- /**
- * @see SystemFilterAbstractFilterAction#getDialogValue(Dialog)
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-
- /**
- * @see SystemFilterAbstractFilterAction#createFilterDialog(Shell)
- */
- public SystemFilterDialogInterface createFilterDialog(Shell parent)
- {
- ISystemFilterWizard newWizard = getFilterWizard();
-
- SystemFilterDialogInterface dialog =
- new SystemFilterWizardDialog(parent, newWizard);
-
- return dialog;
- }
-
- /**
- * Return the wizard so we can customize it prior to showing it.
- */
- public abstract ISystemFilterWizard getFilterWizard();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceAction.java
deleted file mode 100644
index 8381d2f89..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceAction.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A cascading menu action for "New Filter Pool Reference->"
- */
-public class SystemFilterCascadingNewFilterPoolReferenceAction
- extends SystemBaseSubMenuAction
- implements IMenuListener
-{
- private ISystemFilterPoolReferenceManager refMgr;
-
- /**
- * Constructor when reference mgr not available. Must call setSystemFilterPoolReferenceManager.
- */
- public SystemFilterCascadingNewFilterPoolReferenceAction(Shell shell)
- {
- this(shell, null);
- }
-
- /**
- * Constructor when reference mgr is available. No need to call setSystemFilterPoolReferenceManager.
- */
- public SystemFilterCascadingNewFilterPoolReferenceAction(Shell shell, ISystemFilterPoolReferenceManager refMgr)
- {
- super(SystemResources.ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_LABEL, SystemResources.ACTION_CASCADING_FILTERPOOL_NEWREFERENCE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLREF_ID),shell);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- this.refMgr = refMgr;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- menu.addMenuListener(this);
- menu.setRemoveAllWhenShown(true);
- //menu.setEnabled(true);
- menu.add(new SystemBaseAction("dummy",null));
- return menu;
- }
-
- /**
- * Set the master filter pool reference manager from which the filter pools are to be selectable,
- * and into which we will add the filter pool reference
- */
- public void setSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManager refMgr)
- {
- this.refMgr = refMgr;
- }
-
- /**
- * Called when submenu is about to show
- */
- public void menuAboutToShow(IMenuManager ourSubMenu)
- {
- Shell shell = getShell();
- ISystemFilterPoolManager[] mgrs = refMgr.getSystemFilterPoolManagers();
- SystemFilterCascadingNewFilterPoolReferenceFPMgrAction action = null;
- ISystemFilterPoolManager mgr = null;
- ISystemFilterPoolManager defaultMgr = refMgr.getDefaultSystemFilterPoolManager();
- String helpId = getHelpContextId();
- if (defaultMgr != null)
- {
- action = new SystemFilterCascadingNewFilterPoolReferenceFPMgrAction(shell, defaultMgr, refMgr);
- if (helpId != null)
- action.setHelp(helpId);
- ourSubMenu.add(action.getSubMenu());
- }
- for (int idx=0; idx<mgrs.length; idx++)
- {
- mgr = mgrs[idx];
- if (mgr != defaultMgr)
- {
- action = new SystemFilterCascadingNewFilterPoolReferenceFPMgrAction(shell, mgr, refMgr);
- if (helpId != null)
- action.setHelp(helpId);
- ourSubMenu.add(action.getSubMenu());
- }
- }
- }
-
- /**
- * Overridable method from parent that instantiates the menu listener who job is to add mnemonics.
- * @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics need only be set once. False if it is dynamic
- */
- protected SystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
- {
- return new SystemViewMenuListener(false); // our menu is re-built dynamically each time
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceFPMgrAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceFPMgrAction.java
deleted file mode 100644
index 2b7035270..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCascadingNewFilterPoolReferenceFPMgrAction.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A cascading submenu action for "New Filter Pool Reference->".
- * This is after the first cascade, where we list filter pool managers.
- */
-public class SystemFilterCascadingNewFilterPoolReferenceFPMgrAction
- extends SystemBaseSubMenuAction
- implements IMenuListener
-{
- private ISystemFilterPoolManager mgr;
- private ISystemFilterPoolReferenceManager refMgr;
-
- /**
- * Constructor.
- */
- public SystemFilterCascadingNewFilterPoolReferenceFPMgrAction(Shell shell,
- ISystemFilterPoolManager mgr,
- ISystemFilterPoolReferenceManager refMgr)
- {
- super(mgr.getName(),shell);
- setCreateMenuEachTime(false);
- setPopulateMenuEachTime(false);
- this.mgr = mgr;
- this.refMgr = refMgr;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * @see SystemBaseSubMenuAction#getSubMenu()
- */
- public IMenuManager populateSubMenu(IMenuManager menu)
- {
- menu.addMenuListener(this);
- menu.setRemoveAllWhenShown(true);
- //menu.setEnabled(true);
- menu.add(new SystemBaseAction("dummy",null));
- return menu;
- }
-
- /**
- * Called when submenu is about to show
- */
- public void menuAboutToShow(IMenuManager ourSubMenu)
- {
- //System.out.println("inside menu about to show");
- ISystemFilterPool[] pools = mgr.getSystemFilterPools();
- SystemFilterPoolReferenceSelectAction action = null;
- ISystemFilterPool pool = null;
- Shell shell = getShell();
- String helpId = getHelpContextId();
- for (int idx=0; idx<pools.length; idx++)
- {
- pool = pools[idx];
- if (!isPoolAlreadyReferenced(pool) && !isPoolConnectionUnique(pool))
- {
- action = new SystemFilterPoolReferenceSelectAction(shell,pool,refMgr);
- if (helpId != null)
- action.setHelp(helpId);
- ourSubMenu.add(action);
- }
- }
- }
-
- /**
- * Determine if the given filter pool is already referenced by this reference manager
- */
- private boolean isPoolAlreadyReferenced(ISystemFilterPool pool)
- {
- return refMgr.isSystemFilterPoolReferenced(pool);
- }
- /**
- * Determine if the given filter pool is the special unique pool for a connection.
- * If so, we don't want to let anyone else reference it.
- */
- private boolean isPoolConnectionUnique(ISystemFilterPool pool)
- {
- return (pool.getOwningParentName() != null);
- }
-
- /**
- * Overridable method from parent that instantiates the menu listener who job is to add mnemonics.
- * @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics need only be set once. False if it is dynamic
- */
- protected SystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
- {
- return new SystemViewMenuListener(false); // our menu is re-built dynamically each time
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterAction.java
deleted file mode 100644
index 84fa65e5b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterAction.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Copy a filter action.
- */
-public class SystemFilterCopyFilterAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
-
- /**
- * Constructor
- */
- public SystemFilterCopyFilterAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_COPY_FILTER_LABEL, MODE_COPY);
- promptString = SystemResources.RESID_COPY_PROMPT;
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!checkObjectType(selectedObject))
- enable = false;
- }
- /* */
- return enable;
- }
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilter)
- {
- ISystemFilter fs = (ISystemFilter)selectedObject;
- return !fs.isNonChangable();
- }
- else if (selectedObject instanceof ISystemFilterReference)
- {
- ISystemFilter fs = ((ISystemFilterReference)selectedObject).getReferencedFilter();
- return !fs.isNonChangable();
- }
- else
- return false;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- if (selectedElement == null)
- return false;
- Object data = selectedElement.getData();
- return (data instanceof ISystemFilterPool);
- }
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilterPool newPool = (ISystemFilterPool)targetContainer;
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
- String newName = oldName;
- ISystemFilter match = newPool.getSystemFilter(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorFilterName validator = new ValidatorFilterName(newPool.getSystemFilterNames());
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilter oldFilter = (ISystemFilter)oldObject;
- ISystemFilterPool oldFilterPool = oldFilter.getParentFilterPool();
- ISystemFilterPoolManager oldMgr = oldFilterPool.getSystemFilterPoolManager();
- ISystemFilterPool newPool = (ISystemFilterPool)targetContainer;
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
-
- ISystemFilter newFilter = oldMgr.copySystemFilter(newPool, oldFilter, newName);
-
- if ((root != null) && (newFilter!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilter != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilter firstFilter = getFirstSelectedFilter();
- ISystemFilterPoolManagerProvider provider = firstFilter.getProvider();
- return getPoolMgrTreeModel(provider, firstFilter.getSystemFilterPoolManager());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage(String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTER_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilters();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- ISystemFilter[] filters = getSelectedFilters();
- String[] names = new String[filters.length];
- for (int idx=0; idx<filters.length; idx++)
- names[idx] = filters[idx].getName();
- return names;
- }
-
- /**
- * Get the currently selected filters
- */
- protected ISystemFilter[] getSelectedFilters()
- {
- IStructuredSelection selection = getSelection();
- ISystemFilter[] filters = new ISystemFilter[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterReference)
- filters[idx++] = ((ISystemFilterReference)next).getReferencedFilter();
- else
- filters[idx++] = (ISystemFilter)next;
- }
- return filters;
- }
- /**
- * Get the first selected filter
- */
- protected ISystemFilter getFirstSelectedFilter()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterReference)
- return ((ISystemFilterReference)first).getReferencedFilter();
- else if (first instanceof ISystemFilter)
- return (ISystemFilter)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The SystemFilterPoolManager whose tree model element is to be pre-selected
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager poolMgr)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
-
- Vector elements = new Vector();
- populateFilterPoolContentElementVector(poolMgrProvider, mgrs[idx], elements, mgrElement);
- mgrElement.setChildren(elements);
-
- veryRootChildren.addElement(mgrElement);
- if (mgrs[idx] == poolMgr)
- initialSelectionElement = mgrElement;
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
- /**
- * Populate filter pool manager subtree with filter pools
- */
- protected static void populateFilterPoolContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager mgr,
- Vector elements,
- SystemSimpleContentElement parentElement)
- {
- //String mgrName = mgr.getName();
- ISystemFilterPool[] pools = mgr.getSystemFilterPools();
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPool pool = pools[idx];
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterPoolImage(poolMgrProvider, pool));
- //cElement.setSelected(setFilterPoolSelection(pool));
- elements.addElement(cElement);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterPoolAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterPoolAction.java
deleted file mode 100644
index 14eafd89c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterPoolAction.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Copy a filter pool action.
- */
-public class SystemFilterCopyFilterPoolAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
-
- /**
- * Constructor
- */
- public SystemFilterCopyFilterPoolAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_COPY_FILTERPOOL_LABEL, MODE_COPY);
- promptString = SystemResources.RESID_COPY_PROMPT;
- }
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!(selectedObject instanceof ISystemFilterPool) &&
- !(selectedObject instanceof ISystemFilterPoolReference))
- enable = false;
- // disable if this is a connection-unique filter pool
- else if (selectedObject instanceof ISystemFilterPool)
- enable = ((ISystemFilterPool)selectedObject).getOwningParentName() == null;
- // disable if this is a connection-unique filter pool
- else if (selectedObject instanceof ISystemFilterPoolReference)
- enable = ((ISystemFilterPoolReference)selectedObject).getReferencedFilterPool().getOwningParentName() == null;
- }
- /* */
- return enable;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- if (selectedElement == null)
- return false;
- Object data = selectedElement.getData();
- return (data instanceof ISystemFilterPoolManager);
- }
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilterPoolManager newMgr = (ISystemFilterPoolManager)targetContainer;
- String newName = oldName;
- //SystemFilterPool oldFilterPool = (SystemFilterPool)oldObject;
- ISystemFilterPool match = newMgr.getSystemFilterPool(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorFilterPoolName validator = new ValidatorFilterPoolName(newMgr.getSystemFilterPoolNames());
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilterPool oldFilterPool = (ISystemFilterPool)oldObject;
- ISystemFilterPoolManager oldMgr = oldFilterPool.getSystemFilterPoolManager();
- ISystemFilterPoolManager newMgr = (ISystemFilterPoolManager)targetContainer;
- ISystemFilterPool newFilterPool = oldMgr.copySystemFilterPool(newMgr, oldFilterPool, newName);
- if ((root != null) && (newFilterPool!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilterPool != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilterPool firstPool = getFirstSelectedFilterPool();
- ISystemFilterPoolManagerProvider provider = firstPool.getProvider();
- return getPoolMgrTreeModel(provider, firstPool.getSystemFilterPoolManager());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- //return SystemResources.RESID_COPY_TARGET_PROFILE_PROMPT);
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERPOOLS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage(String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERPOOL_PROGRESS).makeSubstitution(oldName);
- }
- /**
- * Return complete message
- */
- public SystemMessage getCompletionMessage(Object targetContainer, String[] oldNames, String[] newNames)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERPOOL_COMPLETE).makeSubstitution(((ISystemFilterPoolManager)targetContainer).getName());
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilterPools();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- ISystemFilterPool[] filterPools = getSelectedFilterPools();
- String[] names = new String[filterPools.length];
- for (int idx=0; idx<filterPools.length; idx++)
- names[idx] = filterPools[idx].getName();
- return names;
- }
-
- /**
- * Get the currently selected filter pools
- */
- protected ISystemFilterPool[] getSelectedFilterPools()
- {
- IStructuredSelection selection = getSelection();
- ISystemFilterPool[] filterPools = new ISystemFilterPool[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterPoolReference)
- filterPools[idx++] = ((ISystemFilterPoolReference)next).getReferencedFilterPool();
- else
- filterPools[idx++] = (ISystemFilterPool)next;
- }
- return filterPools;
- }
- /**
- * Get the first selected filter pool
- */
- protected ISystemFilterPool getFirstSelectedFilterPool()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)first).getReferencedFilterPool();
- else if (first instanceof ISystemFilterPool)
- return (ISystemFilterPool)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The SystemFilterPoolManager whose tree model element is to be pre-selected
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider, ISystemFilterPoolManager poolMgr)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
- veryRootChildren.addElement(mgrElement);
- if (mgrs[idx] == poolMgr)
- initialSelectionElement = mgrElement;
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterStringAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterStringAction.java
deleted file mode 100644
index 2bafad4f8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterCopyFilterStringAction.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ValidatorUniqueString;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Copy a filter string action.
- */
-public class SystemFilterCopyFilterStringAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
- private ISystemFilterString[] strings = null;
-
- /**
- * Constructor
- */
- public SystemFilterCopyFilterStringAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_COPY_FILTERSTRING_LABEL, MODE_COPY);
- promptString = SystemResources.RESID_COPY_PROMPT;
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- strings = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Overridable method if you support duplicate filter strings in the same filter.
- * By default, queries the "supportsDuplicateFilterStrings" attribute in the filter.
- */
- protected boolean supportsDuplicateFilterStrings(ISystemFilter filter)
- {
- return filter.isSupportsDuplicateFilterStrings();
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!checkObjectType(selectedObject))
- enable = false;
- }
- /* */
- return enable;
- }
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilterString)
- {
- ISystemFilterString fs = (ISystemFilterString)selectedObject;
- return fs.isChangable();
- }
- else if (selectedObject instanceof ISystemFilterStringReference)
- {
- ISystemFilterStringReference frs = (ISystemFilterStringReference)selectedObject;
- return frs.getReferencedFilterString().isChangable();
- }
- else
- return false;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- * <p>
- * The default is to return true if the selected element has no children. This is sufficient for most cases. However,
- * in some cases it is not, such as for filter strings where we want to only enable OK if a filter is selected. It is
- * possible that filter pools have no filters, so the default algorithm is not sufficient. In these cases the child class
- * can override this method.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- Object data = selectedElement.getData();
- if (data instanceof ISystemFilter)
- return !((ISystemFilter)data).isPromptable();
- else
- return false;
- }
-
- /**
- * Overridable entry point when you want to prevent any copies/moves if any of the
- * selected objects have a name collision.
- * <p>
- * If you decide to override this, it is your responsibility to issue the error
- * message to the user and return false here.
- * <p>
- * @return true if there is no problem, false if there is a fatal collision
- */
- protected boolean preCheckForCollision(Shell shell, Object targetContainer,
- Object oldObject, String oldName)
- {
- ISystemFilter newFilter = (ISystemFilter)targetContainer;
- if (supportsDuplicateFilterStrings(newFilter))
- return true;
- ISystemFilterString match = newFilter.getSystemFilterString(oldName);
- if (match != null)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS);
- msg.makeSubstitution(oldName, newFilter.getName());
- SystemMessageDialog.displayErrorMessage(shell, msg);
- }
- return (match == null); // all is well iff such a filter string doesn't already exist.
- }
-
- /**
- * SHOULD NEVER BE CALLED IF preCheckForCollision WORKS PROPERLY
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilter newFilter = (ISystemFilter)targetContainer;
- if (supportsDuplicateFilterStrings(newFilter))
- return oldName;
- //ISystemFilterPool newPool = newFilter.getParentFilterPool();
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
- String newName = oldName;
- ISystemFilterString match = newFilter.getSystemFilterString(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- boolean caseSensitive = false;
- ValidatorUniqueString validator = new ValidatorUniqueString(newFilter.getFilterStrings(),caseSensitive);
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, validator); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilterString oldFilterString = (ISystemFilterString)oldObject;
- ISystemFilterPoolManager oldMgr = oldFilterString.getSystemFilterPoolManager();
- ISystemFilter targetFilter = (ISystemFilter)targetContainer;
- //SystemFilterPoolManager newMgr = targetFilter.getSystemFilterPoolManager();
-
- ISystemFilterString newFilterString = oldMgr.copySystemFilterString(targetFilter, oldFilterString);
-
- if ((root != null) && (newFilterString!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilterString != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilterString firstFilterString = getFirstSelectedFilterString();
- ISystemFilterPoolManagerProvider provider = firstFilterString.getProvider();
- return getPoolMgrTreeModel(provider, firstFilterString.getSystemFilterPoolManager(), getSelectedFilters());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERSTRINGS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYFILTERSTRING_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilterStrings();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- strings = null; // clear previous history
- ISystemFilterString[] strings = getSelectedFilterStrings();
- String[] names = new String[strings.length];
- for (int idx=0; idx<strings.length; idx++)
- names[idx] = strings[idx].getString();
- return names;
- }
-
- /**
- * Get the currently selected filter strings
- */
- protected ISystemFilterString[] getSelectedFilterStrings()
- {
- if (strings == null)
- {
- IStructuredSelection selection = getSelection();
- strings = new ISystemFilterString[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterStringReference)
- strings[idx++] = ((ISystemFilterStringReference)next).getReferencedFilterString();
- else
- strings[idx++] = (ISystemFilterString)next;
- }
- }
- return strings;
- }
- /**
- * Get the intersection list of filters of currently selected filter strings
- */
- protected ISystemFilter[] getSelectedFilters()
- {
- Vector v = new Vector();
- ISystemFilterString[] strings = getSelectedFilterStrings();
- for (int idx=0; idx<strings.length; idx++)
- {
- ISystemFilter filter = strings[idx].getParentSystemFilter();
- if (!supportsDuplicateFilterStrings(filter))
- {
- if (!containsFilter(v,filter))
- v.addElement(filter);
- }
- }
- ISystemFilter[] filters = new ISystemFilter[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- filters[idx] = (ISystemFilter)v.elementAt(idx);
- return filters;
- }
- /**
- * Get the first selected filter string
- */
- protected ISystemFilterString getFirstSelectedFilterString()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference)first).getReferencedFilterString();
- else if (first instanceof ISystemFilterString)
- return (ISystemFilterString)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The SystemFilterPoolManager whose tree model element is to be pre-selected
- * @param filtersToExclude All the currently selected filters, which are excluded from the target list
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager poolMgr,
- ISystemFilter[] filtersToExclude)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- ISystemFilter parentFilter = getFirstSelectedFilterString().getParentSystemFilter();
- ISystemFilterPool parentFilterPool = parentFilter.getParentFilterPool();
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
-
- Vector elements = new Vector();
- populateFilterPoolContentElementVector(poolMgrProvider, mgrs[idx], elements,
- mgrElement, filtersToExclude, parentFilterPool, parentFilter);
- mgrElement.setChildren(elements);
-
- veryRootChildren.addElement(mgrElement);
- //if (mgrs[idx] == poolMgr)
- // initialSelectionElement = mgrElement;
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
- /**
- * Populate filter pool manager subtree with filter pools
- */
- protected void populateFilterPoolContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager mgr,
- Vector elements,
- SystemSimpleContentElement parentElement,
- ISystemFilter[] filtersToExclude,
- ISystemFilterPool filterPoolToSelect,
- ISystemFilter filterToSelect)
- {
- ISystemFilterPool[] pools = mgr.getSystemFilterPools();
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPool pool = pools[idx];
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterPoolImage(poolMgrProvider,pool));
-
- Vector childElements = new Vector();
- populateFilterContentElementVector(poolMgrProvider, pool, childElements, cElement, filtersToExclude, filterToSelect);
- cElement.setChildren(childElements);
-
- elements.addElement(cElement);
- if ((pool == filterPoolToSelect) && (initialSelectionElement==null))
- initialSelectionElement = cElement;
- }
- }
-
- /**
- * Populate filter pool subtree with filters
- */
- protected void populateFilterContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPool pool,
- Vector elements,
- SystemSimpleContentElement parentElement,
- ISystemFilter[] filtersToExclude,
- ISystemFilter filterToSelect)
- {
- ISystemFilter[] filters = pool.getSystemFilters();
- for (int idx=0; idx<filters.length; idx++)
- {
- ISystemFilter filter = filters[idx];
- if (!filter.isNonChangable() && !filter.isPromptable() && // defect 43242
- !containsFilter(filtersToExclude,filter))
- {
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(filter.getName(), filter, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterImage(poolMgrProvider, filter));
- elements.addElement(cElement);
- if (filterToSelect == filter)
- initialSelectionElement = cElement;
- }
- }
- }
-
- private static boolean containsFilter(ISystemFilter[] filters, ISystemFilter filter)
- {
- ISystemFilter match = null;
- for (int idx=0; (match==null) && (idx<filters.length); idx++)
- if (filters[idx] == filter)
- match = filters[idx];
- return (match != null);
- }
- public static boolean containsFilter(Vector filters, ISystemFilter filter)
- {
- ISystemFilter match = null;
- for (int idx=0; (match==null) && (idx<filters.size()); idx++)
- if (filters.elementAt(idx) == filter)
- match = (ISystemFilter)filters.elementAt(idx);
- return (match != null);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterAction.java
deleted file mode 100644
index 79d356051..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterAction.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current filter down in the list
- */
-public class SystemFilterMoveDownFilterAction extends SystemBaseAction
-
-{
-
-
- /**
- * Constructor
- */
- public SystemFilterMoveDownFilterAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEDOWN_LABEL,SystemResources.ACTION_MOVEDOWN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Intercept of parent method. We need to test that the filters
- * come from the same parent
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemFilterContainer prevContainer = null;
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- ISystemFilter filter = getSystemFilter(selectedObject);
- if (prevContainer != null)
- {
- if (prevContainer != filter.getParentFilterContainer())
- enable = false;
- else
- prevContainer = filter.getParentFilterContainer();
- }
- else
- prevContainer = filter.getParentFilterContainer();
- if (enable)
- enable = checkObjectType(filter);
- }
- return enable;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (!((selectedObject instanceof ISystemFilter) ||
- (selectedObject instanceof ISystemFilterReference)))
- return false;
-
- ISystemFilter filter = getSystemFilter(selectedObject);
- //SystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- ISystemFilterContainer fpContainer = filter.getParentFilterContainer();
- int pos = fpContainer.getSystemFilterPosition(filter);
- return (pos < (fpContainer.getSystemFilterCount()-1));
- }
-
- private ISystemFilter getSystemFilter(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilter)
- return (ISystemFilter)selectedObject;
- else
- return ((ISystemFilterReference)selectedObject).getReferencedFilter();
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- IStructuredSelection selections = getSelection();
-
- SystemSortableSelection[] sortableArray = new SystemSortableSelection[selections.size()];
- Iterator i = selections.iterator();
- int idx = 0;
- ISystemFilter filter = null;
- ISystemFilterContainer fpContainer = null;
- while (i.hasNext())
- {
- sortableArray[idx] = new SystemSortableSelection(getSystemFilter(i.next()));
- filter = (ISystemFilter)sortableArray[idx].getSelectedObject();
- fpContainer = filter.getParentFilterContainer();
- sortableArray[idx].setPosition(fpContainer.getSystemFilterPosition(filter));
- idx++;
- }
- SystemSortableSelection.sortArray(sortableArray);
- ISystemFilter[] filters = (ISystemFilter[])SystemSortableSelection.getSortedObjects(sortableArray, new ISystemFilter[sortableArray.length]);
-
- if (idx>0)
- {
- ISystemFilterPoolManager fpMgr = filters[0].getSystemFilterPoolManager();
- try {
- fpMgr.moveSystemFilters(filters,1);
- } catch (Exception exc)
- {
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterPoolReferenceAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterPoolReferenceAction.java
deleted file mode 100644
index ce5918e64..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveDownFilterPoolReferenceAction.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current filter down in the list
- */
-public class SystemFilterMoveDownFilterPoolReferenceAction extends SystemBaseAction
-
-{
-
-
- /**
- * Constructor
- */
- public SystemFilterMoveDownFilterPoolReferenceAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEDOWN_LABEL,SystemResources.ACTION_MOVEDOWN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Intercept of parent method. We need to test that the filter pools
- * come from the same parent
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemFilterPoolReferenceManager prevMgr = null;
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- ISystemFilterPoolReference filterPoolRef = (ISystemFilterPoolReference)selectedObject;
- if (prevMgr != null)
- {
- if (prevMgr != filterPoolRef.getFilterPoolReferenceManager())
- enable = false;
- else
- prevMgr = filterPoolRef.getFilterPoolReferenceManager();
- }
- else
- prevMgr = filterPoolRef.getFilterPoolReferenceManager();
- if (enable)
- enable = checkObjectType(filterPoolRef);
- }
- return enable;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (!(selectedObject instanceof ISystemFilterPoolReference))
- return false;
- ISystemFilterPoolReference filterPoolRef = (ISystemFilterPoolReference)selectedObject;
- ISystemFilterPoolReferenceManager fprMgr = filterPoolRef.getFilterPoolReferenceManager();
- int pos = fprMgr.getSystemFilterPoolReferencePosition(filterPoolRef);
- return (pos < (fprMgr.getSystemFilterPoolReferenceCount()-1));
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- IStructuredSelection selections = getSelection();
- //SystemFilterPoolReference filterPoolRefs[] = new SystemFilterPoolReference[selections.size()];
- //Iterator i = selections.iterator();
- //int idx = 0;
- //while (i.hasNext())
- //filterPoolRefs[idx++] = (SystemFilterPoolReference)i.next();
-
- SystemSortableSelection[] sortableArray = new SystemSortableSelection[selections.size()];
- Iterator i = selections.iterator();
- int idx = 0;
- ISystemFilterPoolReference filterPoolRef = null;
- ISystemFilterPoolReferenceManager fprMgr = null;
- while (i.hasNext())
- {
- sortableArray[idx] = new SystemSortableSelection(i.next());
- filterPoolRef = (ISystemFilterPoolReference)sortableArray[idx].getSelectedObject();
- fprMgr = filterPoolRef.getFilterPoolReferenceManager();
- sortableArray[idx].setPosition(fprMgr.getSystemFilterPoolReferencePosition(filterPoolRef));
- idx++;
- }
- SystemSortableSelection.sortArray(sortableArray);
- ISystemFilterPoolReference[] filterPoolRefs = (ISystemFilterPoolReference[])SystemSortableSelection.getSortedObjects(sortableArray, new ISystemFilterPoolReference[sortableArray.length]);
-
- if (idx>0)
- {
- fprMgr = filterPoolRefs[0].getFilterPoolReferenceManager();
- fprMgr.moveSystemFilterPoolReferences(filterPoolRefs,1);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterAction.java
deleted file mode 100644
index 6e895d919..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterAction.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Copy a filter action.
- */
-public class SystemFilterMoveFilterAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
-
- /**
- * Constructor
- */
- public SystemFilterMoveFilterAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_MOVE_FILTER_LABEL, MODE_MOVE);
- promptString = SystemResources.RESID_MOVE_PROMPT;
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!checkObjectType(selectedObject))
- enable = false;
- }
- /* */
- return enable;
- }
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilter)
- {
- ISystemFilter fs = (ISystemFilter)selectedObject;
- return !fs.isNonChangable();
- }
- else if (selectedObject instanceof ISystemFilterReference)
- {
- ISystemFilter fs = ((ISystemFilterReference)selectedObject).getReferencedFilter();
- return !fs.isNonChangable();
- }
- else
- return false;
- }
-
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- if (selectedElement == null)
- return false;
- Object data = selectedElement.getData();
- return (data instanceof ISystemFilterPool);
- }
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilterPool newPool = (ISystemFilterPool)targetContainer;
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
- String newName = oldName;
- ISystemFilter match = newPool.getSystemFilter(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorFilterName validator = new ValidatorFilterName(newPool.getSystemFilterNames());
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilter oldFilter = (ISystemFilter)oldObject;
- ISystemFilterPool oldFilterPool = oldFilter.getParentFilterPool();
- ISystemFilterPoolManager oldMgr = oldFilterPool.getSystemFilterPoolManager();
- ISystemFilterPool newPool = (ISystemFilterPool)targetContainer;
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
-
- ISystemFilter newFilter = oldMgr.moveSystemFilter(newPool, oldFilter, newName);
-
- if ((root != null) && (newFilter!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilter != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilter firstFilter = getFirstSelectedFilter();
- ISystemFilterPoolManagerProvider provider = firstFilter.getProvider();
- return getPoolMgrTreeModel(provider, firstFilter.getSystemFilterPoolManager(), firstFilter.getParentFilterPool());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTER_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilters();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- ISystemFilter[] filters = getSelectedFilters();
- String[] names = new String[filters.length];
- for (int idx=0; idx<filters.length; idx++)
- names[idx] = filters[idx].getName();
- return names;
- }
-
- /**
- * Get the currently selected filters
- */
- protected ISystemFilter[] getSelectedFilters()
- {
- IStructuredSelection selection = getSelection();
- ISystemFilter[] filters = new ISystemFilter[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterReference)
- filters[idx++] = ((ISystemFilterReference)next).getReferencedFilter();
- else
- filters[idx++] = (ISystemFilter)next;
- }
- return filters;
- }
- /**
- * Get the first selected filter
- */
- protected ISystemFilter getFirstSelectedFilter()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterReference)
- return ((ISystemFilterReference)first).getReferencedFilter();
- else if (first instanceof ISystemFilter)
- return (ISystemFilter)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The SystemFilterPoolManager whose tree model element is to be pre-selected
- * @param pool The SystemFilterPool whose tree model element is to be excluded
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager poolMgr,
- ISystemFilterPool pool)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
-
- Vector elements = new Vector();
- populateFilterPoolContentElementVector(poolMgrProvider, mgrs[idx], elements, mgrElement, pool);
- mgrElement.setChildren(elements);
-
- if (mgrs[idx] == poolMgr)
- initialSelectionElement = mgrElement;
-
- veryRootChildren.addElement(mgrElement);
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
- /**
- * Populate filter pool manager subtree with filter pools
- */
- protected static void populateFilterPoolContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager mgr,
- Vector elements,
- SystemSimpleContentElement parentElement,
- ISystemFilterPool poolToExclude)
- {
- ISystemFilterPool[] pools = mgr.getSystemFilterPools();
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPool pool = pools[idx];
- if (pool != poolToExclude)
- {
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterPoolImage(poolMgrProvider, pool));
- //cElement.setSelected(setFilterPoolSelection(pool));
- elements.addElement(cElement);
- }
- }
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterPoolAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterPoolAction.java
deleted file mode 100644
index 9c153e262..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterPoolAction.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Move a filter pool action.
- */
-public class SystemFilterMoveFilterPoolAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
-
- /**
- * Constructor
- */
- public SystemFilterMoveFilterPoolAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_MOVE_FILTERPOOL_LABEL, MODE_MOVE);
- promptString = SystemResources.RESID_MOVE_PROMPT;
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * We intercept to ensure only filterpools from the same filterpool manager are selected.
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e = selection.iterator();
- ISystemFilterPoolManager prevMgr = null;
- ISystemFilterPoolManager currMgr = null;
- ISystemFilterPool pool;
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!(selectedObject instanceof ISystemFilterPool) &&
- !(selectedObject instanceof ISystemFilterPoolReference))
- enable = false;
- // disable if this is a connection-unique filter pool
- else if (selectedObject instanceof ISystemFilterPool)
- enable = ((ISystemFilterPool)selectedObject).getOwningParentName() == null;
- // disable if this is a connection-unique filter pool
- else if (selectedObject instanceof ISystemFilterPoolReference)
- enable = ((ISystemFilterPoolReference)selectedObject).getReferencedFilterPool().getOwningParentName() == null;
-
- if (enable)
- {
- if (selectedObject instanceof ISystemFilterPool)
- pool = (ISystemFilterPool)selectedObject;
- else
- pool = ((ISystemFilterPoolReference)selectedObject).getReferencedFilterPool();
- currMgr = pool.getSystemFilterPoolManager();
- if (prevMgr == null)
- prevMgr = currMgr;
- else
- enable = (prevMgr == currMgr);
- if (enable)
- prevMgr = currMgr;
- }
- }
- /* */
- return enable;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- if (selectedElement == null)
- return false;
- Object data = selectedElement.getData();
- return (data instanceof ISystemFilterPoolManager);
- }
-
- /**
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilterPoolManager newMgr = (ISystemFilterPoolManager)targetContainer;
- String newName = oldName;
- ISystemFilterPool match = newMgr.getSystemFilterPool(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- //ValidatorFilterPoolName validator = new ValidatorFilterPoolName(newMgr.getSystemFilterPoolNames());
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilterPool oldFilterPool = (ISystemFilterPool)oldObject;
- ISystemFilterPoolManager oldMgr = oldFilterPool.getSystemFilterPoolManager();
- ISystemFilterPoolManager newMgr = (ISystemFilterPoolManager)targetContainer;
- ISystemFilterPool newFilterPool = oldMgr.moveSystemFilterPool(newMgr, oldFilterPool, newName);
- if ((root != null) && (newFilterPool!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilterPool != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilterPool firstPool = getFirstSelectedFilterPool();
- ISystemFilterPoolManagerProvider provider = firstPool.getProvider();
-
- return getPoolMgrTreeModel(provider, firstPool.getSystemFilterPoolManager());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERPOOLS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERPOOL_PROGRESS).makeSubstitution(oldName);
- }
- /**
- * Return complete message
- */
- public SystemMessage getCompletionMessage(Object targetContainer, String[] oldNames, String[] newNames)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERPOOL_COMPLETE).makeSubstitution(((ISystemFilterPoolManager)targetContainer).getName());
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilterPools();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- ISystemFilterPool[] filterPools = getSelectedFilterPools();
- String[] names = new String[filterPools.length];
- for (int idx=0; idx<filterPools.length; idx++)
- names[idx] = filterPools[idx].getName();
- return names;
- }
-
- /**
- * Get the currently selected filter pools
- */
- protected ISystemFilterPool[] getSelectedFilterPools()
- {
- IStructuredSelection selection = getSelection();
- ISystemFilterPool[] filterPools = new ISystemFilterPool[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterPoolReference)
- filterPools[idx++] = ((ISystemFilterPoolReference)next).getReferencedFilterPool();
- else
- filterPools[idx++] = (ISystemFilterPool)next;
- }
- return filterPools;
- }
- /**
- * Get the managers of the currently selected filter pools
- */
- protected ISystemFilterPoolManager[] getSelectedFilterPoolManagers()
- {
- ISystemFilterPoolManager[] mgrs = null;
- Vector v = new Vector();
- ISystemFilterPool[] pools = getSelectedFilterPools();
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPoolManager mgr = pools[idx].getSystemFilterPoolManager();
- if (!v.contains(mgr))
- v.addElement(mgr);
- }
-
- mgrs = new ISystemFilterPoolManager[v.size()];
- for (int idx=0; idx<mgrs.length; idx++)
- mgrs[idx] = (ISystemFilterPoolManager)v.elementAt(idx);
-
- return mgrs;
- }
-
- /**
- * Get the first selected filter pool
- */
- protected ISystemFilterPool getFirstSelectedFilterPool()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)first).getReferencedFilterPool();
- else if (first instanceof ISystemFilterPool)
- return (ISystemFilterPool)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The current SystemFilterPoolManager which is to be excluded from the list.
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider, ISystemFilterPoolManager poolMgr)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- if (mgrs[idx] != poolMgr)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
- veryRootChildren.addElement(mgrElement);
- if (initialSelectionElement == null)
- initialSelectionElement = mgrElement;
- }
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterStringAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterStringAction.java
deleted file mode 100644
index 5ea2a41f8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveFilterStringAction.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseCopyAction;
-import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ValidatorUniqueString;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Move a filter string action.
- */
-public class SystemFilterMoveFilterStringAction extends SystemBaseCopyAction
-{
- private String promptString = null;
- private SystemSimpleContentElement initialSelectionElement = null;
- private SystemSimpleContentElement root = null;
- private ISystemFilterString[] strings = null;
-
- /**
- * Constructor
- */
- public SystemFilterMoveFilterStringAction(Shell parent)
- {
- super(parent, SystemResources.ACTION_MOVE_FILTERSTRING_LABEL, MODE_MOVE);
- promptString = SystemResources.RESID_MOVE_PROMPT;
- }
-
- /**
- * Reset. This is a re-run of this action
- */
- protected void reset()
- {
- super.reset();
- initialSelectionElement = null;
- root = null;
- strings = null;
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Overridable method if you support duplicate filter strings in the same filter.
- * By default, queries the "supportsDuplicateFilterStrings" attribute in the filter.
- */
- protected boolean supportsDuplicateFilterStrings(ISystemFilter filter)
- {
- return filter.isSupportsDuplicateFilterStrings();
- }
-
- /**
- * We override from parent to do unique checking...
- * <p>
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- /* */
- Iterator e= selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- if (!checkObjectType(selectedObject))
- enable = false;
- }
- /* */
- return enable;
- }
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilterString)
- {
- ISystemFilterString fs = (ISystemFilterString)selectedObject;
- return fs.isChangable();
- }
- else if (selectedObject instanceof ISystemFilterStringReference)
- {
- ISystemFilterStringReference frs = (ISystemFilterStringReference)selectedObject;
- return frs.getReferencedFilterString().isChangable();
- }
- else
- return false;
- }
-
- // --------------------------
- // PARENT METHOD OVERRIDES...
- // --------------------------
- /**
- * This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
- * object is a valid parent object. This affects the enabling of the OK button on that dialog.
- * <p>
- * The default is to return true if the selected element has no children. This is sufficient for most cases. However,
- * in some cases it is not, such as for filter strings where we want to only enable OK if a filter is selected. It is
- * possible that filter pools have no filters, so the default algorithm is not sufficient. In these cases the child class
- * can override this method.
- */
- public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
- {
- Object data = selectedElement.getData();
- if (data instanceof ISystemFilter)
- return !((ISystemFilter)data).isPromptable();
- else
- return false;
- }
-
- /**
- * Overridable entry point when you want to prevent any copies/moves if any of the
- * selected objects have a name collision.
- * <p>
- * If you decide to override this, it is your responsibility to issue the error
- * message to the user and return false here.
- * <p>
- * @return true if there is no problem, false if there is a fatal collision
- */
- protected boolean preCheckForCollision(Shell shell, Object targetContainer,
- Object oldObject, String oldName)
- {
- ISystemFilter newFilter = (ISystemFilter)targetContainer;
- if (supportsDuplicateFilterStrings(newFilter))
- return true;
- ISystemFilterString match = newFilter.getSystemFilterString(oldName);
- if (match != null)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS);
- msg.makeSubstitution(oldName, newFilter.getName());
- SystemMessageDialog.displayErrorMessage(shell, msg);
-
- }
- return (match == null); // all is well iff such a filter string doesn't already exist.
- }
-
- /**
- * SHOULD NEVER BE CALLED IF preCheckForCollision WORKS PROPERLY
- * @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
- */
- protected String checkForCollision(Shell shell, IProgressMonitor monitor,
- Object targetContainer, Object oldObject, String oldName)
- {
- ISystemFilter newFilter = (ISystemFilter)targetContainer;
- if (supportsDuplicateFilterStrings(newFilter))
- return oldName;
- //ISystemFilterPool newPool = newFilter.getParentFilterPool();
- //ISystemFilterPoolManager newMgr = newPool.getSystemFilterPoolManager();
- String newName = oldName;
- ISystemFilterString match = newFilter.getSystemFilterString(oldName);
- if (match != null)
- {
- //monitor.setVisible(false); wish we could!
- boolean caseSensitive = false;
- ValidatorUniqueString validator = new ValidatorUniqueString(newFilter.getFilterStrings(),caseSensitive);
- //SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
- SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, validator); // true => copy-collision-mode
- dlg.open();
- if (!dlg.wasCancelled())
- newName = dlg.getNewName();
- else
- newName = null;
- }
- return newName;
- }
- /**
- * @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
- */
- protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
- throws Exception
- {
- ISystemFilterString oldFilterString = (ISystemFilterString)oldObject;
- ISystemFilterPoolManager oldMgr = oldFilterString.getSystemFilterPoolManager();
- ISystemFilter targetFilter = (ISystemFilter)targetContainer;
- //SystemFilterPoolManager newMgr = targetFilter.getSystemFilterPoolManager();
-
- ISystemFilterString newFilterString = oldMgr.moveSystemFilterString(targetFilter, oldFilterString);
-
- if ((root != null) && (newFilterString!=null))
- {
- Object data = root.getData();
- if ((data!=null) && (data instanceof TreeViewer))
- ((TreeViewer)data).refresh();
- }
- return (newFilterString != null);
- }
-
- /**
- * @see SystemBaseCopyAction#getTreeModel()
- */
- protected SystemSimpleContentElement getTreeModel()
- {
- ISystemFilterString firstFilterString = getFirstSelectedFilterString();
- ISystemFilterPoolManagerProvider provider = firstFilterString.getProvider();
- return getPoolMgrTreeModel(provider, firstFilterString.getSystemFilterPoolManager(), getSelectedFilters());
- }
- /**
- * @see SystemBaseCopyAction#getTreeInitialSelection()
- */
- protected SystemSimpleContentElement getTreeInitialSelection()
- {
- return initialSelectionElement;
- }
-
- /**
- * Set the prompt string that shows up at the top of the copy-destination dialog.
- */
- public void setPromptString(String promptString)
- {
- this.promptString = promptString;
- }
- /**
- * @see SystemBaseCopyAction#getPromptString()
- */
- protected String getPromptString()
- {
- return promptString;
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage()
- */
- protected SystemMessage getCopyingMessage()
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERSTRINGS_PROGRESS);
- }
- /**
- * @see SystemBaseCopyAction#getCopyingMessage( String)
- */
- protected SystemMessage getCopyingMessage(String oldName)
- {
- return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_MOVEFILTERSTRING_PROGRESS).makeSubstitution(oldName);
- }
-
- /**
- * @see SystemBaseCopyAction#getOldObjects()
- */
- protected Object[] getOldObjects()
- {
- return getSelectedFilterStrings();
- }
-
- /**
- * @see SystemBaseCopyAction#getOldNames()
- */
- protected String[] getOldNames()
- {
- ISystemFilterString[] strings = getSelectedFilterStrings();
- String[] names = new String[strings.length];
- for (int idx=0; idx<strings.length; idx++)
- names[idx] = strings[idx].getString();
- return names;
- }
-
- /**
- * Get the currently selected filter strings
- */
- protected ISystemFilterString[] getSelectedFilterStrings()
- {
- if (strings == null)
- {
- IStructuredSelection selection = getSelection();
- strings = new ISystemFilterString[selection.size()];
- Iterator i = selection.iterator();
- int idx=0;
- while (i.hasNext())
- {
- Object next = i.next();
- if (next instanceof SystemSimpleContentElement)
- next = ((SystemSimpleContentElement)next).getData();
- if (next instanceof ISystemFilterStringReference)
- strings[idx++] = ((ISystemFilterStringReference)next).getReferencedFilterString();
- else
- strings[idx++] = (ISystemFilterString)next;
- }
- }
- return strings;
- }
- /**
- * Get the intersection list of filters of currently selected filter strings
- */
- protected ISystemFilter[] getSelectedFilters()
- {
- Vector v = new Vector();
- ISystemFilterString[] strings = getSelectedFilterStrings();
- for (int idx=0; idx<strings.length; idx++)
- {
- ISystemFilter filter = strings[idx].getParentSystemFilter();
- if (!supportsDuplicateFilterStrings(filter) &&
- !SystemFilterCopyFilterStringAction.containsFilter(v,filter))
- v.addElement(filter);
- }
- ISystemFilter[] filters = new ISystemFilter[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- filters[idx] = (ISystemFilter)v.elementAt(idx);
- return filters;
- }
- /**
- * Get the first selected filter string
- */
- protected ISystemFilterString getFirstSelectedFilterString()
- {
- Object first = getFirstSelection();
- if (first instanceof SystemSimpleContentElement)
- {
- root = ((SystemSimpleContentElement)first).getRoot();
- first = ((SystemSimpleContentElement)first).getData();
- }
- if (first == null)
- return null;
- else if (first instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference)first).getReferencedFilterString();
- else if (first instanceof ISystemFilterString)
- return (ISystemFilterString)first;
- else
- return null;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-
- /**
- * Create and return data model to populate selection tree with.
- * @param poolMgrProvider The provider who will give us the list of filter pool managers to populate the list with
- * @param poolMgr The SystemFilterPoolManager whose tree model element is to be pre-selected
- * @param filtersToExclude All the currently selected filters, which are excluded from the target list
- */
- protected SystemSimpleContentElement getPoolMgrTreeModel(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager poolMgr,
- ISystemFilter[] filtersToExclude)
- {
- SystemSimpleContentElement veryRootElement =
- new SystemSimpleContentElement("Root",
- null, null, (Vector)null);
- veryRootElement.setRenamable(false);
- veryRootElement.setDeletable(false);
-
- ISystemFilterPoolManager[] mgrs = poolMgrProvider.getSystemFilterPoolManagers();
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)poolMgrProvider.getAdapter(ISubSystemConfigurationAdapter.class);
- ImageDescriptor image = adapter.getSystemFilterPoolManagerImage();
-
- if ((mgrs == null) || (mgrs.length == 0))
- return veryRootElement;
-
- ISystemFilter parentFilter = getFirstSelectedFilterString().getParentSystemFilter();
- ISystemFilterPool parentFilterPool = parentFilter.getParentFilterPool();
-
- Vector veryRootChildren = new Vector();
- for (int idx=0; idx<mgrs.length; idx++)
- {
- SystemSimpleContentElement mgrElement =
- new SystemSimpleContentElement(mgrs[idx].getName(),
- mgrs[idx], veryRootElement, (Vector)null);
- mgrElement.setRenamable(false);
- mgrElement.setDeletable(false);
- mgrElement.setImageDescriptor(image);
-
- Vector elements = new Vector();
- populateFilterPoolContentElementVector(poolMgrProvider, mgrs[idx], elements,
- mgrElement, filtersToExclude,
- parentFilterPool, parentFilter);
- mgrElement.setChildren(elements);
-
- veryRootChildren.addElement(mgrElement);
- //if (mgrs[idx] == poolMgr)
- //initialSelectionElement = mgrElement;
- }
- veryRootElement.setChildren(veryRootChildren);
- return veryRootElement;
- }
-
- /**
- * Populate filter pool manager subtree with filter pools
- */
- protected void populateFilterPoolContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPoolManager mgr,
- Vector elements,
- SystemSimpleContentElement parentElement,
- ISystemFilter[] filtersToExclude,
- ISystemFilterPool filterPoolToSelect,
- ISystemFilter filterToSelect)
- {
- ISystemFilterPool[] pools = mgr.getSystemFilterPools();
- for (int idx=0; idx<pools.length; idx++)
- {
- ISystemFilterPool pool = pools[idx];
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterPoolImage(poolMgrProvider,pool));
-
- Vector childElements = new Vector();
- populateFilterContentElementVector(poolMgrProvider, pool, childElements, cElement, filtersToExclude, filterToSelect);
- cElement.setChildren(childElements);
-
- elements.addElement(cElement);
- if ((pool == filterPoolToSelect) && (initialSelectionElement==null))
- initialSelectionElement = cElement;
- }
- }
-
- /**
- * Populate filter pool subtree with filters
- */
- protected void populateFilterContentElementVector(ISystemFilterPoolManagerProvider poolMgrProvider,
- ISystemFilterPool pool,
- Vector elements,
- SystemSimpleContentElement parentElement,
- ISystemFilter[] filtersToExclude,
- ISystemFilter filterToSelect)
- {
- ISystemFilter[] filters = pool.getSystemFilters();
- for (int idx=0; idx<filters.length; idx++)
- {
- ISystemFilter filter = filters[idx];
- if (!filter.isNonChangable() && !filter.isPromptable() && // defect 43242
- !containsFilter(filtersToExclude,filter))
- {
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(filter.getName(), filter, parentElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterImage(poolMgrProvider,filter));
- elements.addElement(cElement);
- if (filter == filterToSelect)
- initialSelectionElement = cElement;
- }
- }
- }
-
- private boolean containsFilter(ISystemFilter[] filters, ISystemFilter filter)
- {
- ISystemFilter match = null;
- for (int idx=0; (match==null) && (idx<filters.length); idx++)
- if (filters[idx] == filter)
- match = filters[idx];
- return (match != null);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterAction.java
deleted file mode 100644
index 4bed51fea..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current filter up in the list
- */
-public class SystemFilterMoveUpFilterAction extends SystemBaseAction
-
-{
-
- /**
- * Constructor
- */
- public SystemFilterMoveUpFilterAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEUP_LABEL,SystemResources.ACTION_MOVEUP_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Intercept of parent method. We need to test that the filters
- * come from the same parent
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemFilterContainer prevContainer = null;
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- ISystemFilter filter = getSystemFilter(selectedObject);
- if (prevContainer != null)
- {
- if (prevContainer != filter.getParentFilterContainer())
- enable = false;
- else
- prevContainer = filter.getParentFilterContainer();
- }
- else
- prevContainer = filter.getParentFilterContainer();
- if (enable)
- enable = checkObjectType(filter);
- }
- return enable;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (!((selectedObject instanceof ISystemFilter) ||
- (selectedObject instanceof ISystemFilterReference)))
- return false;
- ISystemFilter filter = getSystemFilter(selectedObject);
- ISystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- ISystemFilterContainer fpContainer = filter.getParentFilterContainer();
- int pos = fpContainer.getSystemFilterPosition(filter);
- return (pos>0);
- }
-
- private ISystemFilter getSystemFilter(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilter)
- return (ISystemFilter)selectedObject;
- else
- return ((ISystemFilterReference)selectedObject).getReferencedFilter();
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- IStructuredSelection selections = getSelection();
- //SystemFilter filters[] = new SystemFilter[selections.size()];
- //Iterator i = selections.iterator();
- //int idx = 0;
- //while (i.hasNext())
- //filters[idx++] = getSystemFilter(i.next());
-
- SystemSortableSelection[] sortableArray = new SystemSortableSelection[selections.size()];
- Iterator i = selections.iterator();
- int idx = 0;
- ISystemFilter filter = null;
- ISystemFilterContainer fpContainer = null;
- while (i.hasNext())
- {
- sortableArray[idx] = new SystemSortableSelection(getSystemFilter(i.next()));
- filter = (ISystemFilter)sortableArray[idx].getSelectedObject();
- fpContainer = filter.getParentFilterContainer();
- sortableArray[idx].setPosition(fpContainer.getSystemFilterPosition(filter));
- idx++;
- }
- SystemSortableSelection.sortArray(sortableArray);
- ISystemFilter[] filters = (ISystemFilter[])SystemSortableSelection.getSortedObjects(sortableArray, new ISystemFilter[sortableArray.length]);
-
- if (idx>0)
- {
- ISystemFilterPoolManager fpMgr = filters[0].getSystemFilterPoolManager();
- try {
- //System.out.println("In SystemFilterMoveUpFilterAction#run(). Calling mgr.moveSystemFilters");
- fpMgr.moveSystemFilters(filters,-1);
- } catch (Exception exc)
- {
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterPoolReferenceAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterPoolReferenceAction.java
deleted file mode 100644
index 530b4a8b3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterMoveUpFilterPoolReferenceAction.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemSortableSelection;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to move the current filter pool reference up in the list
- */
-public class SystemFilterMoveUpFilterPoolReferenceAction extends SystemBaseAction
-
-{
-
-
- /**
- * Constructor
- */
- public SystemFilterMoveUpFilterPoolReferenceAction(Shell parent)
- {
- super(SystemResources.ACTION_MOVEUP_LABEL,SystemResources.ACTION_MOVEUP_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction#setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction#getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Intercept of parent method. We need to test that the filter pools
- * come from the same parent
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemFilterPoolReferenceManager prevMgr = null;
- boolean enable = true;
- Iterator e = selection.iterator();
- while (enable && e.hasNext())
- {
- Object selectedObject = e.next();
- ISystemFilterPoolReference filterPoolRef = (ISystemFilterPoolReference)selectedObject;
- if (prevMgr != null)
- {
- if (prevMgr != filterPoolRef.getFilterPoolReferenceManager())
- enable = false;
- else
- prevMgr = filterPoolRef.getFilterPoolReferenceManager();
- }
- else
- prevMgr = filterPoolRef.getFilterPoolReferenceManager();
- if (enable)
- enable = checkObjectType(filterPoolRef);
- }
- return enable;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (!(selectedObject instanceof ISystemFilterPoolReference))
- return false;
- ISystemFilterPoolReference filterPoolRef = (ISystemFilterPoolReference)selectedObject;
- ISystemFilterPoolReferenceManager fprMgr = filterPoolRef.getFilterPoolReferenceManager();
- int pos = fprMgr.getSystemFilterPoolReferencePosition(filterPoolRef);
- return (pos>0);
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- IStructuredSelection selections = getSelection();
- //SystemFilterPoolReference filterPoolRefs[] = new SystemFilterPoolReference[selections.size()];
- //Iterator i = selections.iterator();
- //int idx = 0;
- //while (i.hasNext())
- //filterPoolRefs[idx++] = (SystemFilterPoolReference)i.next();
-
- SystemSortableSelection[] sortableArray = new SystemSortableSelection[selections.size()];
- Iterator i = selections.iterator();
- int idx = 0;
- ISystemFilterPoolReference filterPoolRef = null;
- ISystemFilterPoolReferenceManager fprMgr = null;
- while (i.hasNext())
- {
- sortableArray[idx] = new SystemSortableSelection(i.next());
- filterPoolRef = (ISystemFilterPoolReference)sortableArray[idx].getSelectedObject();
- fprMgr = filterPoolRef.getFilterPoolReferenceManager();
- sortableArray[idx].setPosition(fprMgr.getSystemFilterPoolReferencePosition(filterPoolRef));
- idx++;
- }
- SystemSortableSelection.sortArray(sortableArray);
- ISystemFilterPoolReference[] filterPoolRefs = (ISystemFilterPoolReference[])SystemSortableSelection.getSortedObjects(sortableArray, new ISystemFilterPoolReference[sortableArray.length]);
-
- if (idx > 0)
- {
- fprMgr = filterPoolRefs[0].getFilterPoolReferenceManager();
- fprMgr.moveSystemFilterPoolReferences(filterPoolRefs,-1);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterNewFilterPoolAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterNewFilterPoolAction.java
deleted file mode 100644
index 0f62994ba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterNewFilterPoolAction.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.ISystemWizardAction;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterNewFilterPoolWizard;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterPoolWizardDialog;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterPoolWizardInterface;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterWorkWithFilterPoolsDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the New Filter Pool wizard
- * @see #setHelpContextId(String)
- */
-public class SystemFilterNewFilterPoolAction
- extends SystemFilterAbstractFilterPoolWizardAction
- implements ISystemWizardAction
-{
-
- private SystemFilterWorkWithFilterPoolsDialog wwdialog = null;
- //private SystemFilterNewFilterPoolWizard wizard = null;
-
- /**
- * Constructor for SystemNewFilterPoolAction when not called from work-with dialog.
- */
- public SystemFilterNewFilterPoolAction(Shell parent)
- {
- this(parent, null);
- }
-
- /**
- * Constructor for SystemNewFilterPoolAction when called from work-with dialog.
- */
- public SystemFilterNewFilterPoolAction(Shell parent,
- SystemFilterWorkWithFilterPoolsDialog wwdialog)
- {
- super(parent,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOL_ID),
- SystemResources.ACTION_NEWFILTERPOOL_LABEL, SystemResources.ACTION_NEWFILTERPOOL_TOOLTIP);
- this.wwdialog = wwdialog;
- allowOnMultipleSelection(false);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- }
-
- /**
- * Override of init in parent
- */
- protected void init()
- {
- super.init();
- dlgInputs.prompt = SystemResources.RESID_NEWFILTERPOOL_PAGE1_DESCRIPTION;
- dlgInputs.title = SystemResources.RESID_NEWFILTERPOOL_PAGE1_TITLE;
- dlgInputs.poolNamePrompt = SystemResources.RESID_FILTERPOOLNAME_LABEL;
- dlgInputs.poolNameTip = SystemResources.RESID_FILTERPOOLNAME_TIP;
- dlgInputs.poolMgrNamePrompt = SystemResources.RESID_FILTERPOOLMANAGERNAME_LABEL;
- dlgInputs.poolMgrNameTip = SystemResources.RESID_FILTERPOOLMANAGERNAME_TIP;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (selectedObject instanceof SystemSimpleContentElement)
- selectedObject = ((SystemSimpleContentElement)selectedObject).getData();
- boolean enable =
- (selectedObject instanceof ISystemFilterPoolReferenceManagerProvider) ||
- (selectedObject instanceof ISystemFilterPoolManager) ||
- (selectedObject instanceof ISystemFilterPool);
- return enable;
- }
-
-
- /**
- * Return the wizard so we can customize it prior to showing it.
- * Returns new SystemFilterNewFilterPoolWizard(). Override to replace with your own.
- */
- public SystemFilterPoolWizardInterface getFilterPoolWizard()
- {
- //if (wizard == null)
- // wizard = new SystemFilterNewFilterPoolWizard();
- //return wizard;
- return new SystemFilterNewFilterPoolWizard();
- }
-
- /**
- * Overrides parent. Called after dialog dismissed.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- SystemFilterPoolWizardDialog wizardDlg = (SystemFilterPoolWizardDialog)dlg;
- SystemFilterPoolDialogOutputs dlgOutput = wizardDlg.getFilterPoolDialogOutputs();
- return dlgOutput;
- }
-
- /**
- * Overrides parent. Called after dialog dismissed and getDialogValue called.
- * The output of getDialogValue passed as input here.
- */
- public void doOKprocessing(Object dlgValue)
- {
- //System.out.println("In SystemFilterNewFIlterPoolAction.doOKProcessing");
- SystemFilterPoolDialogOutputs dlgOutput = (SystemFilterPoolDialogOutputs)dlgValue;
- // called from WorkWith dialog... we do not offer to create a reference...
- if ((dlgOutput.newPool != null) && (wwdialog != null))
- wwdialog.addNewFilterPool(getShell(), dlgOutput.newPool);
- else if (dlgOutput.newPool != null)
- {
- ISystemFilterPoolReferenceManagerProvider sfprmp = getReferenceManagerProviderSelection();
- // Action selected by user when a reference manager provider was selected.
- // Seems obvious then that the user wishes to see the newly created pool, so
- // we take the liberty of creating a reference object...
- if (sfprmp != null)
- {
- ISystemFilterPoolReferenceManager sfprm = sfprmp.getSystemFilterPoolReferenceManager();
- //System.out.println("...calling addREferenceToSystemFilterPool...");
- sfprm.addReferenceToSystemFilterPool(dlgOutput.newPool);
- //System.out.println("...back from addREferenceToSystemFilterPool");
- }
- }
- }
-
- /**
- * Returns array of managers to show in combo box.
- * Overrides parent to call back to wwdialog if not null.
- */
- public ISystemFilterPoolManager[] getFilterPoolManagers()
- {
- if (wwdialog != null)
- return wwdialog.getFilterPoolManagers();
- else
- return super.getFilterPoolManagers();
- }
-
- /**
- * Returns the zero-based index of the manager name to preselect.
- * Overrides parent to call back to wwdialog if not null.
- */
- public int getFilterPoolManagerNameSelectionIndex()
- {
- if (wwdialog != null)
- return wwdialog.getFilterPoolManagerSelection();
- else
- return super.getFilterPoolManagerNameSelectionIndex();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterPoolReferenceSelectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterPoolReferenceSelectAction.java
deleted file mode 100644
index c8cbadcd9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterPoolReferenceSelectAction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A selectable filter pool name action.
- * This is typically used to allow users to select a filter pool for referencing
- */
-public class SystemFilterPoolReferenceSelectAction extends SystemBaseAction
-
-{
- private ISystemFilterPool pool;
- private ISystemFilterPoolReferenceManager refMgr;
-
- /**
- * Constructor
- */
- public SystemFilterPoolReferenceSelectAction(Shell parent, ISystemFilterPool pool, ISystemFilterPoolReferenceManager refMgr)
- {
- super(pool.getName(), RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLREF_ID), parent);
- this.pool = pool;
- this.refMgr = refMgr;
- //setChecked(false);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- //System.out.println("Pretend to select");
- try
- {
- refMgr.addReferenceToSystemFilterPool(pool);
- } catch (Exception exc)
- {
- SystemBasePlugin.logError("Unexpected error adding filter pool reference",exc);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterRemoveFilterPoolReferenceAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterRemoveFilterPoolReferenceAction.java
deleted file mode 100644
index 3079dc50c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterRemoveFilterPoolReferenceAction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to remove a filter pool reference
- */
-public class SystemFilterRemoveFilterPoolReferenceAction
- extends SystemBaseAction
-
-{
-
-
- /**
- * Constructor
- */
- public SystemFilterRemoveFilterPoolReferenceAction(Shell parent)
- {
- super(SystemResources.ACTION_RMVFILTERPOOLREF_LABEL,SystemResources.ACTION_RMVFILTERPOOLREF_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_DELETEREF_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- if (!(selectedObject instanceof ISystemFilterPoolReference))
- return false;
- // disable if this is a connection-unique filter pool
- else
- return ((ISystemFilterPoolReference)selectedObject).getReferencedFilterPool().getOwningParentName() == null;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- IStructuredSelection selections = getSelection();
- ISystemFilterPoolReference poolReferences[] = new ISystemFilterPoolReference[selections.size()];
- Iterator i = selections.iterator();
- ISystemFilterPoolReferenceManager fprMgr = null;
- while (i.hasNext())
- {
- ISystemFilterPoolReference poolReference = (ISystemFilterPoolReference)i.next();
- fprMgr = poolReference.getFilterPoolReferenceManager();
- fprMgr.removeSystemFilterPoolReference(poolReference,true); // true means do dereference
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterSelectFilterPoolsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterSelectFilterPoolsAction.java
deleted file mode 100644
index 7ad0a8ae8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterSelectFilterPoolsAction.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Vector;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.dialogs.SystemSimpleSelectDialog;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action that displays the Select Filter Pools dialog, and which returns
- * an array of selected filter pools.
- * <p>
- * Dialog will display a root node for each manager, and then the filter pools
- * within each manager as children. User can select any pool from any of the
- * given managers.
- * <p>
- * Uses getName() on manager for display name of root nodes.
- * <p>
- * Typically, such a dialog is used to allow the user to select a subset of pools
- * that they will access in some context. There is framework support for such
- * selections, via SystemFilterPoolReferences. Each of these are a reference to a
- * filter pool, and the SystemFilterPoolReferenceManager class offers full support
- * for manager a list of such references, optionally even saving and restoring such
- * a list.
- *
- * <p>
- * You call the setFilterPoolManagers method to set the array of filter pool managers
- * this dialog allows the user to select from.
- * <p>
- * If you also call the optional method setFilterPoolReferenceManager, you need not
- * subclass this action. It will handle everything for you!!
- * <ul
- * <li>Preselects the filter pools currently referenced by one or more reference objects
- * in the filter pool reference manager.
- * <li>What OK is pressed, removes the previous references from the reference manager,
- * and adds references for the pools selected by the user.
- * </ul>
- *
- * You can either supply the label, dialog title, dialog prompt, filter pool image,
- * input filter pool managers and filter pool reference manager by calling the
- * appropriate setXXX methods, or by overriding the related getXXX methods.
- */
-public class SystemFilterSelectFilterPoolsAction
- extends SystemFilterAbstractFilterPoolAction
-
-{
-
-
- /**
- * Constructor when default label desired.
- */
- public SystemFilterSelectFilterPoolsAction(Shell parent)
- {
- super(parent,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS_ID),
- SystemResources.ACTION_SELECTFILTERPOOLS_LABEL, SystemResources.ACTION_SELECTFILTERPOOLS_TOOLTIP);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- // set default help for action and dialog
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0043");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dsfp0000");
- }
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterSelectFilterPoolsAction(Shell parent, String title)
- {
- super(parent, title);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- // set default help for action and dialog
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0043");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dsfp0000");
- }
-
-
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterSelectFilterPoolsAction(Shell parent, String title, String tooltip)
- {
- super(parent, title, tooltip);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- // set default help for action and dialog
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0043");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dsfp0000");
- }
-
-
- /**
- * Override of init in parent
- */
- protected void init()
- {
- super.init();
- dlgInputs.prompt = SystemResources.RESID_SELECTFILTERPOOLS_PROMPT;
- dlgInputs.title = SystemResources.RESID_SELECTFILTERPOOLS_TITLE;
- }
-
- /**
- * Creates our select-filter-pools dialog, and populates it with the list of
- * filter pools to select from.
- * <p>
- * <i>Assumes setFilterPoolManagers has been called.</i>
- * <p>
- * Dialog will display a root node for each manager, and then the filter pools
- * within each manager as children. User can select any pool from any of the
- * given managers.
- * <p>
- * Uses getName() on manager for display name of root nodes.
- *
- * @see org.eclipse.rse.ui.actions.SystemBaseDialogAction#run()
- */
- protected Dialog createDialog(Shell parent)
- {
- SystemSimpleSelectDialog dialog =
- new SystemSimpleSelectDialog(parent, getDialogTitle(), getDialogPrompt());
-
- ISystemFilterPoolManager[] mgrs = getFilterPoolManagers();
- ISystemFilterPoolReferenceManagerProvider sprmp = getReferenceManagerProviderSelection();
- ISystemFilterPoolManager[] additionalMgrs = null;
- if (sprmp != null)
- additionalMgrs = sprmp.getSystemFilterPoolReferenceManager().getAdditionalSystemFilterPoolManagers();
- if (additionalMgrs != null)
- {
- ISystemFilterPoolManager[] allmgrs = new ISystemFilterPoolManager[mgrs.length+additionalMgrs.length];
- int allidx = 0;
- for (int idx=0; idx<mgrs.length; idx++)
- allmgrs[allidx++] = mgrs[idx];
- for (int idx=0; idx<additionalMgrs.length; idx++)
- allmgrs[allidx++] = additionalMgrs[idx];
- mgrs = allmgrs;
- }
-
- SystemSimpleContentElement input =
- SystemFilterUIHelpers.getFilterPoolModel(getFilterPoolManagerProvider(), mgrs);
- preSelect(input);
- setValue(input);
-
- if (sprmp != null)
- {
- ISystemFilterPoolManager initialSelection = sprmp.getSystemFilterPoolReferenceManager().getDefaultSystemFilterPoolManager();
- if (initialSelection != null)
- {
- SystemSimpleContentElement initialElementSelection = SystemFilterUIHelpers.getDataElement(input, initialSelection);
- if (initialElementSelection != null)
- dialog.setRootToPreselect(initialElementSelection);
- }
- }
- return dialog;
- }
- /**
- * We override createDialog from parent, so this is a no-op.
- */
- public SystemFilterPoolDialogInterface createFilterPoolDialog(Shell parent)
- {
- return null;
- }
-
- /**
- * Walk elements deciding pre-selection
- */
- protected void preSelect(SystemSimpleContentElement inputElement)
- {
- super.preSelect(inputElement);
- }
- /**
- * Decide per pool if it should be selected or not.
- * Default behaviour is to select it if it is currently referenced.
- */
- protected boolean getFilterPoolPreSelection(ISystemFilterPool pool)
- {
- ISystemFilterPoolReferenceManagerProvider refMgrProvider = getReferenceManagerProviderSelection();
- if (refMgrProvider != null)
- {
- ISystemFilterPoolReferenceManager refMgr = refMgrProvider.getSystemFilterPoolReferenceManager();
- if (refMgr != null)
- {
- return refMgr.isSystemFilterPoolReferenced(pool);
- }
- else
- return false;
- }
- else
- return false;
- }
-
- /**
- * Called by parent class after dialog returns. We set the internal value attribute
- * to be the array of user selected filter pools.
- * <p>
- * After this action executes, simply call getValue() to get an
- * array of SystemFilterPool objects representing what pools the user selected.
- * A result of null means the dialog was cancelled.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- SystemSimpleSelectDialog dialog = (SystemSimpleSelectDialog)dlg;
- if (!dialog.wasCancelled())
- {
- Vector selectedFilterPools = new Vector();
- SystemSimpleContentElement inputElement = dialog.getUpdatedContent();
- SystemSimpleContentElement[] mgrElements = inputElement.getChildren();
- for (int idx=0; idx<mgrElements.length; idx++)
- {
- SystemSimpleContentElement[] poolElements = mgrElements[idx].getChildren();
- for (int jdx=0; jdx<poolElements.length; jdx++)
- {
- if (poolElements[jdx].isSelected())
- selectedFilterPools.addElement(poolElements[jdx].getData());
- }
- }
-
- ISystemFilterPool[] selectedPoolArray = new ISystemFilterPool[selectedFilterPools.size()];
- for (int idx=0; idx<selectedFilterPools.size(); idx++)
- selectedPoolArray[idx] = (ISystemFilterPool)selectedFilterPools.elementAt(idx);
- return selectedPoolArray;
- }
- else
- return null;
- }
-
-
- /**
- * Method called when ok pressed on dialog and after getDialogValue has set the
- * value attribute to an array of SystemFilterPool objects for the selected pools.
- * <p>
- * By default, if the current selected object implements SystemFilterPoolReferenceManagerProvider,
- * then this will call setFilterPoolReferences on that selected object.
- * <p>
- * @param dlgOutput The array of SystemFilterPools selected by the user, as set in getDialogValue()
- */
- public void doOKprocessing(Object dlgOutput)
- {
- ISystemFilterPool[] selectedPools = (ISystemFilterPool[])dlgOutput;
- ISystemFilterPoolReferenceManagerProvider sfprmp = getReferenceManagerProviderSelection();
- if (sfprmp != null)
- {
- sfprmp.getSystemFilterPoolReferenceManager().setSystemFilterPoolReferences(selectedPools,true);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsAction.java
deleted file mode 100644
index 660065b18..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsAction.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.filters.SystemFilterPoolManagerUIProvider;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.rse.ui.filters.dialogs.SystemFilterWorkWithFilterPoolsDialog;
-import org.eclipse.rse.ui.validators.ValidatorFilterPoolName;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * The action that displays the Work With Filter Pools dialog
- */
-public class SystemFilterWorkWithFilterPoolsAction
- extends SystemFilterAbstractFilterPoolAction
- implements SystemFilterPoolManagerUIProvider
-{
-
- private ValidatorFilterPoolName poolNameValidator = null;
-
- /**
- * Constructor when default label desired.
- */
- public SystemFilterWorkWithFilterPoolsAction(Shell parent)
- {
- super(parent,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID),
- SystemResources.ACTION_WORKWITH_FILTERPOOLS_LABEL, SystemResources.ACTION_WORKWITH_FILTERPOOLS_TOOLTIP);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);
- allowOnMultipleSelection(false);
- // set default action and dialog help
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0044");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dwfp0000");
- }
- /**
- * Constructor when default label desired, and you want to choose between
- * Work With -> Filter Pools and Work With Filter Pools.
- */
- public SystemFilterWorkWithFilterPoolsAction(Shell parent, boolean cascadingAction)
- {
- super(parent,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID),
- cascadingAction ? SystemResources.ACTION_WORKWITH_FILTERPOOLS_LABEL : SystemResources.ACTION_WORKWITH_WWFILTERPOOLS_LABEL,
- cascadingAction ? SystemResources.ACTION_WORKWITH_FILTERPOOLS_TOOLTIP : SystemResources.ACTION_WORKWITH_WWFILTERPOOLS_TOOLTIP
- );
- if (cascadingAction)
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);
- else
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- allowOnMultipleSelection(false);
- // set default action and dialog help
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0044");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dwfp0000");
- }
- /**
- * Constructor when given the translated action label
- */
- public SystemFilterWorkWithFilterPoolsAction(Shell parent, String title)
- {
- super(parent, title);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
- allowOnMultipleSelection(false);
- // set default action and dialog help
- setHelp(RSEUIPlugin.HELPPREFIX + "actn0044");
- setDialogHelp(RSEUIPlugin.HELPPREFIX + "dwfp0000");
- }
-
-
- /**
- * Override of init in parent
- */
- protected void init()
- {
- super.init();
- dlgInputs.prompt = SystemResources.RESID_WORKWITHFILTERPOOLS_PROMPT;
- dlgInputs.title = SystemResources.RESID_WORKWITHFILTERPOOLS_TITLE;
- }
-
- /**
- * Reset between runs
- */
- public void reset()
- {
- }
-
- /**
- * Set the pool name validator for the rename action.
- * The work-with dialog automatically calls setExistingNamesList on it for each selection.
- */
- public void setFilterPoolNameValidator(ValidatorFilterPoolName pnv)
- {
- this.poolNameValidator = pnv;
- }
-
- /**
- * Called by SystemBaseAction when selection is set.
- * Our opportunity to verify we are allowed for this selected type.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- //return (selectedObject instanceof SystemFilterPoolReferenceManagerProvider); // override as appropriate
- return true; // override as appropriate
- }
-
-
- /**
- * Override of parent to create and return our specific filter pool dialog.
- */
- public SystemFilterPoolDialogInterface createFilterPoolDialog(Shell parent)
- {
- //SystemFilterPoolManager[] mgrs = getFilterPoolManagers();
- //SystemSimpleContentElement input = getTreeModel();
- //SystemFilterUIHelpers.getFilterPoolModel(getFilterPoolImageDescriptor(),mgrs);
-
- SystemFilterWorkWithFilterPoolsDialog dialog =
- new SystemFilterWorkWithFilterPoolsDialog(parent, getDialogTitle(), getDialogPrompt(), this);
-
- if (poolNameValidator != null)
- dialog.setFilterPoolNameValidator(poolNameValidator);
-
- //SystemSimpleContentElement initialElementSelection = getTreeModelPreSelection(input);
- //if (initialElementSelection != null)
- //dialog.setRootToPreselect(initialElementSelection);
-
- return dialog;
- }
-
- /**
- * Callback for dialog to refresh its contents
- */
- public SystemSimpleContentElement getTreeModel()
- {
- ISystemFilterPoolManager[] mgrs = getFilterPoolManagers();
- SystemSimpleContentElement input =
- SystemFilterUIHelpers.getFilterPoolModel(getFilterPoolManagerProvider(), mgrs);
- return input;
- }
- /**
- * Callback for dialog to refresh its contents
- */
- public SystemSimpleContentElement getTreeModelPreSelection(SystemSimpleContentElement input)
- {
- ISystemFilterPoolReferenceManagerProvider sprmp = getReferenceManagerProviderSelection();
- SystemSimpleContentElement initialElementSelection = null;
- if (sprmp != null)
- {
- ISystemFilterPoolManager initialSelection = sprmp.getSystemFilterPoolReferenceManager().getDefaultSystemFilterPoolManager();
- if (initialSelection != null)
- {
- initialElementSelection = SystemFilterUIHelpers.getDataElement(input, initialSelection);
- //if (initialElementSelection != null)
- //dialog.setRootToPreselect(initialElementSelection);
- }
- }
- return initialElementSelection;
- }
-
- /**
- * We are a special case of dialog, where we do not need to do anything
- * upon return from the dialog, as the dialog itself does it all.
- */
- protected Object getDialogValue(Dialog dlg)
- {
- return null;
- }
-
- /**
- * Because we return null from getDialogValue(Dialog dlg), this
- * method will never be called.
- */
- public void doOKprocessing(Object dlgValue)
- {
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsRefreshAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsRefreshAllAction.java
deleted file mode 100644
index 3cbf5501c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemFilterWorkWithFilterPoolsRefreshAllAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to refresh the entire Remote Systems Explorer tree view
- */
-public class SystemFilterWorkWithFilterPoolsRefreshAllAction extends SystemBaseAction
-
-{
-
-
- private TreeViewer viewer = null;
-
- /**
- * Constructor
- */
- public SystemFilterWorkWithFilterPoolsRefreshAllAction(TreeViewer viewer, Shell parent)
- {
- super(SystemResources.ACTION_REFRESH_ALL_LABEL,SystemResources.ACTION_REFRESH_ALL_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID),
- parent);
- this.viewer = viewer;
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
- }
-
- /**
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- viewer.refresh();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemNewFilterAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemNewFilterAction.java
deleted file mode 100644
index c6ad81c1b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/actions/SystemNewFilterAction.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.actions;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterContainerReference;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolSelectionValidator;
-import org.eclipse.rse.core.filters.ISystemFilterPoolWrapperInformation;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseWizardAction;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.filters.dialogs.SystemNewFilterWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action acts as a base class for all "New Filter" wizards so we can
- * get some common functionality.
- * <p>
- * An interesting capability of this action is to defer configuration, which might be
- * time consuming, until the user selects to run it. That can be done by registering
- * a callback object that implements ISystemNewFilterActionConfigurator.
- */
-public class SystemNewFilterAction
- extends SystemBaseWizardAction
-
-{
- protected ISystemFilterPool parentPool;
- protected ISystemFilterPool[] poolsToSelectFrom;
- protected ISystemFilterPoolWrapperInformation poolWrapperInformation;
- protected boolean nested = false;
- protected boolean showFilterStrings = true;
- protected boolean showNamePrompt = true;
- protected boolean showInfoPage = true;
- protected boolean fromRSE = false;
- protected String[] defaultFilterStrings;
- protected String type = null;
- protected String verbage = null;
- protected String page1Description;
- protected String namePageHelp;
- protected ISystemFilterPoolSelectionValidator filterPoolSelectionValidator;
- protected ISystemNewFilterActionConfigurator callbackConfigurator;
- protected boolean callbackConfiguratorCalled = true;
- protected Object callbackData = null;
- protected SystemFilterStringEditPane editPane;
-
- /**
- * Constructor for non-nested actions.
- */
- public SystemNewFilterAction(Shell shell, ISystemFilterPool parentPool,
- String label, String tooltip, ImageDescriptor image)
- {
- this(shell, parentPool, label, tooltip, image, false);
- }
- /**
- * Constructor allowing nested actions. Changes the title.
- */
- public SystemNewFilterAction(Shell shell, ISystemFilterPool parentPool,
- String label, String tooltip, ImageDescriptor image,
- boolean nested)
- {
- super(label, tooltip, image, shell);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
- this.parentPool = parentPool;
- this.nested = nested;
- setAvailableOffline(true);
- }
- /**
- * Constructor to use when you want to just use the default action name and image.
- * Also defaults to nested filters not allowed.
- */
- public SystemNewFilterAction(Shell shell, ISystemFilterPool parentPool)
- {
- this(shell, parentPool, SystemResources.ACTION_NEWFILTER_LABEL, SystemResources.ACTION_NEWFILE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTER_ID), false);
- }
-
- // ------------------------
- // CONFIGURATION METHODS...
- // ------------------------
-
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Call this to defer expensive configuration until the user runs the action
- * @param caller - an implementor of the callback interface
- * @param data - any data the callback needs. It will be passed back on the callback.
- */
- public void setCallBackConfigurator(ISystemNewFilterActionConfigurator caller, Object data)
- {
- this.callbackConfigurator = caller;
- this.callbackData = data;
- this.callbackConfiguratorCalled = false;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the help context Id (infoPop) for this action. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelpContextId(String id)
- {
- setHelp(id);
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the parent filter pool that the new-filter actions need.
- * Typically this is set at constructor time but it can be set later if re-using the action.
- */
- public void setParentFilterPool(ISystemFilterPool parentPool)
- {
- this.parentPool = parentPool;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * If you want to prompt the user for the parent filter pool to create this filter in,
- * call this with the list of filter pools. In this case, the filter pool passed into
- * the constructor will be used as the initial selection.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPool[] poolsToSelectFrom)
- {
- this.poolsToSelectFrom = poolsToSelectFrom;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[])}
- * <p>
- * If you want to prompt the user for the parent filter pool to create this filter in,
- * but want to not use the term "pool" say, you can use an array of euphamisms. That is,
- * you can pass an array of objects that map to filter pools, but have a different
- * display name that is shown in the dropdown.
- * <p>
- * Of course, if you want to do this, then you will likely want to offer a different
- * label and tooltip for the prompt, and different verbage above the prompt. The
- * object this method accepts as a parameter encapsulates all that information, and
- * there is a default class you can use for this.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolsToSelectFrom)
- {
- this.poolWrapperInformation = poolsToSelectFrom;
- }
-
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the type of filter we are creating. Results in a call to setType(String) on the new filter.
- * Types are not used by the base filter framework but are a way for tools to create typed
- * filters and have unique actions per filter type.
- * <p>This will also result in a call to setType(String) on the filter string edit pane, which
- * sets the <samp>type</samp> instance variable in case your edit pane subclass needs to know.
- */
- public void setType(String type)
- {
- this.type = type;
- }
- /**
- * <i>Getter method. Do not override.</i><br>
- * Get the type of filter as set by {@link #setType(String)}
- */
- public String getType()
- {
- return type;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set whether to show, or hide, the first page that prompts for a filter string. Default is true.
- * @see #setDefaultFilterStrings(String[])
- */
- public void setShowFilterStrings(boolean show)
- {
- showFilterStrings = show;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Call this if you want the new filter to have some default filter strings.
- */
- public void setDefaultFilterStrings(String[] defaultFilterStrings)
- {
- this.defaultFilterStrings = defaultFilterStrings;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Call in order to not prompt the user for a filter name. This also implies we will not
- * be prompting for a parent filter pool! Default is true.
- * <p>
- * This is used when creating temporary filters that won't be saved. In this case, on
- * Finish a filter is not created! Instead, call getFilterStrings() to get the filter
- * strings created by the user ... typically there is just one unless you also called
- * setDefaultFilterStrings, in which case they will also be returned.
- * <p>
- * For convenience, when this is called, setShowInfoPage(false) is called for you
- */
- public void setShowNamePrompt(boolean show)
- {
- showNamePrompt = show;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Call in order to not show the final info-only page of the wizard. Default is true.
- * @see #setVerbage(String)
- */
- public void setShowInfoPage(boolean show)
- {
- showInfoPage = show;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the verbage to show on the final page. By default, it shows a tip about creating multiple
- * filter strings via the Change action. Use this method to change that default.
- */
- public void setVerbage(String verbage)
- {
- this.verbage = verbage;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the description to display on the first page of the wizard
- */
- public void setPage1Description(String description)
- {
- this.page1Description = description;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set if we are creating a filter for use in the RSE or not. This affects the
- * tips and help.
- * <p>
- * This is set to true automatically by the subsystem factory base class in the RSE,
- * else it defaults to false.
- */
- public void setFromRSE(boolean rse)
- {
- this.fromRSE = true;
- }
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Set the validator to call when the user selects a filter pool. Optional.
- * Only valid in create mode.
- */
- public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator)
- {
- this.filterPoolSelectionValidator = validator;
- }
-
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
-
- /**
- * <i>Configuration method. Do not override.</i><br>
- * Specify the help to show for the name page (page 2)
- */
- public void setNamePageHelp(String helpId)
- {
- this.namePageHelp = helpId;
- }
-
- // ----------------------
- // OVERRIDABLE METHODS...
- // ----------------------
- /**
- * <i><b>Overridable</b> configuration method.</i><br>
- * Overridable extension. For those cases when you don't want to create your
- * own wizard subclass, but prefer to simply configure the default wizard.
- * <p>
- * Note, at the point this is called, all the base configuration, based on the
- * setters for this action, have been called. There really is nothing much that
- * can't be done via setters. The reason you may want to subclass versus use the
- * setters is defer expensive operations until the user actually selects the New Filter
- * action. Using the setters means this is done at time the popup menu is being
- * construction. Overriding this method allows you to defer the wizard configuration
- * until the user selects the action and the wizard is actually created.
- * <p>By default, this does nothing.
- */
- protected void configureNewFilterWizard(SystemNewFilterWizard wizard)
- {
- }
-
- /**
- * <i><b>Overridable</b> configuration method.</i><br>
- * Configure the new filter created by the wizard. This is only called after
- * successful completion of the wizard
- * <p>By default, this does nothing.
- */
- protected void configureNewFilter(ISystemFilter newFilter)
- {
- }
-
- // --------------------
- // LIFECYCLE METHODS...
- // --------------------
-
- /**
- * <i>Lifecyle method. Do not override. Instead override {@link #createNewFilterWizard(ISystemFilterPool)}.</i><br>
- * The default processing for the run method calls createDialog, which
- * in turn calls this method to return an instance of our wizard.<br>
- * Our default implementation is to call createNewFilterWizard.
- * <p>
- * Note your own wizard must subclass {@link org.eclipse.rse.ui.filters.dialogs.SystemNewFilterWizard SystemNewFilterWizard}
- */
- protected IWizard createWizard()
- {
- if ((callbackConfigurator != null) && !callbackConfiguratorCalled)
- {
- callbackConfigurator.configureNewFilterAction(((ISubSystem)callbackData).getSubSystemConfiguration(), this, callbackData);
- callbackConfiguratorCalled = true;
- }
- SystemNewFilterWizard wizard = createNewFilterWizard(parentPool);
- if (poolsToSelectFrom != null)
- wizard.setAllowFilterPoolSelection(poolsToSelectFrom);
- else if (poolWrapperInformation != null)
- wizard.setAllowFilterPoolSelection(poolWrapperInformation);
- if (type != null)
- wizard.setType(type);
- if (defaultFilterStrings != null)
- wizard.setDefaultFilterStrings(defaultFilterStrings);
- if (namePageHelp != null)
- wizard.setNamePageHelp(namePageHelp);
- wizard.setShowFilterStrings(showFilterStrings);
- wizard.setShowNamePrompt(showNamePrompt);
- wizard.setShowInfoPage(showInfoPage);
- wizard.setFromRSE(fromRSE);
- if (verbage != null)
- wizard.setVerbage(verbage);
- if (page1Description != null)
- wizard.setPage1Description(page1Description);
- if (filterPoolSelectionValidator != null)
- wizard.setFilterPoolSelectionValidator(filterPoolSelectionValidator);
- if (editPane != null)
- wizard.setFilterStringEditPane(editPane);
- ISystemFilterPoolReferenceManagerProvider provider = getSystemFilterPoolReferenceManagerProvider();
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Inside createWizard. null? " + (provider==null));
- wizard.setSystemFilterPoolReferenceManagerProvider(provider);
- configureNewFilterWizard(wizard);
- return wizard;
- }
-
- /**
- * <i><b>Overridable</b> lifecyle method. </i><br>
- * Create and return the actual wizard.
- * By default this returns an instance of {@link org.eclipse.rse.filters.ui.wizards.SystemNewFilterWizard}.
- * <p>
- * You can avoid creating your own wizard subclass by instead overriding
- * {@link #configureNewFilterWizard(SystemNewFilterWizard)}
- */
- protected SystemNewFilterWizard createNewFilterWizard(ISystemFilterPool parentPool)
- {
- return new SystemNewFilterWizard(parentPool);
- }
- /**
- * <i>Lifecyle method. Do not override. Instead override {@link #configureNewFilter(ISystemFilter)}.</i><br>
- * Intercept of parent method so we can allow overrides opportunity to
- * configure the new filter.
- * This simply calls configureNewFilter.
- */
- protected void postProcessWizard(IWizard wizard)
- {
- SystemNewFilterWizard newFilterWizard = (SystemNewFilterWizard)wizard;
- ISystemFilter newFilter = newFilterWizard.getSystemFilter();
- if (newFilter != null)
- configureNewFilter(newFilter);
- }
-
- /**
- * <i>Lifecyle method. No need to override.</i><br>
- * Decide whether to enable this action based on selected object's type.
- * Returns false unless selected object is a filter pool or subsystem.
- */
- public boolean checkObjectType(Object selectedObject)
- {
- return ((selectedObject instanceof ISystemFilterContainer) ||
- (selectedObject instanceof ISystemFilterContainerReference) ||
- (selectedObject instanceof ISystemFilterPoolReferenceManagerProvider));
- }
-
- // -----------------
- // OUTPUT METHODS...
- // -----------------
-
- /**
- * <i>Output method. Do not override.</i><br>
- * Get the contextual system filter pool reference manager provider. Will return non-null if the
- * current selection is a reference to a filter pool or filter, or a reference manager
- * provider.
- */
- public ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider()
- {
- Object firstSelection = getFirstSelection();
- if (firstSelection != null)
- {
- if (firstSelection instanceof ISystemFilterReference)
- return ((ISystemFilterReference)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)firstSelection).getProvider();
- else if (firstSelection instanceof ISystemFilterPoolReferenceManagerProvider)
- return (ISystemFilterPoolReferenceManagerProvider)firstSelection;
- else
- return null;
- }
- return null;
- }
-
- /**
- * <i>Output method. Do not override.</i><br>
- * Convenience method to return the newly created filter after running the action.
- * Will be null if the user cancelled. Will also be null if you called setShowNamePrompt(false),
- * in which case you should call getNewFilterStrings().
- * <p>
- * Be sure to call wasCancelled() first before calling this.
- */
- public ISystemFilter getNewFilter()
- {
- Object output = getValue();
- if (output instanceof ISystemFilter)
- return (ISystemFilter)getValue();
- else
- return null;
- }
-
- /**
- * <i>Output method. Do not override.</i><br>
- * When prompting for an unnamed filter, no filter is created. Instead, the user is prompted
- * for a single filter string. This method returns that string. However, if you happened to
- * call setDefaultFilterStrings(...) then those are also returned, hence the need for an
- * array. If not, this will be an array of one, or null if the user cancelled the wizard.
- * <p>
- * Be sure to call wasCancelled() first before calling this.
- */
- public String[] getFilterStrings()
- {
- Object output = getValue();
- if (output == null)
- return null;
- else if (output instanceof Vector)
- {
- Vector v = (Vector)output;
- String[] strings = new String[v.size()];
- for (int idx=0; idx<strings.length; idx++)
- strings[idx] = (String)v.elementAt(idx);
- return strings;
- }
- else if (output instanceof ISystemFilter)
- {
- return ((ISystemFilter)output).getFilterStrings();
- }
- else
- return null;
- }
- /**
- * <i>Output method. Do not override.</i><br>
- * Shortcut to getFilterStrings()[0].
- */
- public String getFilterString()
- {
- String[] strings = getFilterStrings();
- if ((strings!=null) && (strings.length>0))
- return strings[0];
- else
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemFilterWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemFilterWizard.java
deleted file mode 100644
index 16cfab45a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemFilterWizard.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import org.eclipse.rse.ui.filters.SystemFilterDialogInterface;
-import org.eclipse.rse.ui.wizards.ISystemWizard;
-
-
-public interface ISystemFilterWizard
- extends ISystemWizard, SystemFilterDialogInterface
-{
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemNewFilterWizardConfigurator.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemNewFilterWizardConfigurator.java
deleted file mode 100644
index 5b7ff29e8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/ISystemNewFilterWizardConfigurator.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-/**
- * Much of the new filter wizard is configurable, especially with respect to translated strings.
- * While there exists setters and overridable methods for most of it, sometimes that gets overwhelming.
- * This interface is designed to capture all the configurable attributes that are not likely to change
- * from usage to usage of the wizard (eg, not context sensitive) such that for convenience you can
- * implement it in a class and instantiate a singleton instance of that class to re-use for your
- * wizard.
- * <p>
- * Your best option is to subclass {@link SystemNewFilterWizardConfigurator} and override just those
- * things you want to change.
- */
-public interface ISystemNewFilterWizardConfigurator
-{
-
- /**
- * Return the default page title to use for each page, unless overridden individually
- */
- public String getPageTitle();
- /**
- * Return the page title for page 1 (which prompts for the filter string)
- */
- public String getPage1Title();
- /**
- * Return the description for page 1 (which prompts for the filter string)
- */
- public String getPage1Description();
-
- /**
- * Return the page title for page 2 (which prompts for the name and filter pool)
- */
- public String getPage2Title();
- /**
- * Return the description for page 2 (which prompts for the name and filter pool)
- */
- public String getPage2Description();
- /**
- * Return the help ID for page 2
- */
- public String getPage2HelpID();
- /**
- * Return the verbage for the name prompt on page 2
- */
- public String getPage2NameVerbage();
- /**
- * Return the verbage for the pool prompt on page 3
- */
- public String getPage2PoolVerbage();
- /**
- * Return the verbage tooltip for the name prompt on page 2
- */
- public String getPage2PoolVerbageTip();
- /**
- * Return the label for the filter name
- * prompt on page 2.
- */
- public String getPage2NamePromptLabel();
-
- /**
- * Return the tooltip for the filter name
- * prompt on page 2.
- */
- public String getPage2NamePromptTooltip();
-
- /**
- * Return the label for the filter pool
- * prompt on page 2.
- */
- public String getPage2PoolPromptLabel();
-
- /**
- * Return the label for the filter pool
- * prompt on page 2.
- */
- public String getPage2PoolPromptTooltip();
-
- /**
- * Get the "Unique to this connection" checkbox label
- */
- public String getPage2UniqueToConnectionLabel();
- /**
- * Set the "Unique to this connection" checkbox tooltip
- */
- public String getPage2UniqueToConnectionToolTip();
-
- /**
- * Return the page title for page 3 (which shows 2 tips)
- */
- public String getPage3Title();
- /**
- * Return the description for page 3 (which shows 2 tips)
- */
- public String getPage3Description();
- /**
- * Return the first tip on page 3
- */
- public String getPage3Tip1();
- /**
- * Return the second tip on page 3
- */
- public String getPage3Tip2();
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemChangeFilterDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemChangeFilterDialog.java
deleted file mode 100644
index cf270f4b8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemChangeFilterDialog.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemPageCompleteListener;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.filters.ISystemChangeFilterPaneEditPaneSupplier;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A dialog that allows the user to change a filter. It allows update of the filter strings. <br>
- * We do not typically override this to produce our own change filter dialog ... rather we usually
- * call the configuration methods to affect it. At a minimum, we usually want to set the {@link #setFilterStringEditPane(SystemFilterStringEditPane) editpane},
- * which is used to prompt for a new filter string or change an existing one. We usually share the
- * same edit pane with the {@link SystemNewFilterWizard} wizard.
- */
-public class SystemChangeFilterDialog extends SystemPromptDialog
- implements ISystemPageCompleteListener, ISystemChangeFilterPaneEditPaneSupplier
-{
-
- protected SystemChangeFilterPane changeFilterPane;
- protected SystemFilterStringEditPane editPane;
-
- /**
- * Constructor
- */
- public SystemChangeFilterDialog(Shell shell)
- {
- this(shell, SystemResources.RESID_CHGFILTER_TITLE);
- }
- /**
- * Constructor, when unique title desired
- */
- public SystemChangeFilterDialog(Shell shell, String title)
- {
- super(shell, title);
- changeFilterPane = new SystemChangeFilterPane(shell, this, this);
- changeFilterPane.addPageCompleteListener(this);
- setHelp();
- }
-
- /**
- * Overridable extension point for setting dialog help
- */
- protected void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr0000");
- }
-
- // INPUT/CONFIGURATION
- /**
- * <i>Configuration method</i><br>
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool reference manager provider. Will be non-null if the
- * current selection is a reference to a filter pool or filter, or a reference manager
- * provider.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- changeFilterPane.setSystemFilterPoolReferenceManagerProvider(provider);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool manager provider. Will be non-null if the
- * current selection is a filter pool or filter, or reference to them, or a manager provider.
- * Generally this is called when the setSystemFilterPoolReferenceManagerProvider can't be called
- * for some reason.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- changeFilterPane.setSystemFilterPoolManagerProvider(provider);
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the Parent Filter Pool prompt label and tooltip text.
- */
- public void setParentPoolPromptLabel(String label, String tip)
- {
- changeFilterPane.setParentPoolPromptLabel(label, tip);
- }
- /**
- * Return the parent filter pool prompt label, as set by {@link #setParentPoolPromptLabel(String, String)}
- */
- public String getParentPoolPromptLabel()
- {
- return changeFilterPane.getParentPoolPromptLabel();
- }
- /**
- * Return the parent filter pool prompt tip, as set by {@link #setParentPoolPromptLabel(String, String)}
- */
- public String getParentPoolPromptTip()
- {
- return changeFilterPane.getParentPoolPromptTip();
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the name prompt label and tooltip text.
- */
- public void setNamePromptLabel(String label, String tip)
- {
- changeFilterPane.setNamePromptLabel(label, tip);
- }
- /**
- * Return the name prompt label as set by {@link #setNamePromptLabel(String, String)}
- */
- public String getNamePromptLabel()
- {
- return changeFilterPane.getNamePromptLabel();
- }
- /**
- * Return the name prompt tip as set by {@link #setNamePromptLabel(String, String)}
- */
- public String getNamePromptTip()
- {
- return changeFilterPane.getNamePromptTip();
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the label shown in group box around the filter string list, and the tooltip text for the
- * list box.
- */
- public void setListLabel(String label, String tip)
- {
- changeFilterPane.setListLabel(label, tip);
- }
- /**
- * Return list label as set by {@link #setListLabel(String, String)}
- */
- public String getListLabel()
- {
- return changeFilterPane.getListLabel();
- }
- /**
- * Return list tip as set by {@link #setListLabel(String, String)}
- */
- public String getListTip()
- {
- return changeFilterPane.getListTip();
- }
-
- /**
- * Set the string to show as the first item in the list.
- * The default is "New filter string"
- */
- public void setNewListItemText(String label)
- {
- changeFilterPane.setNewListItemText(label);
- }
- /**
- * Return the text for the list item, as set by {@link #setNewListItemText(String)},
- * or the default if not set.
- */
- public String getNewListItemText()
- {
- return changeFilterPane.getNewListItemText();
- }
-
- /**
- * <i>Configuration method</i><br>
- * Call this to specify a validator for the filter string. It will be called per keystroke.
- * A default validator is supplied otherwise: ValidatorFilterString.
- * <p>
- * Your validator should extend ValidatorFilterString to inherited the uniqueness error checking.
- * <p>
- * Alternatively, if all you want is a unique error message for the case when duplicates are found,
- * call setDuplicateFilterStringErrorMessage, and it will be used in the default validator.
- */
- public void setFilterStringValidator(ISystemValidator v)
- {
- changeFilterPane.setFilterStringValidator(v);
- }
- /**
- * Return the result of {@link #setFilterStringValidator(ISystemValidator)}.
- */
- public ISystemValidator getFilterStringValidator()
- {
- return changeFilterPane.getFilterStringValidator();
- }
- /**
- * <i>Configuration method</i><br>
- * Set the error message to use when the user is editing or creating a filter string, and the
- * Apply processing detects a duplicate filter string in the list.
- */
- public void setDuplicateFilterStringErrorMessage(SystemMessage msg)
- {
- changeFilterPane.setDuplicateFilterStringErrorMessage(msg);
- }
- /**
- * Return results of {@link #setDuplicateFilterStringErrorMessage(SystemMessage)}
- */
- public SystemMessage getDuplicateFilterStringErrorMessage()
- {
- return changeFilterPane.getDuplicateFilterStringErrorMessage();
- }
-
- /**
- * <i>Configuration method</i><br>
- * Specify if you want to include a test button or not. Appears with "Apply" and "Reset"
- */
- public void setWantTestButton(boolean wantTestButton)
- {
- changeFilterPane.setWantTestButton(wantTestButton);
- }
- /**
- * Return whether a test button is wanted or not, as set by {@link #setWantTestButton(boolean)}
- */
- public boolean getWantTestButton()
- {
- return changeFilterPane.getWantTestButton();
- }
-
- /**
- * Set if the edit pane is not to be editable
- */
- public void setEditable(boolean editable)
- {
- changeFilterPane.setEditable(editable);
- }
- /**
- * Return whether the edit pane is editable, as set by {@link #setEditable(boolean)}
- */
- public boolean getEditable()
- {
- return changeFilterPane.getEditable();
- }
-
- /**
- * Set if the user is to be allowed to create multiple filter strings or not. Default is true
- */
- public void setSupportsMultipleStrings(boolean multi)
- {
- changeFilterPane.setSupportsMultipleStrings(multi);
- }
- /**
- * Return whether the user is to be allowed to create multiple filter strings or not. Default is true
- */
- public boolean getSupportsMultipleStrings()
- {
- return changeFilterPane.getSupportsMultipleStrings();
- }
-
- // LIFECYCLE
- /**
- * Intercept of parent so we can set the input filter, and deduce whether
- * strings are case sensitive and if duplicates are allowed.<br>
- * Not typically overridden, but if you do, be sure to call super!
- */
- public void setInputObject(Object inputObject)
- {
- changeFilterPane.setInputObject(inputObject);
- }
-
- /**
- * Returns the control (the list view) to recieve initial focus control
- */
- protected Control getInitialFocusControl()
- {
- return changeFilterPane.getInitialFocusControl();
- }
- /**
- * Populates the content area
- */
- protected Control createInner(Composite parent)
- {
- return changeFilterPane.createContents(parent);
- }
- /**
- * Intercept of parent so we can reset the default button
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- super.createButtonsForButtonBar(parent);
- getShell().setDefaultButton(changeFilterPane.getApplyButton()); // defect 46129
- }
- /**
- * Return our edit pane. Overriding this is an alternative to calling setEditPane.
- * Method is declared in {@link ISystemChangeFilterPaneEditPaneSupplier}.
- */
- public SystemFilterStringEditPane getFilterStringEditPane(Shell shell)
- {
- if (editPane == null)
- editPane = new SystemFilterStringEditPane(shell);
- return editPane;
- }
-
- /**
- * Parent override.
- * Called when user presses OK button.
- * This is when we save all the changes the user made.
- */
- protected boolean processOK()
- {
- return changeFilterPane.processOK();
- }
-
- /**
- * Parent override.
- * Called when user presses CLOSE button. We simply blow away all their changes!
- */
- protected boolean processCancel()
- {
- return changeFilterPane.processCancel();
- }
-
-
- /**
- * The comleteness of the page has changed.
- * This is a callback from SystemChangeFilterPane.
- */
- public void setPageComplete(boolean complete)
- {
- super.setPageComplete(complete);
- }
-
- /**
- * Returns parent shell, under which this window's shell is created.
- *
- * @return the parent shell, or <code>null</code> if there is no parent shell
- */
- public Shell getParentShell()
- {
- return super.getParentShell();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizard.java
deleted file mode 100644
index a50ae4445..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizard.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ValidatorFolderName;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizard;
-
-
-/**
- * Wizard for creating a new system filter pool.
- */
-public class SystemFilterNewFilterPoolWizard
- extends AbstractSystemWizard
- implements SystemFilterPoolWizardInterface
-{
- protected SystemFilterNewFilterPoolWizardMainPageInterface mainPage;
- protected ValidatorFolderName usv;
- protected SystemFilterPoolDialogOutputs output;
- protected SystemFilterAbstractFilterPoolAction caller;
- protected ISystemFilterPoolManager[] mgrs;
-
- /**
- * Constructor that uses a default title and image
- */
- public SystemFilterNewFilterPoolWizard()
- {
- this(SystemResources.RESID_NEWFILTERPOOL_TITLE,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID));
- }
- /**
- * Constructor
- * @param label The title for this wizard
- * @param image The image for this wizard
- */
- public SystemFilterNewFilterPoolWizard(String title, ImageDescriptor image)
- {
- super(title, image);
- }
-
- /**
- * Set the help context Id (infoPop) for this wizard. This must be fully qualified by
- * plugin ID.
- */
- public void setHelpContextId(String id)
- {
- super.setHelp(id);
- }
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class.
- */
- public void addPages()
- {
- try {
- mainPage = createMainPage();
- addPage((WizardPage)mainPage);
- //super.addPages();
- } catch (Exception exc)
- {
- System.out.println("Unexpected error in addPages of NewFilterPoolWizard: "+exc.getMessage() + ", " + exc.getClass().getName());
- }
- }
-
-
- /**
- * Creates the wizard's main page.
- */
- protected SystemFilterNewFilterPoolWizardMainPageInterface createMainPage()
- {
- mainPage = new SystemFilterNewFilterPoolWizardDefaultMainPage(this,
- caller.getDialogTitle(), caller.getDialogPrompt());
- mgrs = caller.getFilterPoolManagers();
- if (mgrs != null)
- {
- mainPage.setFilterPoolManagers(mgrs);
- mainPage.setFilterPoolManagerNameSelectionIndex(caller.getFilterPoolManagerNameSelectionIndex());
- }
- return mainPage;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- if (mainPage.performFinish())
- {
- output = mainPage.getFilterPoolDialogOutputs();
- String mgrName = output.filterPoolManagerName;
- ISystemFilterPoolManager mgr = null;
- try
- {
- if (mgrName != null)
- {
- for (int idx=0; (mgr==null)&&(idx<mgrs.length); idx++)
- if (mgrs[idx].getName().equalsIgnoreCase(mgrName))
- mgr = mgrs[idx];
- }
- if (mgr == null)
- {
- System.out.println("Unexpected problem in performFinish of filter pool wizard: no match for selected profile name " + mgrName);
- return false;
- }
- String poolName = mainPage.getPoolName();
- output.newPool = createFilterPool(mgr, poolName);
- }
- catch (Exception exc)
- {
- //RSEUIPlugin.logError("Error in performFinish of filter pool wizard!", exc);
- //System.out.println("Error in performFinish of filter pool wizard!");
- //exc.printStackTrace();
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED);
- msg.makeSubstitution(exc);
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), msg);
- msgDlg.openWithDetails();
- return false;
- }
- return (output.newPool != null);
- }
- return false;
- }
-
-
- /**
- * Process the create new filter pool request, after user presses OK on the dialog.
- * By default, asks the selected manager to create the new pool of the given name.
- */
- protected ISystemFilterPool createFilterPool(ISystemFilterPoolManager selectedManager, String poolName)
- throws Exception
- {
- ISystemFilterPool newFilterPool = null;
- if (selectedManager != null)
- //try {
- newFilterPool = selectedManager.createSystemFilterPool(poolName, true);
- //} catch (Exception exc)
- //{
- //System.out.println("Unexpected error in createFilterPool of NewFilterPoolWizard: "+exc.getMessage() + ", " + exc.getClass().getName());
- //}
- return newFilterPool;
- }
-
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs()
- {
- return output;
- }
-
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterPoolDialogActionCaller(SystemFilterAbstractFilterPoolAction caller)
- {
- this.caller = caller;
- }
-
- /**
- * Allow wizard pages to get this.
- */
- public SystemFilterAbstractFilterPoolAction getFilterPoolDialogActionCaller()
- {
- return caller;
- }
-
-} // end class \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardDefaultMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardDefaultMainPage.java
deleted file mode 100644
index b215c5a21..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardDefaultMainPage.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterPoolName;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Default main page of the "New Filter Pool" wizard.
- * This page asks for the name of the connection pool.
- * Also allows user to select from a list of filter pool managers
- * to put the filter pool into.
- */
-
-public class SystemFilterNewFilterPoolWizardDefaultMainPage
- extends AbstractSystemWizardPage
- implements SystemFilterNewFilterPoolWizardMainPageInterface, Listener, SelectionListener
-{
- protected Label labelName, labelMgr;
- protected Text textName;
- protected Combo mgrCombo;
- protected int mgrSelection = 0;
- protected String[] mgrNames = null;
- protected ISystemValidator[] validatorsByManager = null;
- protected SystemFilterAbstractFilterPoolAction parentWizardAction = null;
-
- /**
- * Constructor.
- */
- public SystemFilterNewFilterPoolWizardDefaultMainPage(Wizard wizard,
- String title,
- String description)
- {
- super(wizard, "NewFilterPool", title, description);
- this.parentWizardAction = ((SystemFilterNewFilterPoolWizard)wizard).getFilterPoolDialogActionCaller();
- }
-
- /**
- * Call this to specify a validator for the pool name. It will be called per keystroke.
- * Only call this if you do not call setFilterPoolManagers!
- */
- public void setNameValidator(ISystemValidator v)
- {
- validatorsByManager = new ISystemValidator[1];
- validatorsByManager[0] = v;
- }
- /**
- * Even if you call setFilterPoolManagers and you really want your own validators,
- * then call this. Otherwise, FolderNameValidator will be called for you.
- * The input must be an array of validators that is the same length as the array
- * of filter pool managers. Call this AFTER setFilterPoolManagers!
- */
- public void setNameValidators(ISystemValidator[] v)
- {
- validatorsByManager = v;
- }
-
- /**
- * Call this to specify the list of filter pool managers to allow the user to select from.
- * Either call this or override getFilterPoolManagerNames, or leave null and this prompt will
- * not show.
- */
- public void setFilterPoolManagers(ISystemFilterPoolManager[] mgrs)
- {
- mgrNames = new String[mgrs.length];
- validatorsByManager = new ISystemValidator[mgrNames.length];
- for (int idx=0; idx<mgrs.length; idx++)
- {
- mgrNames[idx] = mgrs[idx].getName();
- ISystemValidator iiv = new ValidatorFilterPoolName(mgrs[idx].getSystemFilterPoolNamesVector());
- validatorsByManager[idx] = iiv;
- }
- }
- /**
- * Returns array of manager names to show in combo box.
- */
- protected String[] getFilterPoolManagerNames()
- {
- return mgrNames;
- }
- /**
- * Set the zero-based index of the manager name to preselect.
- * The default is zero.
- * Either call this or override getFilterPoolManagerNameSelectionIndex.
- */
- public void setFilterPoolManagerNameSelectionIndex(int index)
- {
- this.mgrSelection = index;
- //System.out.println("inside setFilterPoolManagerNameSelectionIndex in main page: " + index);
- }
- /**
- * Returns the zero-based index of the manager name to preselect.
- * Returns what was set in setFilterPoolManagerNameSelectionIndex by default.
- */
- protected int getFilterPoolManagerNameSelectionIndex()
- {
- return mgrSelection;
- }
-
- /**
- * Retrieve the pool name entry field prompt text.
- * By default, uses what we set in setPoolNamePromptText,
- * or uses a supplied default if that is null.
- */
- protected String getPoolNamePromptText()
- {
- String namePromptText = parentWizardAction.getDialogFilterPoolNamePrompt();
- return (namePromptText==null) ? SystemResources.RESID_FILTERPOOLNAME_LABEL : namePromptText;
- }
- /**
- * Retrieve the pool name entry field tooltip text.
- * By default, uses what we set in setPoolNameToolTip,
- * or uses a supplied default if that is null.
- */
- protected String getPoolNameToolTip()
- {
- String nameTip = parentWizardAction.getDialogFilterPoolNameTip();
- return (nameTip==null) ? SystemResources.RESID_FILTERPOOLNAME_TIP : nameTip;
- }
- /**
- * Retrieve the pool manager combo prompt text.
- * By default, uses what we set in setPoolManagerPromptText,
- * or uses a supplied default if that is null.
- */
- protected String getPoolManagerPromptText()
- {
- String mgrPromptText = parentWizardAction.getDialogFilterPoolManagerNamePrompt();
- return (mgrPromptText == null) ? SystemResources.RESID_FILTERPOOLMANAGERNAME_LABEL : mgrPromptText;
- }
- /**
- * Retrieve the pool manager combo field tooltip text.
- * By default, uses what we set in setPoolManagerToolTip,
- * or uses a supplied default if that is null.
- */
- protected String getPoolManagerToolTip()
- {
- String mgrTip = parentWizardAction.getDialogFilterPoolManagerNameTip();
- return (mgrTip == null) ? SystemResources.RESID_FILTERPOOLMANAGERNAME_TIP : mgrTip;
- }
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- * @param parent The parent composite
- */
- public Control createContents(Composite parent)
- {
- // top level composite
- Composite composite = new Composite(parent,SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(
- GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
-
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(
- composite, 2);
-
- // POOLNAME PROMPT
- labelName = SystemWidgetHelpers.createLabel(composite_prompts, getPoolNamePromptText());
- textName = SystemWidgetHelpers.createTextField(
- composite_prompts,this);
- String tip = getPoolNameToolTip();
- if (tip != null)
- textName.setToolTipText(tip);
-
- // POOL MANAGER PROMPT
- String[] mgrs = getFilterPoolManagerNames();
- if (mgrs != null)
- {
- labelMgr = SystemWidgetHelpers.createLabel(composite_prompts, getPoolManagerPromptText());
- mgrCombo = SystemWidgetHelpers.createReadonlyCombo(composite_prompts,this);
- tip = getPoolManagerToolTip();
- if (tip != null)
- mgrCombo.setToolTipText(tip);
- mgrCombo.setItems(mgrs);
- //System.out.println("inside createContents in main page. Selecting " + mgrSelection);
- mgrCombo.select(mgrSelection);
- setPoolNameTextLimit(mgrSelection);
- }
-
- textName.setFocus();
-
- // add keystroke listeners...
- textName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateNameInput();
- }
- }
- );
- if (mgrCombo != null)
- mgrCombo.addSelectionListener(this);
-
- setPageComplete(false);
- return composite;
- }
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- return textName;
- }
-
- // --------------------------------- //
- // METHODS FOR LISTENER INTERFACE...
- // --------------------------------- //
- /**
- * Combo selection listener method
- */
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- /**
- * Combo selection listener method
- */
- public void widgetSelected(SelectionEvent event)
- {
- Object src = event.getSource();
- if (src == mgrCombo)
- {
- setPoolNameTextLimit(mgrCombo.getSelectionIndex());
- }
- }
- /**
- * Handles events generated by controls on this page.
- */
- public void handleEvent(Event e)
- {
- }
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- SystemMessage errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
- errMsg = validateNameInput();
- if (errMsg != null)
- controlInError = textName;
- if (errMsg != null)
- controlInError.setFocus();
- return (errMsg == null);
- }
-
- // ---------------------------------------------
- // METHODS FOR VERIFYING INPUT PER KEYSTROKE ...
- // ---------------------------------------------
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- * @see #setNameValidator(ISystemValidator)
- */
- protected SystemMessage validateNameInput()
- {
- int mgrIndex = 0;
- if (mgrCombo != null)
- mgrIndex = mgrCombo.getSelectionIndex();
- if (mgrIndex < 0)
- mgrIndex = 0;
- ISystemValidator iiv = validatorsByManager[mgrIndex];
- SystemMessage errorMessage= null;
- if (iiv != null)
- errorMessage= iiv.validate(textName.getText());
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- else
- clearErrorMessage();
- setPageComplete(errorMessage == null);
- return errorMessage;
- }
-
- /**
- * Set the name length for the filter pool based on the
- * currently selected manager
- */
- protected void setPoolNameTextLimit(int mgrIndex)
- {
- if (mgrIndex < 0)
- return;
- ISystemValidator iiv = validatorsByManager[mgrIndex];
- if (iiv != null)
- {
- int limit = -1;
- if (iiv != null)
- limit = iiv.getMaximumNameLength();
- if (limit == -1)
- limit = ValidatorFilterPoolName.MAX_FILTERPOOLNAME_LENGTH; // default is 50
- textName.setTextLimit(limit);
- }
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return user-entered pool name.
- * Call this after finish ends successfully.
- */
- public String getPoolName()
- {
- return textName.getText().trim();
- }
- /**
- * Return user-selected pool manager name.
- * Call this after finish ends successfully.
- */
- public String getPoolManagerName()
- {
- if (mgrCombo!=null)
- return mgrCombo.getText();
- else
- return null;
- }
-
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs()
- {
- SystemFilterPoolDialogOutputs output = new SystemFilterPoolDialogOutputs();
- output.filterPoolName = getPoolName();
- output.filterPoolManagerName = getPoolManagerName();
- return output;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardMainPageInterface.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardMainPageInterface.java
deleted file mode 100644
index bee623fce..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterNewFilterPoolWizardMainPageInterface.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.wizards.ISystemWizardPage;
-
-
-
-/**
- * Interface for new Filter wizard main page classes
- */
-public interface SystemFilterNewFilterPoolWizardMainPageInterface extends ISystemWizardPage
-{
- /**
- * Call this to specify a validator for the pool name. It will be called per keystroke.
- * Only call this if you do not call setFilterPoolManagers!
- */
- public void setNameValidator(ISystemValidator v);
- /**
- * Even if you call setFilterPoolManagers and you really want your own validators,
- * then call this. Otherwise, FolderNameValidator will be called for you.
- * The input must be an array of validators that is the same length as the array
- * of filter pool managers. Call this AFTER setFilterPoolManagers!
- */
- public void setNameValidators(ISystemValidator[] v);
- /**
- * Call this to specify the list of filter pool managers to allow the user to select from.
- * Either call this or override getFilterPoolManagerNames, or leave null and this prompt will
- * not show.
- */
- public void setFilterPoolManagers(ISystemFilterPoolManager[] mgrs);
- /**
- * Set the zero-based index of the manager name to preselect.
- * The default is zero.
- * Either call this or override getFilterPoolManagerNameSelectionIndex.
- */
- public void setFilterPoolManagerNameSelectionIndex(int index);
-
- /**
- * Return user-entered pool name.
- * Call this after finish ends successfully.
- */
- public String getPoolName();
- /**
- * Return user-selected pool manager name.
- * Call this after finish ends successfully.
- */
- public String getPoolManagerName();
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardDialog.java
deleted file mode 100644
index 78dc6791a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardDialog.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Extends WizardDialog to support ability to pass data in from the
- * common wizard action class, and get data out.
- * This is deferred to the actual wizard, which in turn defers to the wizard's first page.
- */
-public class SystemFilterPoolWizardDialog
- extends SystemWizardDialog
- implements SystemFilterPoolDialogInterface
-{
- // all ctors are from parent...
- /**
- * Constructor
- */
- public SystemFilterPoolWizardDialog(Shell shell, SystemFilterPoolWizardInterface wizard)
- {
- super(shell, wizard);
- }
- /**
- * Constructor two. Use when you have an input object at instantiation time.
- */
- public SystemFilterPoolWizardDialog(Shell shell, SystemFilterPoolWizardInterface wizard, Object inputObject)
- {
- super(shell,wizard,inputObject);
- }
-
- /**
- * Return wrapped filter pool wizard
- */
- public SystemFilterPoolWizardInterface getFilterPoolWizard()
- {
- return (SystemFilterPoolWizardInterface)getWizard();
- }
-
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs()
- {
- return getFilterPoolWizard().getFilterPoolDialogOutputs();
- }
-
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterPoolDialogActionCaller(SystemFilterAbstractFilterPoolAction caller)
- {
- getFilterPoolWizard().setFilterPoolDialogActionCaller(caller);
- }
-
- /**
- * Set the help context id for this wizard
- */
- public void setHelpContextId(String id)
- {
- super.setHelp(id);
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardInterface.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardInterface.java
deleted file mode 100644
index 155cd6a45..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterPoolWizardInterface.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.wizards.ISystemWizard;
-
-/**
- * An interface for filter pool wizards to implement
- */
-public interface SystemFilterPoolWizardInterface
- extends ISystemWizard, SystemFilterPoolDialogInterface
-{
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWizardDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWizardDialog.java
deleted file mode 100644
index 69f4db338..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWizardDialog.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.rse.ui.filters.SystemFilterDialogInterface;
-import org.eclipse.rse.ui.filters.SystemFilterDialogOutputs;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Extends WizardDialog to support ability to pass data in from the
- * common wizard action class, and get data out.
- * This is deferred to the actual wizard, which in turn defers to the wizard's first page.
- */
-public class SystemFilterWizardDialog
- extends SystemWizardDialog
- implements SystemFilterDialogInterface
-{
-
- // all ctors are from parent...
- /**
- * Constructor
- */
- public SystemFilterWizardDialog(Shell shell, ISystemFilterWizard wizard)
- {
- super(shell, wizard);
- }
- /**
- * Constructor two. Use when you have an input object at instantiation time.
- */
- public SystemFilterWizardDialog(Shell shell, ISystemFilterWizard wizard, Object inputObject)
- {
- super(shell,wizard,inputObject);
- }
-
- /**
- * Return wrapped filter wizard
- */
- public ISystemFilterWizard getFilterWizard()
- {
- return (ISystemFilterWizard)getWizard();
- }
-
- /**
- * Return an object containing user-specified information pertinent to filter actions
- */
- public SystemFilterDialogOutputs getFilterDialogOutputs()
- {
- return getFilterWizard().getFilterDialogOutputs();
- }
-
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterDialogActionCaller(SystemFilterAbstractFilterAction caller)
- {
- getFilterWizard().setFilterDialogActionCaller(caller);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWorkWithFilterPoolsDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWorkWithFilterPoolsDialog.java
deleted file mode 100644
index 791bef487..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemFilterWorkWithFilterPoolsDialog.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
-import org.eclipse.rse.ui.dialogs.SystemSimpleContentProvider;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogInterface;
-import org.eclipse.rse.ui.filters.SystemFilterPoolDialogOutputs;
-import org.eclipse.rse.ui.filters.SystemFilterPoolManagerUIProvider;
-import org.eclipse.rse.ui.filters.SystemFilterUIHelpers;
-import org.eclipse.rse.ui.filters.SystemFilterWorkWithFilterPoolsTreeViewer;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterCopyFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterNewFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterWorkWithFilterPoolsRefreshAllAction;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ValidatorFilterPoolName;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Dialog for working with filter pools.
- */
-public class SystemFilterWorkWithFilterPoolsDialog
- extends SystemPromptDialog
- implements ISystemPropertyConstants,
- ISelectionChangedListener,
- ISystemDeleteTarget, ISystemRenameTarget,
- SystemFilterPoolDialogInterface
- //,ISystemResourceChangeListener
-{
-
- private String promptString;
- //private Label prompt;
- private SystemFilterWorkWithFilterPoolsTreeViewer tree;
- private ToolBar toolbar = null;
- private ToolBarManager toolbarMgr = null;
- private SystemSimpleContentProvider provider = new SystemSimpleContentProvider();
- private SystemSimpleContentElement filterPoolContent;
- private SystemSimpleContentElement preSelectedRoot = null;
- private ISystemFilterPoolManager[] filterPoolManagers;
- private SystemFilterPoolManagerUIProvider caller = null;
- private boolean initializing = false;
-
- //private ActionContributionItem newActionItem, deleteActionItem, renameActionItem;
- private SystemFilterWorkWithFilterPoolsRefreshAllAction refreshAction = null;
- private SystemFilterNewFilterPoolAction newAction = null;
- //private SystemSimpleDeleteAction dltAction = null;
- private SystemCommonDeleteAction dltAction = null;
- //private SystemSimpleRenameAction rnmAction = null;
- private SystemCommonRenameAction rnmAction = null;
- private SystemFilterCopyFilterPoolAction cpyAction = null;
- private SystemFilterMoveFilterPoolAction movAction = null;
- private IAction[] contextMenuActions = null;
-
-
- /**
- * Constructor
- */
- public SystemFilterWorkWithFilterPoolsDialog(Shell shell, String title, String prompt,
- SystemFilterPoolManagerUIProvider caller)
- //SystemFilterPoolManager[] filterPoolManagers,
- //SystemSimpleContentElement filterPoolContent)
- {
- super(shell, title);
- this.caller = caller;
- promptString = prompt;
- this.filterPoolContent = caller.getTreeModel();
- this.filterPoolManagers = caller.getFilterPoolManagers();
- this.preSelectedRoot = caller.getTreeModelPreSelection(filterPoolContent);
- setCancelButtonLabel(SystemResources.BUTTON_CLOSE);
- setShowOkButton(false);
- //pack();
- }
-
- /**
- * Set the root to preselect
- */
- public void setRootToPreselect(SystemSimpleContentElement preSelectedRoot)
- {
- this.preSelectedRoot = preSelectedRoot;
- }
-
- /**
- * Create message line. Intercept so we can set msg line of form.
- */
- protected ISystemMessageLine createMessageLine(Composite c)
- {
- /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
- return fMessageLine;
- }
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return tree.getControl();
- }
-
- /**
- * Set the pool name validator for the rename action.
- * The work-with dialog automatically calls setExistingNamesList on it for each selection.
- */
- public void setFilterPoolNameValidator(ValidatorFilterPoolName pnv)
- {
- }
-
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- //System.out.println("INSIDE CREATEINNER");
- /*
- // top level composite
- Composite composite = new Composite(parent,SWT.NONE);
- composite.setLayout(new GridLayout());
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
- */
-
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 1);
-
- // PROMPT
- /*prompt =*/ SystemWidgetHelpers.createLabel(composite_prompts, promptString);
-
- // TOOLBAR
- createToolBar(composite_prompts);
-
- // WORK-WITH TREE
- initializing = true;
- tree = new SystemFilterWorkWithFilterPoolsTreeViewer(getShell(), this, new Tree(composite_prompts, SWT.SINGLE | SWT.BORDER));
- GridData treeData = new GridData();
- treeData.horizontalAlignment = GridData.FILL;
- treeData.grabExcessHorizontalSpace = true;
- treeData.widthHint = 300;
- treeData.heightHint= 300;
- treeData.verticalAlignment = GridData.CENTER;
- treeData.grabExcessVerticalSpace = true;
- tree.getTree().setLayoutData(treeData);
-
- tree.setContentProvider(provider);
- tree.setLabelProvider(provider);
-
- // populate tree
- if (filterPoolContent != null)
- {
- filterPoolContent.setData(tree); // so actions can refresh our tree
- tree.setInput(filterPoolContent);
- }
-
- if (preSelectedRoot != null)
- tree.setSelection(new StructuredSelection(preSelectedRoot), true);
-
- // expand and pre-check
- tree.expandAll();
- tree.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
-
- // add selection listener to tree
- tree.addSelectionChangedListener(this);
-
- // populate toolbar
- populateToolBar(getShell(), tree);
-
- initializing = false;
-
- return composite_prompts;
- }
-
- /**
- * Callback from tree when refresh is done
- */
- public boolean refreshTree()
- {
- if (initializing)
- return false;
- this.filterPoolContent = caller.getTreeModel();
- this.filterPoolManagers = caller.getFilterPoolManagers();
- this.preSelectedRoot = caller.getTreeModelPreSelection(filterPoolContent);
- filterPoolContent.setData(tree); // so actions can refresh our tree
- tree.setInput(filterPoolContent); // hmm, hope we don't go into a loop!
- //System.out.println("in refreshTree");
- return true;
- }
-
- /**
- * Create the toolbar displayed at the top of the dialog
- */
- protected void createToolBar(Composite parent)
- {
- toolbar = new ToolBar(parent, SWT.FLAT | SWT.WRAP);
- toolbarMgr = new ToolBarManager(toolbar);
- }
- /**
- * Populate the toolbar displayed at the top of the dialog
- */
- protected void populateToolBar(Shell shell, SystemFilterWorkWithFilterPoolsTreeViewer tree)
- {
- newAction = new SystemFilterNewFilterPoolAction(shell,this);
- //dltAction = new SystemSimpleDeleteAction(shell,this);
- dltAction = new SystemCommonDeleteAction(shell,this);
- rnmAction = new SystemCommonRenameAction(shell,this);
- // undo typical settings...
- rnmAction.allowOnMultipleSelection(false);
- rnmAction.setProcessAllSelections(false);
- //rnmAction = new SystemSimpleRenameAction(shell,this);
- //poolNameValidator = new ValidatorFilterPoolName((Vector)null);
- //rnmAction.setNameValidator(poolNameValidator);
- cpyAction = new SystemFilterCopyFilterPoolAction(shell);
- cpyAction.setSelectionProvider(this);
- movAction = new SystemFilterMoveFilterPoolAction(shell);
- movAction.setSelectionProvider(this);
- refreshAction = new SystemFilterWorkWithFilterPoolsRefreshAllAction(tree, shell);
-
- contextMenuActions = new IAction[6];
- contextMenuActions[0] = newAction;
- contextMenuActions[1] = rnmAction;
- contextMenuActions[2] = cpyAction;
- contextMenuActions[3] = movAction;
- contextMenuActions[4] = dltAction;
- contextMenuActions[5] = refreshAction;
-
- for (int idx=0; idx<contextMenuActions.length; idx++)
- {
- ((ISystemAction)contextMenuActions[idx]).setSelection(tree.getSelection());
- ((ISystemAction)contextMenuActions[idx]).setViewer(tree);
- }
-
- // populate toolbar...
- toolbarMgr.add(refreshAction);
- toolbarMgr.add(newAction);
- toolbarMgr.add(dltAction);
- toolbarMgr.add(rnmAction);
- toolbarMgr.add(cpyAction);
- toolbarMgr.add(movAction);
- toolbarMgr.update(false);
-
- // populate tree..
- tree.setContextMenuActions(contextMenuActions);
-
- }
-
- /**
- * ISelectionChangedListener method. Called when user changes selection in tree
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- //IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- //SystemSimpleContentElement element = (SystemSimpleContentElement)sel.getFirstElement();
- if (rnmAction != null)
- rnmAction.selectionChanged(event);
- }
-
- /**
- * Return current selection
- */
- public SystemSimpleContentElement getSelectedElement()
- {
- IStructuredSelection sel = (IStructuredSelection)tree.getSelection();
- return (SystemSimpleContentElement)sel.getFirstElement();
- }
- /**
- * Return true if something selected
- */
- public boolean isSelectionEmpty()
- {
- IStructuredSelection sel = (IStructuredSelection)tree.getSelection();
- return sel.isEmpty();
- }
- public void clearSelection()
- {
- tree.setSelection((ISelection)null);
- }
-
-
- /**
- * Called when user presses OK button.
- * Return true to close dialog.
- * Return false to not close dialog.
- */
- protected boolean processOK()
- {
- boolean closeDialog = verify();
- if (closeDialog)
- {
- setOutputObject(getInputObject());
- }
- return closeDialog;
- }
-
- public boolean close()
- {
- //RSEUIPlugin.getDefault().getSystemRegistry().removeSystemResourceChangeListener(this);
- return super.close();
- }
- /**
- * Verifies all input.
- * @return true if there are no errors in the user input
- */
- public boolean verify()
- {
- String errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
-
- if (errMsg != null)
- controlInError.setFocus();
- return (errMsg == null);
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = true;
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
- // ------------------------------
- // ISYSTEMDELETETARGET METHODS...
- // ------------------------------
-
- /**
- * Return true if delete should even be shown in the popup menu
- */
- public boolean showDelete()
- {
- return true;
- }
- /**
- * Return true if delete should be enabled based on your current selection.
- */
- public boolean canDelete()
- {
- SystemSimpleContentElement element = getSelectedElement();
- if (element != null) {
- Object elementData = element.getData();
- //System.out.println("In SFWWFPsDlg.canDelete: element data class = " + elementData.getClass().getName());
- if (elementData instanceof ISystemFilterPool) {
- ISystemFilterPool pool = (ISystemFilterPool)elementData;
- return (pool.isDeletable() && element.isDeletable());
- }
- }
- return false;
- }
-
- /**
- * Actually do the delete of currently selected items.
- */
- public boolean doDelete(IProgressMonitor monitor)
- {
- boolean ok = false;
- SystemSimpleContentElement element = getSelectedElement();
- Object elementData = element.getData();
- if ((elementData == null) || !(elementData instanceof ISystemFilterPool))
- return ok;
- ISystemFilterPool pool = (ISystemFilterPool)elementData;
- ISystemFilterPoolManager mgr = pool.getSystemFilterPoolManager();
- try
- {
- mgr.deleteSystemFilterPool(pool);
- ok = true;
- SystemSimpleContentElement parent = element.getParent();
- clearSelection();
- tree.setSelection(new StructuredSelection(parent),true);
- parent.deleteChild(element);
- tree.refresh(parent);
- } catch (Exception exc)
- {
- //SystemMessage.displayExceptionMessage(getShell(),RSEUIPlugin.getResourceBundle(),
- // ISystemMessages.MSG_EXCEPTION_DELETING,exc,
- // pool.getName());
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(pool.getName(),exc));
- msgDlg.open();
- //RSEUIPlugin.logError("Error deleting filter pool in workwith dialog",exc);
- }
- return ok;
- }
-
- // ------------------------------
- // ISYSTEMRENAMETARGET METHODS...
- // ------------------------------
-
- /**
- * Return true if rename should even be shown in the popup menu
- */
- public boolean showRename()
- {
- return true;
- }
- /**
- * Return true if rename should be enabled based on your current selection.
- */
- public boolean canRename()
- {
- boolean canRename = false;
- SystemSimpleContentElement element = getSelectedElement();
- if (element != null) {
- Object elementData = element.getData();
- //System.out.println("In SFWWFPsDlg.canRename: element data class = " + elementData.getClass().getName());
- if (elementData instanceof ISystemFilterPool) {
- ISystemFilterPool pool = (ISystemFilterPool)elementData;
- canRename = (!pool.isNonRenamable() && element.isRenamable());
- //if (canRename) {
- // poolNameValidator.setExistingNamesList(pool.getSystemFilterPoolManager().getSystemFilterPoolNamesVector());
- //}
- }
- }
- return canRename;
- }
-
- /**
- * Actually do the rename of currently selected items.
- * The array of new names matches the currently selected items.
- */
- public boolean doRename(String[] newNames)
- {
- boolean ok = false;
- SystemSimpleContentElement element = getSelectedElement();
- Object elementData = element.getData();
- if ((elementData == null) || !(elementData instanceof ISystemFilterPool))
- return ok;
- ISystemFilterPool pool = (ISystemFilterPool)elementData;
- ISystemFilterPoolManager mgr = pool.getSystemFilterPoolManager();
- try
- {
- mgr.renameSystemFilterPool(pool, newNames[0]);
- ok = true;
- element.setName(newNames[0]);
- String properties[] = {IBasicPropertyConstants.P_TEXT};
- tree.update(element, properties); // for refreshing non-structural properties in viewer when model changes
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayMessage(getShell(), exc);
- }
- catch (Exception exc)
- {
- //SystemMessage.displayExceptionMessage(getShell(),RSEUIPlugin.getResourceBundle(),
- // ISystemMessages.MSG_EXCEPTION_RENAMING,exc,
- // pool.getName());
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(pool.getName(),exc));
- msgDlg.open();
- //RSEUIPlugin.logError("Error renaming filter pool in workwith dialog",exc);
- }
- return ok;
- }
-
- // -----------------------------
- // ISELECTIONPROVIDER METHODS...
- // -----------------------------
- /**
- *
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- tree.addSelectionChangedListener(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- tree.removeSelectionChangedListener(listener);
- }
-
- public void setSelection(ISelection selection)
- {
- tree.setSelection(selection);
- }
-
- public ISelection getSelection()
- {
- return tree.getSelection();
- }
-
-
- /**
- * Callback from new action when new pool created
- */
- public void addNewFilterPool(Shell shell, ISystemFilterPool pool)
- {
- String newPoolMgrName = pool.getSystemFilterPoolManager().getName();
- SystemSimpleContentElement rootElement = filterPoolContent;
- SystemSimpleContentElement[] mgrElements = rootElement.getChildren();
- SystemSimpleContentElement mgrElement = null;
- for (int idx=0; (mgrElement==null) && (idx<mgrElements.length); idx++)
- {
- String mgrName = mgrElements[idx].getName();
- if (mgrName.equals(newPoolMgrName))
- mgrElement = mgrElements[idx];
- }
- SystemSimpleContentElement cElement =
- new SystemSimpleContentElement(pool.getName(), pool, mgrElement, (Vector)null);
- cElement.setImageDescriptor(SystemFilterUIHelpers.getFilterPoolImage(pool.getProvider(),pool));
- mgrElement.addChild(cElement, 0);
- tree.refresh(mgrElement); // rebuild whole thing
- tree.setSelection(new StructuredSelection(cElement),true);
- // defect 42503
- Object inputObj = getInputObject();
- if (inputObj instanceof ISubSystem)
- {
- ISubSystem ss = (ISubSystem)inputObj;
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FILTERPOOL_CREATED);
- msg.makeSubstitution("'"+pool.getName()+"'", "'"+ss.getName()+"'");
- if (shell.isDisposed() || !shell.isVisible())
- shell = getShell();
- SystemMessageDialog msgdlg = new SystemMessageDialog(shell, msg);
- boolean yes = msgdlg.openQuestionNoException();
- if (yes)
- {
- ISystemFilterPoolReferenceManager sfprm = ss.getSystemFilterPoolReferenceManager();
- sfprm.addReferenceToSystemFilterPool(pool);
- }
- }
- }
-
-
- /**
- * Callback from new action to get array of managers
- */
- public ISystemFilterPoolManager[] getFilterPoolManagers()
- {
- ISystemFilterPoolManager[] mgrs = filterPoolManagers;
- return mgrs;
- }
- /**
- * Callback from new action to get index of initial manager to select
- */
- public int getFilterPoolManagerSelection()
- {
- int selection = 0;
- SystemSimpleContentElement element = getSelectedElement();
- Object elementData = element.getData();
- if (elementData != null)
- {
- if (elementData instanceof ISystemFilterPoolManager)
- selection = getManagerIndex((ISystemFilterPoolManager)elementData);
- else if (elementData instanceof ISystemFilterPool)
- selection = getManagerIndex(((ISystemFilterPool)elementData).getSystemFilterPoolManager());
- }
- //System.out.println("In getFilterPoolManagerSelection(). Returning "+selection);
- return selection;
- }
-
- private int getManagerIndex(ISystemFilterPoolManager mgr)
- {
- int pos = -1;
- ISystemFilterPoolManager[] mgrs = filterPoolManagers;
- for (int idx=0; (pos==-1)&&(idx<mgrs.length); idx++)
- {
- if (mgr == mgrs[idx])
- pos = idx;
- }
- if (pos == -1)
- pos = 0;
- return pos;
- }
-
- // SystemFilterPoolDialogInterface methods...
- /**
- * Allow base action to pass instance of itself for callback to get info
- */
- public void setFilterPoolDialogActionCaller(SystemFilterAbstractFilterPoolAction caller)
- {
- }
- /**
- * Return an object containing user-specified information pertinent to filter pool actions
- */
- public SystemFilterPoolDialogOutputs getFilterPoolDialogOutputs()
- {
- SystemFilterPoolDialogOutputs output = new SystemFilterPoolDialogOutputs();
- output.filterPoolTreeRoot = filterPoolContent;
- return output;
- }
-
- /**
- * Set the help context id for this wizard
- */
- public void setHelpContextId(String id)
- {
- super.setHelp(id);
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizard.java
deleted file mode 100644
index 193c32b87..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizard.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterContainerReference;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolSelectionValidator;
-import org.eclipse.rse.core.filters.ISystemFilterPoolWrapper;
-import org.eclipse.rse.core.filters.ISystemFilterPoolWrapperInformation;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterName;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Base Wizard for users to define a new system filter.
- * While subsystem providers are free to offer their own wizards, this
- * abstracts out much of it and makes it easy to simply override and
- * supply a couple classes to offer a totally unique presentation to the
- * user.
- * <p>
- * Some guiding design rules for this wizard:
- * <ul>
- * <li>Users are confused about filter strings versus filters. So, we don't
- * support the creation of multiple filter strings at the time the filter
- * is created, only after via the change action. The wizard basically
- * prompts for the creation of a single new filter string.
- * <li>Users are confused about "naming" a filter, so the name is not asked
- * for until the second page, and it is possible for subclasses to
- * default that name to something intelligent based on the contents of
- * the first page, such that users can press Finish and not think about
- * the name.
- * </ul>
- * <p>
- * While this class can be subclassed, you should find all attributes can be
- * configured via setters.
- */
-public class SystemNewFilterWizard
- extends AbstractSystemWizard
-{
- protected SystemNewFilterWizardMainPage mainPage;
- protected SystemNewFilterWizardNamePage namePage;
- protected SystemNewFilterWizardInfoPage infoPage;
- protected ISystemFilterContainer filterContainer;
- protected ISystemFilterPool parentPool;
- protected ISystemFilterPool[] poolsToSelectFrom;
- protected String type;
- protected String[] defaultFilterStrings;
- //protected String verbage;
- //protected String page1Description;
- protected boolean showFilterStrings = true;
- protected boolean showNamePrompt = true;
- protected boolean showInfoPage = true;
- protected boolean fromRSE = false;
- protected boolean page1DescriptionSet = false;
- protected ISystemFilter newFilter = null;
- protected SystemFilterStringEditPane editPane;
- protected ISystemFilterPoolReferenceManagerProvider provider;
- protected ISystemFilterPoolWrapperInformation poolWrapperInformation;
- protected ISystemFilterPoolSelectionValidator filterPoolSelectionValidator;
- protected ISystemNewFilterWizardConfigurator configurator;
-
-
- /**
- * Constructor when you want to supply your own title and image
- * @param title - title to show for this wizard. This is used as the page title! The title is always "New"!
- * @param wizardImage - title bar image for this wizard
- * @param parentPool - the filter pool we are to create this filter in.
- */
- public SystemNewFilterWizard(String title, ImageDescriptor wizardImage, ISystemFilterPool parentPool)
- {
- this(new SystemNewFilterWizardConfigurator(title), wizardImage, parentPool);
- }
- /**
- * Constructor when you want to use the default page title and image, or want to
- * supply it via setWizardTitle and setWizardImage.
- * @param parentPool - the filter pool we are to create this filter in.
- */
- public SystemNewFilterWizard(ISystemFilterPool parentPool)
- {
- this(new SystemNewFilterWizardConfigurator(),
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERWIZARD_ID),
- parentPool);
- }
- /**
- * Constructor when you want to supply all your own configuration data
- * @param data - configuration data
- * @param wizardImage - title bar image for this wizard
- * @param parentPool - the filter pool we are to create this filter in.
- */
- public SystemNewFilterWizard(ISystemNewFilterWizardConfigurator data, ImageDescriptor wizardImage, ISystemFilterPool parentPool)
- {
- super(SystemResources.RESID_NEWFILTER_TITLE, wizardImage);
- super.setWizardPageTitle(data.getPageTitle());
- super.setForcePreviousAndNextButtons(true);
- this.configurator = data;
- this.parentPool = parentPool;
- setOutputObject(null);
- }
-
- // -----------------------------------
- // INPUT/CONFIGURATION METHODS...
- // -----------------------------------
-
- /**
- * If you want to prompt the user for the parent filter pool to create this filter in,
- * call this with the list of filter pools. In this case, the filter pool passed into
- * the constructor will be used as the initial selection.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPool[] poolsToSelectFrom)
- {
- this.poolsToSelectFrom = poolsToSelectFrom;
- }
- /**
- * This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[])}
- * <p>
- * If you want to prompt the user for the parent filter pool to create this filter in,
- * but want to not use the term "pool" say, you can use an array of euphamisms. That is,
- * you can pass an array of objects that map to filter pools, but have a different
- * display name that is shown in the dropdown.
- * <p>
- * Of course, if you want to do this, then you will likely want to offer a different
- * label and tooltip for the prompt, and different verbage above the prompt. The
- * object this method accepts as a parameter encapsulates all that information, and
- * there is a default class you can use for this.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolsToSelectFrom)
- {
- this.poolWrapperInformation = poolsToSelectFrom;
- }
- /**
- * Set the type of filter we are creating. Results in a call to setType on the new filter.
- * Types are not used by the base filter framework but are a way for tools to create typed
- * filters and have unique actions per filter type.
- */
- public void setType(String type)
- {
- this.type = type;
- }
- /**
- * Get the type of filter as set by {@link #setType(String)}
- */
- public String getType()
- {
- return type;
- }
- /**
- * Call in order to not have the first page, but instead the name-prompt page. Default is true.
- * @see #setDefaultFilterStrings(String[])
- */
- public void setShowFilterStrings(boolean show)
- {
- showFilterStrings = show;
- }
- /**
- * Call in order to not prompt the user for a filter name. This also implies we will not
- * be prompting for a parent filter pool! Default is true.
- * <p>
- * This is used when creating temporary filters that won't be saved. In this case, on
- * Finish a filter is not created! Instead, call getFilterStrings() to get the filter
- * strings created by the user ... typically there is just one unless you also called
- * setDefaultFilterStrings, in which case they will also be returned.
- * <p>
- * For convenience, when this is called, setShowInfoPage(false) is called for you
- */
- public void setShowNamePrompt(boolean show)
- {
- showNamePrompt = show;
- if (!show)
- setShowInfoPage(false);
- }
- /**
- * Specify the help to show for the name page (page 2)
- */
- public void setNamePageHelp(String helpId)
- {
- if (configurator instanceof SystemNewFilterWizardConfigurator)
- ((SystemNewFilterWizardConfigurator)configurator).setPage2HelpID(helpId);
- }
- /**
- * Call in order to not show the final info-only page of the wizard. Default is true.
- */
- public void setShowInfoPage(boolean show)
- {
- showInfoPage = show;
- }
- /**
- * Call this if you want the filter to auto-include some default filter strings.
- */
- public void setDefaultFilterStrings(String[] defaultFilterStrings)
- {
- this.defaultFilterStrings = defaultFilterStrings;
- }
- /**
- * Set if we are creating a filter for use in the RSE or not. This affects the
- * tips and help.
- * <p>
- * This is set to true automatically by the subsystem factory base class in the RSE,
- * else it defaults to false.
- */
- public void setFromRSE(boolean rse)
- {
- this.fromRSE = true;
- }
- /**
- * Set the validator to call when the user selects a filter pool. Optional.
- * Only valid in create mode.
- */
- public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator)
- {
- this.filterPoolSelectionValidator = validator;
- }
-
- /**
- * Set the contextual system filter pool reference manager provider. Eg, in the RSE, this
- * will be the selected subsystem if the New Filter action is launched from there, or if
- * launched from a filter pool reference under there.
- * <p>
- * Will be non-null if the current selection is a reference to a filter pool or filter,
- * or a reference manager provider.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- this.provider = provider;
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Inside setSystemFilterPoolReferenceManagerProvider. null? " + (provider==null));
- }
- /**
- * Set the verbage to show on the final page. By default, it shows a tip about creating multiple
- * filter strings via the Change action. Use this method to change that default.
- */
- public void setVerbage(String verbage)
- {
- if (configurator instanceof SystemNewFilterWizardConfigurator)
- ((SystemNewFilterWizardConfigurator)configurator).setPage3Tip1(verbage);
- }
- /**
- * Set the wizard page title. Using this makes it possible to avoid subclassing.
- * The page title goes below the wizard title, and can be unique per page. However,
- * typically the wizard page title is the same for all pages... eg "Filter".
- * <p>
- * This is not used by default, but can be queried via getPageTitle() when constructing
- * pages.
- */
- public void setWizardPageTitle(String pageTitle)
- {
- super.setWizardPageTitle(pageTitle);
- if (configurator instanceof SystemNewFilterWizardConfigurator)
- ((SystemNewFilterWizardConfigurator)configurator).setPageTitle(pageTitle);
- }
- /**
- * Set the description to display on the first page of the wizard
- */
- public void setPage1Description(String description)
- {
- if (configurator instanceof SystemNewFilterWizardConfigurator)
- ((SystemNewFilterWizardConfigurator)configurator).setPage1Description(description);
- page1DescriptionSet = true;
- }
-
- /**
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
-
- // -----------------------------------
- // INTERNAL BUT OVERRIDABLE METHODS...
- // -----------------------------------
- /**
- * Extendable point for child classes. You don't need to override typically though... rather
- * you can simply supply your own filter string edit pane.
- * <p>
- * By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
- * @return the primary page prompting for a single filter string.
- */
- protected SystemNewFilterWizardMainPage createMainPage()
- {
- mainPage = null;
- if (editPane == null)
- mainPage = new SystemNewFilterWizardMainPage(this, configurator);
- else
- mainPage = new SystemNewFilterWizardMainPage(this, editPane, configurator);
- return mainPage;
- }
- /**
- * Extendable point for child classes. You don't need to override typically though.
- * <p>
- * By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
- * @return the wizard page prompting for the filter name and parent filter pool
- */
- protected SystemNewFilterWizardNamePage createNamePage()
- {
- namePage = new SystemNewFilterWizardNamePage(this, parentPool, configurator);
- return namePage;
- }
- /**
- * Extendable point for child classes. You don't need to override typically though.
- * <p>
- * By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
- * @return the final wizard page with additional readonly information
- */
- protected SystemNewFilterWizardInfoPage createInfoPage()
- {
- boolean showFilterPoolsTip = ((poolsToSelectFrom != null) || (poolWrapperInformation != null));
- infoPage = new SystemNewFilterWizardInfoPage(this, showFilterPoolsTip, configurator);
- return infoPage;
- }
- /**
- * Override of parent to do nothing
- */
- public void addPages() {}
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class.
- */
- public void createPageControls(Composite c)
- {
- try {
- // MAIN PAGE...
- mainPage = createMainPage();
- mainPage.setSystemFilterPoolReferenceManagerProvider(provider);
- mainPage.setType(type);
- if (defaultFilterStrings != null)
- mainPage.setDefaultFilterStrings(defaultFilterStrings);
- if (showFilterStrings)
- {
- addPage(mainPage);
- }
-
- // NAME PAGE...
- namePage = createNamePage();
- if (showNamePrompt && (namePage!=null))
- {
- if (filterPoolSelectionValidator!=null)
- namePage.setFilterPoolSelectionValidator(filterPoolSelectionValidator);
- if (poolsToSelectFrom != null)
- {
- ISystemValidator[] validators = new ISystemValidator[poolsToSelectFrom.length];
- for (int idx=0; idx<validators.length; idx++)
- validators[idx] = getFilterNameValidator(poolsToSelectFrom[idx]);
- namePage.setAllowFilterPoolSelection(poolsToSelectFrom, validators);
- }
- else if (poolWrapperInformation != null)
- {
- ISystemFilterPoolWrapper[] wrappers = poolWrapperInformation.getWrappers();
- ISystemValidator[] validators = new ISystemValidator[wrappers.length];
- for (int idx=0; idx<validators.length; idx++)
- validators[idx] = getFilterNameValidator(wrappers[idx].getSystemFilterPool());
- namePage.setAllowFilterPoolSelection(poolWrapperInformation, validators);
- }
- else
- {
- ISystemValidator validator = getFilterNameValidator(getFilterContainer());
- namePage.setFilterNameValidator(validator);
- }
- if (!showFilterStrings && page1DescriptionSet)
- namePage.setDescription(configurator.getPage1Description());
- addPage(namePage);
- }
-
- // INFO PAGE...
- if (showInfoPage)
- {
- infoPage = createInfoPage();
- if (infoPage!=null)
- {
- addPage(infoPage);
- }
- }
- } catch (Exception exc)
- {
- SystemBasePlugin.logError("Error in createPageControls of SystemNewFilterWizard", exc);
- //System.out.println("Error in createPageControls of SystemNewFilterWizard"); // temp
- //exc.printStackTrace(); // temp
- }
- }
- /**
- * Extendable point for child classes.
- * Override to change the validator used for the filter name given the master object.
- * By default, uses FilterNameValidator.
- */
- protected ISystemValidator getFilterNameValidator(ISystemFilterContainer container)
- {
- return getFilterNameValidator(container, null);
- }
- /**
- * Reusable method to return a name validator for renaming a filter.
- * @param the current filter object on updates. Can be null for new names. Used
- * to remove from the existing name list the current filter's name.
- */
- public static ISystemValidator getFilterNameValidator(ISystemFilterContainer container,ISystemFilter filter)
- {
- Vector v = container.getSystemFilterNames();
- if (filter != null)
- v.removeElement(filter.getName());
- ValidatorFilterName filterNameValidator = new ValidatorFilterName(v);
- return filterNameValidator;
- }
-
- /**
- * Override if necessary.
- * Returns true if filter strings are case-sensitive in this filter.
- * <p>
- * By default, returns the value in the selected filter container. If this is null, returns false.
- */
- public boolean areStringsCaseSensitive()
- {
- ISystemFilterContainer fc = getFilterContainer();
- if (fc != null)
- return fc.areStringsCaseSensitive();
- return false;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish() {
- boolean ok = false;
- newFilter = null;
- setOutputObject(null);
- if (!mainPage.performFinish()) {
- setPageError(mainPage);
- } else if (!namePage.performFinish()) {
- setPageError(namePage);
- } else {
- Vector filterStrings = mainPage.getFilterStrings();
- String filterName = null;
- if (showNamePrompt) {
- filterName = namePage.getFilterName();
- // Get the filter parent, i.e. the filter pool for this new filter
- ISystemFilterContainer filterParent = null;
- if ((poolsToSelectFrom != null) || (poolWrapperInformation != null)) {
- filterParent = namePage.getParentSystemFilterPool();
- if (namePage.getUniqueToThisConnection()) {
- /*
- * this means the user selected to create this filter in the filter pool that is unique to this connection. So now we
- * must find, or create, that filter pool.
- */
- filterParent = provider.getUniqueOwningSystemFilterPool(true); // true -> create if not found
- } else
- filterParent = namePage.getParentSystemFilterPool();
- } else
- filterParent = getFilterContainer();
- // Create the filter and possibly a filter pool reference.
- String type = mainPage.getType();
- try {
- newFilter = createNewFilter(getShell(), filterParent, filterName, filterStrings, type);
- if (newFilter == null) return false;
- /*
- * We allow users to select a profile to create their filter in. From this we
- * select the default filter pool for the particular subsystem in that profile.
- * It is possible for the user to pick a profile that this subsystem does not yet reference.
- * To solve this we need to add a reference for them. This is only a possibility when called
- * from a subsystem's New Filter action, versus that action on a directly on a filter pool.
- */
- if ((provider != null) && (filterParent instanceof ISystemFilterPool)) {
- ISystemFilterPool parentPool = (ISystemFilterPool) filterParent;
- if (provider.getSystemFilterPoolReferenceManager().getReferenceToSystemFilterPool(parentPool) == null) {
- provider.getSystemFilterPoolReferenceManager().addReferenceToSystemFilterPool(parentPool);
- }
- }
- } catch (Exception exc) {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED);
- msg.makeSubstitution(exc);
- SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(), msg);
- msgDlg.openWithDetails();
- return false;
- }
- setOutputObject(newFilter);
- // special handling to expand the currently selected parent node and reveal the new filter
- if ((newFilter != null) && (getInputObject() != null)) {
- Object selectedObject = getInputObject();
- if ((selectedObject instanceof ISystemFilterPoolReference) || (selectedObject instanceof ISystemFilterPoolReferenceManagerProvider)) {
- ISystemFilterPoolReferenceManagerProvider provider = null;
- if (selectedObject instanceof ISystemFilterPoolReference) {
- ISystemFilterPoolReferenceManager sfprm = ((ISystemFilterPoolReference) selectedObject).getFilterPoolReferenceManager();
- if (sfprm != null) provider = sfprm.getProvider();
- } else
- provider = (ISystemFilterPoolReferenceManagerProvider) selectedObject;
- if (provider != null) provider.filterEventFilterCreated(selectedObject, newFilter);
- } else if (selectedObject instanceof ISystemFilterReference) {
- ISystemFilterReference ref = (ISystemFilterReference) selectedObject;
- ISystemFilterPoolReferenceManagerProvider provider = ref.getProvider();
- provider.filterEventFilterCreated(selectedObject, newFilter);
- }
- }
- ok = (newFilter != null);
- } // end if showNamePrompt
- else {
- ok = true;
- setOutputObject(filterStrings);
- }
- return ok;
- }
- return false;
- }
-
- /**
- * Return the parent into which we are creating a filter. If filterContainer has been set,
- * returns that, else returns getInputObject() which is set by the calling action.
- */
- protected Object getParent()
- {
- if (filterContainer != null)
- return filterContainer;
- else
- return getInputObject();
- }
- /**
- * Return parent filter container to contain this filter
- */
- protected ISystemFilterContainer getFilterContainer()
- {
- //System.out.println("Old. inside getFilterContainer. " + filterContainer + ", " + getInputObject());
-
- if (filterContainer == null)
- {
- Object input = getInputObject();
- //if (input != null)
- // System.out.println("... input instanceof SystemFilterContainer? " + (input instanceof SystemFilterContainer));
- //else
- // System.out.println("... input is null");
-
- if (input != null)
- {
- if (input instanceof ISystemFilter)
- return ((ISystemFilter)input).getParentFilterContainer();
- else if (input instanceof ISystemFilterReference)
- return ((ISystemFilterReference)input).getReferencedFilter().getParentFilterContainer();
- else if (input instanceof ISystemFilterContainer)
- return (ISystemFilterContainer)input;
- else if (input instanceof ISystemFilterContainerReference)
- return ((ISystemFilterContainerReference)input).getReferencedSystemFilterContainer();
- else if (input instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference)input).getReferencedFilterPool();
- else if (parentPool != null)
- return parentPool;
- else if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0))
- return poolsToSelectFrom[0];
- else if (poolWrapperInformation != null)
- return poolWrapperInformation.getPreSelectWrapper().getSystemFilterPool();
- else
- return null;
- }
- else
- return null;
- }
- else
- return filterContainer;
- }
- /**
- * Set parent filter container to contain this filter
- */
- public void setFilterContainer(ISystemFilterContainer container)
- {
- this.filterContainer = container;
- }
- /**
- * Set parent filter container to contain this filter
- */
- public void setFilterContainer(ISystemFilterContainerReference containerRef)
- {
- this.filterContainer = containerRef.getReferencedSystemFilterContainer();
- }
-
- /**
- * Extendable point for child classes.
- * Override to create unique SystemFilter object.
- * By default calls createSystemFilter in subsystem factory.
- * @param shell the shell that hosts this wizard.
- * @param filterParent the parent of this filter - usually a filter pool
- * @param aliasName the name of the filter itself
- * @param filterStrings a Vector of string that contain the specification of this filter
- * @param type the type of the filter used when interpreting the filter, usually supplied by a subsystem
- * @return the ISystemFilter that was created
- * @throws Exception if an error occurs
- */
- public ISystemFilter createNewFilter(Shell shell, ISystemFilterContainer filterParent, String aliasName, Vector filterStrings, String type) throws Exception {
- ISystemFilter newFilter = null;
- ISystemFilterPoolManager fpMgr = filterParent.getSystemFilterPoolManager();
- if (type == null)
- newFilter = fpMgr.createSystemFilter(filterParent, aliasName, filterStrings);
- else
- newFilter = fpMgr.createSystemFilter(filterParent, aliasName, filterStrings, type);
- return newFilter;
- }
-
- // -----------------------
- // CALLBACKS FROM PAGES...
- // -----------------------
- /**
- * Return true if this filter is an RSE filter or not
- */
- protected boolean isFromRSE()
- {
- return fromRSE;
- }
- /**
- * For page 2 of the New Filter wizard, if it is possible to
- * deduce a reasonable default name from the user input here,
- * then return it here. Else, just return null.
- * <b>
- * By default this calls getDefaultFilterName on the edit pane.
- */
- public String getDefaultFilterName()
- {
- return mainPage.getEditPane(null).getDefaultFilterName();
- }
- // ------
- // OUTPUT
- // ------
- /**
- * Return the filter created upon successful finish
- */
- public ISystemFilter getSystemFilter()
- {
- return newFilter;
- }
-} // end class \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardConfigurator.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardConfigurator.java
deleted file mode 100644
index 990b0491b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardConfigurator.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-/**
- * Much of the new filter wizard is configurable, especially with respect to translated strings.
- * While there exists setters and overridable methods for most of it, sometimes that gets overwhelming.
- * This class is designed to capture all the configurable attributes that are not likely to change
- * from usage to usage of the wizard (eg, not context sensitive) such that for convenience you can
- * subclass it in a class and instantiate a singleton instance of that class to re-use in your
- * wizard.
- * <p>
- * Your best option is to subclass this and override just those things you want to change.
- */
-public class SystemNewFilterWizardConfigurator
- implements ISystemNewFilterWizardConfigurator, ISystemIconConstants
-{
- // cached attrs
- private String pageTitle;
- private String page1Description, page2Help, page3Tip1, page3Tip2;
-
- /**
- * Constructor for SystemNewFilterWizardConfigurator.
- */
- protected SystemNewFilterWizardConfigurator()
- {
- this(SystemResources.RESID_NEWFILTER_PAGE_TITLE);
- }
- /**
- * Constructor for SystemNewFilterWizardConfigurator when you want to change the page title
- */
- protected SystemNewFilterWizardConfigurator(String pageTitle)
- {
- super();
- this.pageTitle = pageTitle;
- this.page1Description = SystemResources.RESID_NEWFILTER_PAGE1_DESCRIPTION;
- this.page3Tip1 = SystemResources.RESID_NEWFILTER_PAGE3_STRINGS_VERBAGE;
- this.page3Tip2 = SystemResources.RESID_NEWFILTER_PAGE3_POOLS_VERBAGE;
- this.page2Help = RSEUIPlugin.HELPPREFIX + "nfp20000";
- }
-
- /**
- * Return the default page title to use for each page, unless overridden individually
- */
- public String getPageTitle()
- {
- return pageTitle;
- }
-
- /**
- * Return the page title for page 1 (which prompts for the filter string)
- */
- public String getPage1Title()
- {
- return pageTitle;
- }
-
- /**
- * Return the description for page 1 (which prompts for the filter string)
- */
- public String getPage1Description()
- {
- return page1Description;
- }
- /*page1 help of a wizard comes from the setDialogHelp of the wizard... so this is meaningless
- * Return the help ID for page 1
- *
- public String getPage1HelpID()
- {
- return RSEUIPlugin.HELPPREFIX + "nfp10000";
- }*/
-
- /**
- * Return the page title for page 2 (which prompts for the name and filter pool)
- */
- public String getPage2Title()
- {
- return pageTitle;
- }
- /**
- * Return the description for page 2 (which prompts for the name and filter pool)
- */
- public String getPage2Description()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_DESCRIPTION;
- }
- /**
- * Return the help ID for page 2
- */
- public String getPage2HelpID()
- {
- return page2Help;
- }
- /**
- * Return the verbage for the name prompt on page 2
- */
- public String getPage2NameVerbage()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_NAME_VERBAGE;
- }
- /**
- * Return the verbage for the name prompt on page 2
- */
- public String getPage2PoolVerbage()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_POOL_VERBAGE;
- }
- /**
- * Return the verbage tooltip for the name prompt on page 2
- */
- public String getPage2PoolVerbageTip()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_POOL_VERBAGE_TIP;
- }
-
- public String getPage2NamePromptLabel()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_NAME_LABEL;
- }
-
- public String getPage2NamePromptTooltip()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_NAME_TOOLTIP;
- }
-
- public String getPage2PoolPromptLabel()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_POOL_LABEL;
- }
-
- public String getPage2PoolPromptTooltip()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_POOL_TOOLTIP;
- }
-
- /**
- * Get the "Unique to this connection" checkbox label
- */
- public String getPage2UniqueToConnectionLabel()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_UNIQUE_LABEL;
- }
- /**
- * Set the "Unique to this connection" checkbox tooltip
- */
- public String getPage2UniqueToConnectionToolTip()
- {
- return SystemResources.RESID_NEWFILTER_PAGE2_UNIQUE_TOOLTIP;
- }
-
- /**
- * Return the page title for page 3 (which shows 2 tips)
- */
- public String getPage3Title()
- {
- return pageTitle;
- }
- /**
- * Return the description for page 3 (which shows 2 tips)
- */
- public String getPage3Description()
- {
- return SystemResources.RESID_NEWFILTER_PAGE3_DESCRIPTION;
- }
- /**
- * Return the description for page 3 (which shows 2 tips)
- */
- public String getPage3Tip1()
- {
- return page3Tip1;
- }
-
- /**
- * Return the second tip on page 3
- */
- public String getPage3Tip2()
- {
- return page3Tip2;
- }
-
-
-
- // -------
- // SETTERS
- // -------
- /**
- * Set the default page title. Sometimes this is all you want to change and don't want to subclass.
- */
- public void setPageTitle(String pageTitle)
- {
- this.pageTitle = pageTitle;
- }
- /**
- * Set the description for page 1
- */
- public void setPage1Description(String description)
- {
- this.page1Description = description;
- }
- /**
- * Set the help ID for page 2
- */
- public void setPage2HelpID(String helpId)
- {
- this.page2Help = helpId;
- }
- /**
- * Set the first tip to show for page 3
- */
- public void setPage3Tip1(String tip)
- {
- this.page3Tip1 = tip;
- }
- /**
- * Set the second tip to show for page 3
- */
- public void setPage3Tip2(String tip)
- {
- this.page3Tip2 = tip;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardInfoPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardInfoPage.java
deleted file mode 100644
index 7b6b99126..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardInfoPage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-
-/**
- * Third page of the New Filter wizard that simply shows information
- */
-public class SystemNewFilterWizardInfoPage
- extends AbstractSystemWizardPage
-{
- private ISystemNewFilterWizardConfigurator configurator;
-
- /**
- * Constructor.
- */
- public SystemNewFilterWizardInfoPage(SystemNewFilterWizard wizard, boolean filterPoolsShowing, ISystemNewFilterWizardConfigurator data)
- {
- super(wizard, "NewFilterPage3", data.getPage3Title(), data.getPage3Description());
- this.configurator = data;
- //setHelp(data.getPage3HelpID());
- }
- // ---------------------------------
- // LIFECYCLE METHODS...
- // ---------------------------------
-
- // ---------------------------------
- // LIFECYCLE METHODS...
- // ---------------------------------
-
- /**
- * Populate the dialog area with our widgets. Return the composite they are in.
- */
- public Control createContents(Composite parent)
- {
- int nbrColumns = 1;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- if (configurator.getPage3Tip1() != null)
- {
- SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage3Tip1(), nbrColumns, false, 200);
- addSeparatorLine(composite_prompts, nbrColumns);
- addFillerLine(composite_prompts, nbrColumns);
- }
-
- if (((SystemNewFilterWizard)getWizard()).isFromRSE())
- {
- if (configurator.getPage3Tip2() != null)
- SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage3Tip2(), nbrColumns, false, 200);
- }
-
- return composite_prompts;
- }
-
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return null;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return true
- */
- public boolean performFinish()
- {
- return true;
- }
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- * @return true
- */
- public boolean isPageComplete()
- {
- return true;
- }
-
- /**
- * Inform wizard of page-complete status of this page
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardMainPage.java
deleted file mode 100644
index 6dad5f22f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardMainPage.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import java.util.Vector;
-
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Main page of the abstract "New Filter" wizard.
- * This page's content is supplyable in the form of an "edit pane" which
- * essentially is reponsible for the content area of the wizard, and
- * which implements necessary minimal methods for this wizard to
- * interact with it.
- * <p>
- * As per the design goals of the filter wizard, this page effectively
- * only prompts to create a single new filter string. Thus, the
- * edit pane needed is in fact the "new filter string" edit pane.
- */
-
-public class SystemNewFilterWizardMainPage
- extends AbstractSystemWizardPage
- implements ISystemFilterStringEditPaneListener
- //,SystemFilterNewFilterWizardMainPageInterface, ISystemMessageLine
-{
- protected SystemFilterStringEditPane editPane;
- protected String type;
- protected String[] defaultFilterStrings;
- protected boolean firstVisit = true;
- private Control clientArea;
- /**
- * Constructor.
- * Uses the wizard page title as set in the overall wizard.
- * Uses a default wizard page description. Change later via setDescription if desired.
- * @param wizard - the parent new filter wizard
- * @param data - configurable mri data
- */
- public SystemNewFilterWizardMainPage(SystemNewFilterWizard wizard, ISystemNewFilterWizardConfigurator data)
-
- {
- super(wizard,"NewFilterPage1", data.getPage1Title(), data.getPage1Description());
- editPane = getEditPane(wizard.getShell());
- //setHelp(data.getPage1HelpID()); not used as it comes from wizard help
- }
- /**
- * Constructor when unique edit pane supplied
- * Uses the wizard page title as set in the overall wizard.
- * Uses a default wizard page description. Change later via setDescription if desired.
- * @param wizard - the parent new filter wizard
- * @param editPane - the edit pane that prompts the user for a single filter string
- * @param data - configurable mri data
- */
- public SystemNewFilterWizardMainPage(SystemNewFilterWizard wizard, SystemFilterStringEditPane editPane, ISystemNewFilterWizardConfigurator data)
-
- {
- super(wizard,"NewFilterPage1", data.getPage1Title(), data.getPage1Description());
- this.editPane = editPane;
- editPane.addChangeListener(this);
- //setHelp(data.getPage1HelpID()); not used as it comes from wizard help
- }
- /**
- * Set the contextual system filter pool reference manager provider. Ie, in the RSE this
- * is the currently selected subsystem if this wizard was launched from a subsystem.
- * <p>
- * Will be non-null if the current selection is a reference to a filter pool or filter,
- * or a reference manager provider.
- * <p>
- * This is not used by default but made available for subclasses.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- editPane.setSystemFilterPoolReferenceManagerProvider(provider);
- }
- /**
- * Overrride this if you want to supply your own edit pane for the filter string.
- */
- protected SystemFilterStringEditPane getEditPane(Shell shell)
- {
- if (editPane == null)
- editPane = new SystemFilterStringEditPane(shell);
- return editPane;
- }
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- */
- public Control createContents(Composite parent)
- {
- clientArea = editPane.createContents(parent);
- editPane.addChangeListener(this);
- return clientArea;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- SystemMessage errorMessage = editPane.verify();
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- return (errorMessage == null);
- }
-
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return editPane.getInitialFocusControl();
- }
- // ------------------------------------
- // METHODS FOR EXTRACTING USER DATA ...
- // ------------------------------------
- /**
- * Return the user-specified filter strings
- */
- public Vector getFilterStrings()
- {
- Vector v = new Vector();
-
- String userAddedString = editPane.getFilterString();
- if ((userAddedString !=null) && (userAddedString.length()>0))
- {
- if (!v.contains(userAddedString))
- v.add(userAddedString);
- }
- else if (defaultFilterStrings != null)
- {
- for (int idx=0; idx<defaultFilterStrings.length; idx++)
- {
- v.add(defaultFilterStrings[idx]);
- }
- }
- return v;
- //return editPane.getFilterStrings();
- }
- /**
- * Get the type of filter as set by {@link #setType(String)}
- */
- public String getType()
- {
- return type;
- }
- // -----------------------------------------
- // METHODS FOR SETTING/CONFIGURING INPUT ...
- // -----------------------------------------
- /**
- * Set the type of filter we are creating. Results in a call to setType on the new filter.
- * Types are not used by the base filter framework but are a way for tools to create typed
- * filters and have unique actions per filter type.
- */
- public void setType(String type)
- {
- this.type = type;
- editPane.setType(type);
- }
-
- /**
- * Supply the default set of filter strings this filter is to have.
- */
- public void setDefaultFilterStrings(String[] defaultFilterStrings)
- {
- this.defaultFilterStrings = defaultFilterStrings;
- if (editPane != null)
- {
- for (int i = 0; i < defaultFilterStrings.length; i++)
- {
- editPane.setFilterString(defaultFilterStrings[i], i);
- }
- }
- }
-
- // ----------------------------------------------
- // EDIT PANE CHANGE LISTENER INTERFACE METHODS...
- // ----------------------------------------------
- /**
- * Callback method. The user has changed the filter string. It may or may not
- * be valid. If not, the given message is non-null. If it is, and you want it,
- * call getSystemFilterString() in the edit pane.
- */
- public void filterStringChanged(SystemMessage message)
- {
- if (message != null)
- setErrorMessage(message);
- else
- clearErrorMessage();
- setPageComplete(message == null);
- }
- /**
- * Callback method. We are about to do a verify,the side effect of which is to
- * change the current state of the dialog, which we don't want. This tells the
- * dialog to back up that state so it can be restored.
- */
- public void backupChangedState()
- {
- }
- /**
- * Callback method. After backup and change events this is called to restore state
- */
- public void restoreChangedState()
- {
- }
-
- // -------------------------------
- // INTERCEPT OF WIZARDPAGE METHODS
- // -------------------------------
- /**
- * This is called when a page is given focus or loses focus
- */
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
- if (visible)
- {
- // ok, we don't want to issue a msg in the user's face the first time they see this page, but
- // after that when we get focus we verify the contents.
- // It is the job of that verify method in the edit pane to fire an event back to us as the result
- // of that verify. This results in a call to our filterStringChanged method above.
- if (!firstVisit)
- editPane.verify();
- else
- setPageComplete(editPane.isComplete());
- firstVisit = false;
- //System.out.println("Edit pane size = " + clientArea.getSize());
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardNamePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardNamePage.java
deleted file mode 100644
index 86ce30fe4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardNamePage.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolSelectionValidator;
-import org.eclipse.rse.core.filters.ISystemFilterPoolWrapper;
-import org.eclipse.rse.core.filters.ISystemFilterPoolWrapperInformation;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.wizards.AbstractSystemWizardPage;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-
-
-
-/**
- * Second page of the New Filter wizard that prompts for the name of the filter.
- */
-public class SystemNewFilterWizardNamePage
- extends AbstractSystemWizardPage
- implements SelectionListener
-{
-
- protected Text nameText;
- protected Button uniqueCB;
- protected Label poolVerbage;
- protected Label poolComboLabel;
- protected Combo poolWrapperCombo;
- protected Combo poolCombo;
- protected SystemMessage errorMessage;
- protected String inputFilterName;
- protected boolean contentsCreated;
- protected boolean userEditedName;
- protected boolean ignoreChanges;
- protected ISystemValidator nameValidator;
- protected ISystemValidator[] nameValidators;
- protected ISystemFilterPoolSelectionValidator filterPoolSelectionValidator;
- protected ISystemFilterPool[] poolsToSelectFrom = null;
- protected ISystemFilterPoolWrapper[] poolWrappers = null;
- protected ISystemFilterPoolWrapperInformation poolWrapperInformation;
- protected ISystemFilterPool parentPool = null;
- private ISystemNewFilterWizardConfigurator configurator;
-
- /**
- * Constructor.
- */
- public SystemNewFilterWizardNamePage(SystemNewFilterWizard wizard, ISystemFilterPool parentPool, ISystemNewFilterWizardConfigurator data)
- {
- super(wizard, "SetNewFilterName", data.getPage2Title(), data.getPage2Description());
- this.parentPool = parentPool;
- this.configurator = data;
- setHelp(data.getPage2HelpID());
- }
-
- // ---------------------------------
- // INPUT METHODS...
- // ---------------------------------
- /**
- * Set the filter name to default the entry field to
- */
- public void setFilterName(String filterName)
- {
- this.inputFilterName = filterName;
- if (nameText != null)
- nameText.setText(inputFilterName);
- }
- /**
- * Set the validator to use to verify the filter name is correct
- */
- public void setFilterNameValidator(ISystemValidator nameValidator)
- {
- this.nameValidator = nameValidator;
- }
- /**
- * Call if you want to allow the user to select the filter pool to create this filter in.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPool[] poolsToSelectFrom,
- ISystemValidator[] nameValidators)
- {
- this.poolsToSelectFrom = poolsToSelectFrom;
- this.nameValidators = nameValidators;
- if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0))
- {
- if (parentPool == null)
- parentPool = poolsToSelectFrom[0];
- }
- }
- /**
- * This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[], ISystemValidator[])}
- * <p>
- * If you want to prompt the user for the parent filter pool to create this filter in,
- * but want to not use the term "pool" say, you can use an array of euphamisms. That is,
- * you can pass an array of objects that map to filter pools, but have a different
- * display name that is shown in the dropdown.
- * <p>
- * Of course, if you want to do this, then you will likely want to offer a different
- * label and tooltip for the prompt, and different verbage above the prompt. The
- * object this method accepts as a parameter encapsulates all that information, and
- * there is a default class you can use for this.
- */
- public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolWrappersToSelectFrom,
- ISystemValidator[] nameValidators)
- {
- this.poolWrapperInformation = poolWrappersToSelectFrom;
- this.nameValidators = nameValidators;
- if (parentPool == null)
- parentPool = poolWrappersToSelectFrom.getPreSelectWrapper().getSystemFilterPool();
- }
- /**
- * Set the validator to call when the user selects a filter pool. Optional.
- */
- public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator)
- {
- filterPoolSelectionValidator = validator;
- //System.out.println("Inside setFilterPoolSelectionValidator. Non null? " + (validator != null));
- }
-
- // ---------------------------------
- // LIFECYCLE METHODS...
- // ---------------------------------
-
- /**
- * Populate the dialog area with our widgets. Return the composite they are in.
- */
- public Control createContents(Composite parent)
- {
-
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2NameVerbage(), nbrColumns, false, 200);
- nameText = SystemWidgetHelpers.createLabeledTextField(composite_prompts, null, configurator.getPage2NamePromptLabel(), configurator.getPage2NamePromptTooltip());
-
- addSeparatorLine(composite_prompts, nbrColumns);
- addFillerLine(composite_prompts, nbrColumns);
-
- // allow the user to create this filter uniquely for this connection, which means putting it in a
- // special filter pool we will create, just for this connection. This option is not shown if we are
- // already told which filter pool to create the filter in, such as in Show Filter Pools mode, when
- // the user selects New Filter to create a filter in the selected pool. We assume in this case the
- // will go in whatever filter is selected.
- if ((poolsToSelectFrom!=null) || (poolWrapperInformation!=null))
- {
- uniqueCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, configurator.getPage2UniqueToConnectionLabel(), null);
- uniqueCB.setToolTipText(configurator.getPage2UniqueToConnectionToolTip());
- uniqueCB.addSelectionListener(this);
- }
-
- addFillerLine(composite_prompts, nbrColumns);
-
- if (poolsToSelectFrom != null)
- {
- poolVerbage = SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2PoolVerbage(), nbrColumns, false, 200);
- poolVerbage.setToolTipText(configurator.getPage2PoolVerbageTip());
- poolCombo = SystemWidgetHelpers.createLabeledReadonlyCombo(composite_prompts, null, configurator.getPage2PoolPromptLabel(), configurator.getPage2PoolPromptTooltip());
- poolComboLabel = SystemWidgetHelpers.getLastLabel();
- String[] poolNames = new String[poolsToSelectFrom.length];
- int filterPoolSelectionIndex = 0;
- for (int idx=0; idx<poolNames.length; idx++)
- {
- ISystemFilterPool pool = poolsToSelectFrom[idx];
- if (pool == parentPool)
- filterPoolSelectionIndex = idx;
- poolNames[idx] = pool.getSystemFilterPoolManager().getName()+"."+pool.getName();
- }
- if ((nameValidator == null) && (nameValidators!=null))
- nameValidator = nameValidators[filterPoolSelectionIndex];
- poolCombo.setItems(poolNames);
- poolCombo.select(filterPoolSelectionIndex);
- poolCombo.addSelectionListener(this);
- if ((uniqueCB!=null) && uniqueCB.getSelection())
- {
- poolVerbage.setEnabled(false);
- poolComboLabel.setEnabled(false);
- poolCombo.setEnabled(false);
- }
- }
- else if (poolWrapperInformation != null)
- {
- poolVerbage = SystemWidgetHelpers.createVerbiage(composite_prompts, poolWrapperInformation.getVerbageLabel(), nbrColumns, false, 200);
- //poolWrapperCombo = SystemWidgetHelpers.createLabeledCombo(composite_prompts, null, poolWrapperInformation.getResourceBundle(), poolWrapperInformation.getPromptRBKey()); // d47323
- poolWrapperCombo = SystemWidgetHelpers.createLabeledReadonlyCombo(composite_prompts, null, poolWrapperInformation.getPromptLabel(), poolWrapperInformation.getPromptTooltip());
- poolComboLabel = SystemWidgetHelpers.getLastLabel();
- poolWrappers = poolWrapperInformation.getWrappers();
- String[] poolNames = new String[poolWrappers.length];
- int filterPoolSelectionIndex = 0;
- for (int idx=0; idx<poolNames.length; idx++)
- {
- if (poolWrapperInformation.getPreSelectWrapper() == poolWrappers[idx])
- filterPoolSelectionIndex = idx;
- poolNames[idx] = poolWrappers[idx].getDisplayName();
- }
- if ((nameValidator == null) && (nameValidators!=null))
- nameValidator = nameValidators[filterPoolSelectionIndex];
- poolWrapperCombo.setItems(poolNames);
- poolWrapperCombo.select(filterPoolSelectionIndex);
- poolWrapperCombo.addSelectionListener(this);
- if ((uniqueCB!=null) && uniqueCB.getSelection())
- {
- poolVerbage.setEnabled(false);
- poolComboLabel.setEnabled(false);
- poolWrapperCombo.setEnabled(false);
- }
- }
-
- // initialize inputs
- if (nameValidator != null)
- {
- int maxNameLength = nameValidator.getMaximumNameLength();
- if (maxNameLength >= 0)
- nameText.setTextLimit(maxNameLength);
- }
- if (inputFilterName != null)
- nameText.setText(inputFilterName);
-
- // add keystroke listeners...
- nameText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (ignoreChanges)
- return;
- userEditedName = true;
- validateNameInput();
- }
- }
- );
-
- setPageComplete();
- contentsCreated = true;
- return composite_prompts;
- }
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return nameText;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- if (!contentsCreated)
- return true;
- return (verify() == null);
- }
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = (errorMessage == null) && (nameText!=null);
- if (pageComplete)
- pageComplete = (nameText.getText().trim().length() > 0);
- return pageComplete;
- }
-
- /**
- * Inform caller of page-complete status of this page
- */
- public void setPageComplete()
- {
- setPageComplete(isPageComplete());
- }
- /**
- * User has selected something
- */
- public void widgetSelected(SelectionEvent e)
- {
- Object src = e.getSource();
- if (src == poolCombo)
- {
- int selection = poolCombo.getSelectionIndex();
- if ((selection >= 0) && (nameValidators!=null))
- nameValidator = nameValidators[selection];
- }
- else if (src == poolWrapperCombo)
- {
- int selection = poolWrapperCombo.getSelectionIndex();
- if ((selection >= 0) && (nameValidators!=null))
- nameValidator = nameValidators[selection];
- }
- else if (src == uniqueCB)
- {
- boolean selected = uniqueCB.getSelection();
- if (poolVerbage != null)
- poolVerbage.setEnabled(!selected);
- if (poolCombo != null)
- poolCombo.setEnabled(!selected);
- if (poolWrapperCombo != null)
- poolWrapperCombo.setEnabled(!selected);
- if (poolComboLabel != null)
- poolComboLabel.setEnabled(!selected);
- }
- verify();
- setPageComplete();
- }
- /**
- * User has selected something and pressed Enter
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- // ---------------------------------
- // VERIFICATION METHODS...
- // ---------------------------------
- /**
- * Verify all contents
- */
- public SystemMessage verify()
- {
- errorMessage = null;
- Control controlInError = null;
-
- if ((errorMessage == null) && (filterPoolSelectionValidator != null))
- {
- errorMessage = filterPoolSelectionValidator.validate(getParentSystemFilterPool());
- if (poolCombo != null)
- controlInError = poolCombo;
- else if (poolWrapperCombo != null)
- controlInError = poolCombo;
- }
- if ((errorMessage == null) && (nameValidator != null))
- {
- errorMessage = nameValidator.validate(nameText.getText().trim());
- controlInError = nameText;
- }
-
- if (errorMessage != null)
- {
- if (controlInError != null)
- controlInError.setFocus();
- setErrorMessage(errorMessage);
- }
- else
- clearErrorMessage();
- return errorMessage;
- }
- /**
- * This hook method is called whenever the text changes in the filter name input field.
- */
- protected SystemMessage validateNameInput()
- {
- errorMessage= null;
- if (nameValidator != null)
- errorMessage = nameValidator.validate(nameText.getText().trim());
- if ((errorMessage == null) && (filterPoolSelectionValidator != null))
- errorMessage = filterPoolSelectionValidator.validate(getParentSystemFilterPool());
- setPageComplete();
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- else
- clearErrorMessage();
- return errorMessage;
- }
-
-
- // ---------------------------------
- // METHODS FOR EXTRACTING USER DATA
- // ---------------------------------
- /**
- * Return name of filter
- * Call this after finish ends successfully.
- */
- public String getFilterName()
- {
- if (nameText != null)
- return nameText.getText().trim();
- else
- return inputFilterName;
- }
- /**
- * Return the filter pool that was explicitly chosen by the user,
- * or implicitly set by the caller.
- */
- public ISystemFilterPool getParentSystemFilterPool()
- {
- ISystemFilterPool pool = null;
- // do we prompt with a list of filter pools? Yes, just return selected...
- if (poolCombo != null)
- {
- int selection = poolCombo.getSelectionIndex();
- if (selection < 0)
- selection = 0;
- pool = poolsToSelectFrom[selection];
- }
- // do we prompt using a wrapper of some kind, such a profile or a command set,
- // from which we deduce the pool? If so, deduce pool from selected wrapper....
- else if (poolWrapperCombo != null)
- {
- int selection = poolWrapperCombo.getSelectionIndex();
- if (selection < 0)
- selection = 0;
- pool = poolWrappers[selection].getSystemFilterPool();
- }
- // else no prompt so we must have been given the explicit filter pool in which
- // to create this filter. Eg, in Show Filter Pools mode and the user selects a
- // filter pool and choose New Filter from it.
- else
- pool = parentPool;
- //System.out.println("Inside getParentSystemFilterPool. returning " + pool.getName());
- return pool;
- }
-
- /**
- * Return the user's decision whether to create this filter uniquely
- * for this connection, or for all applicable connections.
- */
- public boolean getUniqueToThisConnection()
- {
- if (uniqueCB != null)
- return uniqueCB.getSelection();
- else
- return false;
- }
-
- // -------------------------------
- // INTERCEPT OF WIZARDPAGE METHODS
- // -------------------------------
- /**
- * This is called when a page is given focus or loses focus
- */
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
- if (visible)
- {
- if (!userEditedName && (nameText!=null))
- {
- String defaultName = ((SystemNewFilterWizard)getWizard()).getDefaultFilterName();
- if (defaultName != null)
- {
- ignoreChanges = true;
- nameText.setText(defaultName);
- ignoreChanges = false;
- }
- }
- verify();
- //System.out.println("Wizard size = " + ((SystemNewFilterWizard)getWizard()).getShell().getSize());
- }
- }
-
- // --------------------------------------------------------------
- // ALL THE MRI ON THIS PAGE IS CONFIGURABLE. CALL HERE TO SET IT.
- // --------------------------------------------------------------
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemUnNamedFilterDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemUnNamedFilterDialog.java
deleted file mode 100644
index 05e7ff187..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/dialogs/SystemUnNamedFilterDialog.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.filters.dialogs;
-
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * A dialog that prompts the user for a single filter string, but not for the
- * purpose of creating a named filter. The output is that single filter string,
- * and the caller can do what they want with it.
- */
-
-public class SystemUnNamedFilterDialog extends SystemPromptDialog
- implements
- ISystemFilterStringEditPaneListener
-{
-
- protected SystemFilterStringEditPane editpane;
- protected String outputFilterString;
- // inputs
- protected ISystemFilterPoolReferenceManagerProvider provider;
- /**
- * Constructor
- */
- public SystemUnNamedFilterDialog(Shell shell)
- {
- this(shell, SystemResources.RESID_CRTFILTER_TITLE);
- }
- /**
- * Constructor, when unique title desired
- */
- public SystemUnNamedFilterDialog(Shell shell, String title)
- {
- super(shell, title);
- //this.parentPool = parentPool;
- //setMinimumSize(450, 350); // x, y
- //pack();
- setOutputObject(null);
- setHelp();
- }
-
- /**
- * Overridable extension point for setting dialog help. By default, there is no help
- */
- protected void setHelp()
- {
- }
- // -------------------
- // INPUT/CONFIGURATION
- // -------------------
- /**
- * Set the contextual system filter pool reference manager provider. Eg, in the RSE, this
- * will be the selected subsystem if the New Filter action is launched from there, or if
- * launched from a filter pool reference under there.
- * <p>
- * Will be non-null if the current selection is a reference to a filter pool or filter,
- * or a reference manager provider.
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- this.provider = provider;
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Inside setSystemFilterPoolReferenceManagerProvider. null? " + (provider==null));
- }
- /**
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editpane = editPane;
- }
-
- // -------------------
- // OUTPUT
- // -------------------
- /**
- * Return the string the user configured in this dialog.
- * Will return null if the user cancelled the dialog, so test with wasCancelled().
- */
- public String getFilterString()
- {
- return outputFilterString;
- }
-
-
- // LIFECYCLE
-
- /**
- * @see SystemPromptDialog#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return editpane.getInitialFocusControl();
- }
- /**
- * @see SystemPromptDialog#createInner(Composite)
- */
- protected Control createInner(Composite parent)
- {
- editpane = getFilterStringEditPane(getShell());
- editpane.setSystemFilterPoolReferenceManagerProvider(provider);
-
- // Edit pane is our whole content area
- Control composite = editpane.createContents(parent);
-
- // add listeners
- editpane.addChangeListener(this);
-
- return composite;
- }
- /**
- * Return our edit pane. Overriding this is an alternative to calling setEditPane.
- * This is called in createContents
- */
- protected SystemFilterStringEditPane getFilterStringEditPane(Shell shell)
- {
- if (editpane == null)
- editpane = new SystemFilterStringEditPane(shell);
- return editpane;
- }
-
- /**
- * Parent override.
- * Called when user presses OK button.
- * This is when we save all the changes the user made.
- */
- protected boolean processOK()
- {
- SystemMessage errorMessage = editpane.verify(); // should fire events back to us if there is an error
- if (errorMessage != null)
- return false;
- outputFilterString = editpane.getFilterString();
- return super.processOK();
- }
-
- /**
- * Parent override.
- * Called when user presses CLOSE button. We simply blow away all their changes!
- */
- protected boolean processCancel()
- {
- return super.processCancel();
- }
-
- /**
- * Override of parent method so we can direct it to the Apply button versus the OK button
- */
- public void setPageComplete(boolean complete)
- {
- }
-
- // ---------------
- // HELPER METHODS
- // ---------------
-
-
-
- // ----------------------------------------------
- // EDIT PANE CHANGE LISTENER INTERFACE METHODS...
- // ----------------------------------------------
- /**
- * Callback method. The user has changed the filter string. It may or may not
- * be valid. If not, the given message is non-null. If it is, and you want it,
- * call getSystemFilterString() in the edit pane.
- */
- public void filterStringChanged(SystemMessage message)
- {
- if (message != null)
- setErrorMessage(message);
- else
- clearErrorMessage();
- setPageComplete(message == null);
- }
- /**
- * Callback method. We are about to do a verify,the side effect of which is to
- * change the current state of the dialog, which we don't want. This tells the
- * dialog to back up that state so it can be restored.
- */
- public void backupChangedState()
- {
- }
- /**
- * Callback method. After backup and change events this is called to restore state
- */
- public void restoreChangedState()
- {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSESystemTypeAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSESystemTypeAdapterFactory.java
deleted file mode 100644
index e137d8e77..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSESystemTypeAdapterFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.ui.RSESystemTypeAdapter;
-
-public class RSESystemTypeAdapterFactory implements IAdapterFactory {
-
- private RSESystemTypeAdapter adapter = new RSESystemTypeAdapter();
-
- public RSESystemTypeAdapterFactory() {
- super();
- }
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof IRSESystemType) {
- return adapter;
- }
- else {
- return null;
- }
- }
-
- public Class[] getAdapterList() {
- return new Class[] {IRSESystemType.class};
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSEUIRegistry.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSEUIRegistry.java
deleted file mode 100644
index 841203673..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/internal/RSEUIRegistry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.ui.internal;
-
-import org.eclipse.rse.ui.IRSEUIRegistry;
-
-public class RSEUIRegistry implements IRSEUIRegistry {
-
- // the singleton instance
- private static RSEUIRegistry instance;
-
- /**
- * Constructor.
- */
- public RSEUIRegistry() {
- super();
- init();
- }
-
- /**
- * Initializes the registry. This should only be called from the constructor.
- */
- private void init() {
- }
-
- /**
- * Returns the singleton instance of the registry.
- * @return the singleton instance
- */
- public static final RSEUIRegistry getDefault() {
-
- if (instance == null) {
- instance = new RSEUIRegistry();
- }
-
- return instance;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLine.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLine.java
deleted file mode 100644
index 67906a929..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLine.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-/**
- * A message line interface. It distinguishs between "normal" messages and errors, as does the
- * DialogPage classes in eclipse.
- * <p>
- * For each of those, however, we also support both simple string msgs and more robust SystemMessage
- * messages. A dialog, wizard page or property page class that implements this interface will support
- * these by using getLevelOneText() to get the string for the first level text, and support mouse
- * clicking on the message to display the SystemMessageDialog class to show the 2nd level text.
- * <p>
- * Setting an error message hides a currently displayed message until
- * <code>clearErrorMessage</code> is called.
- */
-public interface ISystemMessageLine {
-
- /**
- * Clears the currently displayed error message and redisplayes
- * the non-error message which was active before the error message was set (if any).
- */
- public void clearErrorMessage();
-
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage();
-
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage();
-
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage();
-
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage();
-
- /**
- * Display the given error message. A currently displayed (non-error) message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message);
-
- /**
- * Display the given error message. A currently displayed (non-error) message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message);
-
- /**
- * Display the given exception as an error message. This is a convenience
- * method... a generic SystemMessage is used for exceptions.
- */
- public void setErrorMessage(Throwable exc);
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage.
- */
- public void setMessage(String message);
-
- /**
- * If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLineTarget.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLineTarget.java
deleted file mode 100644
index 5dfa23966..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/ISystemMessageLineTarget.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-/**
- * Implemented by any class that supports being passed an ISystemMessageLine to
- * target messages to. This is useful in re-usable forms so that the parent dialog
- * or wizard can pass in "this" in order to allow the form to issue messages.
- */
-public interface ISystemMessageLineTarget
-{
- /**
- * Set the message line to use for issuing messages
- */
- public void setMessageLine(ISystemMessageLine msgLine);
- /**
- * Get the message line to use for issuing messages
- */
- public ISystemMessageLine getMessageLine();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/StatusLineManagerAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/StatusLineManagerAdapter.java
deleted file mode 100644
index 4fadeb73b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/StatusLineManagerAdapter.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-
-/**
- * This class adapts the eclipse IStatusLineManager to an ISystemMessageLine.
- *
- * @author yantzi
- */
-public class StatusLineManagerAdapter implements ISystemMessageLine {
-
- private IStatusLineManager statusLine;
- private String message, errorMessage;
- private SystemMessage sysErrorMessage;
-
- /**
- * Constructor
- *
- * @param statusLineManager the status line manager to adapt to an ISystemMessageLine
- */
- public StatusLineManagerAdapter(IStatusLineManager statusLineManager)
- {
- this.statusLine = statusLineManager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#clearErrorMessage()
- */
- public void clearErrorMessage() {
- errorMessage = null;
- sysErrorMessage = null;
- if (statusLine != null)
- statusLine.setErrorMessage(errorMessage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#clearMessage()
- */
- public void clearMessage() {
- message = null;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#getErrorMessage()
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#getSystemErrorMessage()
- */
- public SystemMessage getSystemErrorMessage() {
- return sysErrorMessage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#getMessage()
- */
- public String getMessage() {
- return message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#setErrorMessage(java.lang.String)
- */
- public void setErrorMessage(String message) {
- this.errorMessage = message;
- if (statusLine != null)
- statusLine.setErrorMessage(message);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#setErrorMessage(org.eclipse.rse.core.ui.messages.SystemMessage)
- */
- public void setErrorMessage(SystemMessage message) {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#setErrorMessage(java.lang.Throwable)
- */
- public void setErrorMessage(Throwable exc) {
- setErrorMessage(exc.getMessage());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#setMessage(java.lang.String)
- */
- public void setMessage(String message) {
- this.message = message;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.messages.ISystemMessageLine#setMessage(org.eclipse.rse.core.ui.messages.SystemMessage)
- */
- public void setMessage(SystemMessage message) {
- setMessage(message.getLevelOneText());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemDialogPageMessageLine.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemDialogPageMessageLine.java
deleted file mode 100644
index 58491f1e5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemDialogPageMessageLine.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-
-/**
- * @deprecated
- * <p>DO NOT USE THIS CLASS!
- * <p>This class attempts to wrap the message constructs of eclipse provided property
- * and wizard pages with an ISystemMessageLine interface.
- * It fails to do this properly and is extremely fragile since it depends on knowledge
- * of the internal structure of eclipse provided windows.
- * <p>Use SystemMessageLine instead.
- * @link org.eclipse.rse.core.ui.messages.SystemMessageLine
- *
- */
-public class SystemDialogPageMessageLine implements ISystemMessageLine, MouseListener {
- // cached inputs
- private Label msgTextLabel;
- private Label msgIconLabel;
- private CLabel msgIconCLabel;
- private DialogPage dlgPage;
- // state
- private SystemMessage sysErrorMessage;
- private SystemMessage sysMessage;
- private boolean stringErrorMessageShowing = false;
-
- /**
- * Factory method for wizard pages.
- * We only need to configure a single message line for all pages in a given wizard,
- * so this method looks after ensuring there is only one such message line created.
- * @param wizardPage - the wizard page we are configuring
- */
- public static SystemDialogPageMessageLine createWizardMsgLine(WizardPage wizardPage) {
- SystemDialogPageMessageLine msgLine = null;
- Composite pageContainer = wizardPage.getControl().getParent();
- Object pageContainerData = null;
- //Object pageContainerData = pageContainer.getData();
- //System.out.println("pageContainerData = " + pageContainerData);
- if (pageContainerData == null) {
- // wizardPage.getControl() => returns the composite we created in createControl
- // .getParent() => returns the page container composite created in createPageContainer in WizardDialog, that holds all pages
- // .getParent() => returns the composite created in createDialogArea in TitleAreaDialog. The "dialog area" of the dialog below the top stuff, and above the button bar.
- // .getParent() => returns the workarea composite created in createContents in TitleAreaDialog
- // .getParent() => returns the parent composite passed to createContents in TitleAreaDialog
- // .getChildren() => returns the children of this composite, which includes the stuff at the top, which is placed
- // there by createTitleArea() in TitleAreaDialog, the parent of WizardDialog
- // [0]=> dialog image Label
- // [1]=> title Label
- // [2]=> message image Label
- // [3]=> message Label
- // [4]=> filler Label
- Composite dialogAreaComposite = pageContainer.getParent(); // see createDialogArea in WizardDialog
- Composite workAreaComposite = dialogAreaComposite.getParent(); // see createContents in TitleAreaDialog
- Composite mainComposite = workAreaComposite.getParent(); // whatever is passed into createContents in TitleAreaDialog
- Control[] list = mainComposite.getChildren();
- Label msgImageLabel = null;
- Label msgLabel = null;
- if (list[2] instanceof Label) {
- msgImageLabel = (Label) list[2];
- }
- if (list[3] instanceof Label) {
- msgLabel = (Label) list[3];
- } else if (list[4] instanceof Label) {
- msgLabel = (Label) list[4];
- }
- msgLine = new SystemDialogPageMessageLine(wizardPage, msgImageLabel, msgLabel);
- pageContainer.setData(msgLine);
- } else
- msgLine = (SystemDialogPageMessageLine) pageContainerData;
- return msgLine;
- }
-
- /**
- * Factory method for property pages.
- * We only need to configure a single message line for all pages in a properties dialog,
- * so this method looks after ensuring there is only one such message line created.
- * @param propertyPage - the property page we are configuring
- */
- public static SystemDialogPageMessageLine createPropertyPageMsgLine(PropertyPage propertyPage) {
- SystemDialogPageMessageLine msgLine = null;
- Composite pageContainer = propertyPage.getControl().getParent();
- // propertyPage.getControl() => returns the composite we created in createControl
- // .getParent() => returns the page container composite created in createPageContainer in PreferencesDialog, that holds all pages
- // .getParent() => returns the composite created in createDialogArea in PreferencesDialog. This holds the tree, title area composite, page container composite and separator
- // .getChildren()[1] => returns the title area parent composite, created in createDialogArea in PreferencesDialog
- // .getChildren()[0] => returns the title area composite, created in createTitleArea in PreferencesDialog
- // .getChildren() => returns the children of the title area composite
- // [0]=> message CLabel
- // [1]=> title image
- Composite dialogAreaComposite = pageContainer.getParent(); // see createDialogArea in PreferencesDialog
- Composite titleAreaParentComposite = (Composite) dialogAreaComposite.getChildren()[1];
- Composite titleAreaComposite = (Composite) titleAreaParentComposite.getChildren()[0];
- //Control[] list=titleAreaComposite.getChildren();
- // DKM - trying to figure out this mess for 3.0
- Composite listContainer = (Composite) titleAreaComposite.getChildren()[0];
- Control[] list = listContainer.getChildren();
- Label label1 = null;
- Label label2 = null;
- if (list.length > 0) {
- label1 = (Label) list[0];
- label2 = (Label) list[1];
- }
- msgLine = new SystemDialogPageMessageLine(propertyPage, /*(CLabel)list[0]*/label1, label2);
- pageContainer.setData(msgLine);
- return msgLine;
- }
-
- /**
- * Private constructor.
- */
- private SystemDialogPageMessageLine(DialogPage dialogPage, Label msgIconLabel, Label msgTextLabel) {
- this.msgIconLabel = msgIconLabel;
- this.msgTextLabel = msgTextLabel;
- this.dlgPage = dialogPage;
- msgIconLabel.addMouseListener(this);
- msgTextLabel.addMouseListener(this);
- }
-
- protected SystemMessage getSysErrorMessage() {
- return sysErrorMessage;
- }
-
- protected SystemMessage getSysMessage() {
- return sysMessage;
- }
-
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage() {
- return sysErrorMessage;
- }
-
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage() {
- sysErrorMessage = null;
- stringErrorMessageShowing = false;
- dlgPage.setErrorMessage(null);
- setIconToolTipText();
- }
-
- /**
- * Clears the currently displayed non-error message.
- */
- public void clearMessage() {
- dlgPage.setMessage(null);
- sysMessage = null;
- setIconToolTipText();
- }
-
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage() {
- return dlgPage.getErrorMessage();
- }
-
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage() {
- return dlgPage.getMessage();
- }
-
- /**
- * DO NOT CALL THIS METHOD! IT IS ONLY HERE BECAUSE THE INTERFACE NEEDS IT.
- * RATHER, CALL THE SAME MSG THAT DIALOGPAGE NOW SUPPORTS, AND THEN CALL
- * setInternalErrorMessage HERE. WE HAVE TO AVOID INFINITE LOOPS.
- */
- public void setErrorMessage(String emessage) {
- internalSetErrorMessage(emessage);
- //dlgPage.setErrorMessage(emessage);
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage emessage) {
- // I removed @deprecated... I think it was a mistake! What would be the replacement? Phil
- if (emessage == null)
- clearErrorMessage();
- else {
- dlgPage.setErrorMessage(getMessageText(emessage));
- stringErrorMessageShowing = false;
- sysErrorMessage = emessage;
- logMessage(emessage);
- }
- setIconToolTipText();
- }
-
- /**
- * Convenience method to set an error message from an exception
- */
- public void setErrorMessage(Throwable exc) {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED);
- msg.makeSubstitution(exc);
- setErrorMessage(msg);
- }
-
- /**
- * DO NOT CALL THIS METHOD! IT IS ONLY HERE BECAUSE THE INTERFACE NEEDS IT.
- * RATHER, CALL THE SAME MSG THAT DIALOGPAGE NOW SUPPORTS, AND THEN CALL
- * setInternalMessage HERE. WE HAVE TO AVOID INFINITE LOOPS.
- */
- public void setMessage(String msg) {
- internalSetMessage(msg);
- dlgPage.setMessage(msg);
- }
-
- /**
- * Set a non-error message to display.
- * If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage smessage) {
- if (smessage == null) {
- clearMessage(); // phil
- return;
- }
- sysMessage = smessage;
- int msgType = IMessageProvider.NONE;
- if ((smessage.getIndicator() == SystemMessage.ERROR) || (smessage.getIndicator() == SystemMessage.UNEXPECTED))
- msgType = IMessageProvider.ERROR;
- else if (smessage.getIndicator() == SystemMessage.WARNING)
- msgType = IMessageProvider.WARNING;
- else if (smessage.getIndicator() == SystemMessage.INFORMATION || (smessage.getIndicator() == SystemMessage.COMPLETION)) msgType = IMessageProvider.INFORMATION;
- dlgPage.setMessage(getMessageText(smessage), msgType);
- logMessage(smessage);
- setIconToolTipText();
- }
-
- /**
- * logs the message in the appropriate log
- */
- private void logMessage(SystemMessage message) {
- Object[] subList = message.getSubVariables();
- for (int i = 0; subList != null && i < subList.length; i++) {
- String msg = message.getFullMessageID() + ": SUB#" + new Integer(i).toString() + ":" + message.getSubValue(subList[i]);
- if (message.getIndicator() == SystemMessage.INFORMATION || message.getIndicator() == SystemMessage.INQUIRY || message.getIndicator() == SystemMessage.COMPLETION)
- SystemBasePlugin.logInfo(msg);
- else if (message.getIndicator() == SystemMessage.WARNING)
- SystemBasePlugin.logWarning(msg);
- else if (message.getIndicator() == SystemMessage.ERROR)
- SystemBasePlugin.logError(msg, null);
- else if (message.getIndicator() == SystemMessage.UNEXPECTED) {
- if (i == subList.length - 1)
- SystemBasePlugin.logError(msg, new Exception());
- else
- SystemBasePlugin.logError(msg, null);
- }
- }
- if (subList == null) {
- String msg = message.getFullMessageID();
- if (message.getIndicator() == SystemMessage.INFORMATION || message.getIndicator() == SystemMessage.INQUIRY || message.getIndicator() == SystemMessage.COMPLETION)
- SystemBasePlugin.logInfo(msg);
- else if (message.getIndicator() == SystemMessage.WARNING)
- SystemBasePlugin.logWarning(msg);
- else if (message.getIndicator() == SystemMessage.ERROR)
- SystemBasePlugin.logError(msg, null);
- else if (message.getIndicator() == SystemMessage.UNEXPECTED) SystemBasePlugin.logError(msg, new Exception());
- }
- }
-
- // METHODS THAT NEED TO BE CALLED BY DIALOGPAGE IN THEIR OVERRIDE OF SETMESSAGE OR SETERRORMESSAGE
- /**
- * Someone has called setMessage(String) on the dialog page. It needs to then call this method
- * after calling super.setMessage(String) so we can keep track of what is happening.
- */
- public void internalSetMessage(String msg) {
- sysMessage = null; // overrides it if it was set
- setIconToolTipText();
- }
-
- /**
- * Someone has called setErrorMessage(String) on the dialog page. It needs to then call this method
- * after calling super.setErrorMessage(String) so we can keep track of what is happening.
- */
- public void internalSetErrorMessage(String msg) {
- sysErrorMessage = null; // overrides if it was set
- stringErrorMessageShowing = (msg != null);
- setIconToolTipText();
- }
-
- // MOUSeListener INTERFACE METHODS...
- /**
- * User double clicked with the mouse
- */
- public void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * User pressed the mouse button
- */
- public void mouseDown(MouseEvent event) {
- }
-
- /**
- * User released the mouse button after pressing it
- */
- public void mouseUp(MouseEvent event) {
- displayMessageDialog();
- }
-
- /**
- * Method to return the current system message to display. If error message is set, return it,
- * else return message.
- */
- public SystemMessage getCurrentMessage() {
- if (sysErrorMessage != null)
- return sysErrorMessage;
- else if (!stringErrorMessageShowing)
- return sysMessage;
- else
- return null;
- }
-
- /**
- * Method to display an error message when the msg button is clicked
- */
- private void displayMessageDialog() {
- SystemMessage currentMessage = getCurrentMessage();
- if (currentMessage != null) {
- SystemMessageDialog msgDlg = new SystemMessageDialog(dlgPage.getShell(), currentMessage);
- msgDlg.openWithDetails();
- }
- }
-
- /**
- * Method to set the tooltip text on the msg icon to tell the user they can press it for more details
- */
- private void setIconToolTipText() {
- SystemMessage msg = getCurrentMessage();
- String tip = "";
- if (msg != null) {
- //String levelTwo = msg.getLevelTwoText();
- //if ((levelTwo!=null) && (levelTwo.length()>0))
- tip = msg.getFullMessageID() + " " + SystemResources.RESID_MSGLINE_TIP;
- }
- if (msgIconLabel != null) msgIconLabel.setToolTipText(tip);
- if (msgTextLabel != null)
- msgTextLabel.setToolTipText(tip);
- else
- msgIconCLabel.setToolTipText(tip);
- }
-
- /**
- * Return the message text to display in the title area, given a system message
- */
- private String getMessageText(SystemMessage msg) {
- //return msg.getFullMessageID()+" " + msg.getLevelOneText();
- return msg.getLevelOneText();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java
deleted file mode 100644
index 127b360f8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageDialog.java
+++ /dev/null
@@ -1,804 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-
-/**
- */
-public class SystemMessageDialog extends ErrorDialog implements Listener {
-
- /**
- * Reserve room for this many list items.
- */
- private static final int LIST_ITEM_COUNT = 5;
-
- /**
- * The Details button.
- */
- private Button detailsButton=null;
- /**
- * The title of the dialog.
- */
- private String title;
-
- /**
- * The message to display.
- */
- private SystemMessage message;
-
- /**
- * Exception being reported and logged
- */
- private Throwable exc;
-
-
- /**
- * The SWT list control that displays the error details.
- */
- private Text list;
-
-
- /**
- * Indicates whether the error details viewer is currently created.
- */
- private boolean listCreated = false;
-
-
- /**
- * Filter mask for determining which status items to display.
- */
- private int displayMask = 0xFFFF;
-
-
- /**
- * The main status object.
- */
- private IStatus status;
-
-
- /**
- * List of the main error object's detailed errors
- * (element type: <code>IStatus</code>).
- */
- private java.util.List statusList;
-
- /**
- * the image to use when displaying the message
- */
- // private String imageName;
- private int imageId;
-
- /**
- * show the details panel
- */
- private boolean showDetails=false;
-
- /**
- * buttons for button area
- */
- private String []buttons=null;
-
- /**
- * default button
- */
- private int defaultIndex=0;
-
- /**
- * button id number for the first button in the button bar.<p>
- * The second button, would have an id of buttonId+1 etc.
- */
- public static final int BUTTON_ID=1000;
-
- /**
- * button pressed to dismiss the dialog
- */
- private int buttonIdPressed;
-
- /**
- * whether or not to open the dialog with the yes/no buttons
- */
- private boolean yesNoButtons=false;
-
- /**
- * whether or not to open the dialog with the yes/no/cancel buttons
- */
- private boolean yesNoCancelButtons=false;
-
- protected boolean noShowAgainOption;
- protected Button noShowAgainButton;
-
- // preference stuff for option to not show the dialog again
- protected IPreferenceStore prefStore;
- protected String prefId;
- protected boolean prefValAsSelected;
-
- /**
- * Creates an error dialog.
- * Note that the dialog will have no visual representation (no widgets)
- * until it is told to open.
- * @param parentShell the shell under which to create this dialog
- * @param message the message to display in the dialog
- */
- public SystemMessageDialog(Shell parentShell, SystemMessage message)
- {
- this(parentShell,
- message.getFullMessageID(),
- message.getLevelOneText(),
- (new MultiStatus(SystemBasePlugin.getBaseDefault().getSymbolicName(), IStatus.OK, "", new Exception(""))),
- 0xFFFFF);
- ((MultiStatus)this.status).add(new Status(IStatus.INFO, SystemBasePlugin.getBaseDefault().getSymbolicName(), IStatus.OK, message.getLevelTwoText(), new Exception("")));
- statusList = Arrays.asList(status.getChildren());
- this.message=message;
- initImage(message);
- }
-
- private SystemMessageDialog(Shell parentShell, String dialogTitle, String message,
- IStatus status, int displayMask)
- {
- super(parentShell, dialogTitle, message, status, displayMask);
- this.title = (dialogTitle == null) ? JFaceResources.getString("Problem_Occurred"): //$NON-NLS-1$
- dialogTitle;
- this.status = status;
- statusList = Arrays.asList(status.getChildren());
- this.displayMask = displayMask;
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
- }
-
- private void initImage(SystemMessage message)
- {
- // setup image
- if (message.getIndicator()==SystemMessage.INFORMATION ||
- message.getIndicator()==SystemMessage.COMPLETION)
- //imageName=DLG_IMG_INFO;
- imageId = SWT.ICON_INFORMATION;
- else if (message.getIndicator()==SystemMessage.INQUIRY)
- //imageName=DLG_IMG_QUESTION;
- imageId = SWT.ICON_QUESTION;
- else if (message.getIndicator()==SystemMessage.ERROR ||
- message.getIndicator()==SystemMessage.UNEXPECTED)
- //imageName=DLG_IMG_ERROR;
- imageId = SWT.ICON_ERROR;
- else if (message.getIndicator()==SystemMessage.WARNING)
- //imageName=DLG_IMG_WARNING;
- imageId = SWT.ICON_WARNING;
- }
-
-
- /* Handles the pressing of the Ok, Details or any button in this dialog.
- * If the Ok button was pressed then close this dialog. If the Details
- * button was pressed then toggle the displaying of the error details area.
- */
- protected void buttonPressed(int id)
- {
- if (id == IDialogConstants.DETAILS_ID) // was the details button pressed?
- toggleDetailsArea();
- else
- {
- super.buttonPressed(id);
- close();
- }
- buttonIdPressed=id;
- }
-
- /*
- * Creates the buttons for the button bar.
- * If the message is an inquiry
- * message or yes/no buttons are explicitly requested then Yes, No, and
- * perhaps Cancel are the preferred buttons.
- * Otherwise, if there are buttons supplied by the client use those.
- * Otherwise if no buttons are supplied, just supply an OK button.
- * A Details button is suppled if the message indicates that it has any
- * significant details. In particular, test to see that the details length is
- * greater than 2. This disqualifies using %2 and getting details for some
- * reason.
- * d58252 - re-ordered tests to make logic easier to read. Set initial focus
- * on the default button since it would normally be on the message which is
- * now read-only text.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- if ( yesNoButtons || yesNoCancelButtons || (message.getIndicator()==SystemMessage.INQUIRY) ) {
- boolean yesDefault=(defaultIndex==0);
- boolean noDefault=(defaultIndex==1);
- boolean cancelDefault=(defaultIndex==2);
- createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, yesDefault);
- createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, noDefault);
- if (yesNoCancelButtons) {
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, cancelDefault);
- }
- if (yesDefault) {
- getButton(IDialogConstants.YES_ID).setFocus();
- } else if (noDefault) {
- getButton(IDialogConstants.NO_ID).setFocus();
- } else if (cancelDefault) {
- getButton(IDialogConstants.CANCEL_ID).setFocus();
- }
- } else if (buttons!=null) {
- for (int i=0; i<buttons.length; i++) {
- boolean defaultButton=(i==defaultIndex);
- createButton(parent, BUTTON_ID+i, buttons[i], defaultButton);
- if (defaultButton) {
- getButton(BUTTON_ID+i).setFocus();
- }
- }
- } else {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- getButton(IDialogConstants.OK_ID).setFocus();
- }
- if (status.isMultiStatus() && message != null && message.getLevelTwoText() != null && message.getLevelTwoText().length() > 2) {
- detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false);
- if (showDetails) {
- toggleDetailsArea2(parent);
- }
- }
- }
-
- /*
- * Creates and returns the contents of the upper part
- * of the dialog (above the button bar).
- * d58252 - fixed dialog layout to allow resize of message area for long message,
- * made message area a read-only text for accessibility reasons.
- */
- protected Control createDialogArea(Composite parent) {
- // create composite
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- ((GridLayout)composite.getLayout()).numColumns = 2;
-
- // create image
- Image image = getShell().getDisplay().getSystemImage(imageId);
- if (image != null) {
- Label label = new Label(composite, 0);
- image.setBackground(label.getBackground());
- label.setImage(image);
- label.setLayoutData(new GridData(
- GridData.HORIZONTAL_ALIGN_CENTER |
- GridData.VERTICAL_ALIGN_BEGINNING));
- }
-
- // create message, this is a read-only text field so it is tab enabled by
- // default for accessibility reasons
- if (message != null) {
- Text messageArea = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
- messageArea.setText(message.getLevelOneText());
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, true);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- messageArea.setLayoutData(data);
- }
-
- // if user wants the option to not show the dialog again
- if (noShowAgainOption) {
- Label l = new Label(composite, SWT.NONE);
- l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER, GridData.VERTICAL_ALIGN_CENTER));
- noShowAgainButton = createNoShowAgainButton(composite);
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, true);
- noShowAgainButton.setLayoutData(data);
- }
-
-// composite.pack(true);
- return composite;
- }
- /**
- * Create this dialog's drop-down list component.
- *
- * @param parent the parent composite
- * @return the drop-down list component
- */
- protected Text createDropDownList2(Composite parent)
- {
- // create the list
- list = new Text(parent, SWT.READ_ONLY | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL );
-
- GridData data = new GridData(
- GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL |
- GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- data.heightHint = list.getLineHeight() * LIST_ITEM_COUNT;
- data.widthHint= getDialogArea().getSize().x;
- list.setLayoutData(data);
- listCreated = true;
- // fill the list
- populateList(list);
-
- return list;
- }
-
- /**
- * When the message involves an exception for which we want to log the stack,
- * set that exception here.
- */
- public void setException(Throwable exc)
- {
- this.exc = exc;
- }
-
- /**
- * logs the message in the appropriate log
- */
- private void LogMessage()
- {
- Object[] subList=message.getSubVariables();
- for (int i=0; subList!=null && i<subList.length; i++)
- {
- String msg=message.getFullMessageID()+": SUB#"+new Integer(i).toString()+":"+message.getSubValue(subList[i]);
- if (message.getIndicator()==SystemMessage.INFORMATION ||
- message.getIndicator()==SystemMessage.COMPLETION ||
- message.getIndicator()==SystemMessage.INQUIRY)
- {
- SystemBasePlugin.logInfo(msg);
- if (i==subList.length-1 && message.getIndicator()==SystemMessage.INQUIRY)
- SystemBasePlugin.logInfo(message.getFullMessageID()+" :Button ID Pressed:"+buttonIdPressed);
- }
- else if (message.getIndicator()==SystemMessage.WARNING)
- SystemBasePlugin.logWarning(msg);
- else if (message.getIndicator()==SystemMessage.ERROR)
- SystemBasePlugin.logError(msg, null);
- else if (message.getIndicator()==SystemMessage.UNEXPECTED)
- {
- if (i==subList.length-1)
- SystemBasePlugin.logError(msg, (exc!=null) ? exc : new Exception());
- else
- SystemBasePlugin.logError(msg, null);
- }
- }
- if (subList==null)
- {
- String msg=message.getFullMessageID();
- if (message.getIndicator()==SystemMessage.INFORMATION ||
- message.getIndicator()==SystemMessage.COMPLETION ||
- message.getIndicator()==SystemMessage.INQUIRY)
- SystemBasePlugin.logInfo(msg);
- else if (message.getIndicator()==SystemMessage.WARNING)
- SystemBasePlugin.logWarning(msg);
- else if (message.getIndicator()==SystemMessage.ERROR)
- SystemBasePlugin.logError(msg, null);
- else if (message.getIndicator()==SystemMessage.UNEXPECTED)
- SystemBasePlugin.logError(msg, (exc!=null) ? exc : new Exception());
- }
- }
-
- /**
- * Opens the message dialog to display the message.
- */
- public int open()
- {
- if (!showDetails)
- LogMessage();
- return super.open();
- }
-
- /**
- * Opens the message dialog with the details showing to display the message.
- */
- public int openWithDetails()
- {
- showDetails=true;
- return open();
- }
-
- /**
- * Opens the message dialog with the details showing to display an exception, if that is
- * the root cause of the message.
- * <p>
- * Also logs the first level text plus exception.
- */
- public int openWithDetails(Exception exc)
- {
- showDetails=true;
- SystemBasePlugin.logError(message.getLevelOneText(), exc);
- return open();
- }
-
- /**
- * opens the dialog with Yes, No, Details button for an Inquiry/Question message
- * Throws an IndicatorException if the message is not an Inquiry message
- * returns true if Yes was pressed, False if No was pressed.
- */
- public boolean openQuestion() throws IndicatorException
- {
- if (message.getIndicator()!=SystemMessage.INQUIRY)
- throw new IndicatorException("Message "+message.getFullMessageID()+" is not an inquiry message.");
- yesNoButtons=true;
- open();
- return (buttonIdPressed==IDialogConstants.YES_ID);
- }
- /**
- * opens the dialog with Yes, No, Details button for an Inquiry/Question message.
- * Eats up the IndicatorException, so only call this when you know what you are doing!
- */
- public boolean openQuestionNoException()
- {
- yesNoButtons=true;
- open();
- return (buttonIdPressed==IDialogConstants.YES_ID);
- }
-
- /**
- * opens the dialog with Yes, No, Cancel Details for an Inquiry/Question message
- * throws an IndicatorException if the indicator is not Inquiry
- * @return IDialogConstants.YES_ID or NO_ID
- */
- public int openYesNoCancel()
- {
- yesNoCancelButtons=true;
- return open();
- }
-
- /**
- * returns the id of the button pressed
- */
- public int getButtonPressedId()
- {
- return buttonIdPressed;
- }
-
- /**
- * overrides the default button selection.
- * @param buttonList an array of buttons for the button bar
- */
- public void setButtons(String [] buttonList)
- {
- buttons=buttonList;
- }
- /**
- * sets the default button for the message.
- * Use this method if you wan to override the default button (the first one)
- * @param buttonIndex the 0-based index of the button
- */
- public void setButtonIndex(int buttonIndex)
- {
- defaultIndex=buttonIndex;
- }
-
-
-
-
- /**
- * Populates the list using this error dialog's status object.
- * This walks the child stati of the status object and
- * displays them in a list. The format for each entry is
- * status_path : status_message
- * If the status's path was null then it (and the colon)
- * are omitted.
- */
- private void populateList(Text list)
- {
- Iterator z = statusList.iterator();
- while (z.hasNext())
- {
- IStatus childStatus = (IStatus) z.next();
- populateList(list, childStatus, 0);
- }
- }
-
-
-
- private void populateList(Text list, IStatus status, int nesting)
- {
- if (!status.matches(displayMask))
- {
- return;
- }
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nesting; i++)
- {
- sb.append(" ");
- }
- sb.append(status.getMessage());
- list.append(sb.toString());
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- list.append("\n");
- populateList(list, children[i], nesting + 1);
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by
- * the user pressing the details button.
- */
- private void toggleDetailsArea()
- {
- Point windowSize = getShell().getSize();
- Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (listCreated)
- {
- list.dispose();
- listCreated = false;
- detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- }
- else
- {
- list = createDropDownList2((Composite)getContents());
- detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
- Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- // yantzi:5.1.2 this leaves a gap at the bottom of the dialog when opened with details,
- // why not just set it to the newSize.y?
- //getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- getShell().setSize(new Point(windowSize.x, newSize.y));
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by
- * open using openWithDetails.
- */
- private void toggleDetailsArea2(Composite composite)
- {
- Point windowSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point oldSize = getDialogArea().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- list = createDropDownList2(composite.getParent());
- detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- Point newSize = composite.getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point buttonSize=composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- // yantzi:5.1.2 this leaves a gap at the bottom of the dialog when opened with details,
- // why not just set it to the newSize.y?
- //getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y-buttonSize.y)));
- getShell().setSize(new Point(windowSize.x, newSize.y));
- }
-
- /**
- * Keeping for posterity. Phil.
- */
- public static Shell getDefaultShell()
- {
- return Display.getCurrent().getActiveShell();
- }
-
- /**
- * For ease of use for simple messages with no response from user.
- */
- public static void displayErrorMessage(Shell shell, SystemMessage msg)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.open();
- }
-
- /**
- * For ease of use for simple messages which are the result of an exception
- */
- public static void displayErrorMessage(Shell shell, SystemMessage msg, Exception exc)
- {
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.setException(exc);
- msgDlg.open();
- }
-
- /**
- * For ease of use for simple error message text with no response from user.
- */
- public static void displayErrorMessage(Shell shell, String msgText)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_E);
- msg.makeSubstitution(msgText);
- displayErrorMessage(shell,msg);
- }
-
- /**
- * For ease of use for simple message text with no response from user.
- */
- public static void displayMessage(Shell shell, String msgText)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_I);
- msg.makeSubstitution(msgText);
- displayErrorMessage(shell,msg);
- }
-
-
-
- /**
- * Display this wrapped system message to the user
- */
- public static void displayMessage(org.eclipse.swt.widgets.Shell shell, SystemMessageException msgEx)
- {
- if (msgEx != null)
- SystemMessageDialog.displayErrorMessage(shell, msgEx.getSystemMessage());
- }
-
- /**
- * For ease of use for simple host error messages that are xlated already.
- */
- public static void displayHostErrorMessage(Shell shell, String hostMsg)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_E);
- msg.makeSubstitution(hostMsg);
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.open();
- }
-
- /**
- * For ease of use for simple host error messages that are xlated already,
- * and which have 2nd level text.
- */
- public static void displayHostErrorMessage(Shell shell, String hostMsg, String levelTwo)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_E_HELP);
- msg.makeSubstitution(hostMsg,levelTwo);
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.open();
- }
-
- /**
- * For ease of use for simple host warning messages that are xlated already.
- */
- public static void displayHostWarningMessage(Shell shell, String hostMsg)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_W);
- msg.makeSubstitution(hostMsg);
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.open();
- }
-
- /**
- * For ease of use for simple host warning messages that are xlated already,
- * and which have 2nd level text.
- */
- public static void displayHostWarningMessage(Shell shell, String hostMsg, String levelTwo)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_W_HELP);
- msg.makeSubstitution(hostMsg,levelTwo);
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.open();
- }
-
- /**
- * For displaying a generic error message when an unexpected exception happens.
- */
- public static void displayExceptionMessage(Shell shell, Exception exc)
- {
- SystemMessage msg = getExceptionMessage(shell, exc);
- if ((shell == null) && (Display.getCurrent()!=null))
- shell = Display.getCurrent().getActiveShell();
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.setException(exc);
- msgDlg.open();
- }
-
-
- /**
- * When an exception occurs and you want to turn it into a SystemMessage,
- * call this...
- */
- public static SystemMessage getExceptionMessage(Shell shell, Exception exc)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED);
- msg.makeSubstitution(exc);
- return msg;
- }
-
- /**
- * Put up an error message when the error msg framework itself doesn't work.
- */
- public static void showExceptionMessage(Shell shell, String msg, Exception exc)
- {
- org.eclipse.swt.widgets.MessageBox mb = new org.eclipse.swt.widgets.MessageBox(null);
- //mb.setTitle("Remote Systems Programming Error");
- mb.setMessage(msg);
- mb.open();
- SystemBasePlugin.logError(msg,exc);
- }
-
- /**
- * Show this message in the message dialog. We polymorphically show the right message dialog,
- * by querying the message type.
- * @return true if this is a question message, and user presses Yes.
- */
- public static boolean show(Shell shell, SystemMessage msg)
- {
- boolean yes = false;
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
-
- if (msg.getIndicator() != SystemMessage.INQUIRY)
- msgDlg.open();
- else
- yes = msgDlg.openQuestionNoException();
- return yes;
- }
-
- /**
- * Set option to not show this dialog again and specify the preference that should be set
- * according to whether the user selects to show the dialog again or no. The caller can
- * query this preference to find out what the user selection is.
- * @param noShowAgainOption <code>true</code> to show the option in the dialog, <code>false</code> to not show it.
- * @param prefStore the preference store.
- * @param prefId the preference id for which a boolean value will be stored according to the user's selection.
- * @param prefValAsSelected whether to mirror the user selection in the preference. If this is set to
- * <code>true</code>, then the value stored in the preference is <code>true</code> if the user selects the option,
- * and <code>false</code> if the user does not select the option. If this is set to <code>false</code>, then the
- * value stored in the preference will be <code>false</code> if the user selects the option, and <code>true</code>
- * if the user does not select the option
- */
- public void setNoShowAgainOption(boolean noShowAgainOption, IPreferenceStore prefStore, String prefId, boolean prefValAsSelected) {
- this.noShowAgainOption = noShowAgainOption;
- this.prefStore = prefStore;
- this.prefId = prefId;
- this.prefValAsSelected = prefValAsSelected;
- }
-
- /**
- * Creates a button to allow option to not show this dialog again.
- * @return the button that allows option to not show this dialog again.
- */
- protected Button createNoShowAgainButton(Composite c) {
- Button b = new Button(c, SWT.CHECK);
- b.setText(SystemResources.RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL);
- b.setToolTipText(SystemResources.RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP);
- b.addListener(SWT.Selection, this);
- return b;
- }
-
- /**
- * Handles events generated by controls on this page.
- * Should be overridden by child.
- * Only public because of interface requirement!
- */
- public void handleEvent(Event e)
- {
- if (e.type == SWT.Selection) {
-
- if (e.widget == noShowAgainButton) {
- boolean isNoShowSelected = noShowAgainButton.getSelection();
-
- if ((prefStore != null) && (prefId != null)) {
-
- if (prefValAsSelected) {
- prefStore.setValue(prefId, isNoShowSelected);
- }
- else {
- prefStore.setValue(prefId, !isNoShowSelected);
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageLine.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageLine.java
deleted file mode 100644
index 2a9ec22a3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageLine.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemThemeConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A message line. It distinguishs between "normal" messages and errors.
- * Setting an error message hides a currently displayed message until
- * <code>clearErrorMessage</code> is called.
- */
-public class SystemMessageLine extends Composite implements ISystemMessageLine {
-
- private Button moreButton;
- private Label image;
- private Text widget;
- private MyMessage infoMessage = null;
- private MyMessage errorMessage = null;
- private static final int ERROR = 3;
- private static final int WARNING = 2;
- private static final int INFO = 1;
- private static final int NONE = 0;
-
- private abstract class MyMessage {
- /**
- * @return The Image of the message based on its type.
- */
- Image getImage() {
- int type = getType();
- switch (type) {
- case ERROR:
- return JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_ERROR);
- case WARNING:
- return JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_WARNING);
- case INFO:
- return JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_INFO);
- default:
- return JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_INFO);
- }
- }
-
- Color getColor() {
- int type = getType();
- switch (type) {
- case ERROR:
- return getColor(ISystemThemeConstants.MESSAGE_ERROR_COLOR);
- case WARNING:
- return getColor(ISystemThemeConstants.MESSAGE_WARNING_COLOR);
- case INFO:
- return getColor(ISystemThemeConstants.MESSAGE_INFORMATION_COLOR);
- default:
- return getColor(ISystemThemeConstants.MESSAGE_INFORMATION_COLOR);
- }
- }
-
- /**
- * @param symbolicName the name of the color in the current theme's color registry.
- * @return an SWT Color or null.
- */
- private Color getColor(String symbolicName) {
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
- Color result = registry.get(symbolicName);
- return result;
- }
-
- boolean isError() {
- return getType() == ERROR;
- }
-
- /**
- * @return The id of the message or null if there is none.
- */
- abstract String getID();
-
- /**
- * @return The full text of the message to be shown in the message line.
- */
- abstract String getText();
-
- /**
- * @return The tooltip for the message, to be shown when hovering over the message line.
- */
- abstract String getTooltip();
-
- /**
- * @return true if there is more text that can be shown in a message details pane.
- */
- abstract boolean hasMore();
-
- /**
- * @return The SystemMessage version of the message.
- */
- abstract SystemMessage toSystemMessage();
-
- /**
- * @return The type of the message. One of NONE, INFO, WARNING, or ERROR.
- */
- abstract int getType();
-
- /**
- * @return The data values associated with this message.
- */
- abstract Object[] getData();
-
- /**
- * @return true if the message resulted form a strange occurence.
- */
- abstract boolean isStrange();
- }
-
- private class MySystemMessage extends MyMessage {
-
- private SystemMessage message = null;
-
- /**
- * @param message
- */
- MySystemMessage(SystemMessage message) {
- this.message = message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#toSystemMessage()
- */
- SystemMessage toSystemMessage() {
- return message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getID()
- */
- String getID() {
- return message.getFullMessageID();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getText()
- */
- String getText() {
- return message.getLevelOneText();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getTooltip()
- */
- String getTooltip() {
- return message.getFullMessageID() + ": " + getText(); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#hasMore()
- */
- boolean hasMore() {
- String text2 = message.getLevelTwoText();
- return (text2 != null) && (text2.length() > 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#wasStrange()
- */
- boolean isStrange() {
- return message.getIndicator() == SystemMessage.UNEXPECTED;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getData()
- */
- Object[] getData() {
- Object[] result = message.getSubVariables();
- if (result == null) result = new Object[0];
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getType()
- */
- int getType() {
- int result = NONE;
- if (message != null) {
- switch (message.getIndicator()) {
- case SystemMessage.COMPLETION:
- case SystemMessage.INFORMATION:
- case SystemMessage.INQUIRY:
- result = INFO;
- break;
- case SystemMessage.ERROR:
- case SystemMessage.UNEXPECTED:
- result = ERROR;
- break;
- case SystemMessage.WARNING:
- result = WARNING;
- break;
- default:
- result = NONE;
- }
- }
- return result;
- }
- }
-
- private class MyImpromptuMessage extends MyMessage {
-
- private int type = NONE;
- private String text1 = ""; //$NON-NLS-1$
- private String text2 = null;
-
- /**
- * @param type The type of the message.
- * @param text1 The first-level text of the message.
- */
- MyImpromptuMessage(int type, String text1) {
- this.type = type;
- this.text1 = text1;
- }
-
- /**
- * @param type The type of the message.
- * @param text1 The first-level text of the message.
- * @param text2 the second-level text of the message.
- */
- MyImpromptuMessage(int type, String text1, String text2) {
- this.type = type;
- this.text1 = text1;
- this.text2 = text2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#toSystemMessage()
- */
- public SystemMessage toSystemMessage() {
- String id = null;
- Object[] data = null;
- if (text2 == null) {
- id = isError() ? ISystemMessages.MSG_GENERIC_E : ISystemMessages.MSG_GENERIC_I;
- data = new Object[] { text1 };
- } else {
- id = isError() ? ISystemMessages.MSG_GENERIC_E_HELP : ISystemMessages.MSG_GENERIC_I_HELP;
- data = new Object[] { text1, text2 };
- }
- SystemMessage result = RSEUIPlugin.getPluginMessage(id, data);
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getID()
- */
- String getID() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getText()
- */
- String getText() {
- return text1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getTooltip()
- */
- String getTooltip() {
- return text1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#hasMore()
- */
- boolean hasMore() {
- return text2 != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#wasStrange()
- */
- boolean isStrange() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getData()
- */
- Object[] getData() {
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.SystemMessageLine.MyMessage#getType()
- */
- int getType() {
- return type;
- }
- }
-
- /**
- * Creates a new message line as a child of the given parent. If the parent
- * uses a grid layout then the layout data is set. If not then the layout data
- * must be set by the creator to match the layout of the parent composite.
- */
- public SystemMessageLine(Composite parent) {
- super(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.verticalSpacing = 0;
- layout.horizontalSpacing = 5;
- layout.marginHeight = 2;
- layout.marginWidth = 3;
- setLayout(layout);
-
- image = new Label(this, SWT.NONE);
- image.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
-
- // this is a read-only text field so it is tab enabled and readable by a screen reader.
- widget = new Text(this, SWT.READ_ONLY | SWT.SINGLE);
- widget.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false));
- widget.setBackground(parent.getBackground());
-
- moreButton = new Button(this, SWT.NONE);
- moreButton.setImage(RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_HELP_ID));
- moreButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
- moreButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.getSource().equals(moreButton)) {
- MyMessage message = getCurrentMessage();
- if (message != null) {
- SystemMessage m = message.toSystemMessage();
- Shell shell = getShell();
- SystemMessageDialog dialog = new SystemMessageDialog(shell, m);
- dialog.openWithDetails();
- }
- }
- }
- });
- // add accessibility information to the "more" button
- moreButton.setToolTipText(SystemResources.RESID_MSGLINE_TIP);
- moreButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- getHelp(e);
- }
-
- public void getHelp(AccessibleEvent e) {
- e.result = moreButton.getToolTipText();
- }
- });
-
- addControlListener(new ControlListener() {
- public void controlMoved(ControlEvent e) {
- }
-
- public void controlResized(ControlEvent e) {
- adjustText();
- layout();
- }
- });
- addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- widget.dispose();
- moreButton.dispose();
- image.dispose();
- }
- });
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearMessage()
- */
- public void clearMessage() {
- infoMessage = null;
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearErrorMessage()
- */
- public void clearErrorMessage() {
- errorMessage = null;
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#setMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)
- */
- public void setMessage(SystemMessage message) {
- infoMessage = new MySystemMessage(message);
- if (infoMessage.isError()) {
- infoMessage = new MyImpromptuMessage(NONE, message.getLevelOneText(), message.getLevelTwoText());
- }
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#setMessage(java.lang.String)
- */
- public void setMessage(String message) {
- infoMessage = new MyImpromptuMessage(INFO, message);
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#setErrorMessage(java.lang.String)
- */
- public void setErrorMessage(String message) {
- errorMessage = new MyImpromptuMessage(ERROR, message);
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#setErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)
- */
- public void setErrorMessage(SystemMessage message) {
- logMessage(message);
- errorMessage = new MySystemMessage(message);
- showCurrentMessage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#setErrorMessage(java.lang.Throwable)
- */
- public void setErrorMessage(Throwable throwable) {
- SystemMessage message = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED);
- message.makeSubstitution(throwable);
- setErrorMessage(message);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#getMessage()
- */
- public String getMessage() {
- String result = infoMessage != null ? infoMessage.getText() : null;
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#getErrorMessage()
- */
- public String getErrorMessage() {
- String result = errorMessage != null ? errorMessage.getText() : null;
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.messages.ISystemMessageLine#getSystemErrorMessage()
- */
- public SystemMessage getSystemErrorMessage() {
- SystemMessage result = errorMessage != null ? errorMessage.toSystemMessage() : null;
- return result;
- }
-
- private MyMessage getCurrentMessage() {
- return errorMessage != null ? errorMessage : infoMessage;
- }
-
- /**
- * Shows the top message on the stack. If the stack is empty it will "show" nothing.
- */
- private void showCurrentMessage() {
- MyMessage message = getCurrentMessage();
- setIcon(message);
- setText(message);
- setMoreButton(message);
- layout();
- }
-
- /**
- * Sets the icon field of the widget to the appropriate symbol depending on the
- * type of message.
- * @param message the message used to determine the icon type.
- */
- private void setIcon(MyMessage message) {
- Image t = (message == null) ? null : message.getImage();
- image.setImage(t);
- }
-
- /**
- * Write the text from a MyMessage to the widget.
- * @param message the message from which to get the text.
- */
- private void setText(MyMessage message) {
- String text = ""; //$NON-NLS-1$
- String toolTip = null;
- Color color = null;
- if (message != null) {
- text = message.getText();
- toolTip = message.getTooltip();
- color = message.getColor();
- }
- widget.setToolTipText(toolTip);
- widget.setForeground(color);
- widget.setText(text);
- widget.setData(text);
- widget.setVisible(text.length() > 0);
- adjustText();
- }
-
- /**
- * Hide or show the "more" button. If the message has second level text then
- * the more button is shown.
- */
- private void setMoreButton(MyMessage message) {
- boolean visible = message != null && message.hasMore();
- moreButton.setVisible(visible);
- }
-
- /**
- * Adjusts the text in the widget. The full text is stored in the data field of the
- * Text widget. The partial text is shown if the width of the containing control
- * is too small to hold it.
- */
- private void adjustText() {
- GC gc = new GC(widget);
- int maxWidth = getSize().x;
- maxWidth -= moreButton.getSize().x;
- maxWidth -= image.getSize().x;
- maxWidth -= 17; // a guess at the padding between controls
- maxWidth = (maxWidth >= 0) ? maxWidth : 0;
- String text = (String) widget.getData();
- if (text != null) {
- if (gc.stringExtent(text).x > maxWidth) {
- StringBuffer head = new StringBuffer(text);
- int n = head.length();
- head.append("..."); //$NON-NLS-1$
- while (n > 0) {
- text = head.toString();
- if (gc.stringExtent(text).x <= maxWidth) break;
- head.deleteCharAt(--n);
- }
- if (n == 0) text = ""; //$NON-NLS-1$
- }
- widget.setText(text);
- }
- gc.dispose();
- }
-
- /**
- * Logs a message in the appropriate log according to the current preferences.
- * @param message The SystemMessage to be logged.
- */
- private void logMessage(SystemMessage message) {
- MyMessage m = new MySystemMessage(message);
- Object[] data = m.getData();
- for (int i = 0; i < data.length; i++) {
- Object object = data[i];
- StringBuffer buffer = new StringBuffer(200);
- buffer.append(m.getID());
- buffer.append(": SUB#"); //$NON-NLS-1$
- buffer.append(Integer.toString(i));
- buffer.append(":"); //$NON-NLS-1$
- buffer.append(object.toString());
- logMessage(m.getType(), buffer.toString(), false);
- }
- logMessage(m.getType(), m.getID(), m.isStrange());
- }
-
- /**
- * Sends a text message to the log. Will log messages only if the RSEUIPlugin has been
- * set to log these.
- * @param type The type of the message - NONE, INFO, WARNING or ERROR.
- * @param text The text to log.
- * @param stackTrace If true then generate a stack trace in the log. Ignored if the
- * type is not ERROR.
- */
- private void logMessage(int type, String text, boolean stackTrace) {
- boolean logging = RSEUIPlugin.getDefault().getLoggingSystemMessageLine();
- if (logging) {
- switch (type) {
- case ERROR:
- Exception e = stackTrace ? new Exception("Stack Trace") : null; //$NON-NLS-1$
- SystemBasePlugin.logError(text, e);
- break;
- case WARNING:
- SystemBasePlugin.logWarning(text);
- break;
- default:
- SystemBasePlugin.logInfo(text);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageStatus.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageStatus.java
deleted file mode 100644
index c8d176eb9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemMessageStatus.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-
-
-/**
- * A SystemMessageStatus object encapsulates a SystemMessage or a
- * SystemMessageException as a Status object. Could be used when creating a
- * CoreException from a SystemMessageException.
- */
-public class SystemMessageStatus implements IStatus {
- private SystemMessage message;
- private SystemMessageException exception;
- public SystemMessageStatus(SystemMessage message) {
- this.message = message;
- }
-
- public SystemMessageStatus(SystemMessageException exception) {
- this.message = exception.getSystemMessage();
- this.exception = exception;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#isOK()
- */
- public boolean isOK() {
- int severity = getSeverity();
- return severity <= IStatus.OK;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getPlugin()
- */
- public String getPlugin() {
- String id = SystemBasePlugin.getBaseDefault().getBundle().getSymbolicName();
- return id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getChildren()
- */
- public IStatus[] getChildren() {
- return new IStatus[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getCode()
- */
- public int getCode() {
- String codeString = message.getMessageNumber();
- int code = 0;
- try {
- code = Integer.parseInt(codeString);
- } catch (NumberFormatException e) {
- }
- return code;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getException()
- */
- public Throwable getException() {
- return exception;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getMessage()
- */
- public String getMessage() {
- return message.getLevelOneText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IStatus#getSeverity()
- */
- public int getSeverity() {
- char ind = message.getIndicator();
- switch (ind) {
- case SystemMessage.COMPLETION:
- return IStatus.OK;
- case SystemMessage.INFORMATION:
- return IStatus.INFO;
- case SystemMessage.INQUIRY:
- return IStatus.INFO;
- case SystemMessage.WARNING:
- return IStatus.WARNING;
- case SystemMessage.UNEXPECTED:
- return IStatus.WARNING;
- case SystemMessage.ERROR:
- return IStatus.ERROR;
- default:
- return IStatus.OK;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IStatus#isMultiStatus()
- */
- public boolean isMultiStatus() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IStatus#matches(int)
- */
- public boolean matches(int severityMask) {
- int severity = getSeverity();
- int matching = severity & severityMask;
- return matching > 0;
- }
-
- /**
- * @return the SystemMessage encapsulated by this status.
- */
- public SystemMessage getSystemMessage() {
- return message;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessage.java
deleted file mode 100644
index ccfabb6a5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-
-
-public class SystemUIMessage extends SystemMessage
-{
- protected static final int displayMask = IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR; // for IStatus substitution variables
-
- public SystemUIMessage(String comp, String sub, String number, char ind, String l1, String l2) throws IndicatorException
- {
- super(comp,sub,number,ind,l1,l2);
- }
-
-/**
- * used to determine the string value of the object
- * it calls toString for all object types except for Exceptions
- * where the stack is also rendered
- * @param sub the substitution object
- * @return the string value for the object
- */
- public String getSubValue(Object sub)
- {
- if (sub == null)
- return "";
-
- if (sub instanceof IStatus)
- {
- return populateList("", (IStatus)sub);
- }
- else
- {
- return super.getSubValue(sub);
- }
- }
-
-/**
- * Populates the list using this error dialog's status object.
- * This walks the child stati of the status object and
- * displays them in a list. The format for each entry is
- * status_path : status_message
- * If the status's path was null then it (and the colon)
- * are omitted.
- */
- private static String populateList(String list, IStatus status) {
- java.util.List statusList = Arrays.asList(status.getChildren());
- Iterator enumer = statusList.iterator();
- while (enumer.hasNext()) {
- IStatus childStatus = (IStatus) enumer.next();
- list = populateList(list, childStatus, 0);
- }
- return list;
- }
- private static String populateList(String list, IStatus status, int nesting) {
- if (!status.matches(displayMask)) {
- return list;
- }
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nesting; i++) {
- sb.append(NESTING_INDENT);
- }
- sb.append(status.getMessage());
- //list.add(sb.toString());
- list = list + sb.toString() + "\n";
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- list = populateList(list, children[i], nesting + 1);
- }
- return list;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessageFile.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessageFile.java
deleted file mode 100644
index 2ce799e37..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/messages/SystemUIMessageFile.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.messages;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-/**
- * A SystemUIMessageFile extends SystemMessageFile and makes it more compatible
- * with Eclipse
- */
-public class SystemUIMessageFile extends SystemMessageFile {
-
- /**
- * Factory method for constructing a SystemUIMessageFile. If an error occurs when
- * reading the message file DTD then that is logged.
- * @param messageFileName The "registered" name of the message file. Used to determine
- * if the message file has been loaded.
- * @param messageFileStream The stream containing the message file. It is the
- * caller's responsibility to close this stream.
- * @return The message file that was constructed.
- */
- public static SystemUIMessageFile getMessageFile(String messageFileName,
- InputStream messageFileStream) {
- SystemUIMessageFile result = null;
- URL dtdURL = RSEUIPlugin.getDefault().getMessageFileDTD();
- if (dtdURL != null) {
- try {
- InputStream dtdStream = dtdURL.openStream();
- result = new SystemUIMessageFile(messageFileName,
- messageFileStream, dtdStream);
- dtdStream.close();
- } catch (IOException e) {
- SystemBasePlugin.logError("Could not open message file DTD.", e);
- }
- } else {
- SystemBasePlugin.logError("Could not find mesage file DTD.");
- }
- return result;
- }
-
- private SystemUIMessageFile(String messageFileName,
- InputStream messageFileStream, InputStream dtdStream) {
- super(messageFileName, messageFileStream, dtdStream);
- }
-
- /**
- * Override this to provide different extended SystemMessage implementation
- *
- * @param componentAbbr
- * @param subComponentAbbr
- * @param msgNumber
- * @param msgIndicator
- * @param msgL1
- * @param msgL2
- * @return The SystemMessage for the given message information
- * @throws IndicatorException
- */
- protected SystemMessage loadSystemMessage(String componentAbbr,
- String subComponentAbbr, String msgNumber, char msgIndicator,
- String msgL1, String msgL2) throws IndicatorException {
- return new SystemUIMessage(componentAbbr, subComponentAbbr, msgNumber,
- msgIndicator, msgL1, msgL2);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPage.java
deleted file mode 100644
index 5071debd1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPage.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import org.eclipse.jface.dialogs.IDialogPage;
-
-/**
- * Defines a page inside the quick open dialog.
- * Clients can contribute their own quick open page to the
- * dialog by implementing this interface, typically as a subclass
- * of <code>DialogPage</code>.
- * <p>
- * The quick open dialog calls the <code>performAction</code> method when the Ok
- * button is pressed.
- * <p>
- *
- * @see org.eclipse.jface.dialogs.IDialogPage
- * @see org.eclipse.jface.dialogs.DialogPage
- */
-public interface ISystemQuickOpenPage extends IDialogPage {
-
- /**
- * Performs the action for this page.
- * The quick open dialog calls this method when the Ok button is pressed.
- * @return <code>true</code> if the dialog can be closed after execution.
- */
- public boolean performAction();
-
- /**
- * Sets the container of this page.
- * The quick open dialog calls this method to initialize this page.
- * Implementations may store the reference to the container.
- * @param container the container for this page.
- */
- public void setContainer(ISystemQuickOpenPageContainer container);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPageContainer.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPageContainer.java
deleted file mode 100644
index fb0fb2d1d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/ISystemQuickOpenPageContainer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.ISelection;
-
-public interface ISystemQuickOpenPageContainer {
-
- /**
- * Returns the selection with which this container was opened.
- *
- * @return the selection passed to this container when it was opened
- */
- public ISelection getSelection();
-
- /**
- * Returns the context for the search operation.
- * This context allows progress to be shown inside the search dialog.
- *
- * @return the <code>IRunnableContext</code> for the search operation
- */
- public IRunnableContext getRunnableContext();
-
- /**
- * Sets the enable state of the perform action button
- * of this container.
- *
- * @param state <code>true</code> to enable the button which performs the action
- */
- public void setPerformActionEnabled(boolean state);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemOpenQuickOpenDialogAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemOpenQuickOpenDialogAction.java
deleted file mode 100644
index 0d49a592a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemOpenQuickOpenDialogAction.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-
-public class SystemOpenQuickOpenDialogAction extends Action implements IWorkbenchWindowActionDelegate {
-
- private IWorkbenchWindow window;
- private String pageId;
-
- /**
- * Constructor for the action.
- * @param text the text.
- * @param tooltip the tooltip.
- * @param image the image.
- * @param parent the parent shell.
- */
- public SystemOpenQuickOpenDialogAction(String text, String tooltip, ImageDescriptor image) {
- super(text, image);
- setToolTipText(tooltip);
- }
-
- /**
- * Constructor for the action.
- * @param text the text.
- * @param tooltip the tooltip.
- * @param parent the parent shell.
- */
- public SystemOpenQuickOpenDialogAction(String text, String tooltip) {
- this(text, tooltip, null);
- }
-
- /**
- * @param window the workbench window
- */
- public SystemOpenQuickOpenDialogAction(IWorkbenchWindow window, String pageId) {
- this((String)null, (String)null);
- this.window = window;
- this.pageId = pageId;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- this.window = window;
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- // if there is no active page, then beep
- if (getWindow().getActivePage() == null) {
- SystemBasePlugin.getActiveWorkbenchWindow().getShell().getDisplay().beep();
- return;
- }
-
- SystemQuickOpenDialog dialog = new SystemQuickOpenDialog(getWindow().getShell(), getSelection(), pageId);
- dialog.open();
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * Gets the current selection.
- * @return the current selection.
- */
- private ISelection getSelection() {
- return getWindow().getSelectionService().getSelection();
- }
-
- /**
- * Gets the window. If the current window is <code>null</code>, the current window is set to the active
- * workbench window, and then returned.
- * @return the current workench window, or the active workbench window if the current window is <code>null</code>.
- */
- private IWorkbenchWindow getWindow() {
-
- if (window == null) {
- window = SystemBasePlugin.getActiveWorkbenchWindow();
- }
-
- return window;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenDialog.java
deleted file mode 100644
index 58b7e414c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenDialog.java
+++ /dev/null
@@ -1,801 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-
-public class SystemQuickOpenDialog extends Dialog implements ISystemQuickOpenPageContainer, IRunnableContext {
-
- // the tab folder layout
- private class TabFolderLayout extends Layout {
-
- /**
- * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int, boolean)
- */
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
-
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) {
- return new Point(wHint, hHint);
- }
-
- int x = 0;
- int y = 0;
-
- Control[] children = composite.getChildren();
-
- for (int i= 0; i < children.length; i++) {
- Point size = children[i].computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
- x = Math.max(x, size.x);
- y = Math.max(y, size.y);
- }
-
- Point minSize = getMinSize();
- x = Math.max(x, minSize.x);
- y = Math.max(y, minSize.y);
-
- if (wHint != SWT.DEFAULT) {
- x = wHint;
- }
-
- if (hHint != SWT.DEFAULT) {
- y = hHint;
- }
-
- return new Point(x, y);
- }
-
-
- /**
- * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
- */
- protected void layout(Composite composite, boolean flushCache) {
- Rectangle rect = composite.getClientArea();
-
- Control[] children = composite.getChildren();
-
- for (int i = 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
- }
- }
-
- // contents and buttons
- private Control contents;
- private Button cancelButton;
- private Button openButton;
-
- //private String performActionLabel = JFaceResources.getString("finish");
-
- // the number of long running operations being executed from the dialog
- private long activeRunningOperations;
-
- // cursors during operation
- private Cursor waitCursor;
- private Cursor arrowCursor;
-
- // progress monitor
- private ProgressMonitorPart progressMonitorPart;
-
- // window closing dialog
- private MessageDialog windowClosingDialog;
-
- // minimum size for tab folder
- private Point minSize;
-
- private ISelection selection;
- private String initialPageId;
- private ISystemQuickOpenPage currentPage;
- private int currentIndex;
- private List descriptors;
-
- /**
- * The constructor for the quick open dialog.
- * @param shell the shell.
- * @param selection the current selection.
- * @param pageId the initial page id.
- */
- public SystemQuickOpenDialog(Shell shell, ISelection selection, String pageId) {
- super(shell);
- this.selection = selection;
- this.initialPageId = pageId;
- this.descriptors = SystemQuickOpenUtil.getInstance().getQuickOpenPageDescriptors(initialPageId);
- }
-
-
- // ------------------------------- UI creation and handling ---------------------------------------
-
- /**
- * @see org.eclipse.jface.window.Window#create()
- */
- public void create() {
- super.create();
-
- if (currentPage != null) {
- currentPage.setVisible(true);
- }
- }
-
- /**
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText("Open");
- // TODO: add image and F1 help
- }
-
- /**
- * Creates a page area, a progress monitor and a separator.
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
-
- // call super to get a standard composite
- Composite composite = (Composite)(super.createDialogArea(parent));
-
- // create a grid layout
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
-
- // set layout for composite
- composite.setLayout(layout);
-
- // set layout data for composite
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- // create the page area
- contents = createPageArea(composite);
-
- // create a progress monitor and make it invisible initially
- GridLayout pmlayout = new GridLayout();
- pmlayout.numColumns = 1;
- progressMonitorPart = new ProgressMonitorPart(composite, pmlayout, SWT.DEFAULT);
- progressMonitorPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- progressMonitorPart.setVisible(false);
-
- // add a separator
- Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // apply dialog font
- applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * Creates the page area.
- * @param parent the parent composite.
- * @return the page area control.
- */
- protected Control createPageArea(Composite parent) {
-
- int numPages = descriptors.size();
-
- // if number of pages is 0, then just show a label
- if (numPages == 0) {
- Label label = new Label(parent, SWT.CENTER | SWT.WRAP);
- // TODO: set text
- //label.setText(SearchMessages.getString("SearchDialog.noSearchExtension")); //$NON-NLS-1$
- return label;
- }
-
- // get the preferred index, which is the index of the page with the initial page id, or depends on
- // the current selection
- currentIndex = getPreferredPageIndex();
-
- // get the current page from the index
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- currentPage = getDescriptorAt(currentIndex).createObject();
- }
- });
-
- // set the current page container
- currentPage.setContainer(this);
-
- // if number of pages is 1, simple get the control representing the page and return it
- if (numPages == 1) {
- return getControl(currentPage, parent);
- }
- // if number of pages is more than 1, then we create a tab folder
- else {
-
- // create a border composite
- Composite border = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth= 7;
- layout.marginHeight= 7;
- border.setLayout(layout);
-
- // create a tab folder
- TabFolder folder = new TabFolder(border, SWT.NONE);
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
- folder.setLayout(new TabFolderLayout());
-
- // go through all descriptors
- for (int i = 0; i < numPages; i++) {
- SystemQuickOpenPageDescriptor descriptor = (SystemQuickOpenPageDescriptor)(descriptors.get(i));
-
- // create a tab item for each descriptor
- final TabItem item = new TabItem(folder, SWT.NONE);
-
- // set the text of the tab item to the label of the descriptor
- item.setText(descriptor.getLabel());
-
- // add a dispose listener which destroys the image
- item.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- item.setData(null);
-
- if (item.getImage() != null) {
- item.getImage().dispose();
- }
- }
- });
-
- // get the image descriptor from the page descriptor
- ImageDescriptor imageDesc = descriptor.getImage();
-
- // if image descriptor exists, create image and set it for the tab item
- if (imageDesc != null) {
- item.setImage(imageDesc.createImage());
- }
-
- // set item data to the descriptor
- item.setData(descriptor);
-
- // now if index is the current index (i.e. the preferred index)
- if (i == currentIndex) {
-
- // get control corresponding to current page with folder as the parent
- item.setControl(getControl(currentPage, folder));
-
- // set the data to the actual page
- item.setData(currentPage);
- }
- }
-
- // add a selection listener to the folder
- folder.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- turnToPage(event);
- }
- });
-
- // set the selection to the current index
- folder.setSelection(currentIndex);
-
- // finally, return the border
- return border;
- }
- }
-
- /**
- * Returns the index of the page to be displayed. If a particular page id was requested, then the index
- * of the page that has that id is returned. Otherwise the index depends on the page most appropriate for
- * the current selection.
- * @return the index of the page to be displayed.
- */
- private int getPreferredPageIndex() {
-
- // TODO: calculate the most appropriate page depending on the selection
- int result = 0;
-
- int size = descriptors.size();
-
- for (int i = 0; i < size; i++) {
-
- SystemQuickOpenPageDescriptor descriptor = (SystemQuickOpenPageDescriptor)(descriptors.get(i));
-
- // if we have an initial page id then we must return the index
- if (initialPageId != null && initialPageId.equals(descriptor.getId())) {
- return i;
- }
-
- // TODO: find out the most appropriate page and return its index
- }
-
- return result;
- }
-
- /**
- * Gets the page descriptor at the specified index.
- * @param index the index.
- * @return the page descriptor at the specified index.
- */
- private SystemQuickOpenPageDescriptor getDescriptorAt(int index) {
- return (SystemQuickOpenPageDescriptor)(descriptors.get(index));
- }
-
- /**
- * Returns the control representing the given page.
- * If the control for the page hasn't been created yet, it is created.
- * The parent of the page control is returned, i.e. we have a wrapper for a page and that is what is returned.
- * @param page the quick open page.
- * @param parent the parent in which to create the page wrapper where the page control will be created.
- * @return the parent of the page control, i.e. a wrapper for the page. The wrapper's parent is the given parent.
- */
- private Control getControl(ISystemQuickOpenPage page, Composite parent) {
-
- // if the page control is null, create it
- if (page.getControl() == null) {
-
- // create a wrapper for the page
- Composite pageWrapper = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- pageWrapper.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- pageWrapper.setLayout(layout);
-
- // create the page in the wrapper
- page.createControl(pageWrapper);
- }
-
- // returns the wrapper
- return page.getControl().getParent();
- }
-
- /**
- * Turns to the page which has been selected.
- * @param event the selection event.
- */
- private void turnToPage(SelectionEvent event) {
- final TabItem item = (TabItem)(event.item);
-
- // if control for tab item hasn't been created yet
- if (item.getControl() == null) {
-
- // get the data which is the descriptor
- final SystemQuickOpenPageDescriptor descriptor = (SystemQuickOpenPageDescriptor)(item.getData());
-
- // set the data to be the actual quick open page
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- item.setData(descriptor.createObject());
- }
- });
-
- // now get the data, which is the quick open page
- ISystemQuickOpenPage page = (ISystemQuickOpenPage)(item.getData());
-
- // set the container of the page
- page.setContainer(this);
-
- // get the control represeting the page
- // note that the widget for the event is the tab folder
- Control newControl = getControl(page, (Composite)(event.widget));
-
- // set the item control
- item.setControl(newControl);
- }
-
- // get the item data and check whether it is an instance of quick open page
- if (item.getData() instanceof ISystemQuickOpenPage) {
-
- // the item data is the new current page
- currentPage = (ISystemQuickOpenPage)(item.getData());
-
- // the current index is the selection index of the item parent (i.e. the tab folder)
- currentIndex = item.getParent().getSelectionIndex();
-
- // resize dialog if needed and pass in the page wrapper
- // that method will test if the control in the page is smaller than the wrapper (i.e. its parent)
- resizeDialogIfNeeded(item.getControl());
-
- // make the current page visible
- currentPage.setVisible(true);
- }
- }
-
- /**
- * Resizes dialog if needed. Tests the given control size with the size of the current page control.
- * If the current page control is smaller, then resize.
- * @param newControl the control whose size we want to test against the size of the page control.
- */
- private void resizeDialogIfNeeded(Control newControl) {
- Point currentSize = currentPage.getControl().getSize();
- Point newSize = newControl.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
-
- // if we must resize, then compute size of shell again, and set it
- if (mustResize(currentSize, newSize)) {
- Shell shell = getShell();
- shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
- }
- }
-
- /**
- * Returns whether we must resize.
- * @param currentSize the current size.
- * @param newSize the new size.
- * @return <code>true</code> if current size is smaller than new size, <code>false</code> otherwise.
- */
- private boolean mustResize(Point currentSize, Point newSize) {
- return currentSize.x < newSize.x || currentSize.y < newSize.y;
- }
-
- /**
- * Gets the minimum size for the tab folder.
- */
- private Point getMinSize() {
-
- if (minSize != null) {
- return minSize;
- }
-
- int x = 0;
- int y = 0;
- int length = descriptors.size();
-
- for (int i = 0; i < length; i++) {
- Point size = getDescriptorAt(i).getPreferredSize();
-
- if (size.x != SWT.DEFAULT) {
- x = Math.max(x, size.x);
- }
- if (size.y != SWT.DEFAULT) {
- y = Math.max(y, size.y);
- }
- }
-
- minSize = new Point(x, y);
- return minSize;
- }
-
- /**
- * Calls the super class method if there are no running operations.
- * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
- */
- protected void cancelPressed() {
-
- if (activeRunningOperations == 0) {
- super.cancelPressed();
- }
- }
-
- /**
- * Calls <code>performAction</code>. If the result of calling this method is <code>true</code>
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- boolean result = performAction();
-
- if (result) {
- super.okPressed();
- }
- }
-
- /**
- * Returns whether ok to close. Asks the current page, if any, whether it is ok to close.
- * @return <code>true</code> if the dialog can be closed, <code>false</code> otherwise.
- */
- protected boolean performAction() {
-
- if (currentPage == null) {
- return true;
- }
-
- return currentPage.performAction();
- }
-
-
- // ----------------------------------------- Interface methods ----------------------------------
-
- /**
- * @see org.eclipse.rse.ui.open.ISystemQuickOpenPageContainer#getRunnableContext()
- */
- public IRunnableContext getRunnableContext() {
- return this;
- }
-
- /**
- * @see org.eclipse.rse.ui.open.ISystemQuickOpenPageContainer#getSelection()
- */
- public ISelection getSelection() {
- return selection;
- }
-
- /**
- * @see org.eclipse.rse.ui.open.ISystemQuickOpenPageContainer#setPerformActionEnabled(boolean)
- */
- public void setPerformActionEnabled(boolean state) {
-
- if (openButton != null) {
- openButton.setEnabled(state);
- }
- }
-
-
- // ----------------------------- Operation related methods --------------------------
-
- /**
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
-
- // The operation can only be canceled if it is executed in a separate thread.
- // Otherwise the UI is blocked anyway.
- HashMap state = null;
-
- try {
- activeRunningOperations++;
- state = aboutToStart(fork && cancelable);
- ModalContext.run(runnable, fork, getProgressMonitor(), getShell().getDisplay());
- }
- finally {
-
- if (state != null) {
- stopped(state);
- }
-
- activeRunningOperations--;
- }
- }
-
- /**
- * Returns the progress monitor. If the dialog doesn't
- * have a progress monitor, <code>null</code> is returned.
- */
- protected IProgressMonitor getProgressMonitor() {
- return progressMonitorPart;
- }
-
- /**
- * About to start a long running operation tiggered through the dialog.
- * Shows the progress monitor and disables the dialog.
- * @param enableCancelButton <code>true</code> if cancel button should be enabled, <code>false</code> otherwise.
- * @return the saved UI state.
- * @see #stopped(HashMap)
- */
- protected synchronized HashMap aboutToStart(boolean enableCancelButton) {
- HashMap savedState = null;
-
- Shell shell = getShell();
-
- if (shell != null) {
- Display d = shell.getDisplay();
-
- // get focus control
- Control focusControl = d.getFocusControl();
-
- if (focusControl != null && focusControl.getShell() != shell) {
- focusControl = null;
- }
-
- // set the busy cursor to all shells
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- setDisplayCursor(d, waitCursor);
-
- // set the arrow cursor to the cancel component
- arrowCursor = new Cursor(d, SWT.CURSOR_ARROW);
- cancelButton.setCursor(arrowCursor);
-
- // deactivate shell
- savedState = saveUIState(enableCancelButton);
-
- // save focus control
- if (focusControl != null) {
- savedState.put("focusControl", focusControl);
- }
-
- // attach the progress monitor part to the cancel button and make it visible
- progressMonitorPart.attachToCancelComponent(cancelButton);
- progressMonitorPart.setVisible(true);
- }
-
- return savedState;
- }
-
- /**
- * A long running operation triggered through the wizard
- * was stopped either by user input or by normal end.
- * @param savedState The saveState returned by <code>aboutToStart</code>.
- * @see #aboutToStart(boolean)
- */
- protected synchronized void stopped(HashMap state) {
-
- Shell shell = getShell();
-
- if (shell != null) {
-
- progressMonitorPart.setVisible(false);
- progressMonitorPart.removeFromCancelComponent(cancelButton);
-
- restoreUIState(state);
-
- setDisplayCursor(shell.getDisplay(), null);
- cancelButton.setCursor(null);
- waitCursor.dispose();
- waitCursor = null;
- arrowCursor.dispose();
- arrowCursor = null;
- Control focusControl = (Control)(state.get("focusControl"));
-
- if (focusControl != null && ! focusControl.isDisposed()) {
- focusControl.setFocus();
- }
- }
- }
-
- /**
- * Sets a cursor for all shells in a display.
- * @param d the display.
- * @param c the cursor.
- */
- private void setDisplayCursor(Display d, Cursor c) {
-
- Shell[] shells = d.getShells();
-
- for (int i= 0; i < shells.length; i++) {
- shells[i].setCursor(c);
- }
- }
-
-
- //------------------------ UI state save and restoring -------------------------------------
-
- /**
- * Restores the enable state of the UI, i.e. all dialog contents.
- * @param state the hashmap that contains the enable state of the UI.
- */
- private void restoreUIState(HashMap state) {
- restoreEnableState(cancelButton, state, "cancel");
- restoreEnableState(openButton, state, "open");
- ControlEnableState pageState = (ControlEnableState)state.get("tabForm");
- pageState.restore();
- }
-
- /**
- * Restores the enable state of a control.
- * @param w the control whose state needs to be restored.
- * @param h the hashmap containing the enable state of the control.
- * @param key the key to use to retrieve the enable state.
- */
- protected void restoreEnableState(Control w, HashMap h, String key) {
-
- if (!w.isDisposed()) {
- Boolean b = (Boolean)h.get(key);
-
- if (b != null) {
- w.setEnabled(b.booleanValue());
- }
- }
- }
-
- /**
- * Disables all dialog contents, except maybe the cancel button, depending on the given boolean.
- * @param keepCancelEnabled <code>true</code> if cancel button is enabled, <code>false</code> otherwise.
- * @return the saved state.
- */
- private HashMap saveUIState(boolean keepCancelEnabled) {
- HashMap savedState = new HashMap();
-
- saveEnableStateAndSet(cancelButton, savedState, "cancel", keepCancelEnabled);
- saveEnableStateAndSet(openButton, savedState, "open", false);
- savedState.put("tabForm", ControlEnableState.disable(contents));
-
- return savedState;
- }
-
- /**
- * Saves the enable state of a control and sets it as well.
- * @param w the control whose enable state we want to set and save.
- * @param h the hashmap where the enable state of the control will be saved.
- * @param key the key with which to save the enable state.
- * @param enabled <code>true</code> if control is to be enabled, <code>false</code> otherwise.
- */
- private void saveEnableStateAndSet(Control w, HashMap h, String key, boolean enabled) {
-
- if (!w.isDisposed()) {
- h.put(key, new Boolean(w.isEnabled()));
- w.setEnabled(enabled);
- }
- }
-
-
- // ------------------------------- Handle shell closing ------------------------------
-
- /**
- * Checks to see if there are any long running operations. If there are, a dialog is shown
- * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
- */
- protected void handleShellCloseEvent() {
-
- if (okToClose()) {
- super.handleShellCloseEvent();
- }
- }
-
- /**
- * Checks if any operations are running. If so, shows a message dialog alerting the user, and returns <code>false</code>
- * indicating the dialog should not be closed.
- * @return <code>true</code> if it is ok to close the dialog, <code>false</code> otherwise.
- */
- public boolean okToClose() {
-
- if (activeRunningOperations > 0) {
-
- // get closing dialog
- synchronized (this) {
- windowClosingDialog = createClosingDialog();
- }
-
- // open it
- windowClosingDialog.open();
-
- // make it null
- synchronized (this) {
- windowClosingDialog = null;
- }
-
- // indicate that operations are running, so not ok to close
- return false;
- }
-
- return true;
- }
-
- /**
- * Creates a dialog with the message that the quick open dialog is closing.
- * @return the message dialog.
- */
- private MessageDialog createClosingDialog() {
- MessageDialog result = new MessageDialog(getShell(), JFaceResources.getString("WizardClosingDialog.title"),
- null, JFaceResources.getString("WizardClosingDialog.message"),
- MessageDialog.QUESTION, new String[] {IDialogConstants.OK_LABEL}, 0);
- return result;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenPageDescriptor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenPageDescriptor.java
deleted file mode 100644
index dad35d6d9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenPageDescriptor.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.StringConverter;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.osgi.framework.Bundle;
-
-
-public class SystemQuickOpenPageDescriptor implements Comparable {
-
- public final static String PAGE_TAG = "page";
- private final static String ID_ATTRIBUTE = "id";
- private final static String ICON_ATTRIBUTE = "icon";
- private final static String CLASS_ATTRIBUTE = "class";
- private final static String LABEL_ATTRIBUTE = "label";
- private final static String SIZE_ATTRIBUTE = "sizeHint";
- private final static String TAB_POSITION_ATTRIBUTE = "tabPosition";
- // private final static String SSF_ID = "ssfid";
-
- public final static Point UNKNOWN_SIZE = new Point(SWT.DEFAULT, SWT.DEFAULT);
-
- private IConfigurationElement element;
-
- /**
- * Constructor for quick open page descriptor.
- * @param a configuration element.
- */
- public SystemQuickOpenPageDescriptor(IConfigurationElement element) {
- this.element = element;
- }
-
- /**
- * Creates a new quick open page from the descriptor.
- */
- public ISystemQuickOpenPage createObject() {
- ISystemQuickOpenPage result = null;
-
- try {
- result = (ISystemQuickOpenPage)(element.createExecutableExtension(CLASS_ATTRIBUTE));
- }
- catch (CoreException e) {
- SystemBasePlugin.logError("Error trying to create a quick open page from configuration element", e);
- return null;
- }
- catch (ClassCastException e) {
- SystemBasePlugin.logError("Error trying to create a quick open page from configuration element", e);
- return null;
- }
-
- if (result != null) {
- result.setTitle(getLabel());
- }
-
- return result;
- }
-
-
- // --------------------------------------------------------------
- // XML attributes
- // --------------------------------------------------------------
-
- /**
- * Returns the id of the page.
- * @return the id of the page.
- */
- public String getId() {
- return element.getAttribute(ID_ATTRIBUTE);
- }
-
- /**
- * Returns the label of the page.
- */
- public String getLabel() {
- return element.getAttribute(LABEL_ATTRIBUTE);
- }
-
- /**
- * Returns the image for the page.
- */
- public ImageDescriptor getImage() {
-
- String imageName = element.getAttribute(ICON_ATTRIBUTE);
-
- if (imageName == null) {
- return null;
- }
-
- URL url = null;
-
- try {
- String nameSpace = element.getDeclaringExtension().getNamespace();
- Bundle bundle = Platform.getBundle(nameSpace);
- url = new URL(bundle.getEntry("/"), imageName);
- }
- catch (java.net.MalformedURLException e) {
- SystemBasePlugin.logError("Error trying to get image", e);
- return null;
- }
-
- return ImageDescriptor.createFromURL(url);
- }
-
- /**
- * Returns the page's preferred size
- */
- public Point getPreferredSize() {
- return StringConverter.asPoint(element.getAttribute(SIZE_ATTRIBUTE), UNKNOWN_SIZE);
- }
-
- /**
- * Returns the page's tab position relative to the other tabs.
- * @return the tab position or <code>Integer.MAX_VALUE</code> if not defined in
- the plugins.xml file
- *
- */
- public int getTabPosition() {
-
- int position = Integer.MAX_VALUE / 2;
-
- String str = element.getAttribute(TAB_POSITION_ATTRIBUTE);
-
- if (str != null) {
-
- try {
- position = Integer.parseInt(str);
- }
- catch (NumberFormatException e) {
- SystemBasePlugin.logError("Error trying to get tab position", e);
- }
- }
-
- return position;
- }
-
- /**
- * Returns whether the page is enabled.
- * @return <code>true</code> if the page is enabled, <code>false</code> otherwise.
- */
- public boolean isEnabled() {
- return true;
- }
-
-
- // -----------------------------------------------------------
- // compare
- // -----------------------------------------------------------
-
- /**
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object o) {
-
- int myPos = getTabPosition();
- int objsPos = ((SystemQuickOpenPageDescriptor)o).getTabPosition();
-
- if (myPos == Integer.MAX_VALUE && objsPos == Integer.MAX_VALUE || myPos == objsPos) {
- return getLabel().compareTo(((SystemQuickOpenPageDescriptor)o).getLabel());
- }
- else {
- return myPos - objsPos;
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUI.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUI.java
deleted file mode 100644
index aa225a649..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUI.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public class SystemQuickOpenUI {
-
- /**
- * Constructor.
- */
- public SystemQuickOpenUI() {
- super();
- }
-
- /**
- * Opens the quick open dialog in the active workbench window.
- * If <code>pageId</code> is specified and a corresponding page is found then it is brought to top.
- * @param pageId the page to select or <code>null</code> if the best fitting page should be selected.
- */
- public static void openSearchDialog(String pageId) {
- openSearchDialog(SystemBasePlugin.getActiveWorkbenchWindow(), pageId);
- }
-
- /**
- * Opens the quick open dialog.
- * If <code>pageId</code> is specified and a corresponding page is found then it is brought to top.
- * @param window the workbench window to open the dialog in.
- * @param pageId the page to select or <code>null</code> if the best fitting page should be selected.
- */
- public static void openSearchDialog(IWorkbenchWindow window, String pageId) {
- new SystemOpenQuickOpenDialogAction(window, pageId).run();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUtil.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUtil.java
deleted file mode 100644
index 163c3f109..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/open/SystemQuickOpenUtil.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.open;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * A utility class for quick open. It is a singleton.
- */
-public class SystemQuickOpenUtil {
-
- public static final String QUICK_OPEN_PAGE_EXTENSION_POINT= "quickOpenPages";
-
- // singleton instance
- private static SystemQuickOpenUtil instance;
-
- // a list of page descriptors
- private List pageDescriptors;
-
- /**
- * Constructor for the utility.
- */
- private SystemQuickOpenUtil() {
- super();
- }
-
- /**
- * Returns the singleton instance.
- * @return the singleton instance.
- */
- public static SystemQuickOpenUtil getInstance() {
-
- if (instance == null) {
- instance = new SystemQuickOpenUtil();
- }
-
- return instance;
- }
-
- /**
- * Returns all quick open pages contributed to the workbench.
- * @param pageId a page id for which a descriptor must be returned.
- * @return a list of quick open page descriptors.
- */
- public List getQuickOpenPageDescriptors(String pageId) {
- Iterator iter = getQuickOpenPageDescriptors().iterator();
- List enabledDescriptors = new ArrayList();
-
- while (iter.hasNext()) {
- SystemQuickOpenPageDescriptor desc = (SystemQuickOpenPageDescriptor)(iter.next());
-
- if (desc.isEnabled() || desc.getId().equals(pageId)) {
- enabledDescriptors.add(desc);
- }
- }
-
- return enabledDescriptors;
- }
-
- /**
- * Returns all quick open pages contributed to the workbench.
- * @return a list of quick open pages.
- */
- public List getQuickOpenPageDescriptors() {
-
- if (pageDescriptors == null) {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] elements = registry.getConfigurationElementsFor(RSEUIPlugin.PLUGIN_ID, QUICK_OPEN_PAGE_EXTENSION_POINT);
- pageDescriptors = createQuickOpenPageDescriptors(elements);
- }
-
- return pageDescriptors;
- }
-
- /**
- * Creates quick open page descriptors.
- * @param an array of elements.
- * @return a list of descriptors that correspond to the given elements.
- */
- private List createQuickOpenPageDescriptors(IConfigurationElement[] elements) {
- List result = new ArrayList();
-
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
-
- if (SystemQuickOpenPageDescriptor.PAGE_TAG.equals(element.getName())) {
- SystemQuickOpenPageDescriptor desc = new SystemQuickOpenPageDescriptor(element);
- result.add(desc);
- }
- }
-
- // sort the list of descriptors
- Collections.sort(result);
-
- return result;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/ISystemRunnableContext.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/ISystemRunnableContext.java
deleted file mode 100644
index f363cf595..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/ISystemRunnableContext.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Interface for a system runnable context.
- */
-public interface ISystemRunnableContext {
-
- /**
- * Runs the given runnable in the context of the receiver. By default, the
- * progress is provided by the active workbench window but subclasses may
- * override this to provide progress in some other way (through Progress view using Eclipse Job support).
- */
- public abstract void run(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException;
-
- /**
- * Returns a shell that can be used to prompt the user.
- * @return a shell.
- */
- public abstract Shell getShell();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java
deleted file mode 100644
index f4761cae7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/Policy.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-public class Policy {
-
-
- protected static ResourceBundle bundle = null;
-
- /**
- * Creates a NLS catalog for the given locale.
- */
- public static void localize(String bundleName) {
- bundle = ResourceBundle.getBundle(bundleName);
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string.
- */
- public static String bind(String id, String binding) {
- return bind(id, new String[] { binding });
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given strings.
- */
- public static String bind(String id, String binding1, String binding2) {
- return bind(id, new String[] { binding1, binding2 });
- }
-
- /**
- * Gets a string from the resource bundle. We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String bind(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Gets a string from the resource bundle and binds it with the given arguments. If the key is
- * not found, return the key.
- */
- public static String bind(String key, Object[] args) {
- try {
- return MessageFormat.format(bind(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Progress monitor helpers
- */
- public static void checkCanceled(IProgressMonitor monitor) {
- if (monitor.isCanceled())
- cancelOperation();
- }
- public static void cancelOperation() {
- throw new OperationCanceledException();
- }
- public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
- public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
- public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-
-
-
- public static ResourceBundle getBundle() {
- return bundle;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java
deleted file mode 100644
index 178781c15..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.core.subsystems.SubSystem.DisplayErrorMessageJob;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.GenericMessages;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.progress.IElementCollector;
-
-
-/**
- * @author dmcknigh
- */
-public class SystemFetchOperation extends JobChangeAdapter implements IRunnableWithProgress
-{
- protected IWorkbenchPart _part;
- protected IAdaptable _remoteObject;
- protected IElementCollector _collector;
- private IRunnableContext context;
- protected ISystemViewElementAdapter _adapter;
- protected boolean _canRunAsJob;
- protected InvocationTargetException _exc;
-
- public SystemFetchOperation(IWorkbenchPart part, IAdaptable remoteObject, ISystemViewElementAdapter adapter, IElementCollector collector)
- {
- _part = part;
- _remoteObject = remoteObject;
- _collector = collector;
- _adapter = adapter;
- _canRunAsJob = false;
- }
-
- public SystemFetchOperation(IWorkbenchPart part, IAdaptable remoteObject, ISystemViewElementAdapter adapter, IElementCollector collector, boolean canRunAsJob)
- {
- _part = part;
- _remoteObject = remoteObject;
- _collector = collector;
- _adapter = adapter;
- _canRunAsJob = canRunAsJob;
- }
-
- public void setException(InvocationTargetException exc)
- {
- _exc = exc;
- }
-
- /**
- * Return the part that is associated with this operation.
- *
- * @return Returns the part or <code>null</code>
- */
- public IWorkbenchPart getPart() {
- return _part;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- startOperation();
- try {
- monitor = Policy.monitorFor(monitor);
- monitor.beginTask(null, 100);
- monitor.setTaskName(getTaskName());
- execute(Policy.subMonitorFor(monitor, 100));
- endOperation();
- } catch (Exception e) {
- // TODO: errors may not be empty (i.e. endOperation has not been executed)
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
-
- protected void startOperation() {
- //statusCount = 0;
- //resetErrors();
- //confirmOverwrite = true;
- }
-
- protected void endOperation() {
- //handleErrors((IStatus[]) errors.toArray(new IStatus[errors.size()]));
- }
-
-
- public class PromptForPassword implements Runnable
- {
- public SubSystem _ss;
- public PromptForPassword(SubSystem ss)
- {
- _ss = ss;
- }
-
- public void run()
- {
- try
- {
- _ss.promptForPassword();
- }
- catch (Exception e)
- {
-
- }
- }
- }
-
- public class UpdateRegistry implements Runnable
- {
- private SubSystem _ss;
- public UpdateRegistry(SubSystem ss)
- {
- _ss = ss;
- }
-
- public void run()
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- registry.connectedStatusChange(_ss, true, false);
- }
- }
-
- /**
- * Subclasses must override this method to perform the operation.
- * Clients should never call this method directly.
- *
- * @param monitor
- * @throws Exception
- * @throws InterruptedException
- */
- protected void execute(IProgressMonitor monitor) throws Exception, InterruptedException
- {
- SubSystem ss = (SubSystem)_adapter.getSubSystem(_remoteObject);
- synchronized (ss.getConnectorService())
- {
- if (!ss.isConnected())
- {
-
- Display dis = Display.getDefault();
- dis.syncExec(new PromptForPassword(ss));
- try
- {
- ss.getConnectorService().connect(monitor);
- if (_exc != null)
- {
- showOperationErrorMessage(null, _exc, ss);
- }
- }
- catch (InvocationTargetException exc)
- {
- showOperationErrorMessage(null, exc, ss);
- }
- catch (Exception e)
- {
- showOperationErrorMessage(null, e, ss);
- }
-
- dis.asyncExec(new UpdateRegistry(ss));
-
- }
- }
- Object[] children = _adapter.getChildren(monitor, _remoteObject);
- _collector.add(children, monitor);
- monitor.done();
- }
-
- protected void showOperationErrorMessage(Shell shell, Throwable exc, SubSystem ss)
- {
- SystemMessage sysMsg = null;
- if (exc instanceof SystemMessageException)
- {
- displayAsyncMsg(ss, (SystemMessageException)exc);
- //sysMsg = ((SystemMessageException)exc).getSystemMessage();
- }
- else
- {
- String excMsg = exc.getMessage();
- if ((excMsg == null) || (excMsg.length()==0))
- excMsg = "Exception " + exc.getClass().getName();
- sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_FAILED);
- sysMsg.makeSubstitution(excMsg);
-
-
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, sysMsg);
- msgDlg.setException(exc);
- msgDlg.open();
- //RSEUIPlugin.logError("Operation failed",exc); now done successfully in msgDlg.open()
- }
-
- }
-
- /**
- * Display message on message thread
- */
- protected void displayAsyncMsg(SubSystem ss, org.eclipse.rse.services.clientserver.messages.SystemMessageException msg)
- {
- DisplayErrorMessageJob job = new DisplayErrorMessageJob(null, msg);
- job.setPriority(Job.INTERACTIVE);
- job.setSystem(true);
- job.schedule();
- }
-
- protected String getTaskName()
- {
- return GenericMessages.RSEQuery_task;
- }
-
- /**
- * Run the operation in a context that is determined by the {@link #canRunAsJob()}
- * hint. If this operation can run as a job then it will be run in a background thread.
- * Otherwise it will run in the foreground and block the caller.
- */
- public final void run() throws InvocationTargetException, InterruptedException {
- if (shouldRun()) {
- getRunnableContext().run(this);
- }
- }
-
- /**
- * This method is invoked from the <code>run()</code> method before
- * the operation is run in the operation's context. Subclasses may
- * override in order to perform prechecks to determine if the operation
- * should run. This may include prompting the user for information, etc.
- *
- * @return whether the operation should be run.
- */
- protected boolean shouldRun() {
- return true;
- }
-
- /**
- * Returns the scheduling rule that is to be obtained before this
- * operation is executed by it's context or <code>null</code> if
- * no scheduling rule is to be obtained. If the operation is run
- * as a job, the schdulin rule is used as the schduling rule of the
- * job. Otherwise, it is obtained before execution of the operation
- * occurs.
- * <p>
- * By default, no scheduling
- * rule is obtained. Sublcasses can override to in order ot obtain a
- * scheduling rule or can obtain schduling rules withing their operation
- * if finer grained schduling is desired.
- *
- * @return the schduling rule to be obtained by this operation
- * or <code>null</code>.
- */
- protected ISchedulingRule getSchedulingRule() {
- return null;
- }
-
- /**
- * Return whether the auto-build should be postponed until after
- * the operation is complete. The default is to postpone the auto-build.
- * subclas can override.
- *
- * @return whether to postpone the auto-build while the operation is executing.
- */
- protected boolean isPostponeAutobuild() {
- return true;
- }
-
-
- /**
- * If this operation can safely be run in the background, then subclasses can
- * override this method and return <code>true</code>. This will make their
- * action run in a {@link org.eclipse.core.runtime.Job}.
- * Subsclass that override this method should
- * also override the <code>getJobName()</code> method.
- *
- * @return <code>true</code> if this action can be run in the background and
- * <code>false</code> otherwise.
- */
- protected boolean canRunAsJob() {
- return _canRunAsJob;
- }
-
- /**
- * Return the job name to be used if the action can run as a job. (i.e.
- * if <code>canRunAsJob()</code> returns <code>true</code>).
- *
- * @return the string to be used as the job name
- */
- protected String getJobName() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * This method is called to allow subclasses to configure an action that could be run to show
- * the results of the action to the user. Default is to return null.
- *
- * @return an action that could be run to see the results of this operation
- */
- protected IAction getGotoAction() {
- return null;
- }
-
- /**
- * This method is called to allow subclasses to configure an icon to show when running this
- * operation.
- *
- * @return an URL to an icon
- */
- protected URL getOperationIcon() {
- return null;
- }
-
- /**
- * This method is called to allow subclasses to have the operation remain in the progress
- * indicator even after the job is done.
- *
- * @return <code>true</code> to keep the operation and <code>false</code> otherwise.
- */
- protected boolean getKeepOperation() {
- return false;
- }
-
- /**
- * Return a shell that can be used by the operation to display dialogs, etc.
- *
- * @return a shell
- */
- protected Shell getShell()
- {
- return SystemBasePlugin.getActiveWorkbenchShell();
- }
-
- private ISystemRunnableContext getRunnableContext() {
- if (context == null && canRunAsJob()) {
- SystemJobRunnableContext context = new SystemJobRunnableContext(getJobName(), getOperationIcon(), getGotoAction(), getKeepOperation(), this, getSite());
- context.setPostponeBuild(isPostponeAutobuild());
- context.setSchedulingRule(getSchedulingRule());
- return context;
- } else {
- SystemProgressDialogRunnableContext context = new SystemProgressDialogRunnableContext(getShell());
- context.setPostponeBuild(isPostponeAutobuild());
- context.setSchedulingRule(getSchedulingRule());
- if (this.context != null) {
- context.setRunnableContext(this.context);
- }
- return context;
- }
- }
-
-
-
-
- private IWorkbenchSite getSite() {
- IWorkbenchSite site = null;
- if(_part != null) {
- site = _part.getSite();
- }
- return site;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemJobRunnableContext.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemJobRunnableContext.java
deleted file mode 100644
index 095b7b416..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemJobRunnableContext.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.progress.IProgressConstants;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-
-
-/**
- * This runnable context executes its operation in the context of a background job.
- */
-public final class SystemJobRunnableContext implements ISystemRunnableContext {
-
- private IJobChangeListener listener;
- private IWorkbenchSite site;
- private String jobName;
- private ISchedulingRule schedulingRule;
- private boolean postponeBuild;
- private boolean isUser;
- private URL icon;
- private boolean keep;
- private IAction action;
-
- /**
- * Constructor.
- * @param jobName the name of the job.
- */
- public SystemJobRunnableContext(String jobName) {
- this(jobName, null, null, false, null, null);
- }
-
- /**
- * Constructor.
- * @param jobName the name of the job.
- * @param icon the icon for the job.
- * @param action the action for the job.
- * @param keep keep the job in the UI even after it is finished.
- * @param listener listener for job changes.
- * @param site the workbench site.
- */
- public SystemJobRunnableContext(String jobName, URL icon, IAction action, boolean keep, IJobChangeListener listener, IWorkbenchSite site) {
- this.jobName = jobName;
- this.listener = listener;
- this.site = site;
- this.isUser = true;
- this.action = action;
- this.icon = icon;
- this.keep = keep;
- }
-
- /**
- * @see org.eclipse.rse.ui.operations.ISystemRunnableContext#run(org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(IRunnableWithProgress runnable) {
-
- // the job
- Job job;
-
- // if there is no scheduling rule, and auto-builds do not have to be postponed
- // then use a basic job
- if (schedulingRule == null && !postponeBuild) {
- job = getBasicJob(runnable);
- }
- // otherwise we need a workspace job for which a scheduling rule needs to be set
- else {
- job = getWorkspaceJob(runnable);
-
- // set scheduling rule if it exists
- if (schedulingRule != null) {
- job.setRule(schedulingRule);
- }
- }
-
- // add a job change listener if there is one
- if (listener != null) {
- job.addJobChangeListener(listener);
- }
-
- // sets whether the job is user initiated
- job.setUser(isUser());
-
- // configure the job
- configureJob(job);
-
- // schedult the job
- schedule(job, site);
- }
-
- /**
- * Configures the properties of the given job.
- * @param job the job to configure.
- */
- private void configureJob(Job job) {
-
- // whether to keep the job in the UI after the job has finished to report results
- // back to the user
- if(keep) {
- job.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
- }
-
- // an action associated with the job if any
- if(action != null) {
- job.setProperty(IProgressConstants.ACTION_PROPERTY, action);
- }
-
- // an icon associated with the job if any
- if(icon != null) {
- job.setProperty(IProgressConstants.ICON_PROPERTY, icon);
- }
- }
-
- /**
- * Returns the shell.
- * @see org.eclipse.rse.ui.operations.ISystemRunnableContext#getShell()
- */
- public Shell getShell() {
- return SystemBasePlugin.getActiveWorkbenchShell();
- }
-
- /**
- * Returns whether auto-builds will be postponed while this
- * context is executing a runnable.
- * @return <code>true</code> if auto-builds will be postponed while this
- * context is executing a runnable, <code>false</code> otherwise.
- */
- public boolean isPostponeBuild() {
- return postponeBuild;
- }
-
- /**
- * Sets whether auto-builds will be postponed while this
- * context is executing a runnable.
- * @param postponeBuild <code>true</code> to postpone auto-builds, <code>false</code> otherwise.
- */
- public void setPostponeBuild(boolean postponeBuild) {
- this.postponeBuild = postponeBuild;
- }
-
- /**
- * Returns the scheduling rule that will be obtained before the context
- * executes a runnable, or <code>null</code> if no scheduling rule is to be obtained.
- * @return the schedulingRule to be used or <code>null</code>.
- */
- public ISchedulingRule getSchedulingRule() {
- return schedulingRule;
- }
-
- /**
- * Returns whether the job created by this runnable context is user initiated.
- * @return <code>true</code> if the job is a result of user initiated actions, <code>false</code> otherwise.
- */
- public boolean isUser() {
- return isUser;
- }
-
- /**
- * Sets wheter the job created by this runnable context is user initiated.
- * By default, the job is a user initiated job.
- * @param isUser <code>true</code> if the job is a result of user initiated actions, <code>false</code> otherwise.
- */
- public void setUser(boolean isUser) {
- this.isUser = isUser;
- }
-
- /**
- * Sets the scheduling rule that will be obtained before the context
- * executes a runnable, or <code>null</code> if no scheduling rule is to be obtained.
- * @param schedulingRule the scheduling rule to be used or <code>null</code>.
- */
- public void setSchedulingRule(ISchedulingRule schedulingRule) {
- this.schedulingRule = schedulingRule;
- }
-
- /**
- * Runs the runnable with the given monitor.
- * @param runnable the runnable.
- * @param monitor the progress monitor.
- * @return the status of running the runnable.
- */
- IStatus run(IRunnableWithProgress runnable, IProgressMonitor monitor) {
-
- // run the runnable
- try {
- runnable.run(monitor);
- }
- catch (InvocationTargetException e) {
- Throwable target = e.getTargetException();
- String msg = "";
-
- if (target != null) {
- msg = target.getMessage();
- }
-
- // return an error status
- return new Status(IStatus.ERROR, RSEUIPlugin.getDefault().getSymbolicName(), 0, msg, target);
- }
- catch (InterruptedException e) {
- return Status.OK_STATUS;
- }
-
- return Status.OK_STATUS;
- }
-
- /**
- * Returns a basic job which simply runs the runnable.
- * @param runnable the runnable.
- * @return the basic job.
- */
- private Job getBasicJob(final IRunnableWithProgress runnable) {
- return new Job(jobName) {
- public IStatus run(IProgressMonitor monitor) {
- return SystemJobRunnableContext.this.run(runnable, monitor);
- }
- };
- }
-
- /**
- * Returns a workspace job which simply runs the runnable.
- * @param runnable the runnable.
- * @return the workspace job.
- */
- private Job getWorkspaceJob(final IRunnableWithProgress runnable) {
- return new WorkspaceJob(jobName) {
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- return SystemJobRunnableContext.this.run(runnable, monitor);
- }
- };
- }
-
- /**
- * Schedules the job.
- * @param job the job to schedule.
- * @param site the workbench site.
- */
- public static void schedule(Job job, IWorkbenchSite site) {
-
- if (site != null) {
-
- // get the site progress service
- IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService)(site.getAdapter(IWorkbenchSiteProgressService.class));
-
- // if there is one, schedule the job with a half-busy cursor
- if (siteProgress != null) {
- siteProgress.schedule(job, 0, true);
- return;
- }
- }
-
- // if no site progress service, just schedule the job in the job queue
- job.schedule();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemProgressDialogRunnableContext.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemProgressDialogRunnableContext.java
deleted file mode 100644
index 02c827f98..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemProgressDialogRunnableContext.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * This runnable context blocks the UI and can therefore have a shell assigned to
- * it (since the shell won't be closed by the user before the runnable completes).
- */
-public class SystemProgressDialogRunnableContext implements ISystemRunnableContext {
-
- private Shell shell;
- private IRunnableContext runnableContext;
- private ISchedulingRule schedulingRule;
- private boolean postponeBuild;
-
- /**
- * Constructor.
- * @param shell the shell for the runnable context.
- */
- public SystemProgressDialogRunnableContext(Shell shell) {
- this.shell = shell;
- }
-
- /**
- * Returns whether the auto-build will be postponed while this
- * context is executing a runnable.
- * @return <code>true</code> if the auto-build will be postponed while this
- * context is executing a runnable, <code>false</code> otherwise.
- */
- public boolean isPostponeBuild() {
- return postponeBuild;
- }
-
- /**
- * Sets whether the auto-build will be postponed while this
- * context is executing a runnable.
- * @param postponeBuild <code>true</code> to postpone the auto-build, <code>false</code< otherwise.
- */
- public void setPostponeBuild(boolean postponeBuild) {
- this.postponeBuild = postponeBuild;
- }
-
- /**
- * Returns the scheduling rule that will be obtained before the context
- * executes a runnable or <code>null</code> if no scheduling rule is to be obtained.
- * @return the scheduling rule to be obtained or <code>null</code>.
- */
- public ISchedulingRule getSchedulingRule() {
- return schedulingRule;
- }
-
- /**
- * Sets the scheduling rule that will be obtained before the context
- * executes a runnable or <code>null</code> if no scheduling rule is to be obtained.
- * @param schedulingRule the scheduling rule to be obtained or <code>null</code>.
- */
- public void setSchedulingRule(ISchedulingRule schedulingRule) {
- this.schedulingRule = schedulingRule;
- }
-
- /**
- * Returns the shell.
- * @see org.eclipse.rse.ui.operations.ISystemRunnableContext#getShell()
- */
- public Shell getShell() {
- return shell;
- }
-
- /**
- * Sets the runnable context that is used to execute the runnable. By default,
- * the workbench's progress service is used, but clients can provide their own.
- * @param runnableContext the runnable contenxt used to execute runnables.
- */
- public void setRunnableContext(IRunnableContext runnableContext) {
- this.runnableContext = runnableContext;
- }
-
- /**
- * Runs the runnable.
- * @see org.eclipse.rse.ui.operations.ISystemRunnableContext#run(org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- // fork and cancellable
- getRunnableContext().run(true, true, wrapRunnable(runnable));
- }
-
- /**
- * Returns the runnable context. If a runnable context was not set, the default is to use the workbench
- * progress service.
- * @return the runnable context.
- */
- private IRunnableContext getRunnableContext() {
-
- // no runnable context set, so we create our default
- if (runnableContext == null) {
-
- return new IRunnableContext() {
-
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
-
- // get the workbench progress service
- IProgressService manager = PlatformUI.getWorkbench().getProgressService();
-
- // run the runnable in a non-UI thread and set the cursor to busy
- manager.busyCursorWhile(runnable);
- }
- };
- }
-
- return runnableContext;
- }
-
- /**
- * Wraps the runnable as required and returns the wrapper runnable. If there is no scheduling rule, and
- * auto-builds do not have to be postponed, then the wrapper simply defers to the runnable. Otherwise,
- * we execute the runnable as an atomic workspace operation.
- * @param runnable the runnable to wrap.
- * @return the wrapper runnable.
- */
- private IRunnableWithProgress wrapRunnable(final IRunnableWithProgress runnable) {
-
- // wrap the runnable in another runnable
- return new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-
- try {
-
- // if there is no scheduling rule, and if auto-build does not have to be postponed
- // then simply use the given runnable
- if (schedulingRule == null && !postponeBuild) {
- runnable.run(monitor);
- }
- // otherwise, we need to run taking into account the scheduling rule
- else {
-
- // array for holding exceptions
- final Exception[] exception = new Exception[] { null };
-
- // we run as an atomic workspace operation with a scheduling rule and allow updates
- // create a workspace runnable
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor pm) throws CoreException {
- try {
- // just use the given runnable
- runnable.run(pm);
- }
- catch (InvocationTargetException e) {
- exception[0] = e;
- }
- catch (InterruptedException e) {
- exception[0] = e;
- }
- }
- }, schedulingRule, 0, monitor);
-
- if (exception[0] != null) {
- if (exception[0] instanceof InvocationTargetException) {
- throw (InvocationTargetException)exception[0];
- }
- else if (exception[0] instanceof InterruptedException) {
- throw (InterruptedException)exception[0];
- }
- }
- }
- }
- catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemSchedulingRule.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemSchedulingRule.java
deleted file mode 100644
index 6b2bbb675..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemSchedulingRule.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.operations;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-/**
- * A simple job scheduling rule for serializing jobs for an ICVSRepositoryLocation
- */
-public class SystemSchedulingRule implements ISchedulingRule {
- IAdaptable _location;
-
- public SystemSchedulingRule(IAdaptable location)
- {
- _location = location;
- }
-
- public boolean isConflicting(ISchedulingRule rule)
- {
- if(rule instanceof SystemSchedulingRule)
- {
- return ((SystemSchedulingRule)rule)._location.equals(_location);
- }
- return false;
- }
-
- public boolean contains(ISchedulingRule rule)
- {
- return isConflicting(rule);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/AbstractSystemSubSystemPropertyPageCoreForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/AbstractSystemSubSystemPropertyPageCoreForm.java
deleted file mode 100644
index 9d074158e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/AbstractSystemSubSystemPropertyPageCoreForm.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-/**
- * The form for the property page for core subsystem properties.
- */
-public abstract class AbstractSystemSubSystemPropertyPageCoreForm
- implements ISystemSubSystemPropertyPageCoreForm
-{
-
- protected Label labelTypePrompt, labelVendorPrompt, labelNamePrompt, labelConnectionPrompt, labelProfilePrompt;
-
- protected Label labelType, labelVendor, labelName, labelConnection, labelProfile;
-
- protected SystemMessage errorMessage;
- protected ResourceBundle rb;
- protected boolean initDone = false;
- protected String xlatedNotApplicable = null;
- // Inputs from caller
- protected ISystemMessageLine msgLine;
- protected Object inputElement;
- protected Shell shell;
- protected Object caller;
- protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog, callerInstanceOfPropertyPage;
-
- /**
- * Constructor
- */
- public AbstractSystemSubSystemPropertyPageCoreForm(ISystemMessageLine msgLine, Object caller)
- {
- super();
- this.msgLine = msgLine;
- this.caller = caller;
- callerInstanceOfWizardPage = (caller instanceof WizardPage);
- callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
- callerInstanceOfPropertyPage = (caller instanceof PropertyPage);
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- }
- /**
- * Get the input element
- */
- private Object getElement()
- {
- return inputElement;
- }
- /**
- * Get the shell
- */
- protected Shell getShell()
- {
- return shell;
- }
-
-
-
- /**
- * Create the GUI contents.
- */
- public Control createContents(Composite parent, Object inputElement, Shell shell)
- {
- this.shell = shell;
- this.inputElement = inputElement;
- String labelText = null;
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type display
- labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_TYPE_LABEL);
- labelTypePrompt = SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- labelType = SystemWidgetHelpers.createLabel(composite_prompts, SystemResources.RESID_SUBSYSTEM_TYPE_VALUE);
-
- // Vendor display
- labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_VENDOR_LABEL);
- labelVendorPrompt = SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- labelVendor = SystemWidgetHelpers.createLabel(composite_prompts, " ");
-
- // Name display
- labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_NAME_LABEL);
- labelNamePrompt = SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- labelName = SystemWidgetHelpers.createLabel(composite_prompts, " ");
-
- // Connection display
- labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_CONNECTION_LABEL);
- labelConnectionPrompt = SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- labelConnection = SystemWidgetHelpers.createLabel(composite_prompts, " ");
-
- // Profile display
- labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_PROFILE_LABEL);
- labelProfilePrompt = SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- labelProfile = SystemWidgetHelpers.createLabel(composite_prompts, " ");
-
- createInner(composite_prompts, inputElement, shell);
-
- return composite_prompts;
- }
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- return null;
- }
- /**
- * Get the input subsystem object
- */
- protected ISubSystem getSubSystem()
- {
- Object element = getElement();
- if (element instanceof ISubSystem)
- return (ISubSystem)element;
- else
- return null;
- }
-
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISubSystem ss = getSubSystem();
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
-
- //getPortValidator();
- // vendor
- labelVendor.setText(ssFactory.getVendor());
- // name
- labelName.setText(ss.getName());
- // connection
- labelConnection.setText(ss.getHostAliasName());
- // profile
- labelProfile.setText(ss.getSystemProfileName());
-
- doInitializeInnerFields();
- }
-
-
-
-
-
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
- return pageComplete;
- }
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- boolean complete = isPageComplete();
- if (callerInstanceOfWizardPage)
- {
- ((WizardPage)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- ((SystemPromptDialog)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfPropertyPage)
- {
- ((PropertyPage)caller).setValid(complete);
- }
- }
-
-
-
-
-
-
- /*
- * Create the inner portion of the contents. These include any additional fields for the subsystem
- */
- protected abstract Control createInner(Composite parent, Object inputElement, Shell shell);
-
- /*
- * Initialize the inner portion of the contents. These include any additional fields for the subsystem
- */
- protected abstract void doInitializeInnerFields();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardErrorUpdater.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardErrorUpdater.java
deleted file mode 100644
index 9391d4d61..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardErrorUpdater.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.ui.ISystemVerifyListener;
-
-/**
- * @author mjberger
- */
-public interface ISystemConnectionWizardErrorUpdater
-{
- public boolean isPageComplete();
- public void addVerifyListener(ISystemVerifyListener listener);
- public String getTheErrorMessage();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java
deleted file mode 100644
index 8c4ca3085..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-
-/**
- * interface for a property page that can be shown in the new connection wizard
- */
-public interface ISystemConnectionWizardPropertyPage
-{
- public boolean applyValues(IConnectorService subsystem);
- public void setSubSystemConfiguration(ISubSystemConfiguration factory);
- public void setHostname(String hostname);
- public void setSystemType(String systemType);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemSubSystemPropertyPageCoreForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemSubSystemPropertyPageCoreForm.java
deleted file mode 100644
index d72999205..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemSubSystemPropertyPageCoreForm.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * interface for a property page that can be shown in the new connection wizard
- */
-public interface ISystemSubSystemPropertyPageCoreForm
-{
- /**
- * Create the GUI contents.
- */
- public Control createContents(Composite parent, Object inputElement, Shell shell);
-
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk();
-
- /**
- * Validate the form
- * <p>
- * Subclasses should override to do full error checking on all
- * the widgets on the form.
- */
- public boolean verifyFormContents();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java
deleted file mode 100644
index 227f5c678..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
-import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.RSESystemTypeAdapter;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-
-/**
- * Root preference page for Remote Systems Plugin
- */
-public class RemoteSystemsPreferencePage
- extends FieldEditorPreferencePage implements IWorkbenchPreferencePage,
- ISystemPreferencesConstants
-{
- private SystemBooleanFieldEditor showFilterPoolsEditor;
- private SystemBooleanFieldEditor qualifyConnectionNamesEditor;
- private SystemBooleanFieldEditor rememberStateEditor;
- private SystemBooleanFieldEditor useDeferredQueryEditor;
-
- // yantzi: artemis 60, restore from cache when available
- private SystemBooleanFieldEditor restoreFromCache;
- private Composite innerComposite;
-
- private SystemTypeFieldEditor systemTypesEditor;
- private SystemBooleanFieldEditor showNewConnectionPromptEditor;
- private boolean lastShowFilterPoolsValue = false;
- private boolean lastQualifyConnectionNamesValue = false;
- private boolean lastRememberStateValue = true; // changed in R2 by Phil. Not sure about migration!
-// private boolean lastRestoreFromCacheValue = true; // yantzi: new in artemis 6.0
- private boolean lastShowNewConnectionPromptValue = true;
- private boolean lastUseDeferredQueryValue = false;
-
- /**
- * Constructor
- */
- public RemoteSystemsPreferencePage()
- {
- super(GRID);
- setTitle(SystemResources.RESID_PREF_ROOT_PAGE);
- setPreferenceStore(RSEUIPlugin.getDefault().getPreferenceStore());
-// setDescription(SystemResources.RESID_PREF_ROOT_TITLE); // removed since this is not read by screen reader
- }
- /**
- * We intercept to set the help
- */
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), RSEUIPlugin.HELPPREFIX+"rsep0000");
- }
-
- /**
- * GUI widgets for preferences page
- */
- protected void createFieldEditors()
- {
- // DEFAULT SYSTEM TYPE
- SystemComboBoxFieldEditor systemTypeEditor = new SystemComboBoxFieldEditor(
- ISystemPreferencesConstants.SYSTEMTYPE,
- SystemResources.RESID_PREF_SYSTEMTYPE_PREFIX_LABEL,
- RSECorePlugin.getDefault().getRegistry().getSystemTypeNames(),
- true, // readonly
- getFieldEditorParent()
- );
- systemTypeEditor.setToolTipText(SystemResources.RESID_PREF_SYSTEMTYPE_PREFIX_TOOLTIP);
- addField(systemTypeEditor);
-
- // ENABLED STATE AND DEFAULT USERID PER SYSTEM TYPE
- systemTypesEditor = new SystemTypeFieldEditor(
- ISystemPreferencesConstants.SYSTEMTYPE_VALUES,
- SystemResources.RESID_PREF_USERID_PERTYPE_PREFIX_LABEL,
- getFieldEditorParent()
- );
- addField(systemTypesEditor);
- systemTypesEditor.setToolTipText(SystemResources.RESID_PREF_USERID_PERTYPE_PREFIX_TOOLTIP);
-
- // QUALIFY CONNECTION NAMES
- qualifyConnectionNamesEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.QUALIFY_CONNECTION_NAMES,
- SystemResources.RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_LABEL,
- getFieldEditorParent()
- );
- addField(qualifyConnectionNamesEditor);
- qualifyConnectionNamesEditor.setToolTipText(SystemResources.RESID_PREF_QUALIFYCONNECTIONNAMES_PREFIX_TOOLTIP);
- lastQualifyConnectionNamesValue = getPreferenceStore().getBoolean(qualifyConnectionNamesEditor.getPreferenceName());
-
- // SHOW FILTER POOLS
- showFilterPoolsEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.SHOWFILTERPOOLS,
- SystemResources.RESID_PREF_SHOWFILTERPOOLS_PREFIX_LABEL,
- getFieldEditorParent()
- );
- addField(showFilterPoolsEditor);
- showFilterPoolsEditor.setToolTipText(SystemResources.RESID_PREF_SHOWFILTERPOOLS_PREFIX_TOOLTIP);
- lastShowFilterPoolsValue = getPreferenceStore().getBoolean(showFilterPoolsEditor.getPreferenceName());
-
- // SHOW "NEW CONNECTION..." PROMPT INSIDE REMOTE SYSTEMS VIEW
- showNewConnectionPromptEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.SHOWNEWCONNECTIONPROMPT,
- SystemResources.RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_LABEL,
- getFieldEditorParent()
- );
- addField(showNewConnectionPromptEditor);
- showNewConnectionPromptEditor.setToolTipText(SystemResources.RESID_PREF_SHOWNEWCONNECTIONPROMPT_PREFIX_TOOLTIP);
- lastShowNewConnectionPromptValue = getPreferenceStore().getBoolean(showNewConnectionPromptEditor.getPreferenceName());
-
- // REMEMBER STATE
- rememberStateEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.REMEMBER_STATE,
- SystemResources.RESID_PREF_REMEMBERSTATE_PREFIX_LABEL,
- getFieldEditorParent()
- );
- addField(rememberStateEditor);
- rememberStateEditor.setToolTipText(SystemResources.RESID_PREF_REMEMBERSTATE_PREFIX_TOOLTIP);
- lastRememberStateValue = getPreferenceStore().getBoolean(rememberStateEditor.getPreferenceName());
-
- // Restore from cache
- innerComposite = SystemWidgetHelpers.createComposite(getFieldEditorParent(), SWT.NULL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalIndent = 20;
- innerComposite.setLayoutData(gd);
- restoreFromCache = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE,
- SystemResources.RESID_PREF_RESTOREFROMCACHE_PREFIX_LABEL,
- innerComposite
- );
- restoreFromCache.setEnabled(lastRememberStateValue, innerComposite);
- addField(restoreFromCache);
- restoreFromCache.setToolTipText(SystemResources.RESID_PREF_RESTOREFROMCACHE_PREFIX_TOOLTIP);
-// lastRestoreFromCacheValue = getPreferenceStore().getBoolean(ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE);
-
- // USE DEFERRED QUERY
- useDeferredQueryEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.USE_DEFERRED_QUERIES,
- SystemResources.RESID_PREF_USEDEFERREDQUERIES_PREFIX_LABEL,
- getFieldEditorParent())
- ;
- addField(useDeferredQueryEditor);
- useDeferredQueryEditor.setToolTipText(SystemResources.RESID_PREF_USEDEFERREDQUERIES_PREFIX_TOOLTIP);
- lastUseDeferredQueryValue = getPreferenceStore().getBoolean(useDeferredQueryEditor.getPreferenceName());
-
- /** FIXME - UDA should not be so coupled to core
- * might need a new preference page for this
- // CASCADE USER-DEFINED ACTIONS BY PROFILE
- SystemBooleanFieldEditor cascadeUDAsEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.CASCADE_UDAS_BYPROFILE,
- SystemUDAResources.RESID_PREF_UDAS_CASCADEBYPROFILE_LABEL,
- getFieldEditorParent()
- );
- addField(cascadeUDAsEditor);
- cascadeUDAsEditor.setToolTipText(SystemUDAResources.RESID_PREF_UDAS_CASCADEBYPROFILE_TOOLTIP);
- lastCascadeUDAsValue = getPreferenceStore().getBoolean(cascadeUDAsEditor.getPreferenceName());
- **/
- // set mnemonics
- (new Mnemonics()).setOnPreferencePage(true).setMnemonics(getFieldEditorParent());
-
- }
-
- // ---------------------------------------------------------
- // GETTERS/SETTERS FOR EACH OF THE USER PREFERENCE VALUES...
- // ---------------------------------------------------------
- // DWD these preferences methods should be moved to SystemPreferencesManager since they are not a proper function of a preference page.
- /**
- * Return the names of the profiles the user has elected to make "active".
- */
- public static String[] getActiveProfiles()
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- return parseStrings(store.getString(ISystemPreferencesConstants.ACTIVEUSERPROFILES));
- }
-
- /**
- * Set the names of the profiles the user has elected to make "active".
- */
- public static void setActiveProfiles(String[] newProfileNames)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.ACTIVEUSERPROFILES, makeString(newProfileNames));
- savePreferenceStore();
- }
-
- /**
- * Return the ordered list of connection names. This is how user arranged his connections in the system view.
- */
- public static String[] getConnectionNamesOrder()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return parseStrings(store.getString(ISystemPreferencesConstants.ORDER_CONNECTIONS));
- }
- /**
- * Set the ordered list of connection names. This is how user arranged his connections in the system view.
- */
- public static void setConnectionNamesOrder(String[] newConnectionNamesOrder)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.ORDER_CONNECTIONS, makeString(newConnectionNamesOrder));
- savePreferenceStore();
- }
- /**
- * Return true if the user has elected to show filter pools in the remote systems explorer view
- */
- public static boolean getShowFilterPoolsPreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.SHOWFILTERPOOLS);
- }
- /**
- * Toggle whether to show filter pools in the remote systems explorer view
- */
- public static void setShowFilterPoolsPreference(boolean show)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.SHOWFILTERPOOLS,show);
- savePreferenceStore();
- }
-
- /**
- * Return true if the user has elected to show the "New Connection..." prompt in the Remote Systems view
- */
- public static boolean getShowNewConnectionPromptPreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- boolean value = store.getBoolean(ISystemPreferencesConstants.SHOWNEWCONNECTIONPROMPT);
- return value;
- }
- /**
- * Toggle whether to show filter pools in the remote systems explorer view
- */
- public static void setShowNewConnectionPromptPreference(boolean show)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.SHOWNEWCONNECTIONPROMPT,show);
- savePreferenceStore();
- }
-
- /**
- * Return true if the user has elected to show connection names qualified by profile
- */
- public static boolean getQualifyConnectionNamesPreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.QUALIFY_CONNECTION_NAMES);
- }
- /**
- * Set if the user has elected to show connection names qualified by profile
- */
- public static void setQualifyConnectionNamesPreference(boolean set)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.QUALIFY_CONNECTION_NAMES,set);
- savePreferenceStore();
- }
-
- /**
- * Return true if the user has elected to remember the state of the Remote Systems view
- */
- public static boolean getRememberStatePreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.REMEMBER_STATE);
- }
- /**
- * Set if the user has elected to show connection names qualified by profile
- */
- public static void setRememberStatePreference(boolean set)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.REMEMBER_STATE,set);
- savePreferenceStore();
- }
-
- /**
- * Return true if the user has elected to restore the state of the Remote Systems view from cached information
- */
- public static boolean getRestoreStateFromCachePreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE);
- }
-
- /**
- * Set if the user has elected to restore the state of the Remote Systems view from cached information
- */
- public static void setRestoreStateFromCachePreference(boolean set)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE, set);
- savePreferenceStore();
- }
-
- /**
- * Return true if the user has elected to show user defined actions cascaded by profile
- */
- public static boolean getCascadeUserActionsPreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.CASCADE_UDAS_BYPROFILE);
- }
- /**
- * Set if the user has elected to show user defined actions cascaded by profile
- */
- public static void setCascadeUserActionsPreference(boolean set)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(ISystemPreferencesConstants.CASCADE_UDAS_BYPROFILE,set);
- savePreferenceStore();
- }
- /**
- * Return the userId to default to on the Create Connection wizard, per the given system type.
- *
- * @see SystemConnectionForm
- */
- public static String getUserIdPreference(String systemType)
- {
- if (systemType == null)
- return null;
-
- IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemType);
- Object adapter = sysType.getAdapter(IRSESystemType.class);
- if (adapter instanceof RSESystemTypeAdapter)
- {
- RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)adapter;
- return sysTypeAdapter.getDefaultUserId(sysType);
- }
- else
- return null;
- }
-
- /**
- * Set the default userId per the given system type.
- */
- public static void setUserIdPreference(String systemType, String userId)
- {
- IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemType);
- RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
- if (sysTypeAdapter != null)
- sysTypeAdapter.setDefaultUserId(sysType, userId);
- else
- return;
- // following needs to stay in synch with modify() method in SystemTypeFieldEditor...
- String value = RSEUIPlugin.getDefault().getPreferenceStore().getString(ISystemPreferencesConstants.SYSTEMTYPE_VALUES);
- Hashtable keyValues = null;
- if ((value == null) || (value.length()==0)) // not initialized yet?
- {
- keyValues = new Hashtable();
- // nothing to do, as we have read from systemTypes extension points already
- }
- else
- {
- keyValues = parseString(value);
- }
-
- String defaultUserId = sysTypeAdapter.getDefaultUserId(sysType);
-
- if (defaultUserId == null) {
- defaultUserId = "null";
- }
-
- keyValues.put(sysType.getName(), "" + sysTypeAdapter.isEnabled(sysType) + SystemTypeFieldEditor.EACHVALUE_DELIMITER + defaultUserId); //$NON-NLS-1$
- String s = SystemTypeFieldEditor.createString(keyValues);
-
- if (s != null)
- RSEUIPlugin.getDefault().getPreferenceStore().setValue(ISystemPreferencesConstants.SYSTEMTYPE_VALUES, s);
-
- savePreferenceStore();
- }
-
-
-// /**
-// * Return the hashtable where the key is a string identifying a particular object, and
-// * the value is the user Id for that object.
-// */
-// public static Hashtable getUserIdsPerKey() // DWD remove this later
-// {
-// IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
-// Hashtable keyValues = null;
-// String value = store.getString(ISystemPreferencesConstants.USERIDPERKEY);
-// if (value != null)
-// keyValues = parseString(value);
-// else
-// {
-// keyValues = new Hashtable();
-// }
-// return keyValues;
-// }
-// /**
-// * Set/store the user ids that are saved keyed by some key.
-// */
-// public static void setUserIdsPerKey(Hashtable uidsPerKey) // DWD remove this later
-// {
-// IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
-// store.setValue(ISystemPreferencesConstants.USERIDPERKEY, makeString(uidsPerKey));
-// savePreferenceStore();
-// }
-
- /**
- * Return the System type to default to on the Create Connection wizard.
- *
- * @see SystemConnectionForm
- */
- public static String getSystemTypePreference()
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getString(ISystemPreferencesConstants.SYSTEMTYPE);
- }
-
- /**
- * Return the history for the folder combo box widget
- */
- public static String[] getFolderHistory()
- {
- return getWidgetHistory(ISystemPreferencesConstants.HISTORY_FOLDER);
- }
- /**
- * Set the history for the folder combo box widget.
- */
- public static void setFolderHistory(String[] newHistory)
- {
- setWidgetHistory(ISystemPreferencesConstants.HISTORY_FOLDER, newHistory);
- }
- /**
- * Return the history for a widget given an arbitrary key uniquely identifying it
- */
- public static String[] getWidgetHistory(String key)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- return parseStrings(store.getString(key));
- }
- /**
- * Set the history for a widget given an arbitrary key uniquely identifying it.
- */
- public static void setWidgetHistory(String key, String[] newHistory)
- {
- IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
- store.setValue(key, makeString(newHistory));
- savePreferenceStore();
- }
-
-
- // -------------------------------------------------
- // MISCELLANEOUS METHODS...
- // -------------------------------------------------
-
- /**
- * Parse out list of key-value pairs into a hashtable
- */
- protected static Hashtable parseString(String allvalues)
- {
- StringTokenizer tokens = new StringTokenizer(allvalues, "=;"); //$NON-NLS-1$
- Hashtable keyValues = new Hashtable(10);
- int count = 0;
- String token1=null;
- String token2=null;
- while (tokens.hasMoreTokens())
- {
- count++;
- if ((count % 2) == 0) // even number
- {
- token2 = tokens.nextToken();
- keyValues.put(token1, token2);
- }
- else
- token1 = tokens.nextToken();
- }
- return keyValues;
- }
- /**
- * Convert hashtable of key-value pairs into a single string
- */
-// protected static String makeString(Hashtable keyValues) DWD remove this later
-// {
-// Enumeration keys = keyValues.keys();
-// StringBuffer sb = new StringBuffer();
-// while (keys.hasMoreElements())
-// {
-// String key = (String)keys.nextElement();
-// String value = (String)keyValues.get(key);
-// if ((value != null) && (value.length()>0))
-// {
-// sb.append(key);
-// sb.append('=');
-// sb.append(value);
-// sb.append(';');
-// }
-// }
-// return sb.toString();
-// }
-
- /**
- * Parse out list of multiple values into a string array per value
- */
- protected static String[] parseStrings(String allvalues)
- {
- if (allvalues == null)
- return new String[0];
- //StringTokenizer tokens = new StringTokenizer(allvalues, ";");
- String[] tokens = allvalues.split(";"); //$NON-NLS-1$
- return tokens;
- /*
- Vector v = new Vector();
- int idx=0;
- while (tokens.hasMoreTokens())
- v.addElement(tokens.nextToken());
- String keyValues[] = new String[v.size()];
- for (idx=0;idx<v.size();idx++)
- keyValues[idx] = (String)v.elementAt(idx);
- return keyValues;
- */
- }
- /**
- * Make a single string out of an array of strings
- */
- protected static String makeString(String[] values)
- {
- StringBuffer allValues = new StringBuffer();
- boolean first = true;
- for (int idx=0; idx<values.length; idx++)
- {
- if (values[idx] != null)
- {
- if (!first)
- {
- allValues = allValues.append(';');
- }
- allValues.append(values[idx]);
- first = false;
- }
- }
- return allValues.toString();
- }
-
- /**
- * Save the preference store.
- */
- private static void savePreferenceStore()
- {
- /* plugin preferences and preference stores are actually the same store and are flushed to disk using this call */
- RSEUIPlugin.getDefault().savePluginPreferences();
- }
-
- public void init(IWorkbench workbench)
- {
- }
-
- /**
- * Initialize our preference store with our defaults.
- * This is called in RSEUIPlugin.initializeDefaultPreferences
- */
- public static void initDefaults(IPreferenceStore store, boolean showNewConnectionPromptDefault)
- {
- store.setDefault(ISystemPreferencesConstants.SYSTEMTYPE, ISystemPreferencesConstants.DEFAULT_SYSTEMTYPE);
- store.setDefault(ISystemPreferencesConstants.QUALIFY_CONNECTION_NAMES, ISystemPreferencesConstants.DEFAULT_QUALIFY_CONNECTION_NAMES);
- store.setDefault(ISystemPreferencesConstants.SHOWFILTERPOOLS, ISystemPreferencesConstants.DEFAULT_SHOWFILTERPOOLS);
-
- String defaultProfileNames = ISystemPreferencesConstants.DEFAULT_ACTIVEUSERPROFILES;
- String userProfileName = SystemProfileManager.getDefaultPrivateSystemProfileName();
- defaultProfileNames += ";" + userProfileName; //$NON-NLS-1$
-
-
- store.setDefault(ISystemPreferencesConstants.ACTIVEUSERPROFILES, defaultProfileNames);
- store.setDefault(ISystemPreferencesConstants.ORDER_CONNECTIONS, ISystemPreferencesConstants.DEFAULT_ORDER_CONNECTIONS);
- store.setDefault(ISystemPreferencesConstants.HISTORY_FOLDER, ISystemPreferencesConstants.DEFAULT_HISTORY_FOLDER);
- store.setDefault(ISystemPreferencesConstants.REMEMBER_STATE, ISystemPreferencesConstants.DEFAULT_REMEMBER_STATE);
- store.setDefault(ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE, ISystemPreferencesConstants.DEFAULT_RESTORE_STATE_FROM_CACHE);
- store.setDefault(ISystemPreferencesConstants.SHOWNEWCONNECTIONPROMPT, showNewConnectionPromptDefault);
- store.setDefault(ISystemPreferencesConstants.CASCADE_UDAS_BYPROFILE, ISystemPreferencesConstants.DEFAULT_CASCADE_UDAS_BYPROFILE);
-
- store.setDefault(ISystemPreferencesConstants.USE_DEFERRED_QUERIES, ISystemPreferencesConstants.DEFAULT_USE_DEFERRED_QUERIES);
- }
-
- /**
- * we don't use this after all because it causes an event to be fired as the
- * user makes each change. We prefer to wait until Apply or Defaults are pressed.
- */
- public void propertyChange(PropertyChangeEvent event)
- {
-
- // yantzi: artemis 6.0
- if (event.getSource() == rememberStateEditor)
- {
- Object newValue = event.getNewValue();
- if (newValue instanceof Boolean)
- {
- restoreFromCache.setEnabled(((Boolean) newValue).booleanValue(), innerComposite);
- }
- }
-
- super.propertyChange(event);
- }
-
- /**
- * Override of parent so we can fire changes to our views
- */
- public boolean performOk()
- {
- boolean ok = super.performOk();
- savePreferenceStore(); // better save to disk, just in case.
- if (!RSEUIPlugin.getDefault().isSystemRegistryActive())
- return ok;
- if (showFilterPoolsEditor != null)
- {
- boolean newValue = showFilterPoolsEditor.getBooleanValue();
- if (newValue != lastShowFilterPoolsValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().setShowFilterPools(newValue);
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_SHOWFILTERPOOLS,lastShowFilterPoolsValue,newValue);
- }
- lastShowFilterPoolsValue = newValue;
- }
- if (showNewConnectionPromptEditor != null)
- {
- boolean newValue = showNewConnectionPromptEditor.getBooleanValue();
- if (newValue != lastShowNewConnectionPromptValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().setShowNewHostPrompt(newValue);
- }
- lastShowNewConnectionPromptValue = newValue;
- }
- if (qualifyConnectionNamesEditor != null)
- {
- boolean newValue = qualifyConnectionNamesEditor.getBooleanValue();
- if (newValue != lastQualifyConnectionNamesValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().setQualifiedHostNames(newValue);
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_QUALIFYCONNECTIONNAMES,lastQualifyConnectionNamesValue,newValue);
- }
- lastQualifyConnectionNamesValue = newValue;
- }
- if (rememberStateEditor != null)
- {
- boolean newValue = rememberStateEditor.getBooleanValue();
- if (newValue != lastRememberStateValue)
- {
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_RESTORESTATE,lastRememberStateValue,newValue);
- }
- lastRememberStateValue = newValue;
- }
- if (useDeferredQueryEditor != null)
- {
- boolean newValue = useDeferredQueryEditor.getBooleanValue();
- if (newValue != lastUseDeferredQueryValue)
- {
- firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_RESTORESTATE,lastUseDeferredQueryValue,newValue);
- }
- lastUseDeferredQueryValue = newValue;
- }
-
- return ok;
- }
-
- /**
- * Fire a preference change event
- */
- private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
- {
- RSEUIPlugin.getDefault().getSystemRegistry().fireEvent(
- new SystemPreferenceChangeEvent(type,
- oldValue ? Boolean.TRUE : Boolean.FALSE,
- newValue ? Boolean.TRUE : Boolean.FALSE));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerConnectionSecurityPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerConnectionSecurityPropertyPage.java
deleted file mode 100644
index 25f6ff9ca..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerConnectionSecurityPropertyPage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.rse.core.comm.SystemKeystoreProviderManager;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.widgets.ServerConnectionSecurityForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-public class ServerConnectionSecurityPropertyPage extends SystemBasePropertyPage implements ISystemConnectionWizardPropertyPage
-{
-
-
- private ServerConnectionSecurityForm _form;
- private IConnectorService _connectorService;
-
- public ServerConnectionSecurityPropertyPage()
- {
- super();
- }
-
- /**
- * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#createContentArea(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Create property page UI
- _form = new ServerConnectionSecurityForm(getShell(), getMessageLine());
- _form.createContents(parent);
-
- initialize();
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "ssls0001");
-
- return parent;
- }
-
- /**
- * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#verifyPageContents()
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- private void initialize()
- {
- IPreferenceStore prefStore = RSEUIPlugin.getDefault().getPreferenceStore();
-
- boolean alertSSL = prefStore.getBoolean(ISystemPreferencesConstants.ALERT_SSL);
- boolean alertNonSSL = prefStore.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL);
-
- // enable/disable as appropriate
- _form.setAlertSSL(alertSSL);
- _form.setAlertNonSSL(alertNonSSL);
-
- // if there is no keystore provider then this needs to be disabled
- boolean hasProvider = SystemKeystoreProviderManager.getInstance().hasProvider();
- if (!hasProvider)
- {
- _form.disable();
- }
- else
- {
- _form.enable();
- }
- }
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk()
- {
- Object subsystem = getElement();
-
- if (subsystem instanceof ISubSystem)
- {
- return applyValues(((ISubSystem)subsystem).getConnectorService());
- }
- return true;
- }
-
- public void setSubSystemConfiguration(ISubSystemConfiguration factory)
- {
- }
-
- public boolean applyValues(IConnectorService connectorService)
- {
- boolean alertSSL = _form.getAlertSSL();
- boolean alertNonSSL = _form.getAlertNonSSL();
- IPreferenceStore prefStore = RSEUIPlugin.getDefault().getPreferenceStore();
- prefStore.setValue(ISystemPreferencesConstants.ALERT_SSL, alertSSL);
- prefStore.setValue(ISystemPreferencesConstants.ALERT_NONSSL, alertNonSSL);
- return true;
- }
-
- public void setHostname(String name)
- {
- }
-
- public void setSystemType(String systemType)
- {
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerLauncherPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerLauncherPropertyPage.java
deleted file mode 100644
index 43acd85d7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServerLauncherPropertyPage.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemVerifyListener;
-import org.eclipse.rse.ui.widgets.IServerLauncherForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * Property page for editing persistant environment variables for an
- * RSE connection.
- */
-public class ServerLauncherPropertyPage extends SystemBasePropertyPage implements ISystemConnectionWizardPropertyPage, ISystemConnectionWizardErrorUpdater
-{
-
- private IServerLauncherForm _form;
- protected String _systemType;
- private IServerLauncherProperties sl;
- private ISubSystemConfiguration _factory;
-
- /**
- * Constructor for ServerLauncherPropertyPage.
- */
- public ServerLauncherPropertyPage()
- {
- super();
- }
-
- /**
- * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#createContentArea(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
-
- ISubSystemConfiguration factory = null;
- Object input = getElement();
- IConnectorService connectorService = null;
- if (input instanceof ISubSystem)
- {
- ISubSystem ss = (ISubSystem)input;
- connectorService = ss.getConnectorService();
- sl = connectorService.getRemoteServerLauncherProperties();
- factory = ss.getSubSystemConfiguration();
- }
- else if (input instanceof ISubSystemConfiguration)
- {
- factory = (ISubSystemConfiguration)input;
- }
- else
- {
- factory =_factory;
- }
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factory.getAdapter(ISubSystemConfigurationAdapter.class);
- _form = adapter.getServerLauncherForm(factory, getShell(), getMessageLine());
-
- // Create property page UI
- _form.createContents(parent);
- if (sl != null)
- {
- _form.setHostname(connectorService.getHost().getHostName());
- _form.initValues(sl);
- }
-
- return parent;
- }
-
- /**
- * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#verifyPageContents()
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- public void setSubSystemConfiguration(ISubSystemConfiguration factory)
- {
- _factory = factory;
- }
-
- public void setHostname(String hostName)
- {
- _form.setHostname(hostName);
- }
-
- public boolean applyValues(IConnectorService connectorService)
- {
- if (_form == null)
- return true;
-
- if (getElement() instanceof SubSystem)
- {
- SubSystem ss = (SubSystem)getElement();
- if (!ss.getConnectorService().supportsServerLaunchProperties())
- {
- return true;
- }
- }
-
- if (_form.verify())
- {
- if (sl == null)
- {
- sl = connectorService.getRemoteServerLauncherProperties();
- }
-
- if (_form.updateValues(sl))
- {
- try
- {
- connectorService.commit();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk()
- {
- if (_form.isDirty())
- {
- return applyValues(sl.getConnectorService());
- }
- return true;
- }
-
- public boolean isPageComplete()
- {
- if (_form.isDirty())
- {
- return _form.verify();
- }
- else
- {
- return true;
- }
- }
-
- public void addVerifyListener(ISystemVerifyListener listener)
- {
- if (_form instanceof ISystemConnectionWizardErrorUpdater)
- ((ISystemConnectionWizardErrorUpdater)_form).addVerifyListener(listener);
- }
-
- public String getTheErrorMessage()
- {
- return getErrorMessage();
- }
-
- public void setSystemType(String systemType)
- {
- _systemType = systemType;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServicesPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServicesPropertyPage.java
deleted file mode 100644
index 5674bf1a5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ServicesPropertyPage.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.IServiceSubSystem;
-import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
-import org.eclipse.rse.ui.widgets.services.FactoryServiceElement;
-import org.eclipse.rse.ui.widgets.services.RootServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServicesForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-public abstract class ServicesPropertyPage extends SystemBasePropertyPage
-{
- protected ServicesForm _form;
- protected String _hostname;
- protected String _hosttype;
- protected ServiceElement _rootElement;
-
- protected Control createContentArea(Composite parent)
- {
- _form = new ServicesForm(getMessageLine());
- _form.createContents(parent);
-
- // init services
- initServices();
-
- return parent;
- }
-
-
- protected boolean verifyPageContents()
- {
- return _form.verify();
- }
-
- protected void initServices()
- {
- ServiceElement[] elements = getServiceElements();
- _rootElement = new RootServiceElement(elements);
- _form.init(_rootElement);
- }
-
- protected IServiceSubSystem getServiceSubSystem()
- {
- return (IServiceSubSystem)getElement();
- }
-
- protected abstract ServiceElement[] getServiceElements();
- protected abstract IServiceSubSystemConfiguration getCurrentServiceSubSystemConfiguration();
-
- public boolean performOk()
- {
- boolean result = super.performOk();
- if (result)
- {
- commitChanges();
- return applyValues(getServiceSubSystem().getConnectorService());
- }
- else
- {
- return result;
- }
- }
-
- protected void commitChanges()
- {
- _rootElement.commit();
- }
-
- protected void revertChanges()
- {
- _rootElement.revert();
- }
-
- public boolean applyValues(IConnectorService connectorService)
- {
-
-
- FactoryServiceElement selectedService = (FactoryServiceElement)_form.getSelectedService();
-
- IServiceSubSystemConfiguration factory = selectedService.getFactory();
- IServiceSubSystemConfiguration currentFactory = getCurrentServiceSubSystemConfiguration();
- if (factory != currentFactory)
- {
- getServiceSubSystem().switchServiceFactory(factory);
- }
-
- return true;
- }
-
-
-
- public void setHostname(String hostname)
- {
- _hostname = hostname;
- }
-
- public void setSystemType(String systemType)
- {
- _hosttype = systemType;
- }
-
- public String getHostname()
- {
- return _hostname;
- }
-
- public String getSystemType()
- {
- return _hosttype;
- }
-
-
- public boolean performCancel()
- {
- _rootElement.revert();
- return super.performCancel();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SignonPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SignonPreferencePage.java
deleted file mode 100644
index 4e4f91c41..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SignonPreferencePage.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.rse.core.PasswordPersistenceManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.SystemSignonInformation;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.SystemPasswordPersistencePrompt;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-
-/**
- * Remote systems preference page which allows users to manage (add / change /
- * remove) their saved passwords.
- */
-public final class SignonPreferencePage extends PreferencePage implements IWorkbenchPreferencePage,
- Listener{
-
-
- // SWT Widgets and content providers
- private Table pwdTable;
- private TableViewer pwdTableViewer;
- private PasswordContentProvider provider;
- private Button addButton, changeButton, removeButton;
-
- // List of information for table
- private List passwords;
-
- // List to keep track of additions / deletions / changes. We need to
- // keep track of these until the user decides whether to cancel the preference
- // page (and we forget about the changes) or press ok (and we commit the changes)
- private List modifications;
-
- /**
- * Inner class to keep track of password modifications (without committing them
- * to the keyring) while the user modifies the preferences.
- */
- protected class PasswordModification
- {
- protected static final int ADD = 1;
- protected static final int DELETE = 2;
-
- protected int changeFlag;
- protected SystemSignonInformation info;
-
- protected PasswordModification(int changeFlag, SystemSignonInformation info)
- {
- this.changeFlag = changeFlag;
- this.info = info;
- }
- }
-
- private final class PasswordContentProvider implements IStructuredContentProvider, ITableLabelProvider {
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- return passwords.toArray();
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case 0:
- return ((SystemSignonInformation) element).getHostname();
-
- case 1:
- return ((SystemSignonInformation) element).getSystemType();
-
- case 2:
- return ((SystemSignonInformation) element).getUserid();
- }
-
- // Should never get here
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- }
-
- }
-
-
- /**
- *
- */
- public SignonPreferencePage() {
- noDefaultAndApplyButton();
- provider = new PasswordContentProvider();
- modifications = new ArrayList();
- }
-
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent)
- {
-
- Composite page = SystemWidgetHelpers.createComposite(parent, 2);
- GridData gd = (GridData) page.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
-
-// SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_DESCRIPTION, 2);
-
- // Password table
- pwdTable = new Table(page, SWT.FULL_SELECTION |SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- pwdTable.setLinesVisible(true);
- pwdTable.setHeaderVisible(true);
- pwdTable.addListener(SWT.Selection, this);
- SystemWidgetHelpers.setHelp(pwdTable, RSEUIPlugin.HELPPREFIX + "pwdi0000"); //$NON-NLS-1$
-
- TableLayout tableLayout = new TableLayout();
- tableLayout.addColumnData(new ColumnWeightData(100, true));
- tableLayout.addColumnData(new ColumnWeightData(100, true));
- tableLayout.addColumnData(new ColumnWeightData(100, true));
- pwdTable.setLayout(tableLayout);
-
- gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
-
- pwdTable.setLayoutData(gd);
-
- // Hostname column
- TableColumn hostnameColumn = new TableColumn(pwdTable, SWT.NONE);
- hostnameColumn.setText(SystemResources.RESID_PREF_SIGNON_HOSTNAME_TITLE);
-
- // System type column
- TableColumn sysTypeColumn = new TableColumn(pwdTable, SWT.NONE);
- sysTypeColumn.setText(SystemResources.RESID_PREF_SIGNON_SYSTYPE_TITLE);
-
- // User ID column
- TableColumn useridColumn = new TableColumn(pwdTable, SWT.NONE);
- useridColumn.setText(SystemResources.RESID_PREF_SIGNON_USERID_TITLE);
-
- pwdTableViewer = new TableViewer(pwdTable);
- pwdTableViewer.setContentProvider(provider);
- pwdTableViewer.setLabelProvider(provider);
- pwdTableViewer.setInput(passwords);
-
- // Create the Button bar for add, change and remove
- Composite buttonBar = SystemWidgetHelpers.createComposite(page, 1);
- gd = (GridData) buttonBar.getLayoutData();
- gd.grabExcessHorizontalSpace = false;
- gd.grabExcessVerticalSpace = true;
-
- addButton = SystemWidgetHelpers.createPushButton(buttonBar, this, SystemResources.RESID_PREF_SIGNON_ADD_LABEL, SystemResources.RESID_PREF_SIGNON_ADD_TOOLTIP);
- changeButton = SystemWidgetHelpers.createPushButton(buttonBar, this, SystemResources.RESID_PREF_SIGNON_CHANGE_LABEL, SystemResources.RESID_PREF_SIGNON_CHANGE_TOOLTIP);
- removeButton = SystemWidgetHelpers.createPushButton(buttonBar, this, SystemResources.RESID_PREF_SIGNON_REMOVE_LABEL, SystemResources.RESID_PREF_SIGNON_REMOVE_TOOLTIP);
-
- changeButton.setEnabled(false);
- removeButton.setEnabled(false);
-
- SystemWidgetHelpers.setHelp(addButton, RSEUIPlugin.HELPPREFIX + "pwdi0000"); //$NON-NLS-1$
- SystemWidgetHelpers.setHelp(changeButton, RSEUIPlugin.HELPPREFIX + "pwdi0000"); //$NON-NLS-1$
- SystemWidgetHelpers.setHelp(removeButton, RSEUIPlugin.HELPPREFIX + "pwdi0000"); //$NON-NLS-1$
-
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "pwdi0000"); //$NON-NLS-1$
- SystemWidgetHelpers.setMnemonics(parent);
-
- return parent;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench)
- */
- public void init(IWorkbench workbench) {
- // reinit passwords list
- passwords = PasswordPersistenceManager.getInstance().getSavedUserIDs();
-
- // refresh password table
- if (pwdTableViewer != null)
- {
- pwdTableViewer.refresh();
- }
- }
-
-
- /**
- * @see org.eclipse.swt.widgets.Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.type == SWT.Selection) {
- if (event.widget == addButton) {
- SystemPasswordPersistencePrompt dialog = new SystemPasswordPersistencePrompt(getShell(), SystemResources.RESID_PREF_SIGNON_ADD_DIALOG_TITLE, passwords, false);
- if (dialog.open() == Window.OK)
- {
- SystemSignonInformation info = dialog.getSignonInformation();
- passwords.add(info);
- modifications.add(new PasswordModification(PasswordModification.ADD, info));
-
- pwdTableViewer.refresh();
- pwdTable.select(passwords.size() - 1); // select the new entry
- }
-
- } else if (event.widget == changeButton) {
- SystemPasswordPersistencePrompt dialog = new SystemPasswordPersistencePrompt(getShell(), SystemResources.RESID_PREF_SIGNON_CHANGE_DIALOG_TITLE, passwords, true);
- int index = pwdTable.getSelectionIndex();
- SystemSignonInformation info = (SystemSignonInformation) passwords.get(index);
- dialog.setInputData(info.getSystemType(), info.getHostname(), info.getUserid());
- if (dialog.open() == Window.OK)
- {
- // Remove old and add new
- info = dialog.getSignonInformation();
- SystemSignonInformation oldInfo = (SystemSignonInformation) passwords.remove(index);
- passwords.add(index, info);
-
- modifications.add(new PasswordModification(PasswordModification.DELETE, oldInfo));
- modifications.add(new PasswordModification(PasswordModification.ADD, info));
-
- pwdTableViewer.refresh();
- pwdTable.select(index);
- }
-
- } else if (event.widget == removeButton) {
- int[] indicies = pwdTable.getSelectionIndices();
- for (int idx = indicies.length - 1; idx >= 0; idx--)
- {
- PasswordPersistenceManager.getInstance().remove((SystemSignonInformation)passwords.get(indicies[idx]));
- modifications.add(new PasswordModification(PasswordModification.DELETE,
- (SystemSignonInformation) passwords.remove(indicies[idx])));
- }
-
- pwdTableViewer.refresh();
- }
-
- // Update table buttons based on changes
- switch (pwdTable.getSelectionCount())
- {
- case 0:
- changeButton.setEnabled(false);
- removeButton.setEnabled(false);
- break;
-
- case 1:
- changeButton.setEnabled(true);
- removeButton.setEnabled(true);
- break;
-
- default:
- changeButton.setEnabled(false);
- removeButton.setEnabled(true);
- break;
- }
- }
- }
-
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
-
- if (modifications.size() > 0)
- {
- PasswordModification mod;
- PasswordPersistenceManager manager = PasswordPersistenceManager.getInstance();
- IHost[] connections = RSEUIPlugin.getTheSystemRegistry().getHosts();
- ISubSystem[] subsystems;
- IConnectorService system;
-
- for (int i = 0; i < modifications.size(); i++)
- {
- mod = (PasswordModification) modifications.get(i);
-
- if (mod.changeFlag == PasswordModification.ADD)
- {
- manager.add(mod.info, true);
-
- // yantzi: artemis 6.0, clear any cached passwords that are affected additions
- // (this is either a real add or a change (which is really a remove followed
- // by an add)
- if (connections != null)
- {
- for (int j = 0; j < connections.length; j++)
- {
- if (connections[j].getHostName().equalsIgnoreCase(mod.info.getHostname()))
- {
- subsystems = connections[j].getSubSystems();
- if (subsystems != null)
- {
- for (int k = 0; k < subsystems.length; k++)
- {
- system = subsystems[k].getConnectorService();
- if (system != null)
- {
- system.clearPasswordCache();
- }
- }
- }
- }
- }
- }
- }
- else if (mod.changeFlag == PasswordModification.DELETE)
- {
- manager.remove(mod.info);
- }
- }
-
- modifications.clear();
- }
-
- return super.performOk();
- }
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performCancel()
- */
- public boolean performCancel() {
- modifications.clear();
- return super.performCancel();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemAbstractPropertyPageExtensionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemAbstractPropertyPageExtensionAction.java
deleted file mode 100644
index 5e2b3571e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemAbstractPropertyPageExtensionAction.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-
-
-
-/**
- * This is a base class to simplify the creation of remote object property pages supplied via the
- * org.eclipse.rse.core.propertyPages extension point.
- * <p>
- * This class extends {@link SystemBasePropertyPage} and so inherits the benefits of that class.<br>
- * <b>To get these benefits though, you must override {@link #createContentArea(Composite)} versus the
- * usual createContents(Composite) method.</b>.
- * <p>
- * The benefits of this class are:</p>
- * <ul>
- * <li>From {@link SystemBasePropertyPage}: Adds a message line and {@link org.eclipse.rse.ui.messages.ISystemMessageLine} message methods.
- * <li>From {@link SystemBasePropertyPage}: Automatically assigns mnemonics to controls on this page, simplifying this common task. See {#wantMnemonics()}.
- * <li>From {@link SystemBasePropertyPage}: For pages with input controls, simplifies the page validation burden: only one method need be overridden: {@link #verifyPageContents()}
- * <li>From {@link SystemBasePropertyPage}: If no Default and Apply buttons wanted, the area reserved for this is removed, removing extra white space.
- * <li>Supplies helper method {@link #getRemoteObject()} for querying the selected remote object.
- * <li>Supplies helper methods getRemoteObjectXXX() for querying the attributes of the selected remote object.
- * <li>Supplies helper methods to query the {@link #getSubSystem() subsystem} and {@link #getSystemConnection() connection} containing the selected remote object.
- * </ul>
- * If your property page is for a file-system file or folder, use {@link SystemAbstractRemoteFilePropertyPageExtensionAction}.
- */
-public abstract class SystemAbstractPropertyPageExtensionAction
- //extends PropertyPage implements IWorkbenchPropertyPage
- extends SystemBasePropertyPage implements IWorkbenchPropertyPage
-{
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * Constructor
- */
- public SystemAbstractPropertyPageExtensionAction()
- {
- super();
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
- }
-
- // ------------------------
- // OVERRIDABLE METHODS...
- // ------------------------
- /**
- * <i><b>Abstract</b>. You must override.</i><br>
- * This is where child classes create their content area versus createContent,
- * in order to have the message line configured for them and mnemonics assigned.
- */
- protected abstract Control createContentArea(Composite parent);
-
- /**
- * <i>You may override if your page has input fields. By default returns true.</i><br>
- * Validate all the widgets on the page. Based on this, the Eclipse framework will know whether
- * to veto any user attempt to select another property page from the list on the left in the
- * Properties dialog.
- * <p>
- * Subclasses should override to do full error checking on all the widgets on the page. Recommendation:<br>
- * <ul>
- * <li>If an error is detected, issue a {@link org.eclipse.rse.ui.messages.SystemMessage} via {@link #setErrorMessage(SystemMessage)} or text message via {@link #setErrorMessage(String)}.
- * <li>If no errors detected, clear the message line via {@link #clearErrorMessage()}
- * </ul>
- *
- * @return true if there are no errors, false if any errors were found.
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- // ---------------------------------------------
- // CONVENIENCE METHODS FOR SUBCLASSES TO USE...
- // ---------------------------------------------
- /**
- * Retrieve the input remote object
- * @see #getRemoteAdapter(Object)
- */
- public Object getRemoteObject()
- {
- return getElement();
- }
- /**
- * Retrieve the adapter of the input remote object as an ISystemRemoteElementAdapter object, for convenience.
- * Will be null if there is nothing selected
- */
- public ISystemRemoteElementAdapter getRemoteAdapter()
- {
- return getRemoteAdapter(getElement());
- }
- /**
- * Returns the implementation of ISystemRemoteElementAdapter for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- if (!(o instanceof IAdaptable))
- return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
- return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
- }
-
- /**
- * Returns the name of the input remote object
- */
- public String getRemoteObjectName()
- {
- return getRemoteAdapter().getName(getRemoteObject());
- }
- /**
- * Returns the id of the subsystem factory of the input remote object.
- */
- public String getRemoteObjectSubSystemConfigurationId()
- {
- return getRemoteAdapter().getSubSystemConfigurationId(getRemoteObject());
- }
- /**
- * Returns the type category of the input remote object
- */
- public String getRemoteObjectTypeCategory()
- {
- return getRemoteAdapter().getRemoteTypeCategory(getRemoteObject());
- }
- /**
- * Returns the type of the input remote object
- */
- public String getRemoteObjectType()
- {
- return getRemoteAdapter().getRemoteType(getRemoteObject());
- }
- /**
- * Returns the subtype of the input remote object
- */
- public String getRemoteObjectSubType()
- {
- return getRemoteAdapter().getRemoteSubType(getRemoteObject());
- }
- /**
- * Returns the sub-subtype of the input remote object
- */
- public String getRemoteObjectSubSubType()
- {
- return getRemoteAdapter().getRemoteSubSubType(getRemoteObject());
- }
- /**
- * Returns the subsystem from which the input remote object was resolved
- */
- public ISubSystem getSubSystem()
- {
- return getRemoteAdapter().getSubSystem(getRemoteObject());
- }
- /**
- * Returns the subsystem factory which owns the subsystem from which the input remote object was resolved
- */
- public ISubSystemConfiguration getSubSystemConfiguration()
- {
- ISubSystem ss = getSubSystem();
- if (ss != null)
- return ss.getSubSystemConfiguration();
- else
- return null;
- }
-
- /**
- * Return the SystemConnection from which the selected remote objects were resolved
- */
- public IHost getSystemConnection()
- {
- IHost conn = null;
- ISubSystem ss = getRemoteAdapter().getSubSystem(getRemoteObject());
- if (ss != null)
- conn = ss.getHost();
- return conn;
- }
-
-
-
- /**
- * Debug method to print out details of given selected object, in a composite GUI widget...
- */
- protected Composite createTestComposite(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- //System.out.println("Remote object name................: " + getRemoteObjectName());
- //System.out.println("Remote object subsystem factory id: " + getRemoteObjectSubSystemConfigurationId());
- //System.out.println("Remote object type category.......: " + getRemoteObjectTypeCategory());
- //System.out.println("Remote object type ...............: " + getRemoteObjectType());
- //System.out.println("Remote object subtype ............: " + getRemoteObjectSubType());
- //System.out.println("Remote object subsubtype .........: " + getRemoteObjectSubSubType());
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object name: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectName()));
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object subsystem factory id: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectSubSystemConfigurationId()));
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object type category: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectTypeCategory()));
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object type: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectType()));
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object subtype: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectSubType()));
-
- SystemWidgetHelpers.createLabel(composite_prompts, "Remote object subsubtype: "); //$NON-NLS-1$
- SystemWidgetHelpers.createLabel(composite_prompts, checkForNull(getRemoteObjectSubSubType()));
-
- return composite_prompts;
- }
-
- /**
- * Check for null, and if so, return ""
- */
- private String checkForNull(String input)
- {
- if (input == null)
- return ""; //$NON-NLS-1$
- else
- return input;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBasePropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBasePropertyPage.java
deleted file mode 100644
index 3688d5290..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBasePropertyPage.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.ISystemMessageLineTarget;
-import org.eclipse.rse.ui.messages.SystemDialogPageMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-/**
- * A base class for property pages that offers value over the base Eclipse PropertyPage
- * class:
- * <ul>
- * <li>Adds a message line and {@link org.eclipse.rse.ui.messages.ISystemMessageLine} message methods.
- * <li>Automatically assigns mnemonics to controls on this page, simplifying this common task. See {#wantMnemonics()}.
- * <li>If no Default and Apply buttons wanted (default), the area reserved for this is removed, removing extra white space.
- * <li>For pages with input controls, simplifies the page validation burden: only one method need be overridden: {@link #verifyPageContents()}
- * <br>To do on-the-fly validation, in your handler calling setErrorMessage/clearErrorMessage automatically calls setValid, although
- * you can call it directly too if you desire.
- * <br>verifyPageContents is called by default by performOk (be sure to call super.performOk if you override), and
- * for multiple property pages, is called when another one is selected.
- * </ul>
- * <p>To get these benefits you must override {@link #createContentArea(Composite)} instead of createContents.
- * Our base implementation of createContents configures the message line and then calls
- * createContentArea and then assigns mnemonics to the content area.
- * </p>
- *
- */
-public abstract class SystemBasePropertyPage extends PropertyPage
- implements ISystemMessageLine, ISystemMessageLineTarget
-{
-
-
- protected ISystemMessageLine msgLine;
- protected boolean msgLineSet = false;
- protected Composite contentArea, buttonsComposite;
- private Cursor waitCursor;
- private String helpId;
-
- /**
- * Constructor for SystemBasePropertyPage
- */
- public SystemBasePropertyPage()
- {
- super();
- }
-
- /**
- * <i>Parent intercept. No need to call or override.</i><br>
- * Our base implementation of createContents configures them message line and then calls
- * {@link #createContentArea(Composite)} and then assigns mnemonics to the content area.
- * Also calls {@link #noDefaultAndApplyButton()} if {@link #wantDefaultAndApplyButton()} returns false.
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- * @see #createContentArea(Composite)
- */
- protected Control createContents(Composite parent)
- {
- // TODO - redesign message line so it works in Eclipse 3.0
- // DKM commenting this out for now to avoid exceptions
- //configureMessageLine();
- if (!wantDefaultAndApplyButton())
- noDefaultAndApplyButton();
- Control c = createContentArea(parent);
- if ((c != null) && (c instanceof Composite))
- {
- contentArea = (Composite)c;
- if (helpId != null)
- SystemWidgetHelpers.setHelp(contentArea, helpId);
- if (wantMnemonics())
- (new Mnemonics()).setOnPreferencePage(true).setMnemonics(contentArea);
- }
- configureMessageLine();
- return c;
- }
-
- /**
- * <i>Configuration method. Override only to change the default. </i><br>
- * Return true if you want to see Apply and Restore Defaults buttons. This is queried by
- * the default implementation of createContents and the default is false, we don't want
- * to see them. Default is <b>false</b>.
- */
- protected boolean wantDefaultAndApplyButton()
- {
- return false;
- }
-
- /**
- * <i>Configuration method. Override only to change the default. </i><br>
- * Return false if you don't want to have mnemonics automatically applied to your page
- * by this parent class. Default is <b>true</b>.
- */
- protected boolean wantMnemonics()
- {
- return true;
- }
- /**
- * <i>Configuration method. Override only to change the default. </i><br>
- * Return false if you don't want to automatically set whether the page is valid based
- * on error message status. Default is <b>true</b>
- */
- protected boolean wantAutomaticValidManagement()
- {
- return true;
- }
-
- /**
- * For setting the default overall help for the dialog.
- * This can be overridden per control by calling {@link #setHelp(Control, String)}.
- */
- public void setHelp(String helpId)
- {
- if (contentArea != null)
- {
- SystemWidgetHelpers.setHelp(contentArea, helpId);
- SystemWidgetHelpers.setHelp(contentArea, helpId);
- //SystemWidgetHelpers.setCompositeHelp(parentComposite, helpId, helpIdPerControl);
- //SystemWidgetHelpers.setCompositeHelp(buttonsComposite, helpId, helpIdPerControl);
- }
- this.helpId = helpId;
- }
-
- /**
- * <i><b>Abstract</b>. You must override.</i><br>
- * This is where child classes create their content area versus createContent,
- * in order to have the message line configured for them and mnemonics assigned.
- */
- protected abstract Control createContentArea(Composite parent);
-
-
- /**
- * <i><b>Private</b>. No need to call or override.</i><br>
- * Configure the message line if not already. Called for you if you override createContentArea
- * versus createContents, else you might choose to call it yourself.
- */
- protected void configureMessageLine()
- {
-// if (msgLine == null)
- //msgLine = SystemPropertiesMessageLine.configureMessageLine(this);
- // msgLine = SystemDialogPageMessageLine.createPropertyPageMsgLine(this);
- }
-
- /**
- * <i><b>Private</b>. No need to call or override.</i><br>
- * Override of parent to delete the button bar since we don't use it, and to make this
- * page fit on a 800x600 display
- */
- protected void contributeButtons(Composite buttonBar)
- {
- this.buttonsComposite = buttonBar;
- if (helpId != null)
- SystemWidgetHelpers.setHelp(buttonsComposite, helpId);
-
- if (wantDefaultAndApplyButton())
- super.contributeButtons(buttonBar);
- else
- {
- // see createControl method in org.eclipse.jface.preference.PreferencePage
- Composite content = buttonBar.getParent();
- //Composite pageContainer = content.getParent();
- //DY The parent PreferencePage class handles this now for us
- //DY buttonBar.setVisible(false);
- //DY buttonBar.dispose();
-
- if ((contentArea != null) && (contentArea.getLayout() != null) &&
- (contentArea.getLayout() instanceof GridLayout))
- {
- ((GridLayout)contentArea.getLayout()).marginHeight = 0;
- if (contentArea.getLayoutData() instanceof GridData)
- ((GridData)contentArea.getLayoutData()).grabExcessVerticalSpace = false;
- contentArea.pack();
- }
- if (content != null)
- {
-// if (content.getLayout() instanceof GridLayout)
-// {
-// GridLayout layout = (GridLayout)content.getLayout();
-// layout.marginHeight= 0; layout.marginWidth= 0;
-// }
- content.pack();
- }
- }
- }
-
- /**
- * <i>Parent intercept. No need to call or override.</i><br>
- * The <code>PreferencePage</code> implementation of this
- * <code>IPreferencePage</code> method returns <code>true</code>
- * if the page is valid.
- * <p>
- * We first test isValid() just like our parent implementation does,
- * but since that only represents the valid state of the
- * last control the user interacted with, we also call verifyPageContents.
- * <p>
- * Subclasses must override {@link #verifyPageContents()} to do full error checking on all
- * the widgets on the page.
- */
- public boolean okToLeave()
- {
- super.okToLeave();
- boolean ok = isValid();
- if (ok)
- {
- ok = verifyPageContents();
- }
- //System.out.println("Inside okToLeave. returning "+ok);
- return ok;
- }
-
- /**
- * <i><b>Abstract</b>. You must override. Return true if no input fields to check.</i><br>
- * Validate all the widgets on the page. Based on this, the Eclipse framework will know whether
- * to veto any user attempt to select another property page from the list on the left in the
- * Properties dialog.
- * <p>
- * Subclasses should override to do full error checking on all the widgets on the page. Recommendation:<br>
- * <ul>
- * <li>If an error is detected, issue a {@link org.eclipse.rse.ui.messages.SystemMessage} via {@link #setErrorMessage(SystemMessage)} or text message via {@link #setErrorMessage(String)}.
- * <li>If no errors detected, clear the message line via {@link #clearErrorMessage()}
- * </ul>
- *
- * @return true if there are no errors, false if any errors were found.
- */
- protected abstract boolean verifyPageContents();
- /*
- {
- return true;
- }*/
-
- /**
- * Method declared on IPreferencePage.
- * Our implementation is to call okToLeave(), which in turn calls verifyPageContents,
- * returning true iff they do.
- * If you override, call super.performOk() to get default processing, and return false if that returns false.
- * @return true if all is well, false if there is an error.
- */
- public boolean performOk()
- {
- boolean oldValid = isValid();
- boolean newValid = okToLeave();
- setValid(oldValid);
- return newValid;
- }
- // -----------------------------------
- // ISystemMessageLineTarget methods...
- // -----------------------------------
- /**
- * <i>ISystemMessageLineTarget method.</i><br>
- * Set the message line to use for issuing messages
- */
- public void setMessageLine(ISystemMessageLine msgLine)
- {
- //System.out.println("Inside setMessageLine");
- this.msgLine = msgLine;
- msgLineSet = (msgLine != null);
- }
- /**
- * <i>ISystemMessageLineTarget method.</i><br>
- * Get the message line to use for issuing messages
- */
- public ISystemMessageLine getMessageLine()
- {
- //if (msgLineSet)
- // return msgLine;
- //else
- return this;
- }
-
- // -----------------------------
- // Helper methods...
- // -----------------------------
- /**
- * <i>Helper method.</i><br>
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- public void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), waitCursor);
- }
- else
- {
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
-
- /**
- * <i>Helper method.</i><br>
- * Add a separator line. This is a physically visible line.
- */
- protected Label addSeparatorLine(Composite parent, int nbrColumns)
- {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- separator.setLayoutData(data);
- return separator;
- }
- /**
- * <i>Helper method.</i><br>
- * Add a spacer line
- */
- protected Label addFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- filler.setLayoutData(data);
- return filler;
- }
-
- /**
- * Sets this control to grab any excess horizontal space
- * left in the window. This is useful to do in a property page
- * to force all the labels on the right to not be squished up on the left.
- *
- * @param control the control for which to grab excess space
- */
- protected Control grabExcessSpace(Control control)
- {
- GridData gd = (GridData) control.getLayoutData();
- if (gd != null)
- gd.grabExcessHorizontalSpace = true;
- return control;
- }
-
- /**
- * Create a labeled label, where the label on the right grabs excess space and has an indent so it
- * isn't smashed up against the prompt on the left.
- * @see SystemWidgetHelpers#createLabeledLabel(Composite, ResourceBundle, String, boolean)
- * @see #grabExcessSpace(Control)
- */
- protected Label createLabeledLabel(Composite c, String label, String tooltip)
- {
- Label l = SystemWidgetHelpers.createLabeledLabel(c, label, tooltip, false);
- GridData gd = (GridData)l.getLayoutData();
- if (gd != null)
- {
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalIndent = 10;
- }
- return l;
- }
- /**
- * Create a labeled combo, where the combo on the right grabs excess space and has an indent so it
- * isn't smashed up against the prompt on the left.
- * @see SystemWidgetHelpers#createLabeledCombo(Composite, Listener, ResourceBundle, String)
- * @see #grabExcessSpace(Control)
- */
- protected Combo createLabeledCombo(Composite c, String label, String tooltip)
- {
- Combo combo = SystemWidgetHelpers.createLabeledCombo(c, null, label, tooltip);
- GridData gd = (GridData)combo.getLayoutData();
- if (gd != null)
- {
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalIndent = 10;
- }
- return combo;
- }
- /**
- * Create a labeled entry field, where the field on the right grabs excess space and has an indent so it
- * isn't smashed up against the prompt on the left.
- * @see SystemWidgetHelpers#createLabeledTextField(Composite, Listener, ResourceBundle, String)
- * @see #grabExcessSpace(Control)
- */
- protected Text createLabeledText(Composite c, String label, String tooltip)
- {
- Text field = SystemWidgetHelpers.createLabeledTextField(c, null, label, tooltip);
- GridData gd = (GridData)field.getLayoutData();
- if (gd != null)
- {
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalIndent = 10;
- }
- return field;
- }
- /**
- * Create a labeled verbage field, where the field on the right grabs excess space and has an indent so it
- * isn't smashed up against the prompt on the left.
- * @see SystemWidgetHelpers#createLabeledTextField(Composite, Listener, ResourceBundle, String)
- * @see #grabExcessSpace(Control)
- */
- protected Label createLabeledVerbage(Composite c, String label, String tooltip)
- {
- Label verbage = SystemWidgetHelpers.createLabeledVerbage(c, label, tooltip, 1, false, 200);
- GridData gd = (GridData)verbage.getLayoutData();
- if (gd != null)
- {
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalIndent = 10;
- }
- return verbage;
- }
- // -----------------------------
- // ISystemMessageLine methods...
- // -----------------------------
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- if (msgLine!=null)
- msgLine.clearErrorMessage();
- else
- super.setErrorMessage(null);
- if (wantAutomaticValidManagement())
- setValid(true);
- }
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- if (msgLine!=null)
- msgLine.clearMessage();
- else
- super.setMessage(null);
- }
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- if (msgLine!=null)
- return msgLine.getSystemErrorMessage();
- else
- return null;
- }
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- super.setErrorMessage(message);
- if (wantAutomaticValidManagement())
- setValid(message == null);
- if (msgLine != null)
- ((SystemDialogPageMessageLine)msgLine).internalSetErrorMessage(message);
- }
-
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- if (msgLine!=null)
- msgLine.setErrorMessage(message);
- else
- super.setErrorMessage(message.getLevelOneText());
- if (wantAutomaticValidManagement())
- setValid(message == null);
- }
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Convenience method to set an error message from an exception
- */
- public void setErrorMessage(Throwable exc)
- {
- if (msgLine != null)
- msgLine.setErrorMessage(exc);
- }
-
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Set the error message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- if (msgLine!=null)
- msgLine.setMessage(message);
- else
- super.setMessage(message.getLevelOneText());
- }
- /**
- * <i>ISystemMessageLine method.</i><br>
- * Set the non-error message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- super.setMessage(message);
- if (msgLine!=null)
- ((SystemDialogPageMessageLine)msgLine).internalSetMessage(message);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBooleanFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBooleanFieldEditor.java
deleted file mode 100644
index c64b01965..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemBooleanFieldEditor.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Thin subclass so we can support setToolTipText!!
- */
-public class SystemBooleanFieldEditor extends BooleanFieldEditor
-{
- private Button button;
- private String tip;
- private Composite parent;
-
- /**
- * Constructor for SystemBooleanFieldEditor
- */
- protected SystemBooleanFieldEditor()
- {
- super();
- }
-
- /**
- * Constructor for SystemBooleanFieldEditor
- * @param name the preference-store-key of the preference this field editor works on
- * @param labelText the label text of the field editor
- * @param style the style, either <code>DEFAULT</code> or
- * <code>SEPARATE_LABEL</code>
- * @param parent the parent of the field editor's control
- * @see #DEFAULT
- * @see #SEPARATE_LABEL
- */
- public SystemBooleanFieldEditor(String name, String labelText, int style, Composite parent)
- {
- super(name, labelText, style, parent);
- this.parent = parent;
- }
-
- /**
- * Constructor for SystemBooleanFieldEditor, using DEFAULT for the style
- * @param name the preference-store-key of the preference this field editor works on
- * @param labelText the label text of the field editor
- * @param parent the parent of the field editor's control
- */
- public SystemBooleanFieldEditor(String name, String labelText, Composite parent)
- {
- super(name, labelText, parent);
- this.parent = parent;
- }
- /**
- * Constructor for SystemBooleanFieldEditor, using DEFAULT for the style, and
- * specifying a resource bundle and key from which the label (_LABEL and
- * tooltip text (_TOOLTIP are retrieved.
- * @param name the preference-store-key of the preference this field editor works on
- * @param rb the ResourceBundle we will query the label and tooltip from
- * @param labelKey the resource bundle key from which we get the label (_LABEL and tooltip (_TOOLTIP
- * @param parent the parent of the field editor's control
- */
- public SystemBooleanFieldEditor(String name, ResourceBundle rb, String labelKey, Composite parent)
- {
- super(name, rb.getString(labelKey+"label"), parent);
- setToolTipText(rb.getString(labelKey+"tooltip"));
- this.parent = parent;
- }
-
- /**
- * Returns the change button for this field editor.
- * This is an override of our parent's method because this is the
- * only way for us to gain access to the checkbox so that we can
- * apply our tooltip text.
- */
- protected Button getChangeControl(Composite parent)
- {
- button = super.getChangeControl(parent);
- if (tip != null)
- button.setToolTipText(tip);
- return button;
- }
- /**
- * Set the tooltip text
- */
- public void setToolTipText(String tip)
- {
- if (button != null)
- button.setToolTipText(tip);
- this.tip = tip;
- }
- /**
- * Get the tooltip text
- */
- public String getToolTipText()
- {
- return tip;
- }
-
- /**
- * Set the help for the control
- */
- public void setHelp(String helpID)
- {
- if (button != null) {
- SystemWidgetHelpers.setHelp(button, helpID);
- }
- }
-
- /**
- * Method setEnabled
- * @param enablement state
- */
- public void setEnabled( boolean enablement )
- {
- getChangeControl(parent).setEnabled(enablement);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemChangeFilterPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemChangeFilterPropertyPage.java
deleted file mode 100644
index a6a414c1c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemChangeFilterPropertyPage.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemPageCompleteListener;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.filters.ISystemChangeFilterPaneEditPaneSupplier;
-import org.eclipse.rse.ui.filters.SystemChangeFilterPane;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This is the property page for changing filters. This page used to be the Change dialog.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.filters.SystemFilter or
- * org.eclipse.rse.filters.SystemFilterReference.
- * <p>
- * If you have your own change filter dialog (versus configuring ours) you must configure this
- * pane yourself by overriding {@link SubSystemConfiguration#customizeChangeFilterPropertyPage(SystemChangeFilterPropertyPage, ISystemFilter, Shell)}
- * and configuring the pane as described in that method's javadoc.
- */
-public class SystemChangeFilterPropertyPage extends SystemBasePropertyPage
- implements ISystemPageCompleteListener, ISystemChangeFilterPaneEditPaneSupplier
-{
-
- protected String errorMessage;
- protected boolean initDone = false;
-
- protected SystemChangeFilterPane changeFilterPane;
- protected SystemFilterStringEditPane editPane;
-
- /**
- * Constructor for SystemFilterPropertyPage
- */
- public SystemChangeFilterPropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- changeFilterPane = new SystemChangeFilterPane(null, this, this);
- changeFilterPane.addPageCompleteListener(this);
- setHelp(RSEUIPlugin.HELPPREFIX+"dufr0000");
- }
-
- // INPUT/CONFIGURATION
- /**
- * <i>Configuration method</i><br>
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool reference manager provider. Will be non-null if the
- * current selection is a reference to a filter pool or filter, or a reference manager
- * provider itself (eg subsystem)
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- changeFilterPane.setSystemFilterPoolReferenceManagerProvider(provider);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool manager provider. Will be non-null if the
- * current selection is a filter pool or filter or reference to either, or a manager
- * provider itself (eg subsystemconfiguration)
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- changeFilterPane.setSystemFilterPoolManagerProvider(provider);
- }
-
- /**
- * <i>Configuration method</i><br>
- * Set the Parent Filter Pool prompt label and tooltip text.
- */
- public void setParentPoolPromptLabel(String label, String tip)
- {
- changeFilterPane.setParentPoolPromptLabel(label, tip);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the name prompt label and tooltip text.
- */
- public void setNamePromptLabel(String label, String tip)
- {
- changeFilterPane.setNamePromptLabel(label, tip);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the label shown in group box around the filter string list, and the tooltip text for the
- * list box.
- */
- public void setListLabel(String label, String tip)
- {
- changeFilterPane.setListLabel(label, tip);
- }
- /**
- * Set the string to show as the first item in the list.
- * The default is "New filter string"
- */
- public void setNewListItemText(String label)
- {
- changeFilterPane.setNewListItemText(label);
- }
- /**
- * <i>Configuration method</i><br>
- * Call this to specify a validator for the filter string. It will be called per keystroke.
- * A default validator is supplied otherwise: ValidatorFilterString.
- * <p>
- * Your validator should extend ValidatorFilterString to inherited the uniqueness error checking.
- * <p>
- * Alternatively, if all you want is a unique error message for the case when duplicates are found,
- * call setDuplicateFilterStringErrorMessage, and it will be used in the default validator.
- */
- public void setFilterStringValidator(ISystemValidator v)
- {
- changeFilterPane.setFilterStringValidator(v);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the error message to use when the user is editing or creating a filter string, and the
- * Apply processing detects a duplicate filter string in the list.
- */
- public void setDuplicateFilterStringErrorMessage(SystemMessage msg)
- {
- changeFilterPane.setDuplicateFilterStringErrorMessage(msg);
- }
- /**
- * <i>Configuration method</i><br>
- * Specify if you want to include a test button or not. Appears with "Apply" and "Reset"
- */
- public void setWantTestButton(boolean wantTestButton)
- {
- changeFilterPane.setWantTestButton(wantTestButton);
- }
-
- /**
- * Set if the edit pane is not to be editable
- */
- public void setEditable(boolean editable)
- {
- changeFilterPane.setEditable(editable);
- }
-
- /**
- * Set if the user is to be allowed to create multiple filter strings or not. Default is true
- */
- public void setSupportsMultipleStrings(boolean multi)
- {
- changeFilterPane.setSupportsMultipleStrings(multi);
- }
-
- // OVERRIDABLE METHODS...
-
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- Shell shell = getShell();
- if (shell == null)
- {
- System.out.println("Damn, shell is still null!");
-
- }
- changeFilterPane.setShell(shell);
-
- ISystemFilter selectedFilter = getFilter();
- if (selectedFilter.isPromptable())
- {
- int nbrColumns = 1;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
- /*Label test =*/ SystemWidgetHelpers.createLabel(composite_prompts, SystemPropertyResources.RESID_TERM_NOTAPPLICABLE, nbrColumns, false);
- return composite_prompts;
- }
-
- if (getElement() instanceof ISystemFilterReference)
- {
- ISystemFilterReference filterRef = (ISystemFilterReference)getElement();
- changeFilterPane.setSystemFilterPoolReferenceManagerProvider(filterRef.getProvider());
- }
- changeFilterPane.setSystemFilterPoolManagerProvider(selectedFilter.getProvider());
-
- ISubSystemConfiguration ssf = SubSystemHelpers.getParentSubSystemConfiguration(selectedFilter);
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssf.getAdapter(ISubSystemConfigurationAdapter.class);
- adapter.customizeChangeFilterPropertyPage(ssf, this, selectedFilter, shell);
-
- changeFilterPane.setInputObject(getElement());
-
- /*
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
-
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- Label test = SystemWidgetHelpers.createLabel(composite_prompts, "Testing", nbrColumns);
-
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- */
- return changeFilterPane.createContents(parent);
- }
- /**
- * Intercept of parent so we can reset the default button
- */
- protected void contributeButtons(Composite parent)
- {
- super.contributeButtons(parent);
- getShell().setDefaultButton(changeFilterPane.getApplyButton()); // defect 46129
- }
-
- /**
- * Parent-required method.
- * Do full page validation.
- * Return true if ok, false if there is an error.
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input filter object
- */
- protected ISystemFilter getFilter()
- {
- Object element = getElement();
- if (element instanceof ISystemFilter)
- return (ISystemFilter)element;
- else
- return ((ISystemFilterReference)element).getReferencedFilter();
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- if (!super.performOk())
- return false;
- else
- return changeFilterPane.processOK();
- }
- /**
- * Called by parent when user presses Cancel
- */
- public boolean performCancel()
- {
- return changeFilterPane.processCancel();
- }
-
- /**
- * The comleteness of the page has changed.
- * This is a callback from SystemChangeFilterPane.
- */
- public void setPageComplete(boolean complete)
- {
- //super.setPageComplete(complete);
- super.setValid(complete); // we'll see if this is the right thing to do
- }
-
- /**
- * Return our edit pane. Overriding this is an alternative to calling setEditPane.
- * Method is declared in {@link ISystemChangeFilterPaneEditPaneSupplier}.
- */
- public SystemFilterStringEditPane getFilterStringEditPane(Shell shell)
- {
- // this method is called from SystemChangeFilterPane via callback
- if (editPane == null)
- editPane = new SystemFilterStringEditPane(shell);
- return editPane;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemComboBoxFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemComboBoxFieldEditor.java
deleted file mode 100644
index dac346064..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemComboBoxFieldEditor.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.rse.ui.ISystemMassager;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * For string properties that have a discrete list of possibilities.
- */
-public class SystemComboBoxFieldEditor extends FieldEditor
-{
-
- private Combo textField;
- private String[] contentArray;
- private boolean contentInited = false;
- private boolean readOnly = true;
- private boolean isValid = true;
- private String tip;
- private SelectionListener selectionListener = null;
- private ModifyListener modifyListener = null;
- private boolean ignoreSelection = false;
- private ISystemValidator validator = null;
- private ISystemMassager massager = null;
- private Composite parentComposite;
- private String oldValue;
- private int numColumnsInParentComposite;
-
-
- /**
- * Constructor for SystemComboBoxFieldEditor
- */
- private SystemComboBoxFieldEditor()
- {
- super();
- }
-
- /**
- * Constructor for SystemComboBoxFieldEditor, using a Vector for the contents
- * @param name - the unique ID for this editor. Used as index in preference store
- * @param labelText - the label to show as the prompt preceding the dropdown
- * @param contents - the list of strings to show in the dropdown, as a vector
- * @param readOnly - true if the user is to be prevented from entering text into the combo
- * @param parent - the parent composite to host this editor
- */
- public SystemComboBoxFieldEditor(String name, String labelText, Vector contents, boolean readOnly, Composite parent)
- {
- super(name, labelText, parent);
- this.readOnly = readOnly;
- this.oldValue = "";
- contentArray = new String[contents.size()];
- for (int idx=0; idx<contentArray.length; idx++)
- contentArray[idx] = contents.elementAt(idx).toString();
- doOurFillIntoGrid();
- initContents();
- }
- /**
- * Constructor for SystemComboBoxFieldEditor, using an array for the contents
- * @param name - the unique ID for this editor. Used as index in preference store
- * @param labelText - the label to show as the prompt preceding the dropdown
- * @param contents - the list of strings to show in the dropdown, as an array
- * @param readOnly - true if the user is to be prevented from entering text into the combo
- * @param parent - the parent composite to host this editor
- */
- public SystemComboBoxFieldEditor(String name, String labelText, String[] contents, boolean readOnly, Composite parent)
- {
- super(name, labelText, parent);
- this.readOnly = readOnly;
- this.oldValue = "";
- contentArray = contents;
- doOurFillIntoGrid();
- initContents();
- }
- /**
- * Constructor for SystemComboBoxFieldEditor, using an array for the contents,
- * and specifying a resource bundle and key, from which we will retrieve the label
- * and the tooltip text
- * @param name - the unique ID for this editor. Used as index in preference store
- * @param rb - the resource bundle from which to retrieve the mri
- * @param rbKey - the key into the resource bundle, to get the label (+"label") and tooltip text (+"tooltip")
- * @param contents - the list of strings to show in the dropdown, as an array
- * @param readOnly - true if the user is to be prevented from entering text into the combo
- * @param parent - the parent composite to host this editor
- */
- public SystemComboBoxFieldEditor(String name, ResourceBundle rb, String rbKey, String[] contents, boolean readOnly, Composite parent)
- {
- super(name, rb.getString(rbKey+"label"), parent);
- this.readOnly = readOnly;
- this.oldValue = "";
- contentArray = contents;
- doOurFillIntoGrid();
- setToolTipText(rb.getString(rbKey+"tooltip"));
- initContents();
- }
-
- /**
- * If this combobox is editable, set the validator to use here per keystroke
- */
- public void setValidator(ISystemValidator validator)
- {
- this.validator = validator;
- if (textField != null)
- textField.setTextLimit(validator.getMaximumNameLength());
- }
-
- /**
- * Set the massager that is used to affect the user-entered text before
- * saving it to the preference store
- */
- public void setMassager(ISystemMassager massager)
- {
- this.massager = massager;
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls()
- {
- return 2;
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#doStore()
- */
- protected void doStore()
- {
- String text = textField.getText();
- if (massager != null)
- {
- text = massager.massage(text);
- ignoreSelection = true;
- textField.setText(text);
- ignoreSelection = false;
- }
-
- getPreferenceStore().setValue(getPreferenceName(), text);
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault()
- {
- if (textField != null)
- {
- String value = getPreferenceStore().getDefaultString(getPreferenceName());
- initSelection(value);
- }
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#doLoad()
- */
- protected void doLoad()
- {
- if (textField != null)
- {
- String value = getPreferenceStore().getString(getPreferenceName());
- initSelection(value);
- }
- }
-
- private void initSelection(String value)
- {
- if (value != null)
- {
- ignoreSelection = true;
- textField.setText(value);
- oldValue = value;
- ignoreSelection = false;
- }
- else
- oldValue = "";
- }
-
- private void initContents()
- {
- if ((contentArray!=null) && (textField!=null) && !contentInited)
- {
- textField.setItems(contentArray);
- contentInited = true;
- }
- }
-
- /**
- * This is called by our parent's constructor, which is too soon for us!
- * So, we do nothing here and then call doOurFillIntoGrid later within our own
- * constructor.
- * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns)
- {
- parentComposite = parent;
- numColumnsInParentComposite = numColumns;
- }
- /**
- * Create controls
- */
- protected void doOurFillIntoGrid()
- {
- getLabelControl(parentComposite);
-
- textField = getTextControl(parentComposite);
- GridData gd = (GridData)textField.getLayoutData();
- gd.horizontalSpan = numColumnsInParentComposite - 1;
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- textField.setLayoutData(gd);
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns)
- {
- GridData gd = (GridData)textField.getLayoutData();
- gd.horizontalSpan = numColumns - 1;
- // We only grab excess space if we have to
- // If another field editor has more columns then
- // we assume it is setting the width.
- gd.grabExcessHorizontalSpace = gd.horizontalSpan == 1;
- }
-
- /**
- * Returns this field editor's Combo control.
- */
- public Combo getTextControl()
- {
- return textField;
- }
-
- /**
- * Returns this field editor's text control.
- * <p>
- * The control is created if it does not yet exist
- * </p>
- *
- * @param parent the parent
- * @return the text control
- */
- public Combo getTextControl(Composite parent)
- {
- if (textField == null)
- {
- if (isReadOnly())
- textField = SystemWidgetHelpers.createReadonlyCombo(parent, null);
- else
- textField = SystemWidgetHelpers.createCombo(parent, null);
- if (tip != null)
- textField.setToolTipText(tip);
- initContents();
-
- textField.addSelectionListener(getSelectionListener());
- if (!isReadOnly())
- {
- textField.addModifyListener(getModifyListener());
- if (validator != null)
- textField.setTextLimit(validator.getMaximumNameLength());
-
- textField.addFocusListener(new FocusAdapter()
- {
- public void focusGained(FocusEvent e) {
- refreshValidState();
- }
- public void focusLost(FocusEvent e) {
- clearErrorMessage();
- }
- });
- }
-
- textField.addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent event)
- {
- textField = null; // not sure why we have to do this
- }
- });
- } else {
- checkParent(textField, parent); // not sure what this is, came from some earlier eclipse example
- }
- return textField;
- }
-
- /**
- * Allows setting of tooltip text
- */
- public void setToolTipText(String tip)
- {
- if (textField != null)
- textField.setToolTipText(tip);
- this.tip = tip;
- }
-
- /**
- * Is this a readonly combo?
- */
- protected boolean isReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Returns this field editor's selection listener.
- * The listener is created if nessessary.
- *
- * @return the selection listener
- */
- private SelectionListener getSelectionListener()
- {
- if (selectionListener == null)
- createSelectionListener();
- return selectionListener;
- }
-
- /**
- * Creates a selection listener.
- */
- protected void createSelectionListener()
- {
- selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- Widget widget = event.widget;
- if (widget == textField)
- selectionChanged();
- }
- };
- }
-
- /**
- * Combobox selection changed
- */
- protected void selectionChanged()
- {
- if (!ignoreSelection)
- setPresentsDefaultValue(false);
- ignoreSelection = false;
- }
-
- /**
- * Returns this field editor's selection listener.
- * The listener is created if nessessary.
- *
- * @return the selection listener
- */
- private ModifyListener getModifyListener()
- {
- if (modifyListener == null)
- createModifyListener();
- return modifyListener;
- }
-
- /**
- * Creates a modify text listener.
- * Ony used for non-readonly flavours
- */
- protected void createModifyListener()
- {
- modifyListener = new ModifyListener()
- {
- public void modifyText(ModifyEvent event)
- {
- Widget widget = event.widget;
- if ((widget == textField) && !ignoreSelection)
- valueChanged();
- }
- };
- }
-
- /**
- * Validate contents of combo field
- */
- protected void validate()
- {
- if (!ignoreSelection)
- {
- setPresentsDefaultValue(false);
- if (validator != null)
- {
- String errmsg = null;
- String value = textField.getText();
- if (!isSpecialValue(value))
- errmsg = validator.isValid(value);
- if (errmsg != null)
- showErrorMessage(errmsg);
- else
- clearErrorMessage();
- isValid = (errmsg == null);
- }
- }
- ignoreSelection = false;
- }
- /**
- * Test if current value is one of the special values
- */
- private boolean isSpecialValue(String input)
- {
- if (contentArray == null)
- return false;
- else
- {
- boolean match = false;
- for (int idx=0; !match && (idx<contentArray.length); idx++)
- if (input.equalsIgnoreCase(contentArray[idx]))
- match = true;
- return match;
- }
- }
-
- /**
- * Informs this field editor's listener, if it has one, about a change
- * to the value (<code>VALUE</code> property) provided that the old and
- * new values are different.
- * <p>
- * This hook is <em>not</em> called when the text is initialized
- * (or reset to the default value) from the preference store.
- * </p>
- */
- protected void valueChanged()
- {
- setPresentsDefaultValue(false);
- boolean oldState = isValid;
- refreshValidState();
-
- if (isValid != oldState)
- fireStateChanged(IS_VALID, oldState, isValid);
-
- String newValue = textField.getText();
- fireValueChanged(VALUE, oldValue, newValue);
- oldValue = newValue;
- }
-
- /**
- * Override of parent to return validity state.
- * If this readonly, we always return true, else we return result of last validation
- */
- public boolean isValid()
- {
- return isValid;
- }
-
- /**
- * Override of parent to refresh validity state by checking if the
- * input is valid. Does nothing unless this is not a readonly combo.
- */
- protected void refreshValidState()
- {
- isValid = true;
- if (!isReadOnly())
- {
- validate();
- }
- }
-
- /**
- * Set focus
- */
- public void setFocus()
- {
- if (textField!= null)
- textField.setFocus();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemCommunicationsPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemCommunicationsPreferencePage.java
deleted file mode 100644
index ee12542f4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemCommunicationsPreferencePage.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.rse.core.comm.SystemCommunicationsDaemon;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Preference page for generic Remote System communication preferences
- */
-public class SystemCommunicationsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
-{
-
-
- private IntegerFieldEditor portEditor;
-
- /**
- * Constructor
- */
- public SystemCommunicationsPreferencePage()
- {
- super(GRID);
- setPreferenceStore(RSEUIPlugin.getDefault().getPreferenceStore());
-// setDescription(SystemResources.RESID_PREF_COMMUNICATIONS_TITLE); dwd description is not readable by screen reader
- }
-
- /**
- * Configure the composite. We intercept to set the help.
- */
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), RSEUIPlugin.HELPPREFIX + "cmmp0000");
- }
-
-
- /**
- *
- */
- protected void createFieldEditors()
- {
- Composite parent= getFieldEditorParent();
-
- // Auto-start the daemon preference
- SystemBooleanFieldEditor autoStartEditor = new SystemBooleanFieldEditor(
- ISystemPreferencesConstants.DAEMON_AUTOSTART,
- SystemResources.RESID_PREF_DAEMON_AUTOSTART_LABEL,
- parent
- );
- autoStartEditor.setToolTipText(SystemResources.RESID_PREF_DAEMON_AUTOSTART_TOOLTIP);
- addField(autoStartEditor);
-
-
- // Daemon port preference
- portEditor = new IntegerFieldEditor(
- ISystemPreferencesConstants.DAEMON_PORT,
- SystemResources.RESID_PREF_DAEMON_PORT_LABEL,
- parent
- );
- portEditor.setValidRange(1, 65536);
- portEditor.setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID).getLevelOneText());
- addField(portEditor);
- portEditor.getTextControl(parent).setToolTipText(SystemResources.RESID_PREF_DAEMON_PORT_TOOLTIP);
-
- SystemWidgetHelpers.setHelp(portEditor.getTextControl(parent), RSEUIPlugin.HELPPREFIX + "cmmp0000");
-
-
- (new Mnemonics()).setOnPreferencePage(true).setMnemonics(parent);
- }
-
- /**
- * Inherited method.
- */
- public void init(IWorkbench workbench)
- {
- }
-
- /**
- * Set default preferences for the communications preference page.
- *
- * @param store PreferenceStore used for this preference page.
- */
- public static void initDefaults(IPreferenceStore store)
- {
- store.setDefault(ISystemPreferencesConstants.DAEMON_AUTOSTART, ISystemPreferencesConstants.DEFAULT_DAEMON_AUTOSTART);
- store.setDefault(ISystemPreferencesConstants.DAEMON_PORT, ISystemPreferencesConstants.DEFAULT_DAEMON_PORT);
- }
-
- /**
- * @see FieldEditorPreferencePage#performOk()
- */
- public boolean performOk() {
- // Restart the communications daemon if required
- int port = portEditor.getIntValue();
- SystemCommunicationsDaemon daemon = SystemCommunicationsDaemon.getInstance();
-
- // Restart communications daemon if it is already running and the
- // port number has changed
- if (daemon.isRunning() && port != daemon.getPort()) {
- SystemCommunicationsDaemon.getInstance().stopDaemon();
- SystemCommunicationsDaemon.getInstance().startDaemon();
- }
-
- return super.performOk();
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java
deleted file mode 100644
index adf89aa55..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRegistryUI;
-import org.eclipse.rse.ui.ISystemConnectionFormCaller;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * The property page for connection properties
- * The plugin.xml file registers this for objects of class org.eclipse.rse.rse.model.IHost
- */
-public class SystemConnectionPropertyPage extends SystemBasePropertyPage
- implements ISystemMessageLine, ISystemConnectionFormCaller
-{
-
- protected SystemConnectionForm form;
- protected String parentHelpId;
-
- /**
- * Constructor for SystemConnectionPropertyPage
- */
- public SystemConnectionPropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
-
- parentHelpId = RSEUIPlugin.HELPPREFIX + "pcon0000"; //$NON-NLS-1$
- form = new SystemConnectionForm(this, this);
- }
- /**
- * Create the page's GUI contents.
- */
- protected Control createContentArea(Composite parent)
- {
- // prepare input data
- IHost conn = (IHost)getElement();
- form.initializeInputFields(conn);
- // create validators
- ISystemValidator connectionNameValidators[] = new ISystemValidator[1];
- connectionNameValidators[0] = SystemConnectionForm.getConnectionNameValidator(conn);
- form.setConnectionNameValidators(connectionNameValidators);
- // create content area
- Control c = form.createContents(parent,true, parentHelpId);
- // set focus
- form.getInitialFocusControl().setFocus();
- SystemWidgetHelpers.setCompositeHelp(parent, parentHelpId);
- return c;
- }
-
- /**
- * Get the input connection object
- */
- protected IHost getConnection()
- {
- return (IHost)getElement();
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- boolean okToClose = verifyPageContents();
- if (okToClose)
- {
- IHost conn = (IHost)getElement();
- ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.updateHost( getShell(),conn,conn.getSystemType(),form.getConnectionName(),
- form.getHostName(), form.getConnectionDescription(),
- form.getDefaultUserId(), form.getUserIdLocation() );
-
-
- boolean offlineSelection = form.isWorkOffline();
- if (offlineSelection != conn.isOffline())
- {
- // offline status has changed
- if (!offlineSelection)
- {
- // offline going online
- sr.setHostOffline(conn, false);
- }
- else
- {
- // these need to be set before calling disconnect so the iSeires subsystems know not
- // to collapse
- sr.setHostOffline(conn, true);
-
- // online going offline, disconnect all subsystems
- ISubSystem[] subsystems = sr.getSubSystems(conn);
- if (subsystems != null)
- {
- boolean cancelled = false;
- for (int i = 0; i < subsystems.length && !cancelled; i++)
- {
- try
- {
- subsystems[i].disconnect(false);
- } catch (InterruptedException e) {
- // user cancelled disconnect
- cancelled = true;
- } catch (Exception e) {
- SystemBasePlugin.logError("SystemConnectionPropertyPage.performOk", e);
- }
- }
- }
-
- // check that everything was disconnedted okay and this is not the local connection
- if(sr.isAnySubSystemConnected(conn) && !IRSESystemType.SYSTEMTYPE_LOCAL.equals(conn.getSystemType()))
- {
- // backout changes, likely because user cancelled the disconnect
- sr.setHostOffline(conn, false);
- okToClose = false;
- }
- }
- }
- }
- return okToClose;
- }
-
- /**
- * Validate all the widgets on the page
- * <p>
- * Subclasses should override to do full error checking on all
- * the widgets on the page.
- */
- protected boolean verifyPageContents()
- {
- return form.verify(true);
- }
-
-
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION FORM...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionSubSystemsPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionSubSystemsPropertyPage.java
deleted file mode 100644
index e89fd98f7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionSubSystemsPropertyPage.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemConnectionFormCaller;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemTabFolderLayout;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.ISystemMessageLineTarget;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-
-/**
- * The property page for subsystem properties when accessed from the connection property page.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.model.IHost
- <page
- objectClass="org.eclipse.rse.model.IHost"
- name="SubSystems"
- class="org.eclipse.rse.core.ui.propertypages.SystemConnectionSubSystemsPropertyPage"
- id="org.eclipse.rse.SystemConnectionSubSystemsPropertyPage">
- </page>
- */
-public class SystemConnectionSubSystemsPropertyPage extends SystemBasePropertyPage
- implements ISystemMessageLine, ISystemConnectionFormCaller, SelectionListener
-{
-
- protected CTabFolder tabFolder;
- protected ResourceBundle rb;
- protected String parentHelpId;
- protected PropertyPage[] pages;
- protected CTabItem[] tabs;
-
- /**
- * Constructor.
- */
- public SystemConnectionSubSystemsPropertyPage()
- {
- super();
- //RSEUIPlugin sp = RSEUIPlugin.getDefault();
- parentHelpId = RSEUIPlugin.HELPPREFIX + "pcon0000"; //$NON-NLS-1$
- }
-
- /**
- * Return false if you don't want to have mnemonics automatically applied to your page
- * by this parent class. We return false as we assume each subpage does their own.
- */
- protected boolean wantMnemonics()
- {
- return false;
- }
-
- /**
- * Create the page's GUI contents.
- */
- protected Control createContentArea(Composite parent)
- {
- // prepare input data
- //IHost conn = (IHost)getElement();
-
- // create notebook
- Composite composite_prompts = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- composite_prompts.setLayout(layout);
-
- // create notebook pages
- ISubSystem[] subsystems = getSubSystems();
- pages = getSubSystemPropertyPages(subsystems);
-
- if (pages != null)
- {
- tabFolder = createTabFolder(composite_prompts);
- createTabbedItems(pages);
- tabFolder.setFocus();
- }
- else
- {
- SystemWidgetHelpers.createLabel(composite_prompts, SystemPropertyResources.RESID_TERM_NOTAVAILABLE);
- }
-
- SystemWidgetHelpers.setCompositeHelp(parent, parentHelpId);
- return composite_prompts;
- }
-
- /**
- * Create the notebook.
- */
- protected CTabFolder createTabFolder(Composite parent)
- {
- tabFolder = new CTabFolder(parent, SWT.NONE);
- tabFolder.setLayout(new SystemTabFolderLayout());
- tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
- return tabFolder;
- }
-
- /**
- * Query the property page for each subsystem and then add each to the
- * tabbed notebook as a tab...
- */
- private PropertyPage[] getSubSystemPropertyPages(ISubSystem[] subsystems)
- {
- PropertyPage[] pages = null;
- Vector v = new Vector();
-
- for (int idx = 0; idx < subsystems.length; idx++)
- {
- ISubSystem ss = subsystems[idx];
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ss.getSubSystemConfiguration().getAdapter(ISubSystemConfigurationAdapter.class);
- PropertyPage page = adapter.getPropertyPage(ss, tabFolder);
-
- if (page != null)
- {
- page.setContainer(getContainer());
- }
-
- if (page != null)
- {
- page.setElement((IAdaptable)ss);
-
- if (page instanceof ISystemMessageLineTarget)
- ((ISystemMessageLineTarget)page).setMessageLine(msgLine);
-
- v.addElement(page);
- }
- }
-
- if (v.size() > 0)
- {
- pages = new PropertyPage[v.size()];
-
- for (int idx=0; idx<pages.length; idx++)
- {
- pages[idx] = (PropertyPage)v.elementAt(idx);
- }
- }
-
- return pages;
- }
-
- /**
- * For each property page create a tabbed item.
- */
- private void createTabbedItems(PropertyPage[] pages)
- {
- if (pages != null)
- {
- tabs = new CTabItem[pages.length];
-
- for (int idx = 0; idx < pages.length; idx++)
- {
- PropertyPage page = pages[idx];
- ISubSystem ss = (ISubSystem)((IWorkbenchPropertyPage)page).getElement();
- CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
- tabItem.setText(ss.getName());
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ss.getSubSystemConfiguration().getAdapter(ISubSystemConfigurationAdapter.class);
- Image image = adapter.getGraphicsImage(ss.getSubSystemConfiguration());
-
- if (image != null)
- {
- tabItem.setImage(image);
- }
-
- tabItem.setData(page);
-
- if (page.getControl() == null)
- {
- page.createControl(tabFolder);
- }
-
- // dy: Need to force the control to repack incase the buttonbar was added
- // and subsequently removed. Otherwise an ArrayIndexOutOfBounds exception
- // occurs when SWT tries to lay out the page
- page.getControl().pack(true);
- tabItem.setControl(page.getControl());
- tabs[idx] = tabItem;
- }
- }
- }
-
- /**
- * Get the input connection object
- */
- protected IHost getConnection()
- {
- return (IHost)getElement();
- }
-
- /**
- * Get the input subsystems
- */
- protected ISubSystem[] getSubSystems()
- {
- ISubSystem[] subsystems =
- RSEUIPlugin.getTheSystemRegistry().getSubSystems(getConnection());
- return subsystems;
- }
-
- /**
- * The <code>PreferencePage</code> implementation of this
- * <code>IPreferencePage</code> method returns <code>true</code>
- * if the page is valid.
- * <p>
- * We cycle through all pages calling okToLeave().
- */
- public boolean okToLeave()
- {
- boolean ok = isValid();
-
- if (ok && (pages!= null) && (pages.length > 0))
- {
- int currIdx = tabFolder.getSelectionIndex();
-
- // if a page is selected
- if (currIdx != -1)
- {
- PropertyPage currentPage = pages[currIdx];
- ok = currentPage.okToLeave();
- }
-
- for (int idx = 0; ok && (idx < pages.length); idx++)
- {
- if (idx != currIdx)
- {
- PropertyPage page = pages[idx];
- ok = page.okToLeave();
-
- if (!ok)
- {
- tabFolder.setSelection(idx);
- }
- }
- }
- }
-
- return ok;
- }
-
- /**
- * Return true if this page is valid. Override of parent.
- * Cycles through all tab pages calling isValid.
- */
- public boolean isValid()
- {
- boolean ok = super.isValid();
- if (ok && (pages!=null) && (pages.length>0))
- {
- for (int idx=0; ok && (idx<pages.length); idx++)
- {
- PropertyPage page = pages[idx];
- ok = page.isValid();
- }
- }
- return ok;
- }
-
- /**
- * Called by parent when user presses OK.
- * We cycle through all subpages calling performOk
- */
- public boolean performOk()
- {
- boolean okToClose = super.performOk();
-
- if (okToClose && (pages != null) && (pages.length > 0))
- {
- int currIdx = tabFolder.getSelectionIndex();
-
- if (currIdx != -1)
- {
- PropertyPage currentPage = pages[currIdx];
- okToClose = currentPage.performOk();
- }
-
- for (int idx = 0; okToClose && (idx < pages.length); idx++)
- {
- if (idx != currIdx)
- {
- PropertyPage page = pages[idx];
- okToClose = page.performOk();
-
- if (!okToClose)
- {
- tabFolder.setSelection(idx);
- }
- }
- }
- }
-
- return okToClose;
- }
-
- /**
- * Validate all the widgets on the page
- * <p>
- * Subclasses should override to do full error checking on all
- * the widgets on the page.
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
- // ----------------------------------------
- // The following were for any aborted attempt to query registered subsystem property pages
- // and use them. The problem with this is that for iSeries, all property pages for subsystems
- // are shared and we ended up with redundancies.
- // ----------------------------------------
-
- // ----------------------------------------
- // SelectionListener methods...
- // ----------------------------------------
- /**
- * A tab item selected
- */
- public void widgetSelected(SelectionEvent event)
- {
- if (event.getSource() == tabFolder)
- {
- }
- }
- /**
- * Not used
- */
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION FORM...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectorServicesPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectorServicesPropertyPage.java
deleted file mode 100644
index 8db94f0cb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectorServicesPropertyPage.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.ui.widgets.services.ConnectorServiceElement;
-import org.eclipse.rse.ui.widgets.services.ConnectorServicesForm;
-import org.eclipse.rse.ui.widgets.services.RootServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServiceElement;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-public class SystemConnectorServicesPropertyPage extends SystemBasePropertyPage
-{
- private ConnectorServicesForm _form;
- private ServiceElement _root;
- public IHost getHost()
- {
- return (IHost)getElement();
- }
-
-
- protected Control createContentArea(Composite parent)
- {
- _form = new ConnectorServicesForm(getMessageLine());
-
- Control control = _form.createContents(parent);
- initForm();
- return control;
- }
-
-
- protected void initForm()
- {
- _root = getRoot();
- _form.init(_root);
- }
-
- protected ServiceElement getRoot()
- {
- RootServiceElement root = new RootServiceElement();
- IHost host = getHost();
- IConnectorService[] connectorServices = host.getConnectorServices();
- ServiceElement[] elements = new ServiceElement[connectorServices.length];
- for (int i = 0; i < connectorServices.length; i++)
- {
- elements[i] = new ConnectorServiceElement(host, root, connectorServices[i]);
- }
- root.setChildren(elements);
- return root;
- }
-
- protected boolean verifyPageContents()
- {
- return true;
- }
-
-
- public boolean performCancel()
- {
- _root.revert();
- return super.performCancel();
- }
-
-
- public boolean performOk()
- {
- _root.commit();
- return super.performOk();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolPropertyPage.java
deleted file mode 100644
index a7d5fda71..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolPropertyPage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for filter pool properties.
- * This is an output-only page.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.filters.SystemFilterPool
- */
-public class SystemFilterPoolPropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelProfile, labelReferenceCount, labelRelatedConnection;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor
- */
- public SystemFilterPoolPropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
-
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type display
- labelType = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_PROPERTIES_TYPE_LABEL, SystemResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP);
- labelType.setText(SystemResources.RESID_FILTERPOOL_TYPE_VALUE);
-
- // Name display
- labelName = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOL_NAME_LABEL, SystemResources.RESID_FILTERPOOL_NAME_TOOLTIP);
-
- // Profile display
- labelProfile = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOL_PROFILE_LABEL, SystemResources.RESID_FILTERPOOL_PROFILE_TOOLTIP);
-
- // Reference count display
- labelReferenceCount = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOL_REFERENCECOUNT_LABEL, SystemResources.RESID_FILTERPOOL_REFERENCECOUNT_TOOLTIP);
-
- // Related connection display
- labelRelatedConnection = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOL_RELATEDCONNECTION_LABEL, SystemResources.RESID_FILTERPOOL_RELATEDCONNECTION_TOOLTIP);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input filterpool object
- */
- protected ISystemFilterPool getFilterPool()
- {
- Object element = getElement();
- if (element instanceof ISystemFilterPool)
- return (ISystemFilterPool)element;
- else
- return ((ISystemFilterPoolReference)element).getReferencedFilterPool();
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISystemFilterPool pool = getFilterPool();
- // name
- labelName.setText(pool.getName());
- // profile
- ISubSystemConfiguration ssFactory = (ISubSystemConfiguration)(pool.getProvider());
- String profileName = ssFactory.getSystemProfile(pool).getName();
- labelProfile.setText( profileName );
- // reference count
- labelReferenceCount.setText(Integer.toString(pool.getReferenceCount()));
- // related connection
- if (pool.getOwningParentName() == null)
- labelRelatedConnection.setText(SystemPropertyResources.RESID_TERM_NOTAPPLICABLE);
- else
- labelRelatedConnection.setText(pool.getOwningParentName());
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolReferencePropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolReferencePropertyPage.java
deleted file mode 100644
index 6254991dc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPoolReferencePropertyPage.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for filter pool properties.
- * This is an output-only page.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.filters.SystemFilterPool
- */
-public class SystemFilterPoolReferencePropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelSubSystem, labelProfile, labelConnection; //, labelRelatedConnection;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor
- */
- public SystemFilterPoolReferencePropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type display
- labelType = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_PROPERTIES_TYPE_LABEL, SystemResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP);
- labelType.setText(SystemResources.RESID_FILTERPOOLREF_TYPE_VALUE);
-
- // Name display
- labelName = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOLREF_NAME_LABEL, SystemResources.RESID_FILTERPOOLREF_NAME_TOOLTIP);
-
- // SubSystem display
- labelSubSystem = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOLREF_SUBSYSTEM_LABEL, SystemResources.RESID_FILTERPOOLREF_SUBSYSTEM_TOOLTIP);
-
- // Connection display
- labelConnection = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOLREF_CONNECTION_LABEL, SystemResources.RESID_FILTERPOOLREF_CONNECTION_TOOLTIP);
-
- // Profile display
- labelProfile = createLabeledLabel(composite_prompts, SystemResources.RESID_FILTERPOOLREF_PROFILE_LABEL, SystemResources.RESID_FILTERPOOLREF_PROFILE_TOOLTIP);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input filterpoolreference object
- */
- protected ISystemFilterPoolReference getFilterPoolReference()
- {
- return ((ISystemFilterPoolReference)getElement());
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISystemFilterPoolReference poolRef = getFilterPoolReference();
- ISystemFilterPool pool = poolRef.getReferencedFilterPool();
- ISubSystem ss = (ISubSystem)poolRef.getProvider();
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
-
- // name
- labelName.setText(pool.getName());
- // subsystem
- labelSubSystem.setText(ss.getName());
- // connection
- labelConnection.setText(ss.getHostAliasName());
- // profile
- labelProfile.setText(ss.getSystemProfileName());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPropertyPage.java
deleted file mode 100644
index 35f0d8511..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterPropertyPage.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for filter properties.
- * This is an output-only page.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.filters.SystemFilter
- */
-public class SystemFilterPropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelFilterPool, labelStringCount, labelIsConnectionPrivate, labelProfile;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor
- */
- public SystemFilterPropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type display
- labelType = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_PROPERTIES_TYPE_LABEL, SystemResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP);
- labelType.setText(SystemResources.RESID_PP_FILTER_TYPE_VALUE);
-
- // Name display
- labelName = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTER_NAME_LABEL, SystemResources.RESID_PP_FILTER_NAME_TOOLTIP);
-
- // String count display
- labelStringCount = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTER_STRINGCOUNT_LABEL, SystemResources.RESID_PP_FILTER_STRINGCOUNT_TOOLTIP);
-
- // Is connection-private display
- labelIsConnectionPrivate = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTER_ISCONNECTIONPRIVATE_LABEL, SystemResources.RESID_PP_FILTER_ISCONNECTIONPRIVATE_TOOLTIP);
-
- // Parent Filter Pool display
- labelFilterPool = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTER_FILTERPOOL_LABEL, SystemResources.RESID_PP_FILTER_FILTERPOOL_TOOLTIP);
-
- // Parent Profile display
- labelProfile = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTER_PROFILE_LABEL, SystemResources.RESID_PP_FILTER_PROFILE_TOOLTIP);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input filter object
- */
- protected ISystemFilter getFilter()
- {
- Object element = getElement();
- if (element instanceof ISystemFilter)
- return (ISystemFilter)element;
- else
- return ((ISystemFilterReference)element).getReferencedFilter();
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISystemFilter filter = getFilter();
- boolean isTransient = filter.isTransient();
- // name
- labelName.setText(filter.getName());
- // type
- if (filter.isPromptable())
- labelType.setText(SystemResources.RESID_PP_FILTER_TYPE_PROMPTABLE_VALUE);
- if (!isTransient)
- {
- // pool
- ISystemFilterPool pool = filter.getParentFilterPool();
- labelFilterPool.setText(pool.getName());
- // profile
- ISubSystemConfiguration ssFactory = (ISubSystemConfiguration)(pool.getProvider());
- String profileName = ssFactory.getSystemProfile(pool).getName();
- labelProfile.setText( profileName );
- // string count
- labelStringCount.setText(Integer.toString(filter.getFilterStringCount()));
- // is connection-private
- if (pool.getOwningParentName() == null)
- labelIsConnectionPrivate.setText(SystemResources.TERM_NO);
- else
- labelIsConnectionPrivate.setText(SystemResources.TERM_YES);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterStringPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterStringPropertyPage.java
deleted file mode 100644
index 2586bad1f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemFilterStringPropertyPage.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener;
-import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterString;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The property page for filter string properties.
- * This is an output-only page.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.filters.SystemFilterString
- */
-public class SystemFilterStringPropertyPage extends SystemBasePropertyPage implements ISystemFilterStringEditPaneListener
-{
- //gui
- protected Label labelType, labelFilter, labelFilterPool, labelProfile;
- //protected Label labelString;
- //input
- protected SystemFilterStringEditPane editPane;
- protected ISystemValidator filterStringValidator;
- protected SystemMessage dupeFilterStringMessage;
- protected boolean editable = true;
- //state
- protected Composite composite_prompts;
- protected SystemMessage errorMessage;
- protected ResourceBundle rb;
- protected boolean initDone = false;
-
- /**
- * Constructor
- */
- public SystemFilterStringPropertyPage()
- {
- super();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- }
-
- // configuration methods, called by customizeFilterStringPropertyPage in SubSystemConfigurationImpl...
-
- /**
- * <i>Configuration method</i><br>
- * Specify an edit pane that prompts the user for the contents of a filter string.
- */
- public void setFilterStringEditPane(SystemFilterStringEditPane editPane)
- {
- this.editPane = editPane;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool reference manager provider. Will be non-null if the
- * current selection is a reference to a filter pool or filter, or a reference manager
- * provider itself (eg subsystem)
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
- {
- editPane.setSystemFilterPoolReferenceManagerProvider(provider);
- }
- /**
- * <i>Configuration method</i><br>
- * Set the contextual system filter pool manager provider. Will be non-null if the
- * current selection is a filter pool or filter or reference to either, or a manager
- * provider itself (eg subsystemconfiguration)
- * <p>
- * This is passed into the filter and filter string wizards and dialogs in case it is needed
- * for context.
- */
- public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
- {
- editPane.setSystemFilterPoolManagerProvider(provider);
- }
- /**
- * <i>Configuration method</i><br>
- * Call this to specify a validator for the filter string. It will be called per keystroke.
- * A default validator is supplied otherwise: ValidatorFilterString.
- * <p>
- * Your validator should extend ValidatorFilterString to inherited the uniqueness error checking.
- * <p>
- * Alternatively, if all you want is a unique error message for the case when duplicates are found,
- * call setDuplicateFilterStringErrorMessage, and it will be used in the default validator.
- */
- public void setFilterStringValidator(ISystemValidator v)
- {
- filterStringValidator = v;
- }
- /**
- * <i>Configuration method</i><br>
- * Set the error message to use when the user is editing or creating a filter string, and the
- * Apply processing detects a duplicate filter string in the list.
- */
- public void setDuplicateFilterStringErrorMessage(SystemMessage msg)
- {
- dupeFilterStringMessage = msg;
- }
- /**
- * Set if the edit pane is not to be editable
- */
- public void setEditable(boolean editable)
- {
- editable = false;
- }
-
- // lifecyle methods...
-
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type display
- labelType = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_PROPERTIES_TYPE_LABEL, SystemResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP);
- labelType.setText(SystemResources.RESID_PP_FILTERSTRING_TYPE_VALUE);
-
- // String display
- //labelString = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTERSTRING_STRING_ROOT);
-
- // Parent Filter display
- labelFilter = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTERSTRING_FILTER_LABEL, SystemResources.RESID_PP_FILTERSTRING_FILTER_TOOLTIP);
-
- // Parent Filter Pool display
- labelFilterPool = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTERSTRING_FILTERPOOL_LABEL, SystemResources.RESID_PP_FILTERSTRING_FILTERPOOL_TOOLTIP);
-
- // Parent Profile display
- labelProfile = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_FILTERSTRING_PROFILE_LABEL, SystemResources.RESID_PP_FILTERSTRING_PROFILE_TOOLTIP);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- boolean ok = false;
- clearErrorMessage();
- errorMessage = editPane.verify();
- if (errorMessage == null)
- {
- ok = true;
- String editedFilterString = editPane.getFilterString();
- if (filterStringValidator != null)
- {
- errorMessage = filterStringValidator.validate(editedFilterString);
- }
- }
- if (errorMessage != null)
- {
- ok = false;
- setErrorMessage(errorMessage);
- }
- //System.out.println("Inside verifyPageContents. errorMessage = "+errorMessage);
- return ok;
- }
-
- /**
- * Get the input filter string object
- */
- protected ISystemFilterString getFilterString()
- {
- Object element = getElement();
- return ((ISystemFilterString)element);
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISystemFilterString filterstring = getFilterString();
- ISystemFilter filter = filterstring.getParentSystemFilter();
- // string
- //labelString.setText(filterstring.getString());
- // filter
- labelFilter.setText(filter.getName());
- // pool
- ISystemFilterPool pool = filter.getParentFilterPool();
- labelFilterPool.setText(pool.getName());
- // profile
- ISubSystemConfiguration ssFactory = (ISubSystemConfiguration)(pool.getProvider());
- String profileName = ssFactory.getSystemProfile(pool).getName();
- labelProfile.setText( profileName );
-
- // edit pane
- ISubSystemConfiguration factory = (ISubSystemConfiguration)filter.getProvider();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factory.getAdapter(ISubSystemConfigurationAdapter.class);
- adapter.customizeFilterStringPropertyPage(factory, this, filterstring, getShell());
- if (editPane == null)
- {
- Shell shell = getShell();
- //System.out.println("Shell is: "+shell);
- editPane = new SystemFilterStringEditPane(shell);
- }
- editPane.setSystemFilterPoolManagerProvider(filter.getProvider());
- editPane.setChangeFilterMode(true);
- editPane.addChangeListener(this);
- Control editPaneComposite = editPane.createContents(composite_prompts);
- ((GridData)editPaneComposite.getLayoutData()).horizontalSpan = 2;
-
- editPane.setFilterString(filterstring.getString(), 0);
- if (!editable || filter.isNonChangable())
- editPaneComposite.setEnabled(false);
- else if (filterStringValidator == null)
- {
- Vector existingStrings = filter.getFilterStringsVector();
- existingStrings.remove(filterstring);
- filterStringValidator = new ValidatorFilterString(existingStrings, filter.isStringsCaseSensitive());
- if (dupeFilterStringMessage != null)
- ((ValidatorFilterString)filterStringValidator).setDuplicateFilterStringErrorMessage(dupeFilterStringMessage);
- }
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- boolean ok = super.performOk();
- if (!ok)
- return false;
- ISystemFilterString filterstring = getFilterString();
- ISystemFilter filter = filterstring.getParentSystemFilter();
- ISystemFilterPool pool = filter.getParentFilterPool(); // recurses for nested filter
- ISystemFilterPoolManager mgr = pool.getSystemFilterPoolManager();
- try
- {
- mgr.updateSystemFilterString(filterstring, editPane.getFilterString());
- }
- catch (SystemMessageException e)
- {
- SystemBasePlugin.logError("Error updating filter string from property page", e);
- e.printStackTrace();
- SystemMessageDialog.displayMessage(getShell(), e);
- ok = false;
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError("Error updating filter string from property page", e);
- e.printStackTrace();
- SystemMessageDialog.displayExceptionMessage(getShell(), e);
- ok = false;
- }
-
- /*
- String[] listItems = listView.getItems();
- String[] filterStrings = new String[listItems.length - 1];
- for (int idx=0; idx<filterStrings.length; idx++)
- filterStrings[idx] = listItems[idx+1];
- try {
- mgr.updateSystemFilter(inputFilter, inputFilter.getName(), filterStrings);
- }
- catch (SystemMessageException exc)
- {
- getMessageLine().setErrorMessage(exc.getSystemMessage());
- return false;
- }
- catch (Exception exc)
- {
- //displayErrorMessage("Error updating filter: " + exc.getMessage());
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UPDATEFILTER_FAILED);
- String excText = exc.getMessage();
- if (excText == null)
- excText = exc.getClass().getName();
- msg.makeSubstitution(excText,exc);
- getMessageLine().setErrorMessage(msg);
- return false;
- }*/
- return ok;
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener#filterStringChanged(org.eclipse.rse.core.ui.messages.SystemMessage)
- */
- public void filterStringChanged(SystemMessage message)
- {
- if (message == null)
- clearErrorMessage();
- else
- setErrorMessage(message);
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener#backupChangedState()
- */
- public void backupChangedState()
- {
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.filters.ISystemFilterStringEditPaneListener#restoreChangedState()
- */
- public void restoreChangedState()
- {
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemIntegerFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemIntegerFieldEditor.java
deleted file mode 100644
index b888ae7c5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemIntegerFieldEditor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A version of an IntegerFieldEditor which allows setting tooltip and help
- * If value is outside of valid range, message will tell user what the valid range is
- */
-public class SystemIntegerFieldEditor extends IntegerFieldEditor {
-
- public static final String Copyright = "(C) Copyright IBM Corp. 2003 All Rights Reserved.";
-
-
- /**
- * the message for an empty field
- */
- private static final String RANGE_MESSAGE = "RSEG0402";
-
- protected Composite composite_parent = null;
-
- /**
- * @see java.lang.Object#Object()
- */
- public SystemIntegerFieldEditor() {
- super();
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#FieldEditor(String, String, Composite)
- */
- public SystemIntegerFieldEditor(
- String name,
- String labelText,
- Composite parent) {
- super(name, labelText, parent);
- composite_parent = parent;
- }
-
- /**
- * @see org.eclipse.jface.preference.IntegerFieldEditor#setValidRange(int, int)
- */
- public void setValidRange(int min,int max) {
- super.setValidRange(min, max);
- SystemMessage msg = RSEUIPlugin.getPluginMessage(RANGE_MESSAGE);
- setErrorMessage(msg.makeSubstitution(getLabelControl().getText(), new Integer(min), new Integer(max)).getLevelOneText());
- }
-
- /**
- * Method setHelp.
- * Sets the info pop help for this field editor
- * @param contextId the context ID for the help
- */
- public void setHelp(String contextId) {
- SystemWidgetHelpers.setHelp(getTextControl(), contextId);
- }
-
- /**
- * Method setToolTipText.
- * The tooltip text
- * @param tip the tip to set for the entry field
- */
- public void setToolTipText(String tip) {
- getTextControl().setToolTipText(tip);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#setEnabled(boolean, org.eclipse.swt.widgets.Composite)
- */
- public void setEnabled(boolean enabled)
- {
- super.setEnabled(enabled, composite_parent);
- }
-
- /* (non-Javadoc)
- * Method declared on FieldEditor.
- */
- public void refreshValidState() {
- super.refreshValidState();
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemKeyValueFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemKeyValueFieldEditor.java
deleted file mode 100644
index fc0c8ea8e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemKeyValueFieldEditor.java
+++ /dev/null
@@ -1,640 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorSpecialChar;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * For string key,value pair properties that have a discrete list of key values.
- * Used in preference pages.
- */
-public class SystemKeyValueFieldEditor extends FieldEditor
-{
- private List keysField;
- private Text valueField;
- private Label keysLabel, valueLabel;
- private Composite keysComposite, valueComposite;
- private Group boxComposite;
- private Button setButton, clearButton;
- private String keysLabelString, valueLabelString;
- private char keyValueDelimiter='=';
- private char keyValuePairDelimiter=';';
- private SystemMessage errorMessage;
- private boolean contentInited;
- protected ISystemValidator valueValidator, defaultValueValidator;
- private String[] contentArray;
- private Hashtable keyValues;
- private SelectionListener selectionListener;
-
- private static boolean boxFlavor = true;
-
- /**
- * Constructor
- */
- private SystemKeyValueFieldEditor()
- {
- super();
- }
-
- /**
- * Constructor
- */
- public SystemKeyValueFieldEditor(String name, String labelText, String[] keys,
- String keysLabelString, String valueLabelString, Composite parent)
- {
- super(name, labelText, parent);
- keyValues = new Hashtable();
- contentArray = keys;
- this.keysLabelString = keysLabelString;
- this.valueLabelString = valueLabelString;
- // the ctor's call to super causes the controls to be created before this
- // instance data is accessible, so we do it now...
- keysLabel.setText(keysLabelString);
- valueLabel.setText(valueLabelString);
- //if (boxFlavor)
- // boxComposite.setText(labelText);
- initContents();
-
- String specialChars = makeString(keyValueDelimiter,keyValuePairDelimiter);
- defaultValueValidator = new ValidatorSpecialChar(specialChars, ValidatorSpecialChar.EMPTY_ALLOWED_YES);
- }
-
- /**
- * Call this to specify a validator for the value entry field. It will be called per keystroke.
- * By default we just check against the special characters used to delimit the key and value (=)
- * and to delimiter each key/value pair (;)
- */
- public void setValueValidator(ISystemValidator v)
- {
- valueValidator = v;
- }
- /**
- * Call this to set the characters used to delimit the strings in the preferences store
- * @param keyValueDelimiter The char to distinguish between key and value. Default is =
- * @param keyValuePairDelimiter The char to distinguish between each key/value pair. Default is ;
- */
- public void setDelimiterCharacters(char keyValueDelimiter, char keyValuePairDelimiter)
- {
- this.keyValueDelimiter = keyValueDelimiter;
- this.keyValuePairDelimiter = keyValuePairDelimiter;
- String specialChars = makeString(keyValueDelimiter,keyValuePairDelimiter);
- defaultValueValidator = new ValidatorSpecialChar(specialChars, ValidatorSpecialChar.EMPTY_ALLOWED_YES);
- }
-
- /**
- * @see FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls()
- {
- return boxFlavor ? 1 : 2;
- }
-
- /**
- * @see FieldEditor#doStore()
- */
- protected void doStore()
- {
- String s = createString(keyValues);
- if (s != null)
- getPreferenceStore().setValue(getPreferenceName(), s);
- }
-
- /**
- * @see FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault()
- {
- if (keysField != null)
- {
- String value = getPreferenceStore().getDefaultString(getPreferenceName());
- if (value != null)
- keyValues = parseString(value);
- else
- keyValues = new Hashtable();
- valueField.setText("");
- keysField.select(0);
- clearButton.setEnabled(false);
- setButton.setEnabled(false);
- //selectionChanged();
- }
- }
-
- /**
- * @see FieldEditor#doLoad()
- */
- protected void doLoad()
- {
- //if (keysField != null)
- //{
- String value = getPreferenceStore().getString(getPreferenceName());
- if ((value == null) || (value.length()==0))
- value = getPreferenceStore().getDefaultString(getPreferenceName());
- if (value != null)
- keyValues = parseString(value);
- if (keysField != null)
- {
- keysField.select(0);
- selectionChanged();
- }
- //}
- }
-
- /**
- * Parse out list of key-value pairs into a hashtable
- */
- public Hashtable parseString(String allvalues)
- {
- StringTokenizer tokens = new StringTokenizer(allvalues, makeString(keyValueDelimiter, keyValuePairDelimiter));
- Hashtable keyValues = new Hashtable(10);
- int count = 0;
- String token1=null;
- String token2=null;
- while (tokens.hasMoreTokens())
- {
- count++;
- if ((count % 2) == 0) // even number
- {
- token2 = tokens.nextToken();
- keyValues.put(token1, token2);
- }
- else
- token1 = tokens.nextToken();
- }
- return keyValues;
- }
- /**
- * Convert hashtable of key-value pairs into a single string
- */
- protected String createString(Hashtable keyValues)
- {
- Enumeration keys = keyValues.keys();
- StringBuffer sb = new StringBuffer();
- while (keys.hasMoreElements())
- {
- String key = (String)keys.nextElement();
- String value = (String)keyValues.get(key);
- if ((value != null) && (value.length()>0))
- {
- sb.append(key);
- sb.append(keyValueDelimiter);
- sb.append(value);
- sb.append(keyValuePairDelimiter);
- }
- }
- //System.out.println("Pref String: " + sb);
- return sb.toString();
- }
-
-
- private String makeString(char charOne, char charTwo)
- {
- StringBuffer s = new StringBuffer(2);
- s.append(charOne);
- s.append(charTwo);
- return s.toString();
- }
-
- private void initContents()
- {
- if ((contentArray!=null) && (keysField!=null) && !contentInited)
- {
- keysField.setItems(contentArray);
- contentInited = true;
- }
- }
-
- /**
- * @see FieldEditor#doFillIntoGrid(Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns)
- {
- GridData gd = null;
- // label goes all the way across top
- if (!boxFlavor)
- {
- Control control = getLabelControl(parent);
- if (control!=null)
- {
- gd = new GridData();
- gd.horizontalSpan = numColumns;
- control.setLayoutData(gd);
- }
- }
-
-boxComposite = SystemWidgetHelpers.createGroupComposite(parent, 2, getLabelText());
- ((GridData)boxComposite.getLayoutData()).horizontalSpan = numColumns;
-// parentComposite = boxComposite;
-// numparentcols = 2;
-
- // under the label we place a labeled combo box, and so on
- keysComposite = getKeysControl(boxComposite);
-// gd = new GridData();
-// gd.horizontalAlignment = GridData.FILL;
-// gd.grabExcessHorizontalSpace = true;
-// gd = new GridData(GridData.FILL_BOTH); //dwd
-// keysComposite.setLayoutData(gd);
-
- valueComposite = getValueControl(boxComposite);
-// gd = new GridData();
-// gd.horizontalSpan = numparentcols - 1;
-// gd.horizontalAlignment = GridData.FILL;
-// gd.grabExcessHorizontalSpace = true;
-// gd = new GridData(GridData.FILL_BOTH); //dwd
-// keysComposite.setLayoutData(gd);
-
- }
-
-
- /**
- * @see FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns)
- {
- Control control = getLabelControl();
- if (control != null)
- ((GridData)control.getLayoutData()).horizontalSpan = numColumns;
- if (boxComposite != null)
- ((GridData)boxComposite.getLayoutData()).horizontalSpan = numColumns;
- }
-
-
-
- /**
- * Returns this field editor's List control for the keys.
- */
- protected List getKeysControl()
- {
- return keysField;
- }
- /**
- * Returns this field editor's Text control for the key value.
- */
- protected Text getValueControl()
- {
- return valueField;
- }
-
-
- /**
- * Returns this field editor's text control.
- * <p>
- * The control is created if it does not yet exist
- * </p>
- *
- * @param parent the parent
- * @return the text control
- */
- public Composite getKeysControl(Composite parent)
- {
- if (keysComposite == null)
- {
- // create composite
- keysComposite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- keysComposite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH); // dwd was FILL_HORIZONTAL
- data.heightHint = 150; // dwd was 100
- keysComposite.setLayoutData(data);
- // populate with label
- keysLabel = new Label(keysComposite, SWT.NULL);
- if (keysLabelString != null)
- keysLabel.setText(keysLabelString);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 150;
- keysLabel.setLayoutData(data);
- // populate with list
- int options = SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL;
- keysField = new List(keysComposite, options);
- data = new GridData(GridData.FILL_BOTH); // dwd was FILL_HORIZONTAL
- data.widthHint = 150;
- keysField.setLayoutData(data);
- keysField.addSelectionListener(getSelectionListener());
-
- keysComposite.addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent event)
- {
- keysComposite = null;
- keysField = null;
- keysLabel = null;
- }
- });
- }
- // else
- // {
- // checkParent(keysComposite, parent);
- // }
- return keysComposite;
- }
-
- /**
- * Returns this field editor's value entry field control.
- *
- * @param parent the parent control
- * @return the list control
- */
- public Composite getValueControl(Composite parent)
- {
- if (valueComposite == null)
- {
- // create composite
- valueComposite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- valueComposite.setLayout(layout);
- //GridData data = new GridData(GridData.FILL_HORIZONTAL);
- // DKM: not filling vertical causes trucations on linux
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 150; // dwd was 100
- valueComposite.setLayoutData(data);
- // populate with label
- valueLabel = new Label(valueComposite, SWT.NULL);
- if (valueLabelString != null)
- valueLabel.setText(valueLabelString);
- data = new GridData(GridData.FILL_HORIZONTAL);
- valueLabel.setLayoutData(data);
- // populate with entry field
- valueField = new Text(valueComposite, SWT.BORDER | SWT.SINGLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 150;
- valueField.setLayoutData(data);
- // populate with button
- setButton = createPushButton(valueComposite, SystemResources.ACTION_SET_LABEL, SystemResources.ACTION_SET_TOOLTIP);
- clearButton = createPushButton(valueComposite, SystemResources.ACTION_CLEAR_LABEL, SystemResources.ACTION_CLEAR_TOOLTIP);
-
- // add keystroke listener...
- valueField.addModifyListener(
- new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- validateValueInput();
- }
- }
- );
- // add dispose listener
- valueComposite.addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent event)
- {
- valueComposite = null;
- valueField = null;
- valueLabel = null;
- setButton = null;
- }
- });
- }
- // else
- // {
- // checkParent(valueComposite, parent);
- // }
- return valueComposite;
- }
-
- /**
- * Helper method to create a push button.
- *
- * @param parent the parent control
- * @param label
- * @param tooltip
- */
- private Button createPushButton(Composite parent, String label, String tooltip)
- {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- button.setToolTipText(tooltip);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- button.setLayoutData(data);
- button.addSelectionListener(getSelectionListener());
- return button;
- }
-
- /**
- * Returns this field editor's selection listener.
- * The listener is created if nessessary.
- *
- * @return the selection listener
- */
- private SelectionListener getSelectionListener()
- {
- if (selectionListener == null)
- createSelectionListener();
- return selectionListener;
- }
-
- /**
- * Creates a selection listener.
- */
- public void createSelectionListener()
- {
- selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- Widget widget = event.widget;
- if (widget == setButton)
- setPressed();
- else if (widget == clearButton)
- clearPressed();
- else if (widget == keysField)
- selectionChanged();
- }
- };
- }
-
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the PreferencePage's message line.
- * @see #setValueValidator(ISystemValidator)
- */
- protected SystemMessage validateValueInput()
- {
- errorMessage= null;
- String valueInput = valueField.getText().trim();
- if (valueValidator != null)
- errorMessage = valueValidator.validate(valueInput);
- else if (defaultValueValidator != null)
- errorMessage = defaultValueValidator.validate(valueInput);
- if (errorMessage != null)
- showErrorMessage(errorMessage.getLevelOneText());
- else
- clearErrorMessage();
- setButton.setEnabled((errorMessage == null) && (valueInput.length()>0));
- //clearButton.setEnabled(true);
- return errorMessage;
- }
-
- /**
- * Notifies that the Set button has been pressed.
- */
- private void setPressed()
- {
- setPresentsDefaultValue(false);
- int index = keysField.getSelectionIndex();
- if (index >= 0)
- {
- String value = valueField.getText().trim();
- valueField.setText(value);
- if (value.length() == 0)
- keyValues.remove(contentArray[index]);
- else
- keyValues.put(contentArray[index],value);
- selectionChanged();
- }
- else
- setButton.setEnabled(false);
- }
-
- /**
- * Notifies that the Clear button has been pressed.
- */
- private void clearPressed()
- {
- setPresentsDefaultValue(false);
- int index = keysField.getSelectionIndex();
- if (index >= 0)
- {
- //valueField.setText("");
- keyValues.remove(contentArray[index]);
- selectionChanged();
- }
- else
- clearButton.setEnabled(false);
- }
- /**
- * Notifies that the list selection has changed.
- */
- private void selectionChanged()
- {
- int index = keysField.getSelectionIndex();
- if (index >= 0)
- {
- String key = contentArray[index];
- String value = (String)keyValues.get(key);
- if (value == null)
- {
- valueField.setText("");
- clearButton.setEnabled(false);
- }
- else
- {
- valueField.setText(value);
- clearButton.setEnabled(true);
- }
- }
- else
- {
- clearButton.setEnabled(false);
- }
- setButton.setEnabled(false);
- }
-
- /**
- * Change the height hint for this composite.
- * Default is 100 pixels.
- */
- public void setHeightHint(int hint)
- {
- if (keysComposite != null)
- ((GridData)keysComposite.getLayoutData()).heightHint = hint;
- if (valueComposite != null)
- ((GridData)valueComposite.getLayoutData()).heightHint = hint;
-
- }
- /**
- * Change the width hint for the keys list
- * Default is 150 pixels.
- */
- public void setKeysWidthHint(int hint)
- {
- if (keysComposite != null)
- ((GridData)keysComposite.getLayoutData()).widthHint = hint;
- }
- /**
- * Change the width hint for the values fields on the right
- * Default is not set
- */
- public void setValuesWidthHint(int hint)
- {
- if (valueComposite != null)
- ((GridData)valueComposite.getLayoutData()).widthHint = hint;
- }
-
- /**
- * Set the tooltip text
- */
- public void setToolTipText(String tip)
- {
- if (boxFlavor)
- boxComposite.setToolTipText(tip);
- else
- {
- keysComposite.setToolTipText(tip);
- valueComposite.setToolTipText(tip);
- }
- }
- /**
- * Get the tooltip text
- */
- public String getToolTipText()
- {
- if (boxFlavor)
- return boxComposite.getToolTipText();
- else
- return keysComposite.getToolTipText();
- }
-
- /*
- * Override to return null!
- *
- public Label getLabelControl(Composite parent)
- {
- System.out.println("Inside getLabelControl");
- return super.getLabelControl(parent);
- }*/
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemLoggingPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemLoggingPreferencePage.java
deleted file mode 100644
index f94bb3cf2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemLoggingPreferencePage.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.rse.logging.ui.LoggingPreferencePage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-
-/**
- * The logging preference page for Remote Systems.
- */
-public class SystemLoggingPreferencePage extends LoggingPreferencePage {
-
- /**
- * @see org.eclipse.rse.logging.LoggingPreferencePage#getPlugin()
- */
- protected AbstractUIPlugin getPlugin() {
- return RSEUIPlugin.getDefault();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemPreferenceInitializer.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemPreferenceInitializer.java
deleted file mode 100644
index f1494aaa0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemPreferenceInitializer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class initializes the preferences for this plugin.
- */
-public class SystemPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * Constructor.
- */
- public SystemPreferenceInitializer() {
- super();
- }
-
- /**
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- RSEUIPlugin.getDefault().initializeDefaultPreferences();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemRemotePropertyPageNode.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemRemotePropertyPageNode.java
deleted file mode 100644
index 8858897d2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemRemotePropertyPageNode.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.jface.preference.PreferenceNode;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.SystemPropertyPageExtension;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-
-
-/**
- * Our version of PropertyPageNode that does not require a RegistryPageContributor input.
- */
-public class SystemRemotePropertyPageNode extends PreferenceNode
-{
-
- private SystemPropertyPageExtension contributor;
- private IWorkbenchPropertyPage page;
- private Image icon;
- private Object element;
- /**
- * Constructor.
- */
- public SystemRemotePropertyPageNode(SystemPropertyPageExtension contributor, Object element)
- {
- super(contributor.getId());
- this.contributor = contributor;
- this.element = element;
- }
- /**
- * Creates the preference page this node stands for. If the page is null,
- * it will be created by loading the class. If loading fails,
- * empty filler page will be created instead.
- */
- public void createPage()
- {
- page = contributor.createPage(element);
- setPage(page);
- }
- /** (non-Javadoc)
- * Method declared on IPreferenceNode.
- */
- public void disposeResources()
- {
- page = null;
- if (icon != null)
- {
- icon.dispose();
- icon = null;
- }
- }
- /**
- * Returns page icon, if defined.
- */
- public Image getLabelImage()
- {
- if (icon==null)
- {
- ImageDescriptor desc = contributor.getImage();
- if (desc != null)
- {
- icon = desc.createImage();
- }
- }
- return icon;
- }
- /**
- * Returns page label as defined in the registry.
- */
- public String getLabelText()
- {
- return contributor.getName();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemStringFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemStringFieldEditor.java
deleted file mode 100644
index 79bbcd72c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemStringFieldEditor.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.rse.ui.ISystemMassager;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * A preference page field editor that prompts for a string.
- * Unlike the eclipse-supplied StringFieldEditor, this one allows
- * use of RSE validators and massagers for error checking and
- * massaging of the user-entered input prior to persisting.
- */
-public class SystemStringFieldEditor extends FieldEditor
-{
-
- private Text textField;
- private String tip;
- private boolean isValid = true;
- private ModifyListener modifyListener = null;
- private boolean ignoreSelection = false;
- private ISystemValidator validator = null;
- private ISystemMassager massager = null;
- private Composite parentComposite;
- private String oldValue;
- private int numColumnsInParentComposite;
-
-
- /**
- * Default constructor for SystemStringFieldEditor.
- * Not permitted to be used.
- */
- private SystemStringFieldEditor()
- {
- super();
- }
-
- /**
- * Constructor for SystemStringFieldEditor
- * @param name - the unique ID for this editor. Used as index in preference store
- * @param rb - the resource bundle from which to retrieve the mri
- * @param rbKey - the key into the resource bundle, to get the label (_LABEL and tooltip text (_TOOLTIP
- * @param parent - the parent composite to host this editor
- */
- public SystemStringFieldEditor(String name, ResourceBundle rb, String rbKey, Composite parent)
- {
- super(name, rb.getString(rbKey+"label"), parent);
- this.oldValue = "";
- //createControl(parent);
- doOurFillIntoGrid();
- setToolTipText(rb.getString(rbKey+"tooltip"));
- }
-
- /**
- * Set the validator to use per keystroke. If not set, no validation is done
- */
- public void setValidator(ISystemValidator validator)
- {
- this.validator = validator;
- if (textField != null)
- textField.setTextLimit(validator.getMaximumNameLength());
- }
-
- /**
- * Set the massager that is used to affect the user-entered text before
- * saving it to the preference store.
- */
- public void setMassager(ISystemMassager massager)
- {
- this.massager = massager;
- }
-
- /**
- * Return number of columns we need. We return 2.
- * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls()
- {
- return 2;
- }
-
- /**
- * Save the user-entered value to the preference store.
- * @see org.eclipse.jface.preference.FieldEditor#doStore()
- */
- protected void doStore()
- {
- String text = textField.getText();
- if (massager != null)
- {
- text = massager.massage(text);
- ignoreSelection = true;
- textField.setText(text);
- ignoreSelection = false;
- }
- getPreferenceStore().setValue(getPreferenceName(), text);
- }
-
- /**
- * Load the entry field contents from the preference store default value
- * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault()
- {
- if (textField != null)
- {
- String value = getPreferenceStore().getDefaultString(getPreferenceName());
- initSelection(value);
- }
- }
-
- /**
- * Load the entry field contents from the preference store current value
- * @see org.eclipse.jface.preference.FieldEditor#doLoad()
- */
- protected void doLoad()
- {
- if (textField != null)
- {
- String value = getPreferenceStore().getString(getPreferenceName());
- initSelection(value);
- }
- }
-
- private void initSelection(String value)
- {
- if (value != null)
- {
- ignoreSelection = true;
- textField.setText(value);
- oldValue = value;
- ignoreSelection = false;
- }
- else
- oldValue = "";
- }
-
- /**
- * This is called by our parent's constructor, which is too soon for us!
- * So, we do nothing here and then call doOurFillIntoGrid later within our own
- * constructor.
- * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns)
- {
- parentComposite = parent;
- numColumnsInParentComposite = numColumns;
- }
-
- /**
- * Create controls
- */
- protected void doOurFillIntoGrid()
- {
- getLabelControl(parentComposite);
-
- textField = getTextControl(parentComposite);
- GridData gd = (GridData)textField.getLayoutData();
- gd.horizontalSpan = numColumnsInParentComposite - 1;
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- textField.setLayoutData(gd);
- }
-
- /**
- * Adjust grid data to support the number of columns, after all field editors
- * have been added to the page.
- *
- * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns)
- {
- GridData gd = (GridData)textField.getLayoutData();
- gd.horizontalSpan = numColumns - 1;
- // We only grab excess space if we have to
- // If another field editor has more columns then
- // we assume it is setting the width.
- gd.grabExcessHorizontalSpace = gd.horizontalSpan == 1;
- }
-
- /**
- * Returns this field editor's Text control.
- */
- protected Text getTextControl()
- {
- return textField;
- }
-
- /**
- * Returns this field editor's text control.
- * <p>
- * The control is created if it does not yet exist
- * </p>
- *
- * @param parent the parent
- * @return the text control
- */
- public Text getTextControl(Composite parent)
- {
- if (textField == null)
- {
- textField = SystemWidgetHelpers.createTextField(parent, null);
- if (tip != null)
- textField.setToolTipText(tip);
-
- textField.addModifyListener(getModifyListener());
- if (validator != null)
- textField.setTextLimit(validator.getMaximumNameLength());
-
- textField.addFocusListener(new FocusAdapter()
- {
- public void focusGained(FocusEvent e) {
- refreshValidState();
- }
- public void focusLost(FocusEvent e) {
- clearErrorMessage();
- }
- });
-
- textField.addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent event)
- {
- textField = null; // not sure why we have to do this
- }
- });
- } else {
- checkParent(textField, parent); // not sure what this is, came from some earlier eclipse example
- }
- return textField;
- }
-
- /**
- * Allows setting of tooltip text
- */
- public void setToolTipText(String tip)
- {
- if (textField != null)
- textField.setToolTipText(tip);
- this.tip = tip;
- }
-
- /**
- * Returns this field editor's selection listener.
- * The listener is created if nessessary.
- *
- * @return the selection listener
- */
- private ModifyListener getModifyListener()
- {
- if (modifyListener == null)
- createModifyListener();
- return modifyListener;
- }
-
- /**
- * Creates a modify text listener used in per-keystroke validation
- */
- protected void createModifyListener()
- {
- modifyListener = new ModifyListener()
- {
- public void modifyText(ModifyEvent event)
- {
- Widget widget = event.widget;
- if (widget == textField)
- valueChanged();
- }
- };
- }
-
- /**
- * Validate contents of text field
- */
- protected void validate()
- {
- if (!ignoreSelection)
- {
- setPresentsDefaultValue(false);
- if (validator != null)
- {
- String value = textField.getText();
- String errmsg = validator.isValid(value);
- if (errmsg != null)
- showErrorMessage(errmsg);
- else
- clearErrorMessage();
- isValid = (errmsg == null);
- }
- }
- ignoreSelection = false;
- }
-
- /**
- * Informs this field editor's listener, if it has one, about a change
- * to the value (<code>VALUE</code> property) provided that the old and
- * new values are different.
- * <p>
- * This hook is <em>not</em> called when the text is initialized
- * (or reset to the default value) from the preference store.
- * </p>
- */
- protected void valueChanged()
- {
- setPresentsDefaultValue(false);
- boolean oldState = isValid;
- refreshValidState();
-
- if (isValid != oldState)
- fireStateChanged(IS_VALID, oldState, isValid);
-
- String newValue = textField.getText();
- fireValueChanged(VALUE, oldValue, newValue);
- oldValue = newValue;
- }
-
- /**
- * Override of parent to return validity state.
- * If this readonly, we always return true, else we return result of last validation
- */
- public boolean isValid()
- {
- return isValid;
- }
-
- /**
- * Override of parent to refresh validity state by checking if the
- * input is valid. Does nothing unless this is not a readonly combo.
- */
- protected void refreshValidState()
- {
- validate();
- }
-
- /**
- * Set focus
- */
- public void setFocus()
- {
- if (textField!= null)
- textField.setFocus();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCore.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCore.java
deleted file mode 100644
index cd6d1aa3c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCore.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * The property page for core subsystem properties.
- * The plugin.xml file registers this for objects of class org.eclipse.rse.internal.subsystems.SubSystem
- */
-public class SystemSubSystemPropertyPageCore extends SystemBasePropertyPage
- implements ISystemMessageLine//, ISystemMessageLineTarget
-{
-
- private ISystemSubSystemPropertyPageCoreForm form = null;
-
- /**
- * Constructor
- */
- public SystemSubSystemPropertyPageCore()
- {
- super();
-
- }
- /**
- * Create the page's GUI contents.
- */
- protected Control createContentArea(Composite parent)
- {
- Object element = getElement();
- if (element instanceof ISubSystem)
- {
- ISubSystemConfiguration factory = ((ISubSystem)element).getSubSystemConfiguration();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factory.getAdapter(ISubSystemConfigurationAdapter.class);
- form = adapter.getSubSystemPropertyPageCoreFrom(factory, this, this);
- }
- else
- {
- form = new SystemSubSystemPropertyPageCoreForm(this, this);
- }
- Control c = form.createContents(parent, getElement(), getShell());
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "psubs0000");
- return c;
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- if (super.performOk())
- return form.performOk();
- else
- return false;
- }
- /**
- * Validate all the widgets on the page
- * <p>
- * Subclasses should override to do full error checking on all
- * the widgets on the page.
- */
- public boolean verifyPageContents()
- {
- return form.verifyFormContents();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java
deleted file mode 100644
index dd1317a91..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.widgets.InheritableEntryField;
-import org.eclipse.rse.ui.widgets.SystemPortPrompt;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-/**
- * The form for the property page for core subsystem properties.
- */
-public class SystemSubSystemPropertyPageCoreForm extends AbstractSystemSubSystemPropertyPageCoreForm
-{
-
- protected SystemPortPrompt portPrompt;
- protected Label labelUserId, labelUserIdPrompt;
- protected InheritableEntryField textUserId;
- protected boolean portEditable=true, portApplicable=true, userIdApplicable=true;
- // validators
- protected ISystemValidator portValidator;
- protected ISystemValidator userIdValidator;
-
- /**
- * Constructor
- */
- public SystemSubSystemPropertyPageCoreForm(ISystemMessageLine msgLine, Object caller)
- {
- super(msgLine, caller);
- }
-
- /**
- * Create the GUI contents.
- */
- public Control createInner(Composite composite_prompts, Object inputElement, Shell shell)
- {
- this.shell = shell;
- this.inputElement = inputElement;
-
-
- // Port prompt
- // Composite portComposite = SystemWidgetHelpers.createComposite(composite_prompts, 2, 1, false, null, 0, 0);
- // labelPortPrompt = SystemWidgetHelpers.createLabel(composite_prompts, rb.getString(RESID_SUBSYSTEM_PORT_LABEL)+": ");
- portPrompt = new SystemPortPrompt(composite_prompts, msgLine, true, isPortEditable(), getSubSystem().getConnectorService().getPort(), getPortValidator());
-
-
- // UserId Prompt
- String temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_USERID_LABEL);
- labelUserIdPrompt = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- userIdApplicable = isUserIdApplicable();
- if (userIdApplicable)
- {
- textUserId = SystemWidgetHelpers.createInheritableTextField(
- composite_prompts,SystemResources.RESID_SUBSYSTEM_USERID_INHERITBUTTON_TIP,SystemResources.RESID_SUBSYSTEM_USERID_TIP);
- textUserId.setFocus();
- }
- else
- labelUserId = SystemWidgetHelpers.createLabel(composite_prompts, getTranslatedNotApplicable());
-
- if (!initDone)
- doInitializeFields();
-
- if (textUserId != null)
- textUserId.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateUserIdInput();
- }
- }
- );
-
- return composite_prompts;
- }
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- if (portPrompt.isEditable())
- return portPrompt.getPortField();
- else if (userIdApplicable)
- return textUserId;
- else
- return null;
- }
-
- /**
- * Return true if the port is editable for this subsystem
- */
- protected boolean isPortEditable()
- {
- return getSubSystem().getSubSystemConfiguration().isPortEditable();
- }
- /**
- * Return true if the userId is applicable for this subsystem
- */
- protected boolean isUserIdApplicable()
- {
- return getSubSystem().getConnectorService().supportsUserId();
- }
-
- private ISystemValidator getPortValidator()
- {
- if (portValidator == null)
- {
- ISubSystemConfiguration ssFactory = getSubSystem().getSubSystemConfiguration();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
- portValidator = adapter.getPortValidator(ssFactory);
- }
- return portValidator;
- }
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISubSystem ss = getSubSystem();
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
-
- userIdValidator = adapter.getUserIdValidator(ssFactory);
- //getPortValidator();
- // vendor
- labelVendor.setText(ssFactory.getVendor());
- // name
- labelName.setText(ss.getName());
- // connection
- labelConnection.setText(ss.getHostAliasName());
- // profile
- labelProfile.setText(ss.getSystemProfileName());
- /*
- // port
- if (portEditable || portApplicable)
- {
- Integer port = ss.getPort();
- String localPort = null;
- if (port==null)
- port = new Integer(0);
- localPort = port.toString();
- int iPort = port.intValue();
- if (!portEditable)
- labelPort.setText(localPort);
- else
- {
- textPort.setLocalText(localPort);
- textPort.setInheritedText("0 "+SystemResources.RESID_PORT_DYNAMICSELECT));
- textPort.setLocal(iPort != 0);
- }
- }
- */
-
- // userId
- if (userIdApplicable)
- {
- String localUserId = ss.getLocalUserId();
- textUserId.setLocalText(localUserId);
- String parentUserId = ss.getHost().getDefaultUserId();
- textUserId.setInheritedText(parentUserId+" "+SystemPropertyResources.RESID_PROPERTY_INHERITED);
- textUserId.setLocal((localUserId!=null)&&(localUserId.length()>0));
- }
- }
-
- public void doInitializeInnerFields()
- {
- initDone = true;
- ISubSystem ss = getSubSystem();
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
-
- userIdValidator = adapter.getUserIdValidator(ssFactory);
-
- // userId
- if (userIdApplicable)
- {
- String localUserId = ss.getLocalUserId();
- textUserId.setLocalText(localUserId);
- String parentUserId = ss.getHost().getDefaultUserId();
- textUserId.setInheritedText(parentUserId+" "+SystemPropertyResources.RESID_PROPERTY_INHERITED);
- textUserId.setLocal((localUserId!=null)&&(localUserId.length()>0));
- }
- }
-
- /**
- * Validate user id value per keystroke
- */
- protected SystemMessage validateUserIdInput()
- {
- errorMessage= null;
- if (textUserId != null)
- {
- if (!textUserId.isLocal())
- return null;
- if (userIdValidator != null)
- errorMessage= userIdValidator.validate(textUserId.getText());
- else if (getUserId().equals(""))
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY);
- }
- setErrorMessage(errorMessage);
- //setPageComplete();
- return errorMessage;
- }
-
- /*
- * Validate port value per keystroke
- *
- protected SystemMessage validatePortInput()
- {
- errorMessage= null;
- if (textPort!=null)
- {
- if (!textPort.isLocal())
- return null;
- if (portValidator != null)
- errorMessage= portValidator.validate(textPort.getText());
- else if (getPort().equals(""))
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY);
- }
- setErrorMessage(errorMessage);
- //setPageComplete();
- return errorMessage;
- }*/
-
-
- /**
- * Return user-entered User Id.
- */
- protected String getUserId()
- {
- return textUserId.getText().trim();
- }
- /*
- * Return user-entered Port number.
- *
- protected String getPort()
- {
- return textPort.getText().trim();
- }*/
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- boolean pageComplete = false;
- if (errorMessage == null)
- pageComplete = (getUserId().length() > 0) && portPrompt.isComplete();
- return pageComplete;
- }
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- boolean complete = isPageComplete();
- if (callerInstanceOfWizardPage)
- {
- ((WizardPage)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- ((SystemPromptDialog)caller).setPageComplete(complete);
- }
- else if (callerInstanceOfPropertyPage)
- {
- ((PropertyPage)caller).setValid(complete);
- }
- }
-
- /**
- * Validate all the widgets on the form
- */
- public boolean verifyFormContents()
- {
- boolean ok = true;
- SystemMessage errMsg = null;
- Control controlInError = null;
- clearErrorMessage();
- errMsg = portPrompt.validatePortInput();
- if (errMsg != null)
- controlInError = portPrompt.getPortField(); //textPort.getTextField();
- else
- {
- errMsg = validateUserIdInput();
- if (errMsg != null)
- controlInError = textUserId.getTextField();
- }
- if (errMsg != null)
- {
- ok = false;
- controlInError.setFocus();
- setErrorMessage(errMsg);
- }
- return ok;
- }
-
-
- /**
- * Called by caller when user presses OK
- */
- public boolean performOk()
- {
- boolean ok = verifyFormContents();
- if (ok)
- {
- ISubSystem ss = getSubSystem();
- // PROCESS PORT...
- if (portPrompt.isEditable())
- updatePort(ss);
-
- // PROCESS USER ID...
- if (textUserId != null)
- {
- String userId = getUserId();
- updateUserId(ss);
- }
- ss.commit();
- }
- return ok;
- }
-
- /**
- * Change the subsystem user Id value
- */
- private void updateUserId(ISubSystem subsys)
- {
- //int whereToUpdate = USERID_LOCATION_SUBSYSTEM;
- String userId = textUserId.getLocalText(); // will be "" if !textuserid.getIsLocal(), which results in wiping out local override
- ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
- // unlike with connection objects, we don't ever allow the user to change the parent's
- // userId value, even if it is empty, when working with subsystems. There is too much
- // ambiquity as the parent could be the connnection or the user preferences setting for this
- // system type. Because of this decision, we don't need to tell updateSubSystem(...) where
- // to update, as it always the local subsystem.
- ssFactory.updateSubSystem(subsys, true, userId, false, subsys.getConnectorService().getPort());
- }
- /**
- * Change the subsystem port value
- */
- private void updatePort(ISubSystem subsys)
- {
- /*
- String port = textPort.getLocalText(); // will be "" if !textPort.getIsLocal(), which results in wiping out local override
- Integer portInteger = null;
- if (textPort.isLocal() && (port.length()>0))
- portInteger = new Integer(port);
- else
- portInteger = new Integer(0);
- */
- int portInteger = portPrompt.getPort();
- ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
- ssFactory.updateSubSystem(subsys, false, subsys.getLocalUserId(), true, portInteger);
- }
-
- /**
- * Return "Not applicable" translated
- */
- private String getTranslatedNotApplicable()
- {
- if (xlatedNotApplicable == null)
- xlatedNotApplicable = SystemPropertyResources.RESID_TERM_NOTAPPLICABLE;
- return xlatedNotApplicable;
- }
-
- private void setErrorMessage(SystemMessage msg)
- {
- if (msgLine != null)
- if (msg != null)
- msgLine.setErrorMessage(msg);
- else
- msgLine.clearErrorMessage();
- }
- private void clearErrorMessage()
- {
- if (msgLine != null)
- msgLine.clearErrorMessage();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewCategoryPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewCategoryPropertyPage.java
deleted file mode 100644
index dc7298036..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewCategoryPropertyPage.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.rse.ui.view.team.SystemTeamViewCategoryNode;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for category nodes in the Team view.
- * This is an output-only page.
- */
-public class SystemTeamViewCategoryPropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelDescription;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor for SystemFilterPropertyPage
- */
- public SystemTeamViewCategoryPropertyPage()
- {
- super();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // Type prompt
- String typeLabel = SystemPropertyResources.RESID_PROPERTY_TYPE_LABEL;
- String typeTooltip = SystemPropertyResources.RESID_PROPERTY_TYPE_TOOLTIP;
-
- labelType = createLabeledLabel(composite_prompts, typeLabel, typeTooltip);
- labelType.setText(SystemViewResources.RESID_PROPERTY_TEAM_CATEGORY_TYPE_VALUE);
-
- // Name prompt
- String nameLabel = SystemPropertyResources.RESID_PROPERTY_NAME_LABEL;
- String nameTooltip = SystemPropertyResources.RESID_PROPERTY_NAME_TOOLTIP;
-
- labelName = createLabeledLabel(composite_prompts, nameLabel, nameTooltip);
-
- // Description prompt
- addFillerLine(composite_prompts, nbrColumns);
- addSeparatorLine(composite_prompts, nbrColumns);
- //key = ISystemConstants.RESID_PROPERTY_DESCRIPTION_ROOT;
- //Label l = SystemWidgetHelpers.createLabel(composite_prompts, rb, key, nbrColumns, false);
- //l.setText(l.getText() + ":");
- labelDescription = SystemWidgetHelpers.createVerbiage(composite_prompts, "", nbrColumns, false, 200);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input team view category node
- */
- protected SystemTeamViewCategoryNode getCategoryNode()
- {
- Object element = getElement();
- return ((SystemTeamViewCategoryNode)element);
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- SystemTeamViewCategoryNode node = getCategoryNode();
- // populate GUI...
- labelName.setText(node.getLabel());
- labelDescription.setText(node.getDescription());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewProfilePropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewProfilePropertyPage.java
deleted file mode 100644
index 48f0ca8fd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewProfilePropertyPage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for profile nodes in the Team view.
- * This is an output-only page.
- */
-public class SystemTeamViewProfilePropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelStatus;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor for SystemFilterPropertyPage
- */
- public SystemTeamViewProfilePropertyPage()
- {
- super();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2);
-
- // Type prompt
- labelType = createLabeledLabel(composite_prompts, SystemPropertyResources.RESID_PROPERTY_TYPE_LABEL, SystemPropertyResources.RESID_PROPERTY_TYPE_TOOLTIP);
- labelType.setText(SystemViewResources.RESID_PROPERTY_PROFILE_TYPE_VALUE);
-
- // Name prompt
- labelName = createLabeledLabel(composite_prompts, SystemPropertyResources.RESID_PROPERTY_NAME_LABEL, SystemPropertyResources.RESID_PROPERTY_NAME_TOOLTIP);
-
- // Status prompt
- labelStatus = createLabeledLabel(composite_prompts, SystemViewResources.RESID_PROPERTY_PROFILESTATUS_LABEL, SystemViewResources.RESID_PROPERTY_PROFILESTATUS_TOOLTIP);
-
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input team view category node
- */
- protected ISystemProfile getProfile()
- {
- Object element = getElement();
- return ((ISystemProfile)element);
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISystemProfile profile = getProfile();
- // populate GUI...
- labelName.setText(profile.getName());
- boolean active = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName());
- if (active)
- labelStatus.setText(SystemViewResources.RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL);
- else
- labelStatus.setText(SystemViewResources.RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL);
-
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- boolean ok = true;
- return ok;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewSubSystemConfigurationPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewSubSystemConfigurationPropertyPage.java
deleted file mode 100644
index 68dd2eec4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTeamViewSubSystemConfigurationPropertyPage.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.propertypages;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.rse.ui.view.team.SystemTeamViewSubSystemConfigurationNode;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * The property page for subsystem factory nodes in the Team view.
- * This is an output-only page.
- */
-public class SystemTeamViewSubSystemConfigurationPropertyPage extends SystemBasePropertyPage
-{
-
- protected Label labelType, labelName, labelId, labelVendor, labelTypes;
- protected String errorMessage;
- protected boolean initDone = false;
-
- /**
- * Constructor for SystemFilterPropertyPage
- */
- public SystemTeamViewSubSystemConfigurationPropertyPage()
- {
- super();
- }
- /**
- * Create the page's GUI contents.
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContentArea(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // Type prompt
- labelType = createLabeledLabel(composite_prompts, SystemPropertyResources.RESID_PROPERTY_TYPE_LABEL, SystemPropertyResources.RESID_PROPERTY_TYPE_TOOLTIP);
- labelType.setText(SystemViewResources.RESID_PROPERTY_TEAM_SSFACTORY_TYPE_VALUE);
-
- // Name prompt
- labelName = createLabeledLabel(composite_prompts, SystemPropertyResources.RESID_PROPERTY_NAME_LABEL, SystemPropertyResources.RESID_PROPERTY_NAME_TOOLTIP);
-
- // Id prompt
- labelId = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_SUBSYSFACTORY_ID_LABEL, SystemResources.RESID_PP_SUBSYSFACTORY_ID_TOOLTIP);
-
- // Vendor prompt
- labelVendor = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_SUBSYSFACTORY_VENDOR_LABEL, SystemResources.RESID_PP_SUBSYSFACTORY_VENDOR_TOOLTIP);
-
- // System Types prompt
- labelTypes = createLabeledLabel(composite_prompts, SystemResources.RESID_PP_SUBSYSFACTORY_TYPES_LABEL, SystemResources.RESID_PP_SUBSYSFACTORY_TYPES_TOOLTIP);
-
- // description
- addFillerLine(composite_prompts, nbrColumns);
- addSeparatorLine(composite_prompts, nbrColumns);
- SystemWidgetHelpers.createVerbiage(composite_prompts, SystemResources.RESID_PP_SUBSYSFACTORY_VERBAGE, nbrColumns, false, 200);
-
- if (!initDone)
- doInitializeFields();
-
- return composite_prompts;
- }
-
- /**
- * From parent: do full page validation
- */
- protected boolean verifyPageContents()
- {
- return true;
- }
-
- /**
- * Get the input team view subsystem factory node
- */
- protected ISubSystemConfiguration getSubSystemConfiguration()
- {
- Object element = getElement();
- SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode)element;
- return ssfNode.getSubSystemConfiguration();
- }
-
- /**
- * Initialize values of input fields based on input
- */
- protected void doInitializeFields()
- {
- initDone = true;
- ISubSystemConfiguration ssf = getSubSystemConfiguration();
- ISubSystemConfigurationProxy proxy = ssf.getSubSystemConfigurationProxy();
- // populate GUI...
- labelName.setText(ssf.getName());
- labelId.setText(proxy.getId());
- labelVendor.setText(proxy.getVendor());
- String systypes = "";
- String[] types = ssf.getSystemTypes();
- if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes())
- {
- systypes = SystemResources.TERM_ALL;
- }
- else
- {
- for (int idx=0; idx<types.length; idx++)
- {
- if (idx==0)
- systypes += types[idx];
- else
- systypes += ", " + types[idx];
- }
- }
- labelTypes.setText(systypes);
- }
-
- /**
- * Called by parent when user presses OK
- */
- public boolean performOk()
- {
- boolean ok = true;
- return ok;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java
deleted file mode 100644
index 8b36ed8ba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-
-package org.eclipse.rse.ui.propertypages;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSESystemTypeAdapter;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-
-/**
- * This is a field type editor for the Remote Systems preference page,
- * used for setting system type preferences.
- */
-public class SystemTypeFieldEditor extends FieldEditor
- implements ICellModifier, ITableLabelProvider, IStructuredContentProvider
-{
- private Table table;
- private GridData tableData;
- private TableViewer tableViewer;
- private CellEditor enabledCellEditor, userIdCellEditor;
- private static final char KEYVALUE_DELIMITER='=';
- private static final char KEYVALUEPAIR_DELIMITER=';';
- public static final char EACHVALUE_DELIMITER='+';
- private Hashtable keyValues;
- private IRSESystemType[] systemTypes;
-
- private boolean enabledStateChanged = false;
-
- private static final int COLUMN_NAME = 0;
- private static final int COLUMN_ENABLED = 1;
- private static final int COLUMN_USERID = 2;
- private static final String P_NAME = "name";
- private static final String P_ENABLED = "enabled";
- private static final String P_DESC = "desc";
- private static final String P_USERID = "userid";
- private static final String columnHeaders[] =
- {
- SystemResources.RESID_PREF_SYSTYPE_COLHDG_NAME,
- SystemResources.RESID_PREF_SYSTYPE_COLHDG_ENABLED,
- SystemResources.RESID_PREF_SYSTYPE_COLHDG_USERID,
- SystemResources.RESID_PREF_SYSTYPE_COLHDG_DESC
- };
- private static ColumnLayoutData columnLayouts[] =
- {
- new ColumnWeightData(20,80,true),
- new ColumnWeightData(20,15,true),
- new ColumnWeightData(20,100,true),
- new ColumnWeightData(55,280,true)
- };
- // give each column a property value to identify it
- private static final String[] tableColumnProperties =
- {
- P_NAME, P_ENABLED, P_USERID, P_DESC
- };
-
- private static final boolean[] enabledStates = {Boolean.TRUE.booleanValue(), Boolean.FALSE.booleanValue()};
- private static final String[] enabledStateStrings = {Boolean.TRUE.toString(), Boolean.FALSE.toString()};
-
- /**
- * Constructor
- * @param name
- * @param labelText
- * @param parent
- */
- public SystemTypeFieldEditor(String name, String labelText, Composite parent)
- {
- super(name, labelText, parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns)
- {
- ((GridData)table.getLayoutData()).horizontalSpan = numColumns;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns)
- {
- table = createTable(parent);
- ((GridData)table.getLayoutData()).horizontalSpan = numColumns;
- tableViewer = new TableViewer(table);
- createColumns();
- tableViewer.setColumnProperties(tableColumnProperties);
- tableViewer.setCellModifier(this);
- CellEditor editors[] = new CellEditor[columnHeaders.length];
- userIdCellEditor = new TextCellEditor(table);
- enabledCellEditor = new ComboBoxCellEditor(table, enabledStateStrings, SWT.READ_ONLY); // DWD should consider a checkbox for this.
- editors[COLUMN_USERID] = userIdCellEditor;
- editors[COLUMN_ENABLED] = enabledCellEditor;
- tableViewer.setCellEditors(editors);
-
- tableViewer.setLabelProvider(this);
- tableViewer.setContentProvider(this);
- tableViewer.setInput(new Object());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doLoad()
- */
- protected void doLoad()
- {
- if (systemTypes == null)
- systemTypes = getSystemTypes(false);
-
- String value = getPreferenceStore().getString(ISystemPreferencesConstants.SYSTEMTYPE_VALUES);
- keyValues = null;
-
- if ((value == null) || (value.length() == 0))
- {
- keyValues = new Hashtable();
- }
- else
- {
- keyValues = parseString(value);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault()
- {
- // when Defaults button pressed, we re-read the system types from disk
- systemTypes = getSystemTypes(true);
- keyValues.clear();
- tableViewer.refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doStore()
- */
- protected void doStore()
- {
- if (systemTypes != null)
- {
- String s = createString(keyValues);
-
- if (s != null)
- getPreferenceStore().setValue(getPreferenceName(), s);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls()
- {
- return 1;
- }
-
- /*
- * @see FieldEditor.setEnabled(boolean,Composite).
- */
- public void setEnabled(boolean enabled, Composite parent)
- {
- if (table != null)
- table.setEnabled(enabled);
- }
-
- /*
- * @see FieldEditor.isValid().
- */
- public boolean isValid()
- {
- return true;
- }
-
-
- // ----------------
- // local methods...
- // ----------------
-
- private Table createTable(Composite parent)
- {
- table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
- table.setLinesVisible(true);
- tableData = new GridData();
- tableData.horizontalAlignment = GridData.FILL;
- tableData.grabExcessHorizontalSpace = true;
- tableData.widthHint = 410;
- tableData.heightHint= 30;
- tableData.verticalAlignment = GridData.FILL;
- tableData.grabExcessVerticalSpace = true;
- table.setLayoutData(tableData);
-
- SystemWidgetHelpers.setHelp(table, RSEUIPlugin.HELPPREFIX+"systype_preferences");
- return table;
- }
-
- private void createColumns()
- {
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
- table.setHeaderVisible(true);
- for (int i = 0; i < columnHeaders.length; i++)
- {
- layout.addColumnData(columnLayouts[i]);
- TableColumn tc = new TableColumn(table, SWT.NONE,i);
- tc.setResizable(columnLayouts[i].resizable);
- tc.setText(columnHeaders[i]);
- }
- }
-
- /**
- * Parse out list of key-value pairs into a hashtable
- */
- private static Hashtable parseString(String allvalues)
- {
- StringTokenizer tokens = new StringTokenizer(allvalues, makeString(KEYVALUE_DELIMITER, KEYVALUEPAIR_DELIMITER));
- Hashtable keyValues = new Hashtable(10);
- int count = 0;
- String token1=null;
- String token2=null;
- while (tokens.hasMoreTokens())
- {
- count++;
- if ((count % 2) == 0) // even number
- {
- token2 = tokens.nextToken();
- keyValues.put(token1, token2);
- }
- else
- token1 = tokens.nextToken();
- }
- return keyValues;
- }
-
- private static String makeString(char charOne, char charTwo)
- {
- StringBuffer s = new StringBuffer(2);
- s.append(charOne);
- s.append(charTwo);
- return s.toString();
- }
-
- /**
- * Convert hashtable of key-value pairs into a single string
- */
- public static String createString(Hashtable keyValues)
- {
- if (keyValues == null)
- return null;
- Enumeration keys = keyValues.keys();
- StringBuffer sb = new StringBuffer();
- while (keys.hasMoreElements())
- {
- String key = (String)keys.nextElement();
- String value = (String)keyValues.get(key);
- if ((value != null) && (value.length()>0))
- {
- sb.append(key);
- sb.append(KEYVALUE_DELIMITER);
- sb.append(value);
- sb.append(KEYVALUEPAIR_DELIMITER);
- }
- }
-
- return sb.toString();
- }
-
- private IRSESystemType[] getSystemTypes(boolean defaults)
- {
- IRSESystemType[] types = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
-
- ArrayList list = new ArrayList();
-
- if (systemTypes == null) {
-
- for (int i = 0; i < types.length; i++) {
-
- ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(types[i].getName());
-
- if (configurations != null && configurations.length > 0) {
- list.add(types[i]);
- }
- }
- }
-
- types = new IRSESystemType[list.size()];
-
- for (int i = 0; i < list.size(); i++) {
- types[i] = (IRSESystemType)(list.get(i));
- }
-
- return types;
- }
-
- // ------------------------
- // ICellModifier methods...
- // ------------------------
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property)
- {
- if (property.equals(P_ENABLED))
- {
- return true;
- }
- else if (property.equals(P_USERID))
- {
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property)
- {
- IRSESystemType row = (IRSESystemType)element;
- RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(IRSESystemType.class));
- Object value = "";
-
- if (property.equals(P_NAME))
- value = row.getName();
- else if (property.equals(P_ENABLED))
- value = (adapter.isEnabled(row) ? new Integer(0) : new Integer(1));
- else if (property.equals(P_USERID))
- value = (adapter.getDefaultUserId(row) == null) ? "" : adapter.getDefaultUserId(row);
- else
- value = (row.getDescription() == null) ? "" : row.getDescription();
-
- return value;
- }
-
- public boolean enabledStateChanged()
- {
- return enabledStateChanged;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value)
- {
- IRSESystemType row = (IRSESystemType)(((TableItem)element).getData());
- RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(IRSESystemType.class));
-
- if (property.equals(P_ENABLED))
- {
- Integer val = (Integer)value;
- adapter.setIsEnabled(row, enabledStates[val.intValue()]);
- enabledStateChanged = true;
- }
- else if (property.equals(P_USERID))
- {
- adapter.setDefaultUserId(row, (String)value);
- }
- else
- return;
-
- keyValues.put(row.getName(), "");
- tableViewer.update(row, null);
- }
-
- // ------------------------------
- // ITableLabelProvider methods...
- // ------------------------------
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex)
- {
- IRSESystemType currType = (IRSESystemType)element;
- RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(currType.getAdapter(IRSESystemType.class));
-
- if (columnIndex == COLUMN_NAME)
- return currType.getName();
- else if (columnIndex == COLUMN_ENABLED)
- return Boolean.toString(adapter.isEnabled(currType));
- else if (columnIndex == COLUMN_USERID)
- return (adapter.getDefaultUserId(currType)==null ? "" : adapter.getDefaultUserId(currType));
- else
- return (currType.getDescription()==null ? "" : currType.getDescription());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- // -------------------------------------
- // IStructuredContentProvider methods...
- // -------------------------------------
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- if (systemTypes == null)
- systemTypes = getSystemTypes(false);
- return systemTypes;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- // ----------------
- // Other methods...
- // ----------------
- /**
- * Set the tooltip text
- */
- public void setToolTipText(String tip)
- {
- table.setToolTipText(tip);
- }
-
- public static Hashtable initSystemTypePreferences(IPreferenceStore store, IRSESystemType[] systemTypes)
- {
- String value = store.getString(ISystemPreferencesConstants.SYSTEMTYPE_VALUES);
- Hashtable keyValues = null;
- if ((value == null) || (value.length()==0)) // not initialized yet?
- {
- return null;
- // nothing to do, as we have read from systemTypes extension points already
- }
- else
- {
- keyValues = parseString(value);
- // we have now a hashtable, where the keys are the system type names,
- // and the values are the column-value attributes for that type, separated
- // by a '+' character: enabled+userid. eg: "true+bob"
- Enumeration keys = keyValues.keys();
- while (keys.hasMoreElements())
- {
- String key = (String)keys.nextElement();
- String attributes = (String)keyValues.get(key);
- String attr1="true", attr2="";
- if ((attributes != null) && (attributes.length()>0))
- {
- StringTokenizer tokens = new StringTokenizer(attributes, Character.toString(EACHVALUE_DELIMITER));
- if (tokens.hasMoreTokens())
- {
- attr1 = tokens.nextToken();
- if (tokens.hasMoreTokens())
- {
- attr2 = tokens.nextToken();
- }
- else
- {
- attr2 = "null";
- }
- }
- }
- // find this system type in the array...
- IRSESystemType matchingType = RSECorePlugin.getDefault().getRegistry().getSystemType(key);
- RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(matchingType.getAdapter(IRSESystemType.class));
-
- // update this system type's attributes as per preferences...
- if (matchingType!=null)
- {
- adapter.setIsEnabled(matchingType, attr1.equals("true"));
- if (!attr2.equals("null"))
- adapter.setDefaultUserId(matchingType, attr2);
- }
- }
- }
- return keyValues;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidator.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidator.java
deleted file mode 100644
index e9d865f57..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-
-/**
- * Our validators need to support querying max length, for generic rename dialogs.
- * They also need to support getting the message not only as a string, which isValid returns,
- * but also as a SystemMessage, which getSystemMessage() does if isValid returns non-null.
- */
-public interface ISystemValidator extends IInputValidator, ICellEditorValidator
-{
-
-
- /**
- * Return the max length for this name, or -1 if no max
- */
- public int getMaximumNameLength();
- /**
- * If isValid returns non-null and you desire a full bodied SystemMessage versus a string,
- * call this method after isValid to get the full bodied SystemMessage.
- * <p>
- * Will be null if isValid returned null.
- */
- public SystemMessage getSystemMessage();
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidatorUniqueString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidatorUniqueString.java
deleted file mode 100644
index d6cbc438a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ISystemValidatorUniqueString.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-
-import java.util.Vector;
-
-/**
- * This interface is implemented by any validator that
- * does uniqueness checking. Allows common code that will set the
- * list of string to check against.
- */
-public interface ISystemValidatorUniqueString
-{
-
- /**
- * Reset whether this is a case-sensitive list or not
- */
- public void setCaseSensitive(boolean caseSensitive);
- /**
- * Reset the existing names list.
- */
- public void setExistingNamesList(String[] existingList);
- /**
- * Reset the existing names list.
- */
- public void setExistingNamesList(Vector existingList);
- /**
- * Return the existing names list. This will be a case-normalized and sorted list.
- */
- public String[] getExistingNamesList();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/IValidatorRemoteSelection.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/IValidatorRemoteSelection.java
deleted file mode 100644
index a0bd91b47..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/IValidatorRemoteSelection.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-
-
-/**
- * On remote selection dialogs, you can pass an implementation of this interface to validate that
- * it is ok to enable the OK button when the user selects a remote object. If you return
- * a SystemMessage, ok will be disabled and the message will be shown on the message line.
- * Return a SystemMessage with blank in the first level text to disable OK without showing
- * an error message.
- * <p>
- * Alternatively you can just subclass {@link org.eclipse.rse.ui.validators.ValidatorRemoteSelection}
- */
-public interface IValidatorRemoteSelection
-{
-
- /**
- * The user has selected one or more remote objects. Return null if OK is to be enabled, or a SystemMessage
- * if it is not to be enabled. The message will be displayed on the message line.
- */
- public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObject);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/SystemNumericVerifyListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/SystemNumericVerifyListener.java
deleted file mode 100644
index 8c2006867..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/SystemNumericVerifyListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-
-/**
- * A class that only allows keys representing numeric values to be entered. It can be turned off if necessary.
- */
-public class SystemNumericVerifyListener implements VerifyListener {
-
- private boolean isOff;
-
- /**
- * Constructor. The verifier is on by default.
- */
- public SystemNumericVerifyListener() {
- isOff = false;
- }
-
- /**
- * Verifies the event text if it is not turned off.
- * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
- */
- public void verifyText(VerifyEvent e) {
-
- if (!isOff) {
- String text = e.text;
- boolean doit = true;
-
- for (int i = 0; i < text.length(); i++) {
- char c = text.charAt(i);
-
- if (!Character.isDigit(c)) {
- doit = false;
- break;
- }
- }
-
- e.doit = doit;
- }
- }
-
- /**
- * Turns the verifier on or off.
- * @param isOff <code>true</code> to turn the verifier off, <code>false</code> to turn it on.
- */
- public void setOff(boolean isOff) {
- this.isOff = isOff;
- }
-
- /**
- * Returns whether the verifier is on or off.
- * @return <code>true</code> if the verifier is off, <code>false</code> if it is on.
- */
- public boolean isOff() {
- return isOff;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorArchiveName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorArchiveName.java
deleted file mode 100644
index a4ec37b0d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorArchiveName.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * @author mjberger
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class ValidatorArchiveName extends ValidatorFileName {
-
- protected SystemMessage msg_NotRegisteredArchive;
-
- public ValidatorArchiveName(Vector existingNameList) {
- super(existingNameList);
- }
-
- public ValidatorArchiveName(String[] existingNameList) {
- super(existingNameList);
- }
-
- public ValidatorArchiveName() {
- super();
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- * Also checks to see if its a valid archive name.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- msg_NotRegisteredArchive = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ARCHIVE_NAME);
- msg_NotRegisteredArchive.makeSubstitution(newText);
- IStatus rc = workspace.validateName(newText, IResource.FILE);
- if (rc.getCode() != IStatus.OK)
- return msg_Invalid;
- else if ((getMaximumNameLength() > 0) && // defect 42507
- (newText.length() > getMaximumNameLength()))
- return msg_Invalid; // TODO: PHIL. MRI. better message.
- else if (!ArchiveHandlerManager.getInstance().isRegisteredArchive(newText))
- return msg_NotRegisteredArchive;
- return checkForBadCharacters(newText) ? null: msg_Invalid;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java
deleted file mode 100644
index 9c5cb2dd2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined compile command's label
- */
-public class ValidatorCompileCommandLabel extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_CMDLABEL_LENGTH = 50; // max name for a compile command name
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when you have a vector of existing labels.
- */
- public ValidatorCompileCommandLabel(Vector existingLabelList)
- {
- super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
- init();
- }
- /**
- * Use this constructor when you have an array of existing labels.
- */
- public ValidatorCompileCommandLabel(String existingLabelList[])
- {
- super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking. Or if you will call setExistingNamesList later.
- */
- public ValidatorCompileCommandLabel()
- {
- super(new String[0], CASE_INSENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character.
- (newText.indexOf('@') == -1)); // defect 43950
- }
-
- public String toString()
- {
- return getClass().getName();
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for compile commands: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_CMDLABEL_LENGTH;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java
deleted file mode 100644
index fc916cdb4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This class is used in dialogs that prompt for a connection alias name.
- * Relies on Eclipse supplied method to test for folder name validity.
- * <p>
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorConnectionName extends ValidatorFolderName implements ISystemValidator
-{
- public static final int MAX_CONNECTIONNAME_LENGTH = 100; // arbitrary restriction due to defects
-
- /**
- * Constructor.
- * @param existingNameList Vector of existing names (strings) in owning profile. Can be null if not a rename operation.
- */
- public ValidatorConnectionName(Vector existingNameList)
- {
- super(existingNameList);
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTVALID));
- }
-
- /**
- * Validate the given connection name is not already used in any profile. This is too expensive
- * to do per keystroke, so you should call this after as a final test. Note, this is a warning
- * situation, not an error, as we assume we have already tested for the containing profile, and
- * thus is a test for a match on a connection in a non-containing profile. This results in msg
- * rseg1241 being presented to the user, and if he chooses No to not continue, we return false
- * here. You should stop processing on false. Else, we return true meaning everything is ok.
- */
- public static boolean validateNameNotInUse(String proposedName, Shell shell)
- {
- SystemMessage msg = null;
- Vector profileNames = RSEUIPlugin.getTheSystemProfileManager().getSystemProfileNamesVector();
- String profileName = null;
- for (int idx=0; (msg==null)&& (idx<profileNames.size()); idx++)
- {
- profileName = (String)profileNames.elementAt(idx);
- IHost[] conns = RSEUIPlugin.getTheSystemProfileManager().getSystemProfile(profileName).getHosts();
- for (int jdx=0; (msg==null) && (jdx<conns.length); jdx++)
- {
- if (conns[jdx].getAliasName().equalsIgnoreCase(proposedName))
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE);
- }
- }
- if (msg != null)
- {
- msg.makeSubstitution(proposedName, profileName);
- SystemMessageDialog dlg = new SystemMessageDialog(shell, msg);
- boolean yesToContinue = dlg.openQuestionNoException();
- if (yesToContinue)
- msg = null;
- }
- return (msg==null);
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for connections: 100
- */
- public int getMaximumNameLength()
- {
- return MAX_CONNECTIONNAME_LENGTH;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFileName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFileName.java
deleted file mode 100644
index 6675a8283..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFileName.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a name that eventually needs to become a file on disk.
- * Relies on Eclipse supplied method to test for folder name validity.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorFileName
- extends ValidatorUniqueString implements ISystemValidator
-{
- public static final int MAX_FILENAME_LENGTH = 256;
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a vector containing a list of existing names to compare against.
- */
- public ValidatorFileName(Vector existingNameList)
- {
- super(existingNameList, false); // case insensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID);
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorFileName(String existingNameList[])
- {
- super(existingNameList, false); // case insensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID);
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorFileName()
- {
- super(new String[0], false);
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable extension point to check for invalidate characters beyond what Eclipse checks for
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return true;
- }
-
-
- public String toString()
- {
- return "FileNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- IStatus rc = workspace.validateName(newText, IResource.FILE);
- if (rc.getCode() != IStatus.OK)
- return msg_Invalid;
- else if ((getMaximumNameLength() > 0) && // defect 42507
- (newText.length() > getMaximumNameLength()))
- return msg_Invalid; // TODO: PHIL. MRI. better message.
- return checkForBadCharacters(newText) ? null: msg_Invalid;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for file names: 256
- */
- public int getMaximumNameLength()
- {
- return MAX_FILENAME_LENGTH;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java
deleted file mode 100644
index fa009c4ae..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for filter name. Filter names
- * have to be unique, and to enable saving per file, must be a valid file name.
- * <p>
- * The IInputValidator interface is implemented by our parent and it
- * is used by jface's InputDialog class and property sheet window.
- */
-public class ValidatorFilterName
- extends ValidatorFileName implements ISystemValidator
-{
- public static final int MAX_FILTERNAME_LENGTH = 100;
-
- //public static final boolean CASE_SENSITIVE = true;
- //public static final boolean CASE_INSENSITIVE = false;
-
- /**
- * Constructor accepting a Vector.
- * @param A vector containing list of existing filter names to compare against.
- * Note that toString() is used to get the string from each item.
- * @param true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterName(Vector existingList)
- {
- super(existingList);
- init();
- }
- /**
- * Constructor accepting an Array.
- * @param An array containing list of existing strings to compare against.
- * @param true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterName(String[] existingList)
- {
- super(existingList);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTUNIQUE),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTVALID));
- }
-
- public String toString()
- {
- return "FilterNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
-
- /**
- * Overridable extension point to check for invalidate characters beyond what Eclipse checks for
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- if (newText.indexOf('#') >= 0)
- return false;
- else
- return true;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for filters: 100
- */
- public int getMaximumNameLength()
- {
- return MAX_FILTERNAME_LENGTH;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java
deleted file mode 100644
index 10b8ec3e9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for filter name. Filter names
- * have to be unique, and to enable saving per folder, must be a valid folder name.
- * <p>
- * The IInputValidator interface is implemented by our parent and it
- * is used by jface's InputDialog class and property sheet window.
- */
-public class ValidatorFilterPoolName
- extends ValidatorFolderName implements ISystemValidator
-{
- public static final int MAX_FILTERPOOLNAME_LENGTH = 50;
-
- /**
- * Constructor accepting a Vector.
- * @param A vector containing list of existing filter names to compare against.
- * Note that toString() is used to get the string from each item.
- * @param true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterPoolName(Vector existingList)
- {
- super(existingList);
- init();
- }
- /**
- * Constructor accepting an Array.
- * @param An array containing list of existing strings to compare against.
- * @param true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterPoolName(String[] existingList)
- {
- super(existingList);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTVALID));
- }
-
-
- public String toString()
- {
- return "FilterNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
-
- /**
- * Overridable extension point to check for invalidate characters beyond what Eclipse checks for
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- if (newText.indexOf('#') >= 0)
- return false;
- else
- return true;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for filter pools: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_FILTERPOOLNAME_LENGTH;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterString.java
deleted file mode 100644
index 2aa4070cb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterString.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-/**
- * This class is used in dialogs that prompt for filter strings.
- * This class typically needs to be overridden for a particular subsystem factory provider.
- * By default, it simply checks for uniqueness.
- */
-public class ValidatorFilterString
- extends ValidatorUniqueString implements ISystemValidator
-{
- public static final int MAX_FILTERSTRINGNAME_LENGTH = 1000;
-
- //public static final boolean CASE_SENSITIVE = true;
- //public static final boolean CASE_INSENSITIVE = false;
- protected SystemMessage msg_Invalid;
-
- /**
- * Constructor accepting a Vector for the list of existing strings, as simple strings.
- * @param existingList A vector of strings to compare against.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterString(Vector existingList, boolean caseSensitive)
- {
- super(existingList, caseSensitive); // case sensitive uniqueness
- init();
- }
- /**
- * Constructor accepting an Array for the list of existing strings, as simple strings.
- * @param existingList An array containing list of existing strings to compare against.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterString(String[] existingList, boolean caseSensitive)
- {
- super(existingList, caseSensitive); // case sensitive uniqueness
- init();
- }
- /**
- * Constructor accepting an Array for the list of existing strings, as actual filter strings.
- * @param existingList An array containing list of existing filter strings to compare against.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorFilterString(ISystemFilterString[] existingList, boolean caseSensitive)
- {
- super(convertFilterStringsToStrings(existingList), caseSensitive); // case sensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorFilterString(boolean caseSensitive)
- {
- super(new String[0], caseSensitive);
- init();
- }
-
- /**
- * Set the error message to issue when a duplicate filter string is found.
- */
- public void setDuplicateFilterStringErrorMessage(SystemMessage msg)
- {
- super.setErrorMessages(null, msg_NonUnique);
- }
-
- /**
- * Converts an array of filter strings into an array of strings
- */
- protected static String[] convertFilterStringsToStrings(ISystemFilterString[] filterStrings)
- {
- if (filterStrings == null)
- return new String[0];
- String[] strings = new String[filterStrings.length];
- for (int idx=0; idx<filterStrings.length; idx++)
- strings[idx] = filterStrings[idx].getString();
- return strings;
- }
-
-
- private void init()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_NOTUNIQUE),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERSTRING_NOTVALID));
- }
-
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- public String toString()
- {
- return "ValidatorFilterString class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
-
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking. We don't do anything by default.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- // nothing more to check so far. But if there ever is, return msg_Invalid
- return null;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for filter strings: 1000
- */
- public int getMaximumNameLength()
- {
- return MAX_FILTERSTRINGNAME_LENGTH;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFolderName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFolderName.java
deleted file mode 100644
index 23565abf2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFolderName.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a name that eventually needs to become a folder.
- * Relies on Eclipse supplied method to test for folder name validity.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorFolderName
- extends ValidatorUniqueString implements ISystemValidator
-{
- public static final int MAX_FOLDERNAME_LENGTH = 256;
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a vector containing a list of existing names to compare against.
- */
- public ValidatorFolderName(Vector existingNameList)
- {
- super(existingNameList, CASE_INSENSITIVE); // case insensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID);
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorFolderName(String existingNameList[])
- {
- super(existingNameList, CASE_INSENSITIVE); // case sensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID);
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorFolderName()
- {
- super(new String[0], CASE_INSENSITIVE);
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable extension point to check for invalidate characters beyond what Eclipse checks for
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return true;
- }
-
- public String toString()
- {
- return "FolderNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- IStatus rc = workspace.validateName(newText, IResource.FOLDER);
- if (rc.getCode() != IStatus.OK)
- currentMessage = msg_Invalid;
- else if ((getMaximumNameLength() > 0) && // defect 42507
- (newText.length() > getMaximumNameLength()))
- currentMessage = msg_Invalid; // TODO: better message
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 256
- */
- public int getMaximumNameLength()
- {
- return MAX_FOLDERNAME_LENGTH;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerInput.java
deleted file mode 100644
index fa45544d0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerInput.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-/**
- * For editable numeric properties.
- * Ensures only digits are entered.
- */
-public class ValidatorIntegerInput implements ISystemValidator
-{
- protected boolean allowBlank = false;
- protected int number;
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when the default error messages are ok
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorIntegerInput()
- {
- this(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY));
- }
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorIntegerInput(SystemMessage emptyMsg)
- {
- this(emptyMsg, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NOT_NUMERIC));
- }
- /**
- * Constructor to use when wanting to specify both error messages
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorIntegerInput(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- setErrorMessages(emptyMsg, invalidMsg);
- }
-
- /**
- * Specify if an empty field is ok or not. The default is not, and will result in an error message.
- */
- public void setBlankAllowed(boolean allowBlank)
- {
- this.allowBlank = allowBlank;
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- //return "Unknown input";
- number = 1;
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- if (!allowBlank)
- currentMessage = emptyMsg;
- }
- else
- {
- try
- {
- number = Integer.parseInt(input);
- }
- catch (NumberFormatException exc)
- {
- currentMessage = invalidMsg;
- currentMessage.makeSubstitution(input);
- }
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for this name, or -1 if no max.
- * For integers, the maximum is +- 2 to the 16th, so we set the max at 11 (to include the sign).
- */
- public int getMaximumNameLength()
- {
- return 11;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
- /**
- * If validation is true, you can call this to get the input as a number
- */
- public int getNumber()
- {
- return number;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerRangeInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerRangeInput.java
deleted file mode 100644
index af0a9cd9a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorIntegerRangeInput.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * For editable integer numbers that must be within a certain range to be valid
- */
-public class ValidatorIntegerRangeInput extends ValidatorIntegerInput
-{
- private int minRange, maxRange;
- private int orgMinRange, orgMaxRange;
- private Integer minRangeInt, maxRangeInt;
- private SystemMessage msg_InvalidRange;
-
- /**
- * Constructor when an empty field is not allowed (will result in an error message)
- * @param minRange - the lowest valid number
- * @param maxRange - the highest valid number
- */
- public ValidatorIntegerRangeInput(int minRange, int maxRange)
- {
- this(minRange, maxRange, false);
- }
- /**
- * Constructor when an empty field is allowed.
- * @param minRange - the lowest valid number
- * @param maxRange - the highest valid number
- * @param allowBlank - true if blanks allowed, false if not
- */
- public ValidatorIntegerRangeInput(int minRange, int maxRange, boolean allowBlank)
- {
- super(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_NOTVALID));
- msg_InvalidRange = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_OUTOFRANGE);
- this.orgMinRange = minRange;
- this.orgMaxRange = maxRange;
- super.setBlankAllowed(allowBlank);
- setRange(minRange, maxRange);
- }
-
- /**
- * Reset the range
- */
- public void setRange(int minRange, int maxRange)
- {
- this.minRange = minRange;
- this.maxRange = maxRange;
- minRangeInt = new Integer(minRange);
- maxRangeInt = new Integer(maxRange);
- }
- /**
- * Restore the range originally specified in the constructor
- */
- public void restoreRange()
- {
- setRange(orgMinRange, orgMaxRange);
- }
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg, SystemMessage outOfRangeMsg)
- {
- super.setErrorMessages(emptyMsg, invalidMsg);
- msg_InvalidRange = outOfRangeMsg;
- }
-
- /**
- * Return the max length for this name, or -1 if no max.
- * We return a max length that just allows the largest number in the range to be set, plus the sign if negative
- */
- public int getMaximumNameLength()
- {
- int maxlen = Integer.toString(Math.abs(maxRange)).length();
- if (maxRange < 0)
- ++maxlen;
- return maxlen;
- }
-
- /**
- * Intercept of parent to also add range checking
- */
- public String isValid(String input)
- {
- String msg = super.isValid(input);
- if ((msg == null) && (input != null) && (input.length()>0))
- {
- if ((number < minRange) || (number > maxRange))
- {
- currentMessage = msg_InvalidRange;
- currentMessage.makeSubstitution(input, minRangeInt, maxRangeInt);
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLocalPath.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLocalPath.java
deleted file mode 100644
index 0b57ba755..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLocalPath.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.io.File;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-
-/**
- * This class is used in dialogs that prompt for a local directory path.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorLocalPath extends ValidatorPathName
-{
-
-
- public static final boolean WINDOWS = System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0;
- public static final char SEPCHAR = File.separatorChar;
-
- /**
- * Constructor for ValidatorLocalPath
- */
- public ValidatorLocalPath(Vector existingNameList)
- {
- super(existingNameList);
- }
-
- /**
- * Constructor for ValidatorLocalPath
- */
- public ValidatorLocalPath(String[] existingNameList)
- {
- super(existingNameList);
- }
-
- /**
- * Constructor for ValidatorLocalPath
- */
- public ValidatorLocalPath()
- {
- super();
- }
-
- /**
- * Validate each character.
- * Override of parent method.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- SystemMessage msg = super.isSyntaxOk(newText);
- if (msg == null)
- {
- boolean ok = true;
- if (WINDOWS)
- {
- if (newText.length()<3)
- ok = false;
- else if (newText.charAt(1) != ':')
- ok = false;
- else if (newText.charAt(2) != SEPCHAR)
- ok = false;
- else if (!Character.isLetter(newText.charAt(0)))
- ok = false;
- }
- else
- {
- if (newText.length()<1)
- ok = false;
- else if (newText.charAt(0) != SEPCHAR)
- ok = false;
- }
- if (!ok)
- msg = msg_Invalid;
- }
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongInput.java
deleted file mode 100644
index 610a94144..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongInput.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-/**
- * For editable large numeric properties.
- * Ensures only digits are entered.
- */
-public class ValidatorLongInput implements ISystemValidator
-{
- protected boolean allowBlank = false;
- protected long number;
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when the default error messages are ok
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorLongInput()
- {
- this(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY));
- }
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorLongInput(SystemMessage emptyMsg)
- {
- this(emptyMsg, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NOT_NUMERIC));
- }
- /**
- * Constructor to use when wanting to specify both error messages
- * @see #setBlankAllowed(boolean)
- */
- public ValidatorLongInput(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- setErrorMessages(emptyMsg, invalidMsg);
- }
-
- /**
- * Specify if an empty field is ok or not. The default is not, and will result in an error message.
- */
- public void setBlankAllowed(boolean allowBlank)
- {
- this.allowBlank = allowBlank;
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- //return "Unknown input";
- number = 1;
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- if (!allowBlank)
- currentMessage = emptyMsg;
- }
- else
- {
- try
- {
- number = Long.parseLong(input);
- }
- catch (NumberFormatException exc)
- {
- currentMessage = invalidMsg;
- currentMessage.makeSubstitution(input);
- }
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for this name. For us, we return 20.
- */
- public int getMaximumNameLength()
- {
- return 20;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
- /**
- * If validation is true, you can call this to get the input as a number
- */
- public long getNumber()
- {
- return number;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongRangeInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongRangeInput.java
deleted file mode 100644
index 243d76430..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorLongRangeInput.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * For editable long numbers that must be within a certain range to be valid
- */
-public class ValidatorLongRangeInput extends ValidatorLongInput
-{
- private long minRange, maxRange;
- private long orgMinRange, orgMaxRange;
- private Long minRangeLong, maxRangeLong;
- private SystemMessage msg_InvalidRange;
-
- /**
- * Constructor when an empty field is not allowed (will result in an error message)
- * @param minRange - the lowest valid number
- * @param maxRange - the highest valid number
- */
- public ValidatorLongRangeInput(long minRange, long maxRange)
- {
- this(minRange, maxRange, false);
- }
- /**
- * Constructor when an empty field is allowed.
- * @param minRange - the lowest valid number
- * @param maxRange - the highest valid number
- * @param allowBlank - true if blanks allowed, false if not
- */
- public ValidatorLongRangeInput(long minRange, long maxRange, boolean allowBlank)
- {
- super(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_NOTVALID));
- msg_InvalidRange = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NUMBER_OUTOFRANGE);
- this.orgMinRange = minRange;
- this.orgMaxRange = maxRange;
- super.setBlankAllowed(allowBlank);
- setRange(minRange, maxRange);
- }
-
- /**
- * Reset the range
- */
- public void setRange(long minRange, long maxRange)
- {
- this.minRange = minRange;
- this.maxRange = maxRange;
- minRangeLong = new Long(minRange);
- maxRangeLong = new Long(maxRange);
- }
- /**
- * Restore the range originally specified in the constructor
- */
- public void restoreRange()
- {
- setRange(orgMinRange, orgMaxRange);
- }
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg, SystemMessage outOfRangeMsg)
- {
- super.setErrorMessages(emptyMsg, invalidMsg);
- msg_InvalidRange = outOfRangeMsg;
- }
- /**
- * Return the max length for this name, or -1 if no max.
- * We return a max length that just allows the largest number in the range to be set, plus the sign if negative
- */
- public int getMaximumNameLength()
- {
- int maxlen = Long.toString(Math.abs(maxRange)).length();
- if (maxRange < 0)
- ++maxlen;
- return maxlen;
- }
- /**
- * Intercept of parent to also add range checking
- */
- public String isValid(String input)
- {
- String msg = super.isValid(input);
- if ((msg == null) && (input != null) && (input.length()>0))
- {
- if ((number < minRange) || (number > maxRange))
- {
- currentMessage = msg_InvalidRange;
- currentMessage.makeSubstitution(input, minRangeLong, maxRangeLong);
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPathName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPathName.java
deleted file mode 100644
index 8d069a3e2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPathName.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a name that eventually needs to become a folder path.
- * Simply checks for a few obviously bad characters.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorPathName
- extends ValidatorUniqueString
-{
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected StringBuffer specialChars;
- private int nbrSpecialChars;
-
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a vector containing a list of existing names to compare against.
- */
- public ValidatorPathName(Vector existingNameList)
- {
- super(existingNameList, CASE_INSENSITIVE); // case insensitive uniqueness
- init();
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorPathName(String existingNameList[])
- {
- super(existingNameList, CASE_INSENSITIVE); // case sensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorPathName()
- {
- super(new String[0], CASE_INSENSITIVE);
- init();
- fUnique = false;
- }
-
- protected void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PATH_NOTVALID);
- specialChars = new StringBuffer("*?;'<>|");
- nbrSpecialChars = specialChars.length();
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- //IStatus rc = workspace.validatePath(newText, IResource.FOLDER);
- //if (rc.getCode() != IStatus.OK)
- //return msg_Invalid;
- boolean ok = !containsSpecialCharacters(newText);
- if (!ok)
- return msg_Invalid;
- return null;
- }
-
- protected boolean containsSpecialCharacters(String newText)
- {
- boolean contains = false;
- int newLen = newText.length();
- for (int idx=0; !contains && (idx<newLen); idx++)
- {
- for (int jdx=0; !contains && (jdx<nbrSpecialChars); jdx++)
- if (newText.charAt(idx) == specialChars.charAt(jdx))
- contains = true;
- }
- return contains;
- }
-
- public String toString()
- {
- return "PathValidator class";
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPortInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPortInput.java
deleted file mode 100644
index 646aa45c3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorPortInput.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * For editable port number properties.
- * Ensures only digits are entered, and they appear to be a valid port.
- * TODO: what appears to be a valid port??
- */
-public class ValidatorPortInput extends ValidatorIntegerInput
-{
-
- public static final int MAXIMUM_PORT_NUMBER = 65535; // according to IP specification
-
- public ValidatorPortInput()
- {
- super(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID));
- }
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- String msg = super.isValid(input);
- if (msg == null)
- {
- // yantzi: 2.1.2 added check for port > 65536 and changed msg to invalid port number
- if (number < 0 || number > MAXIMUM_PORT_NUMBER)
- {
- //if (number <= 0) // we don't let user enter 0 explicitly, only via button selection.
- //currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_EMPTY);
- currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID);
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
- /**
- * @see org.eclipse.rse.ui.validators.ValidatorIntegerInput#isValid(java.lang.String)
- */
- public String isValid(String input) {
- // yantzi:2.1.2 need to override this method in addition to the same
- // one that takes Object parametere otherwise we get the wrong error messages!
- String msg = super.isValid(input);
- if (msg == null)
- {
- // yantzi: 2.1.2 added check for port > 65536 and changed msg to invalid port number
- if (number < 0 || number > MAXIMUM_PORT_NUMBER)
- {
- //if (number <= 0) // we don't let user enter 0 explicitly, only via button selection.
- //currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_EMPTY);
- currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID);
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorProfileName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorProfileName.java
deleted file mode 100644
index 3239ce8f1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorProfileName.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a profile name.
- * Relies on Eclipse supplied method to test for folder name validity.
- * <p>
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorProfileName
- extends ValidatorFolderName implements ISystemValidator
-{
- public static final int MAX_PROFILENAME_LENGTH = 100; // arbitrary restriction! Defect 41816
- private SystemMessage reservedNameMsg;
-
- /**
- * Constructor. The list of existing names can be null if this is not a rename operation.
- */
- public ValidatorProfileName(Vector existingNameList)
- {
- super(existingNameList);
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PROFILENAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PROFILENAME_NOTUNIQUE),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PROFILENAME_NOTVALID));
- }
-
- /**
- * Return the max length for profiles: 100
- */
- public int getMaximumNameLength()
- {
- return MAX_PROFILENAME_LENGTH;
- }
-
- /**
- * Return the msg for reserved names
- */
- private SystemMessage getReservedNameMessage()
- {
- if (reservedNameMsg == null)
- reservedNameMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PROFILENAME_RESERVED);
- return reservedNameMsg;
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Parent intercept to ensure no reserved names are used.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- super.isSyntaxOk(newText);
- if (currentMessage == null)
- {
- if (newText.equalsIgnoreCase("private")) {
- currentMessage = getReservedNameMessage();
- }
- else if (newText.indexOf('.') != -1) {
- currentMessage = msg_Invalid;
- }
-
- }
- return currentMessage;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorRemoteSelection.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorRemoteSelection.java
deleted file mode 100644
index 322aa7399..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorRemoteSelection.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-
-/**
- * On remote selection dialogs, you can pass an instance of this class to validate that
- * it is ok to enable the OK button when the user selects a remote object. If you return
- * a SystemMessage, ok will be disabled and the message will be shown on the message line.
- * Return a SystemMessage with blank in the first level text to disable OK without showing
- * an error message.
- * <p>
- * This class must be subclassed.Alternatively you can just implement {@link IValidatorRemoteSelection}
- */
-public abstract class ValidatorRemoteSelection implements IValidatorRemoteSelection
-{
-
- /**
- * The user has selected a remote object. Return null if OK is to be enabled, or a SystemMessage
- * if it is not to be enabled. The message will be displayed on the message line.
- */
- public abstract SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorServerPortInput.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorServerPortInput.java
deleted file mode 100644
index e6542d7fc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorServerPortInput.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-
-package org.eclipse.rse.ui.validators;
-
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-public class ValidatorServerPortInput extends ValidatorPortInput
-{
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
-
- String msg = super.isValid(input);
- if (msg == null)
- {
- // check that it's not a used port
- if (number == 4035)
- {
- currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PORT_WARNING);
- currentMessage.makeSubstitution("4035", "RSE daemon");
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
- public String isValid(String input)
- {
- // yantzi:2.1.2 need to override this method in addition to the same
- // one that takes Object parametere otherwise we get the wrong error messages!
- String msg = super.isValid(input);
- if (msg == null)
- {
- // check that it's not a used port
- if (number == 4035)
- {
- currentMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PORT_WARNING);
- currentMessage.makeSubstitution("4035", "RSE daemon");
- msg = currentMessage.getLevelOneText();
- }
- }
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSourceType.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSourceType.java
deleted file mode 100644
index a971b5f05..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSourceType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user-entered source type. This is typically
- * subsystem-dependent, such as "*.cpp" for a universal file subsystem.
- * However, this class is defined to be easily subclassed.
- */
-public class ValidatorSourceType extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_SRCTYPE_LENGTH = 50; // max name for a src type
-
- protected SystemMessage msg_Invalid;
-
- /**
- * Constructor. You must specify if src types are case-sensitive or not.
- * Typically, you will also call setExistingNames to set the list of existing src types
- * for uniqueness-validation.
- */
- public ValidatorSourceType(boolean caseSensitive)
- {
- super(new String[0], caseSensitive);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_SRCTYPE_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_SRCTYPE_NOTUNIQUE));
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_SRCTYPE_NOTVALID);
- }
-
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return true;
- }
-
- public String toString()
- {
- return "ValidatorSourceType class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_SRCTYPE_LENGTH;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSpecialChar.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSpecialChar.java
deleted file mode 100644
index 97ec10073..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSpecialChar.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for string, where the
- * string is not allowed to content special characters, as supplied to this class.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorSpecialChar
- implements ISystemValidator // IInputValidator, ICellEditorValidator
-{
-
- public static final boolean EMPTY_ALLOWED_NO = false;
- public static final boolean EMPTY_ALLOWED_YES= true;
- private boolean isEmptyAllowed = true;
- protected StringBuffer specialChars;
- protected SystemMessage msg_Invalid;
- protected SystemMessage msg_Empty;
- protected SystemMessage currentMessage;
- private int nbrSpecialChars;
-
- /**
- * Constructor
- * @param specialChars String containing special characters to test for.
- * @param isEmptyAllowed true if an empty string is valid
- */
- public ValidatorSpecialChar(String specialChars, boolean isEmptyAllowed)
- {
- this(specialChars, isEmptyAllowed, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_NOTVALID), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY));
- }
- /**
- * Constructor
- * @param specialChars String containing special characters to test for.
- * @param isEmptyAllowed true if an empty string is valid
- * @param msg_Invalid error message when invalid characters entered
- */
- public ValidatorSpecialChar(String specialChars, boolean isEmptyAllowed, SystemMessage msg_Invalid)
- {
- this(specialChars, isEmptyAllowed, msg_Invalid, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY));
- }
- /**
- * Constructor
- * @param specialChars String containing special characters to test for.
- * @param isEmptyAllowed true if an empty string is valid
- * @param msg_Invalid error message when invalid characters entered
- * @param msg_Empty error message when empty string
- */
- public ValidatorSpecialChar(String specialChars, boolean isEmptyAllowed, SystemMessage msg_Invalid, SystemMessage msg_Empty)
- {
- this.isEmptyAllowed = isEmptyAllowed;
- this.specialChars = new StringBuffer(specialChars);
- this.nbrSpecialChars = specialChars.length();
- setErrorMessages(msg_Empty, msg_Invalid);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty or null if to keep the default
- * @param msg_Invalid error message when value entered is not valid, or null if to keep the default
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_Invalid)
- {
- if (msg_Empty != null)
- this.msg_Empty = msg_Empty;
- if (msg_Invalid != null)
- this.msg_Invalid = msg_Invalid;
- }
-
- // --------------------------
- // Internal helper methods...
- // --------------------------
-
- /**
- * Helper method to substitute data into a message
- */
- protected String doMessageSubstitution(SystemMessage msg, String substitution)
- {
- currentMessage = msg;
- if (msg.getNumSubstitutionVariables() > 0)
- return msg.makeSubstitution(substitution).getLevelOneText();
- else
- return msg.getLevelOneText();
- }
-
- /**
- * Helper method to set the current system message and return its level one text
- */
- protected String getSystemMessageText(SystemMessage msg)
- {
- currentMessage = msg;
- if (msg != null)
- return msg.getLevelOneText();
- else
- return null;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Validate each character.
- */
- public String isValid(String newText)
- {
- currentMessage = null;
- if ((newText==null) || (newText.length() == 0))
- {
- if (isEmptyAllowed)
- return null;
- else
- currentMessage = msg_Empty;
- }
- else if (containsSpecialCharacters(newText))
- currentMessage = msg_Invalid;
- else
- currentMessage = isSyntaxOk(newText);
- return (currentMessage == null) ? null : doMessageSubstitution(currentMessage, newText);
- }
-
- /**
- * As required by ICellEditor
- */
- public String isValid(Object newValue)
- {
- if (newValue instanceof String)
- return isValid((String)newValue);
- else
- return null;
- }
-
-
- protected boolean containsSpecialCharacters(String newText)
- {
- boolean contains = false;
- int newLen = newText.length();
- for (int idx=0; !contains && (idx<newLen); idx++)
- {
- for (int jdx=0; !contains && (jdx<nbrSpecialChars); jdx++)
- if (newText.charAt(idx) == specialChars.charAt(jdx))
- contains = true;
- }
- return contains;
- }
-
- /**
- * Override in child to do your own syntax checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- return null;
- }
-
- /**
- * Return the max length for this name, or -1 if no max
- */
- public int getMaximumNameLength()
- {
- return -1;
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSystemName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSystemName.java
deleted file mode 100644
index ffbe6c9d2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorSystemName.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for an alias name.
- * The rules used are the same as for Java names, for simplicity.
- * Depending on the constructor used, this will also check for duplicates.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorSystemName
- extends ValidatorUniqueString
-{
-
- //protected String[] existingNames;
- protected boolean fUnique;
- //protected String msg_Empty;
- //protected String msg_NonUnique;
- protected SystemMessage msg_Invalid;
-
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a vector containing a list of existing names to compare against.
- */
- public ValidatorSystemName(Vector existingNameList)
- {
- super(existingNameList, true); // case sensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTVALID);
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorSystemName(String existingNameList[])
- {
- super(existingNameList, true); // case sensitive uniqueness
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTVALID);
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorSystemName()
- {
- super(new String[0], true);
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE));
- fUnique = false;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- public String toString()
- {
- return "SystemNameValidator class";
- }
-
- // -------------------
- // Parent overrides...
- // -------------------
-
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- char currChar = newText.charAt(0);
- if (!Character.isJavaIdentifierStart(currChar))
- return msg_Invalid;
- for (int idx=1; idx<newText.length(); idx++)
- {
- currChar = newText.charAt(idx);
- if (!Character.isJavaIdentifierPart(currChar))
- return msg_Invalid;
- }
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUniqueString.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUniqueString.java
deleted file mode 100644
index e19324599..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUniqueString.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Arrays;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a string
- * that has to be unique. Unless you use the constructor that takes another
- * IInputValidator as input, no syntax checking is done other than checking
- * the input is non-empty and unique.
- *
- * The IInputValidator interface is implelemented by our parent and it
- * is used by jface's InputDialog class and property sheet window.
- */
-public class ValidatorUniqueString
- implements ISystemValidator, ISystemValidatorUniqueString
- //,IInputValidator, ICellEditorValidator ... ISystemValidator extends these
-{
-
- public static final boolean CASE_SENSITIVE = true;
- public static final boolean CASE_INSENSITIVE = false;
- public static final char QUOTE = '\"';
- protected ISystemValidator syntaxValidator;
- protected boolean caseSensitive;
- protected boolean useUpperCase;
- protected String existingList[];
- protected SystemMessage msg_Empty;
- protected SystemMessage msg_NonUnique;
- protected SystemMessage currentMessage;
-
- /**
- * Constructor accepting a Vector.
- * @param existingList A vector containing list of existing strings to compare against.
- * Note that toString() is used to get the string from each item.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorUniqueString(Vector existingList, boolean caseSensitive)
- {
- this.caseSensitive = caseSensitive;
- setExistingNamesList(existingList);
- // initialize error messages
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_NOTUNIQUE));
- }
- /**
- * Constructor accepting an Array.
- * @param existingList An array containing list of existing strings to compare against.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- */
- public ValidatorUniqueString(String existingList[], boolean caseSensitive)
- {
- this.caseSensitive = caseSensitive;
- init(existingList, caseSensitive);
- // initialize error messages
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_ENTRY_NOTUNIQUE));
- }
- /**
- * Constructor accepting a Vector and another validator to use for the syntax checking.
- * @param existingList A vector containing list of existing strings to compare against.
- * Note that toString() is used to get the string from each item.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- * @param syntaxValidator Another IInputValidator who does the job of checking the syntax. After
- * checking for non-nullness and uniqueness, this validator is used to
- * check for syntax.
- */
- public ValidatorUniqueString(Vector existingList, boolean caseSensitive,
- ISystemValidator syntaxValidator)
- {
- this(existingList, caseSensitive);
- this.syntaxValidator = syntaxValidator;
- }
- /**
- * Constructor accepting an Array and another validator to use for the syntax checking.
- * @param existingList An array containing list of existing strings to compare against.
- * @param caseSensitive true if comparisons are to be case sensitive, false if case insensitive.
- * @param syntaxValidator Another IInputValidator who does the job of checking the syntax. After
- * checking for non-nullness and uniqueness, this validator is used to
- * check for syntax.
- */
- public ValidatorUniqueString(String existingList[], boolean caseSensitive,
- ISystemValidator syntaxValidator)
- {
- this(existingList, caseSensitive);
- this.syntaxValidator = syntaxValidator;
- }
- /**
- * Reset whether this is a case-sensitive list or not
- */
- public void setCaseSensitive(boolean caseSensitive)
- {
- this.caseSensitive = caseSensitive;
- }
- /**
- * For case-insensitive, we typically fold to lowercase, affecting what
- * this user sees in the substitution value of error messages.
- * Call this so the value substituted is uppercase vs lowercase.
- */
- public void setUseUpperCase()
- {
- this.useUpperCase = true;
- }
-
- /**
- * Reset the existing names list.
- */
- public void setExistingNamesList(Vector existingList)
- {
- if (existingList == null)
- this.existingList = null;
- else
- {
- String newList[] = new String[existingList.size()];
- for (int idx=0; idx<existingList.size(); idx++)
- {
- if (!caseSensitive)
- newList[idx] = existingList.elementAt(idx).toString().toLowerCase();
- else
- newList[idx] = existingList.elementAt(idx).toString();
- }
- init(newList, true); // don't redo the toLowerCase calls
- }
- }
- /**
- * Reset the existing names list.
- */
- public void setExistingNamesList(String[] existingList)
- {
- if (existingList == null)
- this.existingList = null;
- else
- init(existingList, caseSensitive);
- }
-
- /**
- * Return the existing names list. This will be a case-normalized and sorted list.
- */
- public String[] getExistingNamesList()
- {
- return existingList;
- }
-
- /**
- * Initialize sorted array.
- */
- private void init(String existingList[], boolean caseSensitive)
- {
- this.existingList = existingList;
- if (existingList == null)
- return;
- if (!caseSensitive) // speed up comparison by converting to all lowercase
- {
- String newList[] = new String[existingList.length];
- for (int idx=0; idx<existingList.length; idx++)
- {
- String string = existingList[idx];
- boolean quoted = (string.indexOf(QUOTE) != -1);
- if (!quoted)
- newList[idx] = string.toLowerCase();
- else
- newList[idx] = quotedToLowerCase(string);
- }
- existingList = newList;
- }
- Arrays.sort(existingList); // Arrays is a utility class in java.util. New in JDK 1.2
- this.existingList = existingList;
- }
-
- /**
- * Special-case way to fold non-quoted parts of a string to lowercase
- */
- public static String quotedToLowerCase(String input)
- {
- StringBuffer buffer = new StringBuffer(input.length());
- //System.out.println("INPUT : " + input);
- boolean inQuotes = false;
- for (int idx=0; idx<input.length(); idx++)
- {
- char c = input.charAt(idx);
- if (c == QUOTE)
- inQuotes = !inQuotes;
- else if (!inQuotes)
- c = Character.toLowerCase(c);
- buffer.append(c);
- }
- //System.out.println("OUTPUT: " + buffer.toString());
- return buffer.toString();
- }
-
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty or null if to keep the default
- * @param msg_NonUnique error message when value entered is not unique or null if to keep the default
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique)
- {
- if (msg_Empty != null)
- this.msg_Empty = msg_Empty;
- if (msg_NonUnique != null)
- this.msg_NonUnique = msg_NonUnique;
- }
-
- /**
- * Override in child to do your own syntax checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- return null;
- }
-
- public String toString()
- {
- return "UniqueNameValidator class";
- }
-
- // --------------------------
- // Internal helper methods...
- // --------------------------
-
- /**
- * Helper method to substitute data into a message
- */
- protected String doMessageSubstitution(SystemMessage msg, String substitution)
- {
- currentMessage = msg;
- if (msg.getNumSubstitutionVariables() > 0)
- {
- if (!useUpperCase)
- return msg.makeSubstitution(substitution).getLevelOneText();
- else
- return msg.makeSubstitution(substitution.toUpperCase()).getLevelOneText();
- }
- else
- return msg.getLevelOneText();
- }
-
- /**
- * Helper method to set the current system message and return its level one text
- */
- protected String getSystemMessageText(SystemMessage msg)
- {
- currentMessage = msg;
- if (msg != null)
- return msg.getLevelOneText();
- else
- return null;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Validates the given string. Returns the error message
- * used if the given string isn't valid. A return value
- * <code>null</code> or a string of length zero indicates
- * that the value is valid.
- * Note this is called per keystroke, by the platform.
- * @deprecated You should be using {@link #validate(String)} and SystemMessage objects
- */
- public String isValid(String newText)
- {
- currentMessage = null;
- newText = newText.trim();
- if (newText.length() == 0)
- currentMessage = msg_Empty;
- else
- {
- if (!caseSensitive && (existingList!=null))
- {
- if (newText.indexOf(QUOTE)!=-1)
- newText = quotedToLowerCase(newText);
- else
- newText = newText.toLowerCase();
- }
- /*
- if (!caseSensitive && (existingList!=null) && (Arrays.binarySearch(existingList,newText) >= 0))
- return msg_NonUnique.getLevelOneText();
- else if (caseSensitive && (existingList!=null) && (Arrays.binarySearch(existingList,newText) >= 0))
- return msg_NonUnique.getLevelOneText();
- */
- if ((existingList!=null) && (Arrays.binarySearch(existingList,newText) >= 0))
- currentMessage = msg_NonUnique;
- else if (syntaxValidator!=null)
- {
- String msg = syntaxValidator.isValid(newText);
- if (msg != null)
- {
- currentMessage = syntaxValidator.getSystemMessage();
- if (currentMessage == null) // tsk, tsk
- return msg;
- }
- }
- else
- currentMessage = isSyntaxOk(newText);
- }
- return (currentMessage == null) ? null : doMessageSubstitution(currentMessage, newText);
- }
-
- /**
- * As required by ICellEditor
- */
- public String isValid(Object newValue)
- {
- if (newValue instanceof String)
- return isValid((String)newValue);
- else
- {
- currentMessage = null;
- return null;
- }
- }
-
- /**
- * Return the max length for this name, or -1 if no max
- */
- public int getMaximumNameLength()
- {
- return -1;
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java
deleted file mode 100644
index 787e88ed4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's command
- */
-public class ValidatorUserActionCommand
- implements ISystemValidator
-{
- public static final int MAX_UDACMD_LENGTH = 512; // max command for an action
-
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- */
- public ValidatorUserActionCommand()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMD_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMD_NOTVALID));
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- currentMessage = emptyMsg;
- }
- else
- {
- if (input.length() > MAX_UDACMD_LENGTH)
- currentMessage = invalidMsg;
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for comments
- */
- public int getMaximumNameLength()
- {
- return MAX_UDACMD_LENGTH;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java
deleted file mode 100644
index aaf335aeb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's comment
- */
-public class ValidatorUserActionComment
- implements ISystemValidator
-{
- public static final int MAX_UDACMT_LENGTH = 256; // max comment for an action
-
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- */
- public ValidatorUserActionComment()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMT_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMT_NOTVALID));
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- //currentMessage = emptyMsg;
- }
- else
- {
- if (input.length() > MAX_UDACMT_LENGTH)
- currentMessage = invalidMsg;
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for comments
- */
- public int getMaximumNameLength()
- {
- return MAX_UDACMT_LENGTH;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java
deleted file mode 100644
index df27fd6a2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's name.
- */
-public class ValidatorUserActionName extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_UDANAME_LENGTH = 256; // max name for an action
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a vector containing a list of existing names to compare against.
- */
- public ValidatorUserActionName(Vector existingNameList)
- {
- super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
- init();
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorUserActionName(String existingNameList[])
- {
- super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorUserActionName()
- {
- super(new String[0], CASE_SENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character
- (newText.indexOf('@') == -1)); // defect 43950
- }
-
- public String toString()
- {
- return "UserActionNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 256
- */
- public int getMaximumNameLength()
- {
- return MAX_UDANAME_LENGTH;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserId.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserId.java
deleted file mode 100644
index d6dbd1b1a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserId.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used in dialogs that prompt for a userId.
- * This does very basic userId validation, just to ensure there are no problems when the
- * user Id is saved in the preferences. This means restricting use of a couple special characters
- * that would mess up the key/value processing of the preference data.
- *
- * The IInputValidator interface is used by jface's
- * InputDialog class and numerous other platform and system classes.
- */
-public class ValidatorUserId
- extends ValidatorSpecialChar
-{
- /**
- * Constructor
- */
- public ValidatorUserId(boolean isEmptyAllowed)
- {
- super("=;", isEmptyAllowed, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_NOTVALID), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY));
- }
-
- /**
- * We could do additional syntax checking here if we decide to.
- * This method is called by parent class if all other error checking passes.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java
deleted file mode 100644
index 664f184eb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined type's name.
- */
-public class ValidatorUserTypeName extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_UDTNAME_LENGTH = 50; // max name for a file type
-
- protected SystemMessage msg_Invalid;
-
- /**
- * Use this constructor when the name need not be unique, and you just want the syntax checking.
- */
- public ValidatorUserTypeName()
- {
- super(new String[0], CASE_INSENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTUNIQUE));
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTVALID);
- }
-
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return true;
- }
-
- public String toString()
- {
- return "UserTypeNameValidator class";
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_UDTNAME_LENGTH;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java
deleted file mode 100644
index 89873b932..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's comment
- */
-public class ValidatorUserTypeTypes
- implements ISystemValidator
-{
- public static final int MAX_UDTTYPES_LENGTH = 512;
-
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- */
- public ValidatorUserTypeTypes()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_NOTVALID));
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- currentMessage = emptyMsg;
- }
- else
- {
- if (input.length() > MAX_UDTTYPES_LENGTH)
- currentMessage = invalidMsg;
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for comments
- */
- public int getMaximumNameLength()
- {
- return MAX_UDTTYPES_LENGTH;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- * <pre><code>
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- * </code></pre>
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemRemoteAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemRemoteAdapterFactory.java
deleted file mode 100644
index e86fd21fb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemRemoteAdapterFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * Abstraction of the work needed to create an adapter factory for an adapter
- * that extends {@link AbstractSystemViewAdapter}.
- */
-public abstract class AbstractSystemRemoteAdapterFactory implements IAdapterFactory
-{
-
-
-
- /**
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
- */
- public abstract Object getAdapter(Object adaptableObject, Class adapterType);
-
- /**
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList()
- {
- return new Class[] {ISystemViewElementAdapter.class, ISystemDragDropAdapter.class, ISystemRemoteElementAdapter.class,
- IPropertySource.class, IWorkbenchAdapter.class, IActionFilter.class, IDeferredWorkbenchAdapter.class};
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemViewAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemViewAdapter.java
deleted file mode 100644
index 9d6a6e011..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/AbstractSystemViewAdapter.java
+++ /dev/null
@@ -1,1808 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemResourceSet;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
-import org.eclipse.rse.core.subsystems.AbstractResource;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.model.SystemRemoteResourceSet;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemDynamicPopupMenuExtensionManager;
-import org.eclipse.rse.ui.operations.Policy;
-import org.eclipse.rse.ui.operations.SystemFetchOperation;
-import org.eclipse.rse.ui.operations.SystemSchedulingRule;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.progress.IElementCollector;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Base class for adapters needed for the SystemView viewer.
- * It implements the ISystemViewElementAdapter interface.
- * @see AbstractSystemRemoteAdapterFactory
- */
-public abstract class AbstractSystemViewAdapter
- implements ISystemViewElementAdapter, IPropertySource, ISystemPropertyConstants, IWorkbenchAdapter,
- ISystemViewActionFilter, IDeferredWorkbenchAdapter
-{
- //protected boolean isEditable = false;
-
- protected String filterString = null;
-
- /**
- * Current viewer. Set by content provider
- */
- protected Viewer viewer = null;
- /**
- * Current input provider. Set by content provider
- */
- protected Object propertySourceInput = null;
- /**
- * Current shell, set by the content provider
- */
- protected Shell shell;
- private ISystemViewInputProvider input;
- private String xlatedYes = null;
- private String xlatedNo = null;
- private String xlatedTrue = null;
- private String xlatedFalse = null;
- private String xlatedNotApplicable = null;
- private String xlatedNotAvailable = null;
- /**
- * For returning an empty list from getChildren: new Object[0]
- */
- protected Object[] emptyList = new Object[0];
- /**
- * For returning a msg object from getChildren. Will be an array with one item,
- * one of nullObject, canceledObject or errorObject
- */
- protected Object[] msgList = new Object[1];
- /**
- * Frequently returned msg object from getChildren: "empty list"
- */
- protected SystemMessageObject nullObject = null;
- /**
- * Frequently returned msg object from getChildren: "operation canceled"
- */
- protected SystemMessageObject canceledObject = null;
- /**
- * Frequently returned msg object from getChildren: "operation ended in error"
- */
- protected SystemMessageObject errorObject = null;
-
- /**
- * Message substitution prefix: "&"
- */
- protected static final String MSG_SUB_PREFIX = "&";
- /**
- * Message substitution variable 1: "&1"
- */
- protected static final String MSG_SUB1 = MSG_SUB_PREFIX+"1";
- /**
- * Message substitution variable 2: "&2"
- */
- protected static final String MSG_SUB2 = MSG_SUB_PREFIX+"2";
-
- /**
- * Delimiter for each object's key in a memento, used to persist tree view expansion state: "///"
- */
- public static final String MEMENTO_DELIM = SystemViewPart.MEMENTO_DELIM;
-
- /**
- * A handy constant of "new String[0]"
- */
- protected static final String[] EMPTY_STRING_LIST = new String[0];
-
- // -------------------
- // default descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
- // DKM: temporary memory caching stuff - we should replace this with something
- // more comprehensive later
- /**
- * A variable that can be used in getChildren to cache last returned results, if desired
- */
- protected Object[] _lastResults = null;
- /**
- * A variable that can be used to cache last selection, if desired
- */
- protected Object _lastSelected = null;
-
- // ------------------------------------------------------------------
- // Configuration methods, called by the label and content provider...
- // ------------------------------------------------------------------
-
- /**
- * <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
- * Set the viewer that is driving this adapter
- * Called by label and content provider.
- */
- public void setViewer(Viewer viewer)
- {
- this.viewer = viewer;
- }
- /**
- * <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
- * Set the shell to be used by any method that requires it.
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
- /**
- * <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
- * Set the input object used to populate the viewer with the roots.
- * May be used by an adapter to retrieve context-sensitive information.
- * This is set by the Label and Content providers that retrieve this adapter.
- */
- public void setInput(ISystemViewInputProvider input)
- {
- this.input = input;
- }
-
- // ------------------------------------------------------------------
- // Getter methods, for use by subclasses and actions...
- // ------------------------------------------------------------------
-
- /**
- * <i>Getter method. Callable by subclasses. Do not override.</i><br>
- * Get the shell currently hosting the objects in this adapter
- */
- public Shell getShell()
- {
- if (shell == null || shell.isDisposed() || !shell.isVisible() || !shell.isEnabled())
- {
- // get a new shell
- Shell[] shells = Display.getCurrent().getShells();
- Shell lshell = null;
- for (int i = 0; i < shells.length && lshell == null; i++)
- {
- if (!shells[i].isDisposed() && shells[i].isEnabled() && shells[i].isVisible())
- {
- lshell = shells[i];
- }
- }
- if (lshell == null)
- lshell = SystemBasePlugin.getActiveWorkbenchShell();
- shell = lshell;
- }
- return shell;
- }
- /**
- * <i>Getter method. Callable by subclasses. Do not override.</i><br>
- * Return the current viewer, as set via setViewer or its deduced from the
- * setInput input object if set. May be null so test it.
- */
- public Viewer getViewer()
- {
- if (viewer == null)
- {
- ISystemViewInputProvider ip = getInput();
- if (ip != null)
- {
- return ip.getViewer();
- }
- else
- {
- IWorkbenchPart currentPart = SystemBasePlugin.getActiveWorkbenchWindow().getActivePage().getActivePart();
- if (currentPart instanceof IRSEViewPart)
- {
- return ((IRSEViewPart)currentPart).getRSEViewer();
- }
- }
-
- }
- return viewer;
- }
- /**
- * <i>Getter method. Callable by subclasses. Do not override.</i><br>
- * Return the current viewer as an ISystemTree if it is one, or null otherwise
- */
- protected ISystemTree getCurrentTreeView()
- {
- Viewer v = getViewer();
- if (v instanceof ISystemTree)
- return (ISystemTree)v;
- else
- return null;
- }
-
- /**
- * <i>Getter method. Callable by subclasses. Do not override.</i><br>
- * Get the input object used to populate the viewer with the roots.
- * May be used by an adapter to retrieve context-sensitive information.
- */
- public ISystemViewInputProvider getInput()
- {
- return input;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses. You should override if not using AbstractResource.</i><br>
- * Returns the subsystem that contains this object. By default, if the
- * given element is instanceof {@link org.eclipse.rse.core.subsystems.AbstractResource AbstractResource},
- * it calls getSubSystem on it, else returns null.
- */
- public ISubSystem getSubSystem(Object element)
- {
- if (element instanceof AbstractResource)
- return ((AbstractResource)element).getSubSystem();
- else
- return null;
- }
-
- /**
- * <i>Called by SystemView viewer. No need to override or call.</i><br>
- * Returns any framework-supplied remote object actions that should be contributed to the popup menu
- * for the given selection list. This does nothing if this adapter does not implement ISystemViewRemoteElementAdapter,
- * else it potentially adds menu items for "User Actions" and Compile", for example. It queries the subsystem
- * factory of the selected objects to determine if these actions are appropriate to add.
- *
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell of viewer calling this. Most dialogs require a shell.
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addCommonRemoteActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (this instanceof ISystemRemoteElementAdapter)
- {
- ISystemRemoteElementAdapter rmtAdapter = (ISystemRemoteElementAdapter)this;
- Object firstSelection = getFirstSelection(selection);
- ISubSystem ss = rmtAdapter.getSubSystem(firstSelection);
- if (ss != null)
- {
- ISubSystemConfiguration ssf = ss.getSubSystemConfiguration();
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssf.getAdapter(ISubSystemConfigurationAdapter.class);
- adapter.addCommonRemoteActions(ssf, menu, selection, shell, menuGroup, ss);
- }
- }
-
- }
-
-
- /**
- * <i>Called by system viewers. No need to override or call.</i><br>
- * Contributes actions provided via the <code>dynamicPopupMenuExtensions</code> extension point. Unlike
- * addCommonRemoteActions(), these contributions are for any artifact in the RSE views and are contributed
- * independently of subsystem factories.
- *
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell of viewer calling this. Most dialogs require a shell.
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addDynamicPopupMenuActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- // system view adapter menu extensions
- // these extensions are independent of subsystem factories and are contributed via extension point
- SystemDynamicPopupMenuExtensionManager.getInstance().populateMenu(shell, menu, selection, menuGroup);
- }
-
- /**
- * This is your opportunity to add actions to the popup menu for the given selection.
- * <p>
- * To put your action into the given menu, use the menu's {@link org.eclipse.rse.ui.SystemMenuManager#add(String,org.eclipse.jface.action.IAction) add} method.
- * If you don't care where it goes within the popup, just pass the given <samp>menuGroup</samp> location id,
- * otherwise pass one of the GROUP_XXX values from {@link org.eclipse.rse.ui.ISystemContextMenuConstants}. If you pass one that
- * identifies a pre-defined cascading menu, such as GROUP_OPENWITH, your action will magically appear in that
- * cascading menu, even if it was otherwise empty.
- * <p>
- * For the actions themselves, you will probably use one of the base action classes:
- * <ul>
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseAction SystemBaseAction}. For a simple action doesn't present any UI.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseDialogAction SystemBaseDialogAction}. For an action that presents a {@link org.eclipse.rse.ui.dialogs.SystemPromptDialog dialog}.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseDialogAction SystemBaseWizardAction}. For an action that presents a {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard wizard}.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseSubMenuAction SystemBaseSubMenuAction}. For an action that cascades into a submenu with other actions.
- * </ul>
- *
- * @param menu the popup menu you can contribute to
- * @param selection the current selection in the calling tree or table view
- * @param parent the shell of the calling tree or table view
- * @param menuGroup the default menu group to place actions into if you don't care where they. Pass this to the SystemMenuManager {@link org.eclipse.rse.ui.SystemMenuManager#add(String,org.eclipse.jface.action.IAction) add} method.
- *
- * @see org.eclipse.rse.ui.view.ISystemViewElementAdapter#addActions(SystemMenuManager, IStructuredSelection, Shell, String)
- */
- public abstract void addActions(SystemMenuManager menu,IStructuredSelection selection,Shell parent,String menuGroup);
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * IWorkbenchAdapter method. Returns an image descriptor for the image.
- * More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public abstract ImageDescriptor getImageDescriptor(Object element);
-
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * Return the label for this object.
- * @see #getName(Object)
- * @see #getAbsoluteName(Object)
- */
- public abstract String getText(Object element);
-
- /**
- * Return the alternate label for this object. By default this
- * just returns the regular label. If a custom label is required,
- * this provides the means to it.
- * @see #getName(Object)
- * @see #getAbsoluteName(Object)
- */
- public String getAlternateText(Object element)
- {
- return getText(element);
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but rarely needs to be.</i><br>
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * By default, returns <samp>getText(element);</samp>, but child classes can override if display name doesn't equal real name.
- * <p>
- * Called by common rename and delete actions, and used to populate property sheet.
- * @see #getText(Object)
- * @see #getAbsoluteName(Object)
- */
- public String getName(Object element)
- {
- return getText(element);
- }
- /**
- * <i><b>Abstract</b>. Must be overridden.</i><br>.
- * Return the fully-qualified name, versus just the displayable name, for this object.
- * For remote objects, this should be sufficient to uniquely identify this object within its
- * subsystem.
- * @see #getText(Object)
- * @see #getName(Object)
- */
- public abstract String getAbsoluteName(Object object);
-
- /**
- * <i>Internal use. Can be safely ignored.</i><br>
- * Return the name for this object. Unique requirement for IWorkbenchAdapter.
- * We map to <samp>getText(element)</samp>.
- */
- public String getLabel(Object element)
- {
- return getText(element);
- }
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * Return the type label for this object.
- */
- public abstract String getType(Object element);
-
- /**
- * <i><b>Overridable</b> by subclasses, but rarely needs to be.</i><br>
- * Return the string to display in the status line when the given object is selected.
- * The default is:
- * <pre><samp>
- * getType(): getName()
- * </pre></samp>
- */
- public String getStatusLineText(Object element)
- {
- return getType(element) + ": " + getName(element);
- }
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * Return the parent of this object. This is required by eclipse UI adapters, but
- * we try desperately not to use in the RSE. So, you are probably safe returning null,
- * but if can return a parent, why not, go for it.
- */
- public abstract Object getParent(Object element);
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * Return true if this object has children.
- */
- public abstract boolean hasChildren(Object element);
-
- /**
- * <i><b>Abstract</b>. Must be overridden by subclasses.</i><br>
- * Return the children of this object. Return null if children not supported.
- */
- public abstract Object[] getChildren(Object element);
-
- /**
- * This should be overridden by subclasses in order to provide
- * deferred query support via the Eclipse Jobs mechanism
- * Return the children of this object. Return null if children not supported.
- */
- public Object[] getChildren(IProgressMonitor monitor, Object element)
- {
- return getChildren(element);
- }
-
-
- /**
- * <i><b>Overridable</b> by subclasses, but rarely needs to be.</i><br>
- * Return the children of this object, using the given Expand-To filter.
- * By default, this calls getChildren(element). Override only if you support Expand-To menu actions.
- */
- public Object[] getChildrenUsingExpandToFilter(Object element, String expandToFilter)
- {
- return getChildren(element);
- }
-
- /**
- * <i>Callable by subclasses.</i><br>
- * Return the default descriptors for all system elements.
- */
- protected static IPropertyDescriptor[] getDefaultDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[3];
- // The following determine what properties will be displayed in the PropertySheet
- // resource type
- int idx = 0;
- propertyDescriptorArray[idx++] = createSimplePropertyDescriptor(P_TYPE, SystemPropertyResources.RESID_PROPERTY_TYPE_LABEL, SystemPropertyResources.RESID_PROPERTY_TYPE_TOOLTIP);
- // resource name
- propertyDescriptorArray[idx++] = createSimplePropertyDescriptor(P_TEXT, SystemPropertyResources.RESID_PROPERTY_NAME_LABEL, SystemPropertyResources.RESID_PROPERTY_NAME_TOOLTIP);
- // number of children in tree currently
- propertyDescriptorArray[idx++] = createSimplePropertyDescriptor(P_NBRCHILDREN, SystemViewResources.RESID_PROPERTY_NBRCHILDREN_LABEL, SystemViewResources.RESID_PROPERTY_NBRCHILDREN_TOOLTIP);
-
- }
- //System.out.println("In getDefaultDescriptors() in AbstractSystemViewAdapter");
- return propertyDescriptorArray;
- }
-
- /**
- * <i>Callable by subclasses.</i><br>
- * Create and return a simple string readonly property descriptor.
- * @param propertyKey Key for this property, sent back in getPropertyValue.
- * @param label
- * @param description
- */
- protected static PropertyDescriptor createSimplePropertyDescriptor(String propertyKey, String label, String description)
- {
- PropertyDescriptor pd = new PropertyDescriptor(propertyKey, label);
- pd.setDescription(description);
- return pd;
- }
-
-
- /**
- * <i>Needed by framework for property sheet. No need to call or override.</i><br>
- * Returns a value for this object that can be edited in a property sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue()
- {
- return this;
- }
- /**
- * <i>Implemented. Do not override typically. See {@link #internalGetPropertyDescriptors()}.</i><br>
- * Returns the property descriptors defining what properties are seen in the property sheet.
- * By default returns descriptors for name, type and number-of-children only plus whatever
- * is returned from internalGetPropertyDescriptors().
- *
- * @return an array containing all descriptors.
- *
- * @see #internalGetPropertyDescriptors()
- */
- public IPropertyDescriptor[] getPropertyDescriptors()
- {
- IPropertyDescriptor[] addl = internalGetPropertyDescriptors();
- if ((addl == null) || (addl.length==0))
- return getDefaultDescriptors();
- else
- {
- IPropertyDescriptor[] defaults = getDefaultDescriptors();
- IPropertyDescriptor[] all = new IPropertyDescriptor[defaults.length+addl.length];
- int allIdx=0;
- for (int idx=0; idx<defaults.length; idx++)
- all[allIdx++] = defaults[idx];
- for (int idx=0; idx<addl.length; idx++)
- all[allIdx++] = addl[idx];
- return all;
- }
- }
-
- /**
- * <i><b>Abstract</b>.<i><br>
- * Implement this to return the property descriptors for the
- * properties in the property sheet. This is beyond the Name, Type and NbrOfChildren
- * properties which already implemented and done for you.
- * <p>
- * Override if want to include more properties in the property sheet,</p>
- * <p>If you override this for readonly properties, you must also override:</p>
- * <ul>
- * <li>{@link #getPropertyValue(Object)}
- * </ul>
- * <p>If you override this for editable properties, you must also override:</p>
- * <ul>
- * <li>{@link #isPropertySet(Object)}
- * <li>{@link #resetPropertyValue(Object)}
- * <li>{@link #setPropertyValue(Object,Object)}
- * </ul>
- *
- * @return an array containing all descriptors to be added to the default set of descriptors, or null
- * if no additional properties desired.
- * @see #createSimplePropertyDescriptor(String,ResourceBundle,String)
- */
- protected abstract IPropertyDescriptor[] internalGetPropertyDescriptors();
-
-
- /**
- * <i>Callable by subclasses. Do not override.</i><br>
- * Returns the list of property descriptors that are unique for this
- * particular adapter - that is the difference between the default
- * property descriptors and the total list of property descriptors.
- * <p>
- * If internalGetPropertyDescriptors() returns non-null, then returns that,
- * else computes the difference.
- * <p>
- * This is called by the table views like {@link org.eclipse.rse.ui.view.SystemTableView}.
- */
- public IPropertyDescriptor[] getUniquePropertyDescriptors()
- {
- //optimization by phil in 5.1.2:
- IPropertyDescriptor[] internalDescriptors = internalGetPropertyDescriptors();
- if (internalDescriptors != null)
- return internalDescriptors;
-
- IPropertyDescriptor[] allDescriptors = getPropertyDescriptors();
- IPropertyDescriptor[] commonDescriptors = getDefaultDescriptors();
-
- int totalSize = allDescriptors.length;
- int commonSize = commonDescriptors.length;
- int uniqueSize = totalSize - commonSize;
-
- int uniqueIndex = 0;
-
- IPropertyDescriptor[] uniqueDescriptors = new IPropertyDescriptor[uniqueSize];
- for (int i = 0; i < totalSize; i++)
- {
- IPropertyDescriptor descriptor = allDescriptors[i];
-
- boolean isUnique = true;
- for (int j = 0; j < commonSize; j++)
- {
- IPropertyDescriptor commonDescriptor = commonDescriptors[j];
- if (descriptor == commonDescriptor)
- {
- isUnique = false;
- }
- }
-
- if (isUnique && uniqueSize > uniqueIndex)
- {
- uniqueDescriptors[uniqueIndex] = descriptor;
- uniqueIndex++;
- }
- }
-
- return uniqueDescriptors;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Similar to getPropertyValue(Object key) but takes an argument
- * for determining whether to return a raw value or formatted value.
- * <b>
- * By default, simply calls getPropertyValue(key).
- * <p>
- * This is called by the table views in order to get values that can be sorted when the
- * user clicks on the column heading. To support this for a numeric property say, return
- * a Long/Integer object if false, versus returning string.
- *
- * @param key the name or key of the property as named by its property descriptor
- * @param formatted indication of whether to return the value in formatted or raw form
- * @return the current value of the given property
- */
- public Object getPropertyValue(Object key, boolean formatted)
- {
- return getPropertyValue(key);
- }
-
- /**
- * <i>Implemented. Do not override typically. See {@link #internalGetPropertyValue(Object)}.</i><br>
- * Returns the current value for the named property.<br>
- * By default handles ISystemPropertyConstants.P_TEXT, P_TYPE and P_NBRCHILDREN only, then defers to {@link #internalGetPropertyValue(Object)} for
- * subclasses.
- * <br><b>Note</b>: you will need to reference <code>propertySourceInput</code>, which is the currently selected object. Just case it to what you expect the selected object's type to be.
- *
- * @param key the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object getPropertyValue(Object key)
- {
- String name = (String)key;
- if (name.equals(P_TEXT))
- //return getText(propertySourceInput);
- return getName(propertySourceInput);
- else if (name.equals(P_TYPE))
- return getType(propertySourceInput);
- else if (name.equals(P_NBRCHILDREN))
- {
- ISystemTree tree = getSystemTree();
- if (tree != null)
- return Integer.toString(tree.getChildCount(propertySourceInput));
- else
- {
- if ((viewer != null) && (viewer instanceof TreeViewer))
- return Integer.toString(getChildCount((TreeViewer)viewer, propertySourceInput));
- else
- return "0";
- }
- }
- else
- return internalGetPropertyValue(key);
- }
- /**
- * <i><b>Abstract</b>.<i><br>
- * Implement this to return the property descriptors for the
- * properties in the property sheet. This is beyond the Name, Type and NbrOfChildren
- * properties which already implemented and done for you.
- *
- * @param key the name of the property as named by its property descriptor
- * @return the current value of the property or null if not a known property.
- */
- protected abstract Object internalGetPropertyValue(Object key);
-
-
- /**
- * Return the number of immediate children in the tree, for the given tree node
- */
- private int getChildCount(TreeViewer viewer, Object element)
- {
- if (viewer.getControl().isDisposed())
- return 0;
- if (viewer.getExpandedState(element) == false)
- return 0;
-
- Widget w = findItemInTree(viewer, element);
- if (w != null)
- {
- if (w instanceof TreeItem)
- return ((TreeItem)w).getItemCount();
- else if (w instanceof Tree)
- return ((Tree)w).getItemCount();
- }
- return 0;
- }
-
- private Widget findItemInTree(TreeViewer tree, Object element)
- {
- Item[] items = getChildren(tree.getControl());
- if (items != null)
- {
- for (int i= 0; i < items.length; i++)
- {
- Widget o = internalFindItem(tree.getTree(), items[i], element);
- if (o != null)
- return o;
- }
- }
- return null;
- }
-
- private Widget internalFindItem(Tree tree, Item parent, Object element)
- {
- // compare with node
- Object data= parent.getData();
- if (data != null)
- {
- if (data.equals(element))
- return parent;
- }
- // recurse over children
- Item[] items= getChildren(parent);
- for (int i= 0; i < items.length; i++)
- {
- Item item= items[i];
- Widget o = internalFindItem(tree, item, element);
- if (o != null)
- return o;
- }
- return null;
- }
- private Item[] getChildren(Widget o)
- {
- if (o instanceof TreeItem)
- return ((TreeItem) o).getItems();
- if (o instanceof Tree)
- return ((Tree) o).getItems();
- return null;
- }
-
-
- /**
- * <i><b>Overridable</b> by subclasses. Must be iff editable properties are supported.</i><br>
- * Returns whether the property value has changed from the default.
- * Only applicable for editable properties.
- * <br>RETURNS FALSE BY DEFAULT.
- * @return <code>true</code> if the value of the specified property has changed
- * from its original default value; <code>false</code> otherwise.
- */
- public boolean isPropertySet(Object key)
- {
- return false;
- }
- /**
- * <i><b>Overridable</b> by subclasses. Must be iff editable properties are supported.</i><br>
- * Resets the specified property's value to its default value.
- * Called on editable property when user presses reset button in property sheet viewer.
- * DOES NOTHING BY DEFAULT.
- *
- * @param key the key identifying property to reset
- */
- public void resetPropertyValue(Object key)
- {
- }
- /**
- * <i><b>Overridable</b> by subclasses. Must be iff editable properties are supported.</i><br>
- * Sets the named property to the given value.
- * Called after an editable property is changed by the user.
- *
- * DOES NOTHING BY DEFAULT.
- *
- * @param key the key identifying property to reset
- * @param value the new value for the property
- */
- public void setPropertyValue(Object key, Object value)
- {
- }
-
- /**
- * <i>Called from adapter factories. Do not override.</i><br>
- * Set input object for property source queries. This <b>must</b> be called by your
- * XXXAdaptorFactory before returning this adapter object.
- */
- public void setPropertySourceInput(Object propertySourceInput)
- {
- this.propertySourceInput = propertySourceInput;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * User has double clicked on an object. If you want to do something special,
- * do it and return true. Otherwise return false to have the viewer do the default behaviour.
- */
- public boolean handleDoubleClick(Object element)
- {
- return false;
- }
-
- // ------------------------------------------
- // METHODS TO SUPPORT GLOBAL DELETE ACTION...
- // ------------------------------------------
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return true if we should show the delete action in the popup for the given element.
- * If true, then canDelete will be called to decide whether to enable delete or not.
- * <p>By default, returns true.
- * @see #canDelete(Object)
- * @see #doDelete(Shell,Object)
- */
- public boolean showDelete(Object element)
- {
- return true;
- }
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- * <p>
- * By default, returns false. Override if your object is deletable.
- * @see #showDelete(Object)
- * @see #doDelete(Shell,Object)
- */
- public boolean canDelete(Object element)
- {
- return false;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Perform the delete action. By default does nothing. Override if your object is deletable.
- * Return true if this was successful. Return false if it failed and you issued a msg.
- * Throw an exception if it failed and you want to use the generic msg.
- * @see #showDelete(Object)
- * @see #canDelete(Object)
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- return doDelete(shell, element);
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Perform the delete action. By default just calls the doDelete method for each item in the resourceSet.
- * Override if you wish to perform some sort of optimization for the batch delete.
- * Return true if this was successful. Return false if ANY delete op failed and a msg was issued.
- * Throw an exception if ANY failed and you want to use the generic msg.
- */
- public boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor) throws Exception
- {
- boolean ok = true;
- for (int i = 0; i < resourceSet.size(); i++)
- {
- ok = ok && doDelete(shell, resourceSet.get(i), monitor);
- }
- return ok;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Perform the delete action. By default does nothing. Override if your object is deletable.
- * Return true if this was successful. Return false if it failed and you issued a msg.
- * Throw an exception if it failed and you want to use the generic msg.
- * @see #showDelete(Object)
- * @see #canDelete(Object)
- * @deprecated use the one with the monitor
- */
- public boolean doDelete(Shell shell, Object element) throws Exception
- {
- return false;
- }
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON RENAME ACTION...
- // ------------------------------------------
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return true if we should show the rename action in the popup for the given element.
- * If true, then canRename will be called to decide whether to enable rename or not.
- * <p>By default, returns true.
- * @return true if we should show the rename action in the popup for the given element.
- * @see #canRename(Object)
- * @see #doRename(Shell,Object,String)
- */
- public boolean showRename(Object element)
- {
- return true;
- }
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- * By default, returns false. Override if your object is renamable.
- * @return true if this object is renamable by the user
- * @see #showRename(Object)
- * @see #doRename(Shell,Object,String)
- * @see #getNameValidator(Object)
- * @see #getCanonicalNewName(Object,String)
- * @see #namesAreEqual(Object,String)
- */
- public boolean canRename(Object element)
- {
- return false;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Perform the rename action. By default does nothing. Override if your object is renamable.
- * Return true if this was successful. Return false if it failed and you issued a msg.
- * Throw an exception if it failed and you want to use the generic msg.
- * @return true if the rename was successful
- * @see #showRename(Object)
- * @see #canRename(Object)
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- //org.eclipse.rse.core.ui.SystemMessage.displayErrorMessage("INSIDE DORENAME");
- return false;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is iff canRename is.</i><br>
- * Return a validator for verifying the new name is correct.
- * If you return null, no error checking is done on the new name in the common rename dialog!!
- * <p>
- * Used in the common rename dialogs, and only if you return true to {@link #canRename(Object)}.
- * <p>
- * Suggest you use at least UniqueStringValidator or a subclass to ensure
- * new name is at least unique.
- * @see #canRename(Object)
- */
- public ISystemValidator getNameValidator(Object element)
- {
- return null;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is iff canRename is.</i><br>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * For example, two connections or filter pools can have the same name if they are
- * in different profiles. Two iSeries QSYS objects can have the same name if their object types
- * are different.
- * <p>
- * Used in the common rename dialogs, and only if you return true to {@link #canRename(Object)}.
- * <p>
- * This method returns a name that can be used for uniqueness checking because it is qualified
- * sufficiently to make it unique.
- * <p>
- * By default, this simply returns the given name. It is overridden by child classes when appropriate.
- * @see #canRename(Object)
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- // this is all for defect 42145. Phil
- return newName;
- }
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Compare the name of the given element to the given new name to decide if they are equal.
- * Allows adapters to consider case and quotes as appropriate.
- * <p>
- * Used in the common rename dialogs, and only if you return true to {@link #canRename(Object)}.
- * <p>
- * By default does an equalsIgnoreCase comparison
- * @see #canRename(Object)
- */
- public boolean namesAreEqual(Object element, String newName)
- {
- return getName(element).equalsIgnoreCase(newName);
- }
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON REFRESH ACTION...
- // ------------------------------------------
- /**
- * <i><b>Overridable</b> by subclasses, and usually is.</i><br>
- * Return true if we should show the refresh action in the popup for the given element.
- * Note the actual work to do the refresh is handled for you.
- * <p>
- * Default is true.
- */
- public boolean showRefresh(Object element)
- {
- return true;
- }
-
- // ------------------------------------------------------------
- // METHODS TO SUPPORT COMMON OPEN-IN-NEW-PERSPECTIVE ACTIONS...
- // ------------------------------------------------------------
- /**
- * <i><b>Overridable</b> by subclasses, and usually is NOT.</i><br>
- * Return true if we should show the <b>Go Into;</b> and <b>Open In New Window</b>
- * and <b>Go To</b> actions in the popup for the given element.
- * <p>
- * Only applicable for non-remote resources. Remote always show <b>Go To</b> only.
- */
- public boolean showOpenViewActions(Object element)
- {
- return true;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is NOT.</i><br>
- * Return true if we should show the generic show in table action in the popup for the given element.
- */
- public boolean showGenericShowInTableAction(Object element)
- {
- return true;
- }
-
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON DRAG AND DROP FUNCTION...
- // ------------------------------------------
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Return true if this object can be copied to another location. By default,
- * we return false. Extenders may decide whether or not
- * certain objects can be dragged with this method.
- * @see #doDrag(Object,boolean,IProgressMonitor)
- * @see #canDrop(Object)
- * @see #doDrop(Object,Object,boolean,boolean,IProgressMonitor)
- * @see #validateDrop(Object,Object,boolean)
- */
- public boolean canDrag(Object element)
- {
- return false;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Return true if this object can be copied to another location. By default,
- * we return false. Extenders may decide whether or not
- * certain objects can be dragged with this method.
- * Return true if these objects can be copied to another location via drag and drop, or clipboard copy.
- */
- public boolean canDrag(SystemRemoteResourceSet elements)
- {
- return false;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Perform the drag on the given object. By default this does nothing
- * and returns nothing. Extenders supporting DnD are expected to implement
- * this method to perform a copy to a temporary object, the return value.
- * @see #canDrag(Object)
- * @see #canDrop(Object)
- * @see #doDrop(Object,Object,boolean,boolean,IProgressMonitor)
- * @see #validateDrop(Object,Object,boolean)
- */
- public Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor)
- {
- return null;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Return true if another object can be copied into this object. By default
- * we return false. Extenders may decide whether or not certain objects can
- * accept other objects with this method.
- * @see #canDrag(Object)
- * @see #doDrag(Object,boolean,IProgressMonitor)
- * @see #doDrop(Object,Object,boolean,boolean,IProgressMonitor)
- * @see #validateDrop(Object,Object,boolean)
- */
- public boolean canDrop(Object element)
- {
- return false;
-
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Perform the drag on the given objects. This default implementation simply iterates through the
- * set. For optimal performance, this should be overridden.
- *
- * @param set the set of objects to copy
- * @param sameSystemType indication of whether the source and target reside on the same type of system
- * @param monitor the progress monitor
- * @return a temporary workspace copies of the object that was copied
- *
- */
- public ISystemResourceSet doDrag(SystemRemoteResourceSet set, IProgressMonitor monitor)
- {
- SystemWorkspaceResourceSet results = new SystemWorkspaceResourceSet();
- List resources = set.getResourceSet();
- for (int i = 0; i < resources.size(); i++)
- {
- results.addResource(doDrag(resources.get(i), true, monitor));
- }
- return results;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Perform drop from the "fromSet" of objects to the "to" object
- * @param fromSet the source objects for the drop
- * @param to the target object for the drop
- * @param sameSystemType indication of whether the source and target reside of the same type of system
- * @param sameSystem indication of whether the source and target are on the same system
- * @param srcType the type of objects to be dropped
- * @param monitor the progress monitor
- *
- * @return the set of new objects created from the drop
- *
- */
- public ISystemResourceSet doDrop(ISystemResourceSet fromSet, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor)
- {
- SystemRemoteResourceSet results = new SystemRemoteResourceSet(getSubSystem(to), this);
-
- List resources = fromSet.getResourceSet();
- for (int i = 0; i < resources.size(); i++)
- {
- results.addResource(doDrop(resources.get(i), to, sameSystemType, sameSystem, srcType, monitor));
- }
-
- return results;
- }
-
- /**
- * Sets filter context for querying. Override to provide specialized
- * behaviour.
- */
- public void setFilterString(String filterString)
- {
- this.filterString = filterString;
- }
-
- /**
- * Gets filter context for querying. Override to provide specialized
- * behaviour.
- */
- public String getFilterString()
- {
- return filterString;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Perform drop from the "from" object to the "to" object. By default this does
- * nothing and we return false. Extenders supporting DnD are expected to implement
- * this method to perform a "paste" into an object.
- *
- * @return the new object that was copied
- *
- * @see #canDrag(Object)
- * @see #doDrag(Object,boolean,IProgressMonitor)
- * @see #canDrop(Object)
- * @see #validateDrop(Object,Object,boolean)
- */
- public Object doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor)
- {
- // for backward compatability
- return doDrop(from, to, sameSystemType, sameSystem, monitor);
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br>
- * Perform drop from the "from" object to the "to" object. By default this does
- * nothing and we return false. Extenders supporting DnD are expected to implement
- * this method to perform a "paste" into an object.
- *
- * @return the new object that was copied
- *
- * @see #canDrag(Object)
- * @see #doDrag(Object,boolean,IProgressMonitor)
- * @see #canDrop(Object)
- * @see #validateDrop(Object,Object,boolean)
- *
- * @deprecated use doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor) instead
- */
- public Object doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, IProgressMonitor monitor)
- {
- return null;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and usually is iff drag and drop supported..</i><br>
- * Return true if it is valid for the src object to be dropped in the target. We return false by default.
- * @param src the object to drop
- * @param target the object which src is dropped in
- * @param sameSystem whether this is the same system or not
- * @return whether this is a valid operation
- *
- * @see #canDrag(Object)
- * @see #doDrag(Object,boolean,IProgressMonitor)
- * @see #canDrop(Object)
- * @see #doDrop(Object,Object,boolean,boolean,IProgressMonitor)
- */
- public boolean validateDrop(Object src, Object target, boolean sameSystem)
- {
- return false;
- }
-
- public boolean validateDrop(ISystemResourceSet set, Object target, boolean sameSystem)
- {
- boolean valid = true;
- List resources = set.getResourceSet();
- for (int i = 0; i < resources.size() && valid; i++)
- {
- valid = validateDrop(resources.get(i), target, sameSystem);
- }
- return valid;
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- if (this instanceof ISystemRemoteElementAdapter)
- return ((ISystemRemoteElementAdapter)this).getAbsoluteName(element);
- else
- return getName(element);
- }
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return what to save to disk to identify this element when it is the input object to a secondary
- * Remote Systems Explorer perspective. Defaults to getMementoHandle(element).
- */
- public String getInputMementoHandle(Object element)
- {
- return getMementoHandle(element);
- }
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- if (this instanceof ISystemRemoteElementAdapter)
- return ISystemMementoConstants.MEMENTO_KEY_REMOTE;
- else
- return getType(element);
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted
- * messages. In these cases return false from this method. The default is true
- */
- public boolean saveExpansionState(Object element)
- {
- return true;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Return true if this object is a "prompting" object that prompts the user when expanded.
- * For such objects, we do not try to save and restore their expansion state on F5 or between
- * sessions.
- * <p>
- * Default is false unless element implements ISystemPromptable object. Override as appropriate.
- */
- public boolean isPromptable(Object element)
- {
- return (element instanceof ISystemPromptableObject);
- }
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * Selection has changed in the Remote Systems view. Empty by default, but override if you need
- * to track selection changed. For example, this is used to drive table views that respond to
- * selection.
- * @param element - first selected object
- */
- public void selectionChanged(Object element) // d40615
- {
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, typically if additional properties are supported.</i><br>
- * From <samp>IActionFilter</samp> so the popupMenus extension point can use &lt;filter&gt;, &lt;enablement&gt;
- * or &lt;visibility&gt;. The support is for the following:
- * <ol>
- * <li>name="value". The given value must match getName(target) exactly, or if ends with asterisk must match the beginning.
- * <li>name="type". The given value must match getType(target) exactly. Be careful, as this is usually translated.
- * <li>name="hasChildren". If the given value is "true", returns true if hasChildren(target) returns true. If given "false",
- * returns true if the hasChildren returns false.
- * <li>name="connection". If the given value is "true", returns true if the subsystem is connected. If given "false",
- * returns true if the subsystem is not connected.
- * <li>name="offline". If the given value is "true", returns true if the subsystem is offline. If given "false",
- * returns true if the subsystem is offline.
- * <li>name="systemType". The given value is a system type, and this returns true if this object's connection is of that
- * type. You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * <li>name="subsystemFactoryId". The given value is a subsystem factory Id, and this returns true if this object's
- * subsystem is from that subsystem factory. For connections, returns false.
- * You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * <li>name="subsystemFactoryCategory". The given value is a subsystem category, and this returns true if this object's
- * subsystem is from a subsystem factory of that category. For connections, returns false.
- * You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * </ol>
- * <p>
- * If desired, override, and call super(), to support additional filter criteria for &lt;filter&gt;, &lt;enablement&gt; and &lt;visibility&gt;.
- *
- * @see org.eclipse.ui.IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value)
- {
- //System.out.println("Inside testAttribute: name = " + name + ", value = " + value);
- if (name.equalsIgnoreCase("name"))
- {
- if (value.endsWith("*"))
- {
- // we have a wild card test, and * is the last character in the value
- if (getName(target).startsWith(value.substring(0, value.length() - 1)))
- return true;
- }
- else
- return value.equals(getName(target));
- }
- else if (name.equalsIgnoreCase("type"))
- return value.equals(getType(target));
- else if (name.equalsIgnoreCase("hasChildren"))
- {
- return hasChildren(target) ? value.equals("true") : value.equals("false");
- }
- else if (name.equalsIgnoreCase("connected"))
- {
- ISubSystem ss = getSubSystem(target);
- if (ss != null)
- return ss.isConnected() ? value.equals("true") : value.equals("false");
- else
- return false;
- }
- else if (name.equalsIgnoreCase("offline"))
- {
- ISubSystem ss = getSubSystem(target);
- if (ss != null)
- return ss.isOffline() ? value.equals("true") : value.equals("false");
- else
- return false;
- }
- else if (name.equalsIgnoreCase("systemType"))
- {
- ISubSystem ss = getSubSystem(target);
- String[] values = tokenize(value);
- if (ss == null)
- {
- if (!(target instanceof IHost))
- return false;
- String connSysType = ((IHost)target).getSystemType();
- for (int idx=0; idx<values.length; idx++)
- {
- if (connSysType.equals(values[idx]))
- return true;
- }
- return false;
- }
- for (int idx=0; idx<values.length; idx++)
- {
- if (ss.getHost().getSystemType().equals(values[idx]))
- return true;
- }
- return false;
- }
- else if (name.equalsIgnoreCase("subsystemFactoryId"))
- {
- ISubSystem ss = getSubSystem(target);
- //System.out.println("ss null? " + (ss == null));
- if (ss == null)
- return false;
- String[] values = tokenize(value);
- //System.out.println("Nbr of values: " + (values.length));
- //System.out.println("Comparing against: " + (ss.getParentSubSystemConfiguration().getId()));
- boolean ok = false;
- for (int idx=0; !ok && (idx<values.length); idx++)
- {
- if (ss.getSubSystemConfiguration().getId().equals(values[idx]))
- ok = true;
- }
- //System.out.println("Returning: " + ok);
- return ok;
- }
- else if (name.equalsIgnoreCase("subsystemFactoryCategory"))
- {
- ISubSystem ss = getSubSystem(target);
- if (ss == null)
- return false;
- String[] values = tokenize(value);
- for (int idx=0; idx<values.length; idx++)
- {
- if (ss.getSubSystemConfiguration().getCategory().equals(values[idx]))
- return true;
- }
- return false;
- }
- return false;
- }
-
- /**
- * Break given comma-delimited string into tokens
- */
- private String[] tokenize(String input)
- {
- StringTokenizer tokens = new StringTokenizer(input,";");
- Vector v = new Vector();
- while (tokens.hasMoreTokens())
- v.addElement(tokens.nextToken());
- String[] stringArray = new String[v.size()];
- for (int idx=0; idx<v.size(); idx++)
- stringArray[idx] = (String)v.elementAt(idx);
- return stringArray;
- }
-
- // --------------------------------------
- // ISystemRemoteElementAdapter methods...
- // We include these here so that if a BP
- // creates a class that extends this one
- // and implements the remote resource
- // adapter interface, these methods will
- // be already created, reducing work.
- // These are low-usage methods.
- // --------------------------------------
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * From {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubSubType(Object)}.
- * Pre-supplied for convenience for subclasses that want to implement this interface for
- * remote object adapters.
- * <p>
- * Returns null. Override if you want to supply a sub-sub-type for filtering in the popupMenus extension point.
- */
- public String getRemoteSubSubType(Object element)
- {
- return null; // Extremely fine grained. We don't use it.
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
- * From {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubSubType(Object)}.
- * Pre-supplied for convenience for subclasses that want to implement this interface for
- * remote object adapters.
- * <p>
- * Returns null. Override if the remote resource is compilable.
- */
- public String getRemoteSourceType(Object element)
- {
- return null;
- }
- /**
- * <i><b>Overridable</b> by subclasses, and must be for editable objects.</i><br>
- * Return the remote edit wrapper for this object.
- * @param object the object to edit
- * @return the editor wrapper for this object
- */
- public ISystemEditableRemoteObject getEditableRemoteObject(Object object)
- {
- return null;
- }
-
- /**
- * <i><b>Overridable</b> by subclasses, and must be for editable objects.</i><br>
- * Indicates whether the specified object can be edited or not.
- * @param object the object to edit
- * @return true if the object can be edited. Returns false by default.
- */
- public boolean canEdit(Object object)
- {
- return false;
- }
-
- // ------------------
- // HELPER METHODS...
- // ------------------
- /**
- * <i>Callable by subclasses.</i><br>
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- * <p>Just a convenient shortcut to {@link org.eclipse.rse.core.SystemAdapterHelpers#getAdapter(Object, Viewer)}
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o, getViewer());
- /*
- ISystemViewElementAdapter adapter = null;
- if (!(o instanceof IAdaptable))
- adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
- else
- adapter = (ISystemViewElementAdapter)((IAdaptable)o).getAdapter(ISystemViewElementAdapter.class);
- if (adapter == null)
- RSEUIPlugin.logDebugMessage(this.getClass().getName(), "ADAPTER IS NULL FOR ELEMENT : " + o);
- else
- {
- adapter.setViewer(getViewer()); // added this in V5.0, just in case. Phil
- }
- return adapter;
- */
- }
- /**
- * <i>Callable by subclasses.</i><br>
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- * <p>Just a convenient shortcut to {@link org.eclipse.rse.core.SystemAdapterHelpers#getRemoteAdapter(Object, Viewer)}
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- // hmmm, any reason why we shouldn't do the following 2 lines of code for performance reasons?
- //if (this instanceof ISystemRemoteElementAdapter)
- // return (ISystemRemoteElementAdapter)this;
- return SystemAdapterHelpers.getRemoteAdapter(o, getViewer());
- /*
- if (!(o instanceof IAdaptable))
- adapter = (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
- adapter = (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
- if ((adapter != null) && (adapter instanceof ISystemViewElementAdapter))
- {
- ((ISystemViewElementAdapter)adapter).setViewer(getViewer()); // added this in V5.0, just in case. Phil
- }
- return adapter;
- */
- }
-
- /**
- * <i>Callable by subclasses.</i><br>
- * Do message variable substitution. Using you are replacing &1 (say) with
- * a string.
- * @param msg message containing substitution variable. Eg "Connect failed with return code &1"
- * @param subOld substitution variable. Eg "%1"
- * @param subNew substitution data. Eg "001"
- * @return message with all occurrences of variable substituted with data.
- */
- public static String sub(String msg, String subOld, String subNew)
- {
- StringBuffer temp = new StringBuffer();
- int lastHit = 0;
- int newHit = 0;
- for (newHit = msg.indexOf(subOld,lastHit); newHit != -1;
- lastHit = newHit, newHit = msg.indexOf(subOld,lastHit))
- {
- if (newHit >= 0)
- temp.append(msg.substring(lastHit,newHit));
- temp.append(subNew);
- newHit += subOld.length();
- }
- if (lastHit >= 0)
- temp.append(msg.substring(lastHit));
- return temp.toString();
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return the current viewer as an ISystemTree if the viewer is set and
- * it implements this interface (SystemView does). May be null so test it.
- */
- protected ISystemTree getSystemTree()
- {
- Viewer v = getViewer();
- if ((v != null) && (v instanceof ISystemTree))
- return (ISystemTree)v;
- else
- return null;
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "Yes" translated
- */
- public String getTranslatedYes()
- {
- if (xlatedYes == null)
- xlatedYes = SystemResources.TERM_YES;
- return xlatedYes;
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "No" translated
- */
- protected String getTranslatedNo()
- {
- if (xlatedNo == null)
- xlatedNo = SystemResources.TERM_NO;
- return xlatedNo;
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "True" translated
- */
- protected String getTranslatedTrue()
- {
- if (xlatedTrue == null)
- xlatedTrue = SystemResources.TERM_TRUE;
- return xlatedTrue;
- }
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "False" translated
- */
- protected String getTranslatedFalse()
- {
- if (xlatedFalse == null)
- xlatedFalse = SystemResources.TERM_FALSE;
- return xlatedFalse;
- }
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "Not application" translated
- */
- protected String getTranslatedNotApplicable()
- {
- if (xlatedNotApplicable == null)
- xlatedNotApplicable = SystemPropertyResources.RESID_TERM_NOTAPPLICABLE;
- return xlatedNotApplicable;
- }
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return "Not available" translated
- */
- protected String getTranslatedNotAvailable()
- {
- if (xlatedNotAvailable == null)
- xlatedNotAvailable = SystemPropertyResources.RESID_TERM_NOTAVAILABLE;
- return xlatedNotAvailable;
- }
-
- /**
- * <i>Internal use. Do not override</i><br>
- */
- protected void initMsgObjects()
- {
- nullObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),ISystemMessageObject.MSGTYPE_EMPTY, null);
- canceledObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LIST_CANCELLED),ISystemMessageObject.MSGTYPE_CANCEL, null);
- errorObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),ISystemMessageObject.MSGTYPE_ERROR, null);
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * In getChildren, return <samp>checkForNull(children, true/false)<.samp> versus your array directly.
- * This method checks for a null array which is not allowed and replaces it with an empty array.
- * If true is passed then it returns the "Empty list" message object if the array is null or empty
- */
- protected Object[] checkForNull(Object[] children, boolean returnNullMsg)
- {
- if ((children == null) || (children.length==0))
- {
- if (!returnNullMsg)
- return emptyList;
- else
- {
- if (nullObject == null)
- initMsgObjects();
- msgList[0] = nullObject;
- return msgList;
- }
- }
- else
- return children;
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()
- */
- protected Object[] getCancelledMessageObject()
- {
- if (canceledObject == null)
- initMsgObjects();
- msgList[0] = canceledObject;
- return msgList;
- }
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return the "Operation failed" msg as an object array so can be used to answer getChildren()
- */
- protected Object[] getFailedMessageObject()
- {
- if (errorObject == null)
- initMsgObjects();
- msgList[0] = errorObject;
- return msgList;
- }
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Return the "Empty list" msg as an object array so can be used to answer getChildren()
- */
- protected Object[] getEmptyMessageObject()
- {
- if (nullObject == null)
- initMsgObjects();
- msgList[0] = nullObject;
- return msgList;
- }
-
- /**
- * <i>Callable by subclasses. Do not override</i><br>
- * Get the first selected object of the given selection
- */
- protected Object getFirstSelection(IStructuredSelection selection)
- {
- return selection.getFirstElement();
- }
-
- /**
- * Return a filter string that corresponds to this object.
- * @param object the object to obtain a filter string for
- * @return the corresponding filter string if applicable
- */
- public String getFilterStringFor(Object object)
- {
- return null;
- }
-
-
- /**
- * these methods are for deferred fetch operations
- */
-
- /*
- * Return whether deferred queries are supported. By default
- * they are not supported. Subclasses must override this to
- * return true if they are to support this.
- */
- public boolean supportsDeferredQueries()
- {
- return false;
- }
-
-
- public void fetchDeferredChildren(Object o, IElementCollector collector, IProgressMonitor monitor)
- {
- SystemFetchOperation operation = null;
- monitor = Policy.monitorFor(monitor);
- String taskName = SystemViewResources.RESID_FETCHING;
- monitor.beginTask(taskName, 100);
- operation = getSystemFetchOperation(o, collector);
- try
- {
- operation.run(Policy.subMonitorFor(monitor, 100));
- }
- catch (InvocationTargetException e)
- {
- operation.setException(e);
- }
- catch (InterruptedException e)
- {
- // Cancelled by the user;
- }
- finally
- {
- monitor.done();
- }
- }
-
-
- /**
- * Returns the SystemFetchOperation to be used in performing a query. Adapters should override
- * this to provide customizations where appropriate.
- * @param o
- * @param collector
- * @return the fetch operation. By default it returns the base implementation
- */
- protected SystemFetchOperation getSystemFetchOperation(Object o, IElementCollector collector)
- {
- return new SystemFetchOperation(null, (IAdaptable)o, this, collector);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
- */
- public boolean isContainer()
- {
- return true;
- }
-
- public ISchedulingRule getRule(Object element) {
- IAdaptable location = (IAdaptable)element;
- return new SystemSchedulingRule(location);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/IRSEViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/IRSEViewPart.java
deleted file mode 100644
index e854d327b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/IRSEViewPart.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.jface.viewers.Viewer;
-
-public interface IRSEViewPart
-{
- Viewer getRSEViewer();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemDragDropAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemDragDropAdapter.java
deleted file mode 100644
index 2cee8a87b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemDragDropAdapter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.core.model.ISystemResourceSet;
-import org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.SystemRemoteResourceSet;
-
-public interface ISystemDragDropAdapter extends IRemoteObjectIdentifier
-{
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON DRAG AND DROP FUNCTION...
- // ------------------------------------------
- /**
- * Return true if this object can be copied to another location via drag and drop, or clipboard copy.
- */
- public boolean canDrag(Object element);
-
- /**
- * Return true if these objects can be copied to another location via drag and drop, or clipboard copy.
- */
- public boolean canDrag(SystemRemoteResourceSet elements);
-
- /**
- * Perform the drag on the given object.
- * @param element the object to copy
- * @param sameSystemType indication of whether the source and target reside on the same type of system
- * @param monitor the progress monitor
- * @return a temporary local copy of the object that was copied
- */
- public Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor);
-
-
- /**
- * Perform the drag on the given objects.
- * @param set the set of objects to copy
- * @param monitor the progress monitor
- * @return a set of temporary files of the object that was copied
- */
- public ISystemResourceSet doDrag(SystemRemoteResourceSet set, IProgressMonitor monitor);
-
- /**
- * Return true if another object can be copied into this object
- * @param element the target of a drop operation
- * @return whether this object may be dropped on
- */
- public boolean canDrop(Object element);
-
- /**
- * Perform drop from the "from" object to the "to" object
- * @param from the source object for the drop
- * @param to the target object for the drop
- * @param sameSystemType indication of whether the source and target reside of the same type of system
- * @param sameSystem indication of whether the source and target are on the same system
- * @param srcType the type of object to be dropped.
- * @param monitor the progress monitor
- * @return the new copy of the object that was dropped
- */
- public Object doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor);
-
- /**
- * Perform drop from the "fromSet" of objects to the "to" object
- * @param fromSet the source objects for the drop
- * @param to the target object for the drop
- * @param sameSystemType indication of whether the source and target reside of the same type of system
- * @param sameSystem indication of whether the source and target are on the same system
- * @param srcType the type of objects to be dropped
- * @param monitor the progress monitor
- *
- * @return the set of new objects created from the drop
- */
- public ISystemResourceSet doDrop(ISystemResourceSet fromSet, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor);
-
-
- /**
- * Return true if it is valid for the src object to be dropped in the target
- * @param src the object to drop
- * @param target the object which src is dropped in
- * @param sameSystem whether this is the same system
- * @return whether this is a valid operation
- */
- public boolean validateDrop(Object src, Object target, boolean sameSystem);
-
- /**
- * Return true if it is valid for the src objects to be dropped in the target
- * @param srcSet set of resources to drop on the target
- * @param target the object which src is dropped in
- * @param sameSystem whether this is the same system
- * @return whether this is a valid operation
- */
- public boolean validateDrop(ISystemResourceSet srcSet, Object target, boolean sameSystem);
-
- /**
- * Get the subsystem that corresponds to this object if one exists.
- */
- public ISubSystem getSubSystem(Object element);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemEditableRemoteObject.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemEditableRemoteObject.java
deleted file mode 100644
index 5365b57f6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemEditableRemoteObject.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-
-/**
- * This interface defines some common functionality required from all remote
- * resources for edit, irrespective of whether the remote system is an
- * OS/400, Windows, Linux or Unix operating system.
- */
-public interface ISystemEditableRemoteObject
-{
-
- public static final int NOT_OPEN = -1;
- public static final int OPEN_IN_SAME_PERSPECTIVE = 0;
- public static final int OPEN_IN_DIFFERENT_PERSPECTIVE = 1;
-
- /**
- * Check if user has write authority to the file.
- * @return true if user has write authority to the file, false otherwise
- */
- public boolean isReadOnly();
-
- /**
- * Indicate whether the file can be edited
- */
- public void setReadOnly(boolean isReadOnly);
-
- /**
- * Set the editor variable given an exiting editor part
- * @param editorPart the editor
- */
- public void setEditor(IEditorPart editorPart);
-
- /**
- * Download the file.
- * @param shell if the shell is null, no progress monitor will be shown
- * @return true if successful, false if cancelled
- */
- public boolean download(Shell shell) throws Exception;
-
- /**
- * Download the file.
- * @param monitor the progress monitor
- * @return true if the operation was successful. false if the user cancels.
- */
- public boolean download(IProgressMonitor monitor) throws Exception;
-
- /**
- * Saves the local file and uploads it to the host immediately, rather than, in response to a resource change
- * event.
- * @return true if the operation was successful. false if the upload fails.
- */
- public boolean doImmediateSaveAndUpload();
-
- /**
- * Get the local resource
- */
- public IFile getLocalResource();
-
- /**
- * Is the local file open in an editor
- */
- public int checkOpenInEditor() throws CoreException;
-
- /**
- * Returns the open IEditorPart for this remote object if there is one.
- */
- public IEditorPart getEditorPart();
-
- /**
- * Returns the remote object that is editable
- */
- public IAdaptable getRemoteObject();
-
-
-
- /**
- * Open in editor
- */
- public void open(Shell shell);
-
- /**
- * Open in editor
- */
- public void open(Shell shell, boolean readOnly);
-
- /**
- * Open in editor
- */
- public void open(IProgressMonitor monitor);
-
- /**
- * Open in editor
- */
- public void open(IProgressMonitor monitor, boolean readOnly);
-
- /**
- * Set local resource properties
- */
- public void setLocalResourceProperties() throws Exception;
-
- /**
- * Register as listener for various events
- */
- public void addAsListener();
-
- /**
- * Open the editor
- */
- public void openEditor() throws PartInitException;
-
- /**
- * Update the editor dirty indicator
- */
- public void updateDirtyIndicator();
-
- /**
- * Check if the file is dirty
- */
- public boolean isDirty();
-
-
- /**
- * Return the absolute path on the remote system.
- */
- public String getAbsolutePath();
-
- /**
- * Return the subsystem for the edited object.
- */
- public ISubSystem getSubSystem();
-
- /**
- * Returns whether the edited object exists.
- */
- public boolean exists();
-
- /**
- * Returns whether the underlying resource needs to be updated from the host
- */
- public boolean isStale();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemLongRunningRequestListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemLongRunningRequestListener.java
deleted file mode 100644
index 0a082e930..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemLongRunningRequestListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-/**
- * This interface allows listeners to be kept informed when a long
- * running request starts and stops.
- */
-public interface ISystemLongRunningRequestListener
-{
-
- /**
- * A long running request is starting
- */
- public void startingLongRunningRequest(SystemLongRunningRequestEvent event);
- /**
- * A long running request is finishing
- */
- public void endingLongRunningRequest(SystemLongRunningRequestEvent event);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemMementoConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemMementoConstants.java
deleted file mode 100644
index 701b9c989..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemMementoConstants.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-public interface ISystemMementoConstants
-{
-
- /**
- * Memento ID for profiles
- */
- public static final String MEMENTO_KEY_PROFILE = "Profile";
- /**
- * Memento ID for connections
- */
- public static final String MEMENTO_KEY_CONNECTION = "Conn";
- /**
- * Memento ID for subsystems
- */
- public static final String MEMENTO_KEY_SUBSYSTEM = "Subs";
- /**
- * Memento ID for filter pool references
- */
- public static final String MEMENTO_KEY_FILTERPOOLREFERENCE = "FPoolRef";
- /**
- * Memento ID for filter references
- */
- public static final String MEMENTO_KEY_FILTERREFERENCE = "FRef";
- /**
- * Memento ID for filter string references
- */
- public static final String MEMENTO_KEY_FILTERSTRINGREFERENCE = "FSRef";
- /**
- * Memento ID for remote objects
- */
- public static final String MEMENTO_KEY_REMOTE = "Remote";
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java
deleted file mode 100644
index 7d93dc5b9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemPropertyConstants.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-/**
- * Constants that are the key values used to identify properties that populate the
- * Property Sheet viewer.
- */
-public interface ISystemPropertyConstants extends IBasicPropertyConstants
-{
- public static final String P_PREFIX = org.eclipse.rse.ui.ISystemIconConstants.PREFIX;
- // GENERIC / COMMON
- public static final String P_TYPE = P_PREFIX+"type";
- public static final String P_NEWNAME = P_PREFIX+"newName";
- public static final String P_ERROR = P_PREFIX+"error";
- public static final String P_OK = P_PREFIX+"ok";
- public static final String P_FILTERSTRING = P_PREFIX+"filterString";
- public static final String P_NBRCHILDREN = P_PREFIX+"nbrChildren";
-
- // CONNECTION PROPERTIES
- public static final String P_PROFILE = P_PREFIX+"profile";
- public static final String P_SYSTEMTYPE = P_PREFIX+"systemType";
- public static final String P_HOSTNAME = P_PREFIX+"hostname";
- public static final String P_DEFAULTUSERID = P_PREFIX+"defaultuserid";
- public static final String P_DESCRIPTION = P_PREFIX+"description";
-
- // FILTER POOL PROPERTIES
- //public static final String P_IS_SHARABLE = P_PREFIX+"sharable"; // transient
-
- // FILTER PROPERTIES
- public static final String P_FILTERSTRINGS = P_PREFIX+"filterstrings";
- public static final String P_FILTERSTRINGS_COUNT = P_PREFIX+"filterstringsCount";
- public static final String P_PARENT_FILTER = P_PREFIX+"filterParent";
- public static final String P_PARENT_FILTERPOOL = P_PREFIX+"filterParentPool";
- public static final String P_RELATED_CONNECTION = P_PREFIX+"filterRelatedConnection";
- public static final String P_IS_CONNECTION_PRIVATE = P_PREFIX+"filterConnectionPrivate";
-
- // FILE PROPERTIES
- public static final String P_FILE_LASTMODIFIED = P_PREFIX+"file.lastmodified";
- public static final String P_FILE_SIZE = P_PREFIX+"file.size";
- public static final String P_FILE_PATH = P_PREFIX+"file.path";
- public static final String P_FILE_CANONICAL_PATH = P_PREFIX+"file.canonicalpath";
- public static final String P_FILE_CLASSIFICATION= P_PREFIX+"file.classification";
- public static final String P_FILE_READONLY = P_PREFIX+"file.readonly";
- public static final String P_FILE_READABLE = P_PREFIX+"file.readable";
- public static final String P_FILE_WRITABLE = P_PREFIX+"file.writable";
- public static final String P_FILE_HIDDEN = P_PREFIX+"file.hidden";
-
- // SEARCH LOCATION PROPERTIES
- public static final String P_SEARCH_LINE = P_PREFIX+"search.line";
- //public static final String P_SEARCH_CHAR_END = P_PREFIX+"search.char.end";
-
- // ARCHIVE FILE PROPERTIES
- public static final String P_ARCHIVE_EXPANDEDSIZE = P_PREFIX+"archive.expandedsize";
- public static final String P_ARCHIVE_COMMENT = P_PREFIX+"archive.comment";
-
- // VIRTUAL FILE PROPERTIES
- public static final String P_VIRTUAL_COMPRESSEDSIZE = P_PREFIX+"virtual.compressedsize";
- public static final String P_VIRTUAL_COMMENT = P_PREFIX+"virtual.comment";
- public static final String P_VIRTUAL_COMPRESSIONRATIO = P_PREFIX+"virtual.compressionratio";
- public static final String P_VIRTUAL_COMPRESSIONMETHOD = P_PREFIX+"virtual.compressionmethod";
-
- // SHELL PROPERTIES
- public static final String P_SHELL_STATUS = P_PREFIX+"shell.status";
- public static final String P_SHELL_CONTEXT = P_PREFIX+"shell.context";
-
- // ERROR PROPERTIES
- public static final String P_ERROR_FILENAME = P_PREFIX+"error.filename";
- public static final String P_ERROR_LINENO = P_PREFIX+"error.lineno";
-
- // USER ACTION PROPERTIES
- public static final String P_USERACTION_DOMAIN = P_PREFIX+"action.domain";
-
- // COMPILE TYPE PROPERTIES
- public static final String P_COMPILETYPE_TYPES = P_PREFIX+"compiletypes.types";
-
- // MISCELLANEOUS PROPERTIES
- public static final String P_USERID = P_PREFIX+"userid";
- public static final String P_PASSWORD = P_PREFIX+"password";
- public static final String P_CCSID = P_PREFIX+"ccsid";
- public static final String P_VRM = P_PREFIX+"vrm";
- public static final String P_ENVLIST = P_PREFIX+"envlist"; // indexed
- public static final String P_FILTERS = P_PREFIX+"filters"; // indexed
- public static final String P_FILTER = P_PREFIX+"filter"; // scalar
- public static final String P_IS_CONNECTED = P_PREFIX+"connected"; // transient
- public static final String P_IS_ACTIVE = P_PREFIX+"active"; // for profiles
- public static final String P_HAS_CHILDREN = P_PREFIX+"hasChildren"; // see SystemElementViewerAdapter
- public static final String P_PORT = P_PREFIX+"port";
- public static final String P_ORIGIN = P_PREFIX+"origin";
- public static final String P_VENDOR = P_PREFIX+"vendor";
- public static final String P_COMMAND = P_PREFIX+"command";
- public static final String P_COMMENT = P_PREFIX+"comment";
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoteElementAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoteElementAdapter.java
deleted file mode 100644
index 1b817dda0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoteElementAdapter.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-
-/**
- * This is an interface that only remote system objects supply adapters for.
- * <p>
- * This interface is designed to allow remote property pages to be registered
- * against specific remote system objects of specific name, type or subtype.
- */
-public interface ISystemRemoteElementAdapter extends IRemoteObjectIdentifier
-{
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- */
- public String getName(Object element);
- /**
- * Return the fully qualified name of this remote object.
- * Unlike getName, this should include the full path to the name.
- * This should be enough information to uniquely identify this object within its subsystem.
- */
- public String getAbsoluteName(Object element);
- /**
- * Return fully qualified name that uniquely identifies this remote object's remote parent within its subsystem.
- * This is used when deleting a remote resource for example, all occurrences of its parent are found and refreshed in the RSE views.
- */
- public String getAbsoluteParentName(Object element);
- /**
- * Return the subsystem that is responsible for getting this remote object.
- * When used together with getAbsoluteName, allows for unique identification of this object.
- */
- public ISubSystem getSubSystem(Object element);
- /**
- * Return the subsystem factory id that owns this remote object
- * The value must not be translated, so that property pages registered via xml can subset by it.
- */
- public String getSubSystemConfigurationId(Object element);
- /**
- * Return a value for the type category property for this object
- * The value must not be translated, so that property pages registered via xml can subset by it.
- */
- public String getRemoteTypeCategory(Object element);
- /**
- * Return a value for the type property for this object
- * The value must not be translated, so that property pages registered via xml can subset by it.
- */
- public String getRemoteType(Object element);
- /**
- * Return a value for the subtype property for this object.
- * Not all object types support a subtype, so returning null is ok.
- * The value must not be translated, so that property pages registered via xml can subset by it.
- */
- public String getRemoteSubType(Object element);
- /**
- * Return a value for the sub-subtype property for this object.
- * Not all object types support a sub-subtype, so returning null is ok.
- * The value must not be translated, so that property pages registered via xml can subset by it.
- */
- public String getRemoteSubSubType(Object element);
- /**
- * Return the source type of the selected object. Typically, this only makes sense for compilable
- * source members. For non-compilable remote objects, this typically just returns null.
- */
- public String getRemoteSourceType(Object element);
- /**
- * <p>Short answer: treat this like clone(), and just copy any important instance variables</p>
- * <p>
- * Imagine the same remote resource is shown multiple times in the same tree view.... say
- * because multiple filters resolve to it, or there are two connections to the same host.
- * Typically it is a different object in memory within the tree, but it refers to the same
- * remote resource. <br>
- * Now imagine one of the references is selected by the user and renamed via the rename action. This
- * might only update the selected reference. What about the other objects which refer to the same
- * remote resource... they need to update their in-memory "name" variable too. <br>
- * That is what this method. Every reference to the same remote resource is found (they have the
- * same absolute name and come from a system with the same hostname) and this method is called
- * on those other references. This is your opportunity to copy the attributes from the new element
- * to the old element.
- * <p>
- * Some view has updated the name or properties of this remote object. As a result, the
- * remote object's contents need to be refreshed. You are given the old remote object that has
- * old data, and you are given the new remote object that has the new data. For example, on a
- * rename the old object still has the old name attribute while the new object has the new
- * new attribute. You can copy the new name into the old object. Similar for any properties
- * you allow the user to edit via the property sheet.
- * <p>
- * This is called by viewers like SystemView in response to rename and property change events.
- * <p>
- * @param oldElement the element that was found in the tree
- * @param newElement the updated element that was passed in the REFRESH_REMOTE event
- * @return true if you want the viewer that called this to refresh the children of this object,
- * such as is needed on a rename of a folder, say, if the child object cache the parent folder name
- * or an absolute file name.
- */
- public boolean refreshRemoteObject(Object oldElement, Object newElement);
-
-
- /**
- * Return the remote edit wrapper for this object.
- * @param object the object to edit
- * @return the editor wrapper for this object
- */
- public ISystemEditableRemoteObject getEditableRemoteObject(Object object);
-
- /**
- * Indicates whether the specified object can be edited or not.
- * @param object the object to edit
- * @return true if the object can be edited.
- */
- public boolean canEdit(Object object);
-
- /**
- * Return a filter string that corresponds to this object.
- * @param object the object to obtain a filter string for
- * @return the corresponding filter string if applicable
- */
- public String getFilterStringFor(Object object);
-
- /**
- * Given a remote object, returns it remote parent object. Eg, given a file, return the folder
- * it is contained in.
- */
- public Object getRemoteParent(Shell shell, Object element) throws Exception;
- /**
- * Given a remote object, return the unqualified names of the objects <i>contained</i> in that parent. This is
- * used for testing for uniqueness on a rename operation, for example. Sometimes, it is not
- * enough to just enumerate all the objects in the parent for this purpose, because duplicate
- * names are allowed if the types are different, such as on iSeries. In this case return only
- * the names which should be used to do name-uniqueness validation on a rename operation.
- */
- public String[] getRemoteParentNamesInUse(Shell shell, Object element) throws Exception;
-
- /**
- * Returns whether user defined actions should be shown for the object.
- * @param object the object.
- * @return <code>true</code> if the object supports user defined actions, <code>false</code> otherwise.
- */
- public boolean supportsUserDefinedActions(Object object);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoveElementAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoveElementAdapter.java
deleted file mode 100644
index 3d0b7d217..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemRemoveElementAdapter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-/**
- * This interface must be implemented by adapters who must remove elements from
- * their list of children (not necessarily immediate children).
- */
-public interface ISystemRemoveElementAdapter {
-
- /**
- * Remove all children from the element.
- * @param element the element.
- * @return <code>true</code> if the children have been removed, <code>false</code>
- * otherwise.
- */
- public boolean removeAllChildren(Object element);
-
- /**
- * Remove a child from the element.
- * @param element the element.
- * @param child the child to remove. Does not have to be an immediate child
- * of the element.
- * @return <code>true</code> if the child has been removed, <code>false</code>
- * otherwise.
- */
- public boolean remove(Object element, Object child);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectAllTarget.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectAllTarget.java
deleted file mode 100644
index 5071c1da1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectAllTarget.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * This interface is implemented by all viewers that wish to support
- * the global select all action. To do so, they implement this interface,
- * then instantiate SystemCommonSelectAllAction, and call setGlobalActionHandler.
- * See SystemViewPart for an example.
- */
-public interface ISystemSelectAllTarget
-{
-
-
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection);
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectRemoteObjectAPIProviderCaller.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectRemoteObjectAPIProviderCaller.java
deleted file mode 100644
index 95f972132..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemSelectRemoteObjectAPIProviderCaller.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This is the interface that callers of the SystemSelectRemoteObjectAPIProviderCaller
- * can optionally implement to be called back for events such as the expansion of a
- * promptable, transient filter.
- */
-public interface ISystemSelectRemoteObjectAPIProviderCaller
-{
-
- /**
- * Prompt the user to create a new filter as a result of the user expanding a promptable
- * transient filter.
- *
- * @return the filter created by the user or null if they cancelled the prompting
- */
- public ISystemFilter createFilterByPrompting(ISystemFilter filterPrompt, Shell shell)
- throws Exception;
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemShellProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemShellProvider.java
deleted file mode 100644
index 2f3fdef58..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemShellProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionBars;
-/**
- * Abstraction of any parent window that can supply sub-windows with a Shell object
- */
-public interface ISystemShellProvider
-{
- public Shell getShell();
- public IActionBars getActionBars();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemTree.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemTree.java
deleted file mode 100644
index 8d954942a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemTree.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.swt.widgets.Item;
-
-/**
- * To drive our GUI we find ourselves adding additional useful methods on top of the
- * JFace tree viewer in our subclasses. We capture those here in an interface so they
- * can be implemented by other viewers that wish to fully drive our UI. Typically this
- * is for interesting properties in the property sheet.
- */
-public interface ISystemTree {
-
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. Typically used to disable actions that must take place on a coordinated
- * selection.
- * @return true if the elements of the selection in the viewer all have the same parent
- */
- public boolean sameParent();
-
- /**
- * Called to select an object within the tree, and optionally expand it.
- * @param element the element in the tree to select
- * @param expand true if the element is to be expanded
- */
- public void select(Object element, boolean expand);
-
- /**
- * @param element the element in the tree to query
- * @return the number of immediate children in the tree, for the given tree node
- */
- public int getChildCount(Object element);
-
- /**
- * This is called to accurately get the parent object for the current selection
- * for this viewer.
- * The getParent() method in the adapter is unreliable since adapted objects are
- * unaware of the context which can change via filtering and view options.
- * @return the parent of the selection
- */
- public Object getSelectedParent();
-
- /**
- * This returns the element immediately before the first selected element in this tree level.
- * Often needed for enablement decisions for move up actions.
- * @return the object prior to the selection, null if there is none
- */
- public Object getPreviousElement();
-
- /**
- * This returns the element immediately after the last selected element in this tree level
- * Often needed for enablement decisions for move down actions.
- * @return the object after the selection, null if there is none
- */
- public Object getNextElement();
-
- /**
- * This is called to walk the tree back up to the roots and return the visible root
- * node for the first selected object.
- * @return the root object
- */
- public Object getRootParent();
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * @param element the element from which to begin
- * @return the array of objects in the path from leaf to root. Excluding the leaf and root.
- */
- public Object[] getElementNodes(Object element);
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Considers an element to be "selected" if a child node of the given object is currently selected.
- * @param parentElement the element to query
- * @return true if the element covers any portion of the selection
- */
- public boolean isSelectedOrChildSelected(Object parentElement);
-
- /**
- * Called when a property is updated and we need to inform the Property Sheet viewer.
- * There is no formal mechanism for this so we simulate a selection changed event as
- * this is the only event the property sheet listens for.
- */
- public void updatePropertySheet();
-
- /**
- * Returns the tree item of the first selected object. Used for setViewerItem in a resource
- * change event.
- * @return the item
- */
- public Item getViewerItem();
-
- /**
- * @return true if any of the selected items are currently expanded
- */
- public boolean areAnySelectedItemsExpanded();
-
- /**
- * @return true if any of the selected items are expandable but not yet expanded
- */
- public boolean areAnySelectedItemsExpandable();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewActionFilter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewActionFilter.java
deleted file mode 100644
index aa5570fff..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewActionFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.ui.IActionFilter;
-
-/**
- * This interface is implemented by the adapters for every object shown in the
- * Remote System Explorer. It enables complex filtering of action and popup menu
- * extensions via the <samp>&lt;filter&gt;</samp> element, and action extensions
- * via the <samp>&lt;visibility&gt;</samp> and <samp>&lt;enablement&gt;</samp>
- * elements.
- * <p>
- * The base adapter class used for all RSE objects supports the following properties
- * by default:
- * <ol>
- * <li>name="value". The given value must match getName(target) exactly, or if ends with asterisk must match the beginning.
- * <li>name="type". The given value must match getType(target) exactly. Be careful, as this is usually translated.
- * <li>name="hasChildren". If the given value is "true", returns true if hasChildren(target) returns true. If given "false",
- * returns true if the hasChildren returns false.
- * <li>name="connection". If the given value is "true", returns true if the subsystem is connected. If given "false",
- * returns true if the subsystem is not connected.
- * <li>name="offline". If the given value is "true", returns true if the subsystem is offline. If given "false",
- * returns true if the subsystem is offline.
- * <li>name="systemType". The given value is a system type, and this returns true if this object's connection is of that
- * type. You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * <li>name="subsystemFactoryId". The given value is a subsystem factory Id, and this returns true if this object's
- * subsystem is from that subsystem factory. For connections, returns false.
- * You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * <li>name="subsystemFactoryCategory". The given value is a subsystem category, and this returns true if this object's
- * subsystem is from a subsystem factory of that category. For connections, returns false.
- * You can specify multiple values by comma-separating them, and this returns if there is a match on any them.
- * </ol>
- */
-public interface ISystemViewActionFilter extends IActionFilter
-{
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewDropDestination.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewDropDestination.java
deleted file mode 100644
index 68f2a83d2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewDropDestination.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-/**
- * An adapter can elect to suppot this interface and answer
- * whether it support copy/move/drop from the source (given adapter
- * type) to the specified destination.
- * @author A.Kent Hawley
- */
-public interface ISystemViewDropDestination
-{
-
- /**
- * ask source adapter if it supports drop of its type on this target
- * @param resource (type) in question
- * @return true if copy/move/drop is supported
- */
- public boolean supportDropDestination(Object target);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java
deleted file mode 100644
index 32b50bba5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-
-
-/**
- * This is the interface for an adapter on objects in the system viewer.
- * Any input into the system viewer must register an adapter that implements this interface.
- * <p>
- * This interface supports a union of all the methods needed to support a TreeViewer
- * content provider and label provider. The {@link org.eclipse.rse.ui.view.SystemViewLabelAndContentProvider}
- * delegates to objects of this interface almost completely. It gets such an
- * object by calling:</p>
- * <pre><code>
- * isve = object.getAdapter(ISystemViewElementAdapter.class);
- * interestingInfo = isve.getXXXX(object);
- * </code></pre>
- * <p>
- * This interface also supports IPropertySource via inheritance, so we can feed the
- * PropertySheet.
- * </p>
- * <p>For remote resource objects, their adapter should also implement
- * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}
- * </p>
- * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter
- */
-public interface ISystemViewElementAdapter extends IPropertySource, ISystemDragDropAdapter, ISystemViewActionFilter
-{
- public static final IAction[] noActions = new IAction[0];
-
- /**
- * Set the shell to be used by any method that requires it.
- * This is set by the Label and Content providers that retrieve this adapter.
- */
- public void setShell(Shell shell);
-
- /**
- * Set the viewer that is driving this adapter. Used adapters that implements to access current viewer.
- * This is set by the Label and Content providers that retrieve this adapter.
- */
- public void setViewer(Viewer viewer);
-
- /**
- * Set the input object used to populate the viewer with the roots.
- * May be used by an adapter to retrieve context-sensitive information.
- * This is set by the Label and Content providers that retrieve this adapter.
- */
- public void setInput(ISystemViewInputProvider input);
-
- /**
- * Get the shell currently hosting the objects in this adapter, as last set
- * by the label or content provider that retrieved this adapter.
- */
- public Shell getShell();
- /**
- * Return the current viewer, as set via setViewer or its deduced from the
- * setInput input object if set. May be null so test it.
- */
- public Viewer getViewer();
- /**
- * Get the input object used to populate the viewer with the roots.
- * May be used by an adapter to retrieve context-sensitive information.
- */
- public ISystemViewInputProvider getInput();
-
-
- /**
- * Get the subsystem that corresponds to this object if one exists.
- *
- */
- public ISubSystem getSubSystem(Object element);
-
- /**
- * Wrapper to getPropertyValue(Object key) that takes an argument
- * for determining whether to return a raw value or formatted value.
- *
- */
- public Object getPropertyValue(Object key, boolean formatted);
-
-
- /**
- * Returns the list of property descriptors that are unique for this
- * particular adapter - that is the difference between the default
- * property descriptors and the total list of property descriptors.
- */
- public IPropertyDescriptor[] getUniquePropertyDescriptors();
-
-
- /**
- * This is your opportunity to add actions to the popup menu for the given selection.
- * <p>
- * To put your action into the given menu, use the menu's {@link org.eclipse.rse.ui.SystemMenuManager#add(String,IAction) add} method.
- * If you don't care where it goes within the popup, just pass the given <samp>menuGroup</samp> location id,
- * otherwise pass one of the GROUP_XXX values from {@link ISystemContextMenuConstants}. If you pass one that
- * identifies a pre-defined cascading menu, such as GROUP_OPENWITH, your action will magically appear in that
- * cascading menu, even if it was otherwise empty.
- * <p>
- * For the actions themselves, you will probably use one of the base action classes:
- * <ul>
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseAction SystemBaseAction}. For a simple action doesn't present any UI.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseDialogAction SystemBaseDialogAction}. For an action that presents a {@link org.eclipse.rse.ui.dialogs.SystemPromptDialog dialog}.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseDialogAction SystemBaseWizardAction}. For an action that presents a {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard wizard}.
- * <li>{@link org.eclipse.rse.ui.actions.SystemBaseSubMenuAction SystemBaseSubMenuAction}. For an action that cascades into a submenu with other actions.
- * </ul>
- *
- * @param menu the popup menu you can contribute to
- * @param selection the current selection in the calling tree or table view
- * @param parent the shell of the calling tree or table view
- * @param menuGroup the default menu group to place actions into if you don't care where they. Pass this to the SystemMenuManager {@link org.eclipse.rse.ui.SystemMenuManager#add(String,IAction) add} method.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell parent, String menuGroup);
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element);
- /**
- * Return the label for this object
- */
- public String getText(Object element);
- /**
- * Return the alternate label for this object
- */
- public String getAlternateText(Object element);
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- */
- public String getName(Object element);
- /**
- * Return a value for the type property for this object
- */
- public String getType(Object element);
- /**
- * Return the string to display in the status line when the given object is selected
- */
- public String getStatusLineText(Object element);
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element);
- /**
- * Return the children of this object
- */
- public Object[] getChildren(Object element);
-
- /**
- * Return the children of this object. This version (with monitor) is used when the
- * request happens on a modal thread. The implementation needs to take this into
- * account so that SWT thread exceptions are avoided.
- */
- public Object[] getChildren(IProgressMonitor monitor, Object element);
-
- /**
- * Return the children of this object, using the given Expand-To filter
- */
- public Object[] getChildrenUsingExpandToFilter(Object element, String expandToFilter);
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element);
- /**
- * Return true if this object is a "prompting" object that prompts the user when expanded.
- * For such objects, we do not try to save and restore their expansion state on F5 or between
- * sessions
- */
- public boolean isPromptable(Object element);
-
- /**
- * Set input object for property source queries. This is called by the
- * SystemViewAdaptorFactory before returning this adapter object.
- * Handled automatically if you start with AbstractSystemViewAdaptor.
- */
- public void setPropertySourceInput(Object propertySourceInput);
-
- /**
- * User has double clicked on an object. If you want to do something special,
- * do it and return true. Otherwise return false to have the viewer do the default behaviour.
- */
- public boolean handleDoubleClick(Object element);
-
- // ------------------------------------------
- // METHODS TO SUPPORT GLOBAL DELETE ACTION...
- // ------------------------------------------
- /**
- * Return true if we should show the delete action in the popup for the given element.
- * If true, then canDelete will be called to decide whether to enable delete or not.
- */
- public boolean showDelete(Object element);
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element);
- /**
- * Perform the delete on the given item. This is after the user has been asked to confirm deletion.
- * @deprecated use the one with the monitor
- */
- public boolean doDelete(Shell shell, Object element)
- throws Exception;
-
- /**
- * Perform the delete on the given item. This is after the user has been asked to confirm deletion.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor)
- throws Exception;
-
- /**
- * Perform the delete on the given set of items. This is after the user has been asked to confirm deletion.
- */
- public boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor)
- throws Exception;
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON RENAME ACTION...
- // ------------------------------------------
- /**
- * Return true if we should show the rename action in the popup for the given element.
- * If true, then canRename will be called to decide whether to enable rename or not.
- */
- public boolean showRename(Object element);
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- */
- public boolean canRename(Object element);
- /**
- * Perform the rename on the given item.
- */
- public boolean doRename(Shell shell, Object element, String name)
- throws Exception;
-
-
-
- /**
- * Return a validator for verifying the new name is correct.
- * If you return null, no error checking is done on the new name!!
- * Suggest you use at least UniqueStringValidator or a subclass to ensure
- * new name is at least unique.
- */
- public ISystemValidator getNameValidator(Object element);
- /**
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * For example, two connections or filter pools can have the same name if they are
- * in different profiles. Two iSeries QSYS objects can have the same name if their object types
- * are different.
- * <p>
- * This method returns a name that can be used for uniqueness checking because it is qualified
- * sufficiently to make it unique.
- */
- public String getCanonicalNewName(Object element, String newName);
- /**
- * Compare the name of the given element to the given new name to decide if they are equal.
- * Allows adapters to consider case and quotes as appropriate.
- */
- public boolean namesAreEqual(Object element, String newName);
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON REFRESH ACTION...
- // ------------------------------------------
- /**
- * Return true if we should show the refresh action in the popup for the given element.
- */
- public boolean showRefresh(Object element);
-
- // ------------------------------------------------------------
- // METHODS TO SUPPORT COMMON OPEN-IN-NEW-PERSPECTIVE ACTIONS...
- // ------------------------------------------------------------
- /**
- * Return true if we should show the refresh action in the popup for the given element.
- */
- public boolean showOpenViewActions(Object element);
-
- /**
- * Return true if we should show the generic show in table action in the popup for the given element.
- */
- public boolean showGenericShowInTableAction(Object element);
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element);
- /**
- * Return what to save to disk to identify this element when it is the input object to a secondary
- * Remote Systems Explorer perspective.
- */
- public String getInputMementoHandle(Object element);
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element);
- /**
- * Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted
- * messages. In these cases return false from this method. The default is true
- */
- public boolean saveExpansionState(Object element);
- public void selectionChanged(Object element); // d40615
-
- public void setFilterString(String filterString);
- public String getFilterString();
-
- /**
- * Return whether deferred queries are supported. By default
- * they are not supported. Subclasses must override this to
- * return true if they are to support this.
- * @return <code>true</code> if it supports deferred queries, <code>false</code> otherwise.
- */
- public boolean supportsDeferredQueries();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewInputProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewInputProvider.java
deleted file mode 100644
index e2ba9446a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewInputProvider.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Abstraction for any object that wishes to be a roots-provider for the SystemView tree viewer.
- */
-public interface ISystemViewInputProvider extends IAdaptable {
-
- /**
- * @return the children objects to consistute the root elements in the system view tree
- */
- public Object[] getSystemViewRoots();
-
- /**
- * @return true if {@link #getSystemViewRoots()} will return a non-empty list
- */
- public boolean hasSystemViewRoots();
-
- /**
- * @return true if we are listing connections or not, so we know whether we are interested in
- * connection-add events
- */
- public boolean showingConnections();
-
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * @param selectedConnection the connection undergoing expansion
- * @return the list of objects under the connection
- */
- public Object[] getConnectionChildren(IHost selectedConnection);
-
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection.
- * @param selectedConnection the connection being shown in the viewer
- * @return true if this connection has children to be shown.
- */
- public boolean hasConnectionChildren(IHost selectedConnection);
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapterType);
-
- /**
- * Set the shell in case it is needed for anything.
- * The label and content provider will call this.
- * @param shell the shell being used by the viewer using this provider
- */
- // TODO should possibly be deprecated or removed
- public void setShell(Shell shell);
-
- /**
- * @return the shell of the viewer we are currently associated with
- */
- // TODO should possibly be deprecated or removed
- public Shell getShell();
-
- /**
- * Set the viewer in case it is needed for anything.
- * The label and content provider will call this.
- * @param viewer the viewer that uses this provider
- */
- // TODO should possibly be deprecated or removed
- public void setViewer(Viewer viewer);
-
- /**
- * @return the viewer we are currently associated with
- */
- // TODO should possibly be deprecated or removed
- public Viewer getViewer();
-
- /**
- * @return true to show the action bar (ie, toolbar) above the viewer.
- * The action bar contains connection actions, predominantly.
- */
- public boolean showActionBar();
-
- /**
- * @return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typicall
- * shown in dialogs that list only remote system objects.
- */
- public boolean showButtonBar();
-
- /**
- * @return true to show right-click popup actions on objects in the tree.
- */
- public boolean showActions();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewRunnableObject.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewRunnableObject.java
deleted file mode 100644
index fdae9ddf0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewRunnableObject.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.swt.widgets.Shell;
-/**
- * This interface is for any object in the system views that want to
- * support the SystemRunAction action in their popup. It will
- * call that object's run(Shell) method when invoked
- */
-public interface ISystemViewRunnableObject
-{
-
-
- public Object[] run(Shell shell);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java
deleted file mode 100644
index f37d46ede..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java
+++ /dev/null
@@ -1,1475 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.core.subsystems.SubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.filters.SystemFilterPoolWrapperInformation;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemClearPasswordAction;
-import org.eclipse.rse.ui.actions.SystemConnectAction;
-import org.eclipse.rse.ui.actions.SystemDisconnectAction;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.filters.actions.ISystemNewFilterActionConfigurator;
-import org.eclipse.rse.ui.filters.actions.SystemChangeFilterAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterAbstractFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterCascadingNewFilterPoolReferenceAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterCopyFilterAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterCopyFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveDownFilterAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveDownFilterPoolReferenceAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveFilterAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveUpFilterAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterMoveUpFilterPoolReferenceAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterNewFilterPoolAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterRemoveFilterPoolReferenceAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterSelectFilterPoolsAction;
-import org.eclipse.rse.ui.filters.actions.SystemFilterWorkWithFilterPoolsAction;
-import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction;
-import org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.propertypages.ISystemSubSystemPropertyPageCoreForm;
-import org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage;
-import org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage;
-import org.eclipse.rse.ui.propertypages.SystemSubSystemPropertyPageCoreForm;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorPortInput;
-import org.eclipse.rse.ui.widgets.IServerLauncherForm;
-import org.eclipse.rse.ui.widgets.RemoteServerLauncherForm;
-import org.eclipse.rse.ui.wizards.SubSystemServiceWizardPage;
-import org.eclipse.rse.ui.wizards.SystemSubSystemsPropertiesWizardPage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-
-public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAdapter, ISystemNewFilterActionConfigurator
-{
- protected Hashtable imageTable = null;
-
- // actions stuff...
- private IAction[] subSystemActions = null;
- private IAction[] filterPoolActions = null;
- private IAction[] filterPoolReferenceActions = null;
- private IAction[] filterActions = null;
- public SubSystemConfigurationAdapter()
- {
- }
-
-
- /**
- * Returns any framework-supplied actions remote objects that should be contributed to the popup menu
- * for the given selection list. This does nothing if this adapter does not implement ISystemRemoteElementAdapter,
- * else it potentially adds menu items for "User Actions" and Compile", for example. It queries the subsystem
- * factory of the selected objects to determine if these actions are appropriate to add.
- *
- * <p>
- * No need to override.
- *
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell of viewer calling this. Most dialogs require a shell.
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- * @param subsystem the subsystem of the selection
- */
- public void addCommonRemoteActions(ISubSystemConfiguration factory, SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup, ISubSystem subsystem)
- {
- /** FIXME - UDAs should not be coupled to factory adapter
- SystemCompileManager mgr = factory.getCompileManager();
-
- if (factory.supportsCompileActions() && (mgr != null))
- {
- int size = selection.size();
-
- // for single selections, we try to avoid iterator, to hopefully make it a bit faster
- if (size == 1)
- {
- if (mgr.isCompilable(selection.getFirstElement()))
- { // check that selection is compilable
- mgr.addCompileActions(shell, selection, menu, menuGroup);
- }
- }
- else if (size > 1)
- {
- Iterator iter = selection.iterator();
-
- boolean allCompilable = true;
-
- // check that all selections are compilable
- while (iter.hasNext())
- {
- Object element = iter.next();
- allCompilable = mgr.isCompilable(element);
-
- if (!allCompilable)
- {
- break;
- }
- }
-
- if (allCompilable)
- {
- mgr.addCompileActions(shell, selection, menu, menuGroup);
- }
- }
- }
-
- if (factory.supportsUserDefinedActions() && factory.supportsUserDefinedActions(selection))
- {
- addUserDefinedActions(factory, shell, selection, menu, menuGroup, getActionSubSystem(factory, subsystem));
- }
- **/
- }
-
- // -----------------------------------
- // WIZARD PAGE CONTRIBUTION METHODS... (UCD defect 43194)
- // -----------------------------------
- /**
- * Optionally return one or more wizard pages to append to the New Wizard connection if
- * the user selects a system type that this subsystem factory supports.
- * <p>
- * Some details:
- * <ul>
- * <li>The wizard pages must implement ISystemNewConnectionWizardPage, so as to fit into the wizard's framework
- * <li>When the user successfully presses Finish, the createConnection method in the SystemRegistry will call
- * your {@link #createSubSystem(org.eclipse.rse.model.IHost,boolean, ISystemNewConnectionWizardPage[])} method to create the
- * your subsystem for the connection. The same pages you return here are passed back to you so you can
- * interrogate them for the user-entered data and use it when creating the default subsystem instance.
- * </ul>
- * Tip: consider extending {@link org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage} for your wizard page class.
- */
- public ISystemNewConnectionWizardPage[] getNewConnectionWizardPages(ISubSystemConfiguration factory, IWizard wizard)
- {
- if (factory instanceof IServiceSubSystemConfiguration)
- {
- SubSystemServiceWizardPage page = new SubSystemServiceWizardPage(wizard, factory);
- return new ISystemNewConnectionWizardPage[] {page};
- }
- else
- {
- List pages = getSubSystemPropertyPages(factory);
- if (pages != null && pages.size() > 0)
- {
- SystemSubSystemsPropertiesWizardPage page = new SystemSubSystemsPropertiesWizardPage(wizard, factory, pages);
- return new ISystemNewConnectionWizardPage[] {page};
- }
- }
- return new ISystemNewConnectionWizardPage[0];
- }
-
-
-
-
- /*
- * Return the form used in the subsyste property page. This default implementation returns Syste
- */
- public ISystemSubSystemPropertyPageCoreForm getSubSystemPropertyPageCoreFrom(ISubSystemConfiguration factory, ISystemMessageLine msgLine, Object caller)
- {
- return new SystemSubSystemPropertyPageCoreForm(msgLine, caller);
- }
-
- /**
- * Gets the list of property pages applicable for a subsystem associated with this factory
- * @return the list of subsystem property pages
- */
- protected List getSubSystemPropertyPages(ISubSystemConfiguration factory)
- {
- List propertyPages= new ArrayList();
- // Get reference to the plug-in registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- // Get configured property page extenders
- IConfigurationElement[] propertyPageExtensions =
- registry.getConfigurationElementsFor("org.eclipse.ui", "propertyPages"); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int i = 0; i < propertyPageExtensions.length; i++)
- {
- IConfigurationElement configurationElement = propertyPageExtensions[i];
- String objectClass = configurationElement.getAttribute("objectClass"); //$NON-NLS-1$
- String name = configurationElement.getAttribute("name"); //$NON-NLS-1$
- Class objCls = null;
- try
- {
- ClassLoader loader = getClass().getClassLoader();
- objCls = Class.forName(objectClass, false, loader);
- }
- catch (Exception e)
- {
- }
-
-
- if (objCls != null && ISubSystem.class.isAssignableFrom(objCls) && factory.isFactoryFor(objCls))
- {
- try
- {
- PropertyPage page = (PropertyPage) configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
- page.setTitle(name);
- propertyPages.add(page);
- }
- catch (Exception e)
- {
- }
- }
- }
- return propertyPages;
- }
-
- // FIXME - UDAs no longer coupled with factory in core
-// // ---------------------------------
-// // USER-DEFINED ACTIONS METHODS...
-// // ---------------------------------
-//
-// /**
-// * Get the action subsystem object for this subsystemconfiguration,
-// * and set its current subsystem to the given subsystem instance.
-// * Will ensure the user action subsystem is only ever instantiated once.
-// * <p>
-// * Called in the Work With User Actions and the User Actions cascading action.
-// * <p>
-// * Do not override this, as the implementation is complete. However,
-// * you must override createActionSubSystem.
-// *
-// * @see #supportsUserDefinedActions()
-// * @see #createActionSubSystem()
-// */
-// public SystemUDActionSubsystem getActionSubSystem(ISubSystemConfiguration factory, ISubSystem subsystem)
-// {
-// if (udas == null)
-// udas = createActionSubSystem(factory);
-// if (udas != null)
-// {
-// udas.setSubsystem(subsystem);
-// udas.setSubSystemConfiguration(factory);
-// }
-// return udas;
-// }
-//
-// /**
-// * Overridable method to instantiate the SystemUDActionSubsystem.
-// * You must override this if you return true to supportsUserActions.
-// *
-// * @see #supportsUserDefinedActions()
-// * @see #getActionSubSystem(ISubSystem)
-// */
-// protected SystemUDActionSubsystem createActionSubSystem(ISubSystemConfiguration factory)
-// {
-// return null;
-// }
-//
-// /**
-// * Populate main context menu with a "User Actions->" submenu cascade,
-// * which will only be populated when the submenu is selected.
-// * <p>
-// * This is called by the addCommonRemoteObjectsActions method, if this subsystem
-// * supports user defined actions.
-// */
-// public static void addUserDefinedActions(ISubSystemConfiguration factory, Shell shell, IStructuredSelection selection, SystemMenuManager menu, String menuGroup, SystemUDActionSubsystem userActionSubSystem)
-// {
-// SystemUDACascadeAction act = new SystemUDACascadeAction(userActionSubSystem, selection);
-// menu.add(menuGroup, act);
-// }
-
-
- // ---------------------------------
- // COMPILE ACTIONS METHODS...
- // ---------------------------------
-
- // ---------------------------------
- // USER-PREFERENCE METHODS...
- // ---------------------------------
-
-
- // ---------------------------------
- // PROXY METHODS. USED INTERNALLY...
- // ---------------------------------
-
-
- // ---------------------------------
- // FACTORY ATTRIBUTE METHODS...
- // ---------------------------------
-
-
- /**
- * Return image descriptor of this factory.
- * This comes from the xml "icon" attribute of the extension point.
- */
- public ImageDescriptor getImage(ISubSystemConfiguration factory)
- {
- // casting for now to allow for 2-phase refactoring - SubSystemConfiguration really shouldn't implement this
- return ((SubSystemConfiguration)factory).getImage();
- }
-
- /**
- * Return actual graphics Image of this factory.
- * This is the same as calling getImage().createImage() but the resulting
- * image is cached.
- */
- public Image getGraphicsImage(ISubSystemConfiguration factory)
- {
- ImageDescriptor id = getImage(factory);
- if (id != null)
- {
- Image image = null;
- if (imageTable == null)
- imageTable = new Hashtable();
- else
- image = (Image) imageTable.get(id);
- if (image == null)
- {
- image = id.createImage();
- imageTable.put(id, image);
- }
- return image;
- }
- return null;
- }
-
-
-
- /**
- * Return image to use when this susystem is connection.
- * This comes from the xml "iconlive" attribute of the extension point.
- */
- public ImageDescriptor getLiveImage(ISubSystemConfiguration factory)
- {
- // casting for now to allow for 2-phase refactoring - SubSystemConfiguration really shouldn't implement this
- return ((SubSystemConfiguration)factory).getLiveImage();
- }
-
- /**
- * Return actual graphics LiveImage of this factory.
- * This is the same as calling getLiveImage().createImage() but the resulting
- * image is cached.
- */
- public Image getGraphicsLiveImage(ISubSystemConfiguration factory)
- {
- ImageDescriptor id = getLiveImage(factory);
- if (id != null)
- {
- Image image = null;
- if (imageTable == null)
- imageTable = new Hashtable();
- else
- image = (Image) imageTable.get(id);
- if (image == null)
- {
- image = id.createImage();
- imageTable.put(id, image);
- }
- return image;
- }
- return null;
- }
-
-
- // ---------------------------------
- // PROFILE METHODS...
- // ---------------------------------
-
- // private methods...
-
-
- // ---------------------------------
- // SUBSYSTEM METHODS...
- // ---------------------------------
-
-
- /**
- * Returns a list of actions for the popup menu when user right clicks on a subsystem object from this factory.
- * By default returns a single item array with a SystemNewFilterPoolAction object and
- * calls overridable method getAdditionalSubSystemActions.
- * <p>
- * If you wish to support more actions, override getAdditionalSubSystemActions to return a Vector
- * of IAction objects.
- * @see #getSubSystemNewFilterPoolActions(ISubSystem, Shell)
- * @see #getAdditionalSubSystemActions(ISubSystem, Shell)
- * @param selectedSubSystem the currently selected subsystem
- * @param shell The Shell of the view where this action was launched from
- * @return array of IAction objects to contribute to the popup menu
- */
- public IAction[] getSubSystemActions(ISubSystemConfiguration factory, ISubSystem selectedSubSystem, Shell shell)
- {
- Vector ourChildActions = getAdditionalSubSystemActions(factory, selectedSubSystem, shell);
- // we need to start with a fresh vector each time not build up on what our child
- // class gives us, since that may be cached and hence will grow if we keep adding to i.
- Vector childActions = new Vector();
- if (ourChildActions != null)
- for (int idx = 0; idx < ourChildActions.size(); idx++)
- childActions.addElement(ourChildActions.elementAt(idx));
- if (factory.supportsFilters())
- {
- boolean showFilterPools = factory.showFilterPools();
- // if showing filter pools, we have to add a "new filter pool" action here...
- if (showFilterPools)
- {
- IAction[] newFPActions = getSubSystemNewFilterPoolActions(factory, selectedSubSystem, shell);
- if (newFPActions != null)
- {
- for (int idx = 0; idx < newFPActions.length; idx++)
- {
- // special case handling...
- // set input subsystem for new filter pool actions...
- if (newFPActions[idx] instanceof SystemFilterAbstractFilterPoolAction)
- {
- SystemFilterAbstractFilterPoolAction fpAction = (SystemFilterAbstractFilterPoolAction) newFPActions[idx];
- fpAction.setFilterPoolManagerNamePreSelection(selectedSubSystem.getSystemProfile().getName());
- fpAction.setFilterPoolManagerProvider(factory);
- }
- childActions.addElement(newFPActions[idx]);
- } // end for loop
- } // end if newFPActions != null
- } // and if showFilterPools
- // if showing filter pools, we have to add a "select filter pool and work-with filter pools" actions here...
- if (showFilterPools)
- {
- childActions.addElement(new SystemFilterSelectFilterPoolsAction(shell));
- childActions.addElement(new SystemFilterWorkWithFilterPoolsAction(shell));
- } // end if showFilterPools
- // if not showing filter pools, we have to add a "new filter" action here...
- if (!showFilterPools)
- {
- IAction[] newFilterActions = getNewFilterPoolFilterActions(factory, null, shell);
- if ((newFilterActions != null) && (newFilterActions.length > 0))
- {
- // pre-scan for legacy
- for (int idx = 0; idx < newFilterActions.length; idx++)
- {
- if (newFilterActions[idx] instanceof SystemNewFilterAction)
- ((SystemNewFilterAction) newFilterActions[idx]).setCallBackConfigurator(this, selectedSubSystem);
- else
- {
- }
- }
- /*
- if (anyLegacy)
- {
- SystemFilterPoolReferenceManager refMgr = selectedSubSystem.getSystemFilterPoolReferenceManager();
- SystemFilterPool[] refdPools = refMgr.getReferencedSystemFilterPools();
- if ( refdPools.length == 0 )
- RSEUIPlugin.logInfo("SubSystemConfigurationImpl::getSubSystemActions - getReferencedSystemFilterPools returned array of lenght zero.");
- for (int idx=0; idx<newFilterActions.length; idx++)
- {
- if (newFilterActions[idx] instanceof SystemFilterBaseNewFilterAction && refdPools.length > 0 )
- ((SystemFilterBaseNewFilterAction)newFilterActions[idx]).setAllowFilterPoolSelection(refdPools);
- } // end for loop
- }
- */
- // now add the actions
- for (int idx = 0; idx < newFilterActions.length; idx++)
- childActions.addElement(newFilterActions[idx]);
- } // end if newFilterActions != null
- } // end if !showFilterPools
- } // end if supportsFilters()
-
-// FIXME - UDAs moved out of here
-// // if user defined actions are supported, add an action to work with them...
-// if (factory.supportsUserDefinedActions())
-// childActions.addElement(new SystemWorkWithUDAsAction(shell, (ISubSystem)null));
-// // if named file types are supported, add an action to work with them...
-// if (factory.supportsFileTypes())
-// childActions.addElement(new SystemWorkWithFileTypesAction(shell, null));
-// // if compile actions are supported, add an action to work with them...
-// if (factory.supportsCompileActions())
-// childActions.addElement(new SystemWorkWithCompileCommandsAction(shell, false));
-
-
-
- if (factory.supportsSubSystemConnect())
- {
- // MJB: RE defect 40854
- addConnectOrDisconnectAction(childActions, shell, selectedSubSystem);
- }
-
- if (subSystemActions == null)
- {
- // premise: none of these actions' constructor need the current selection as input
- int nbrBaseActions = 0;
- if (factory.supportsSubSystemConnect())
- {
- //nbrBaseActions += 2; // 4; MJB: RE defect 50854
- if (selectedSubSystem.getConnectorService().supportsUserId())
- nbrBaseActions += 1;
- }
- //if (supportsFilters())
- // nbrBaseActions += 2;
- subSystemActions = new IAction[nbrBaseActions];
- int ssIdx = 0;
- if (factory.supportsSubSystemConnect())
- {
- // MJB: RE defect 40854
- //subSystemActions[ssIdx++] = new SystemConnectAction(shell);
- //subSystemActions[ssIdx++] = new SystemDisconnectAction(shell);
-
- if (selectedSubSystem.getConnectorService().supportsUserId())
- subSystemActions[ssIdx++] = new SystemClearPasswordAction(shell);
- }
- } // end if subsystemActons == null
-
- IAction[] allActions = new IAction[childActions.size() + subSystemActions.length];
- int allIndex = 0;
- for (int idx = 0; idx < childActions.size(); idx++)
- allActions[allIndex++] = (IAction) childActions.elementAt(idx);
- for (int idx = 0; idx < subSystemActions.length; idx++)
- allActions[allIndex++] = subSystemActions[idx];
-
- return allActions;
- }
-
- private void addConnectOrDisconnectAction(Vector actions, Shell shell, ISubSystem selectedSS)
- {
- boolean connected = selectedSS.isConnected();
- if (connected)
- {
- actions.addElement(new SystemDisconnectAction(shell));
- }
- else
- {
- actions.addElement(new SystemConnectAction(shell));
- }
- }
-
- /**
- * There is a reasonable amount of processing needed to configure filter wizards. To aid
- * in performance and memory usage, we extract that processing into this method, and then
- * use a callback contract with the filter wizard to call us back to do this processing
- * only at the time the action is actually selected to be run.
- * <p>
- * The processing we do here is to specify the filter pools to prompt the user for, in the
- * second page of the New Filter wizards.
- * <p>
- * This method is from the ISystemNewFilterActionConfigurator interface
- */
- public void configureNewFilterAction(ISubSystemConfiguration factory, SystemNewFilterAction newFilterAction, Object callerData)
- {
- //System.out.println("Inside configureNewFilterAction! It worked!");
- newFilterAction.setFromRSE(true);
- boolean showFilterPools = factory.showFilterPools();
-
- // It does not make sense, when invoked from a filterPool, to ask the user
- // for the parent filter pool, or to ask the user whether the filter is connection
- // specific, as they user has explicitly chosen their pool...
- //if (!showFilterPools || (callerData instanceof SubSystem))
- if (!showFilterPools)
- {
- ISubSystem selectedSubSystem = (ISubSystem) callerData;
- // When not showing filter pools, we need to distinquish between an advanced user and a new user.
- // For a new user we simply want to ask them whether this filter is to be team sharable or private,
- // and based on that, we will place the filter in the default filter pool for the appropriate profile.
- // For an advanced user who has simply turned show filter pools back off, we want to let them choose
- // explicitly which filter pool they want to place the filter in.
- // To approximate the decision, we will define an advanced user as someone who already has a reference
- // to a filter pool other than the default pools in the active profiles.
- boolean advancedUser = false;
- ISystemFilterPoolReferenceManager refMgr = selectedSubSystem.getSystemFilterPoolReferenceManager();
- ISystemFilterPool[] refdPools = refMgr.getReferencedSystemFilterPools();
- if (refdPools.length == 0)
- SystemBasePlugin.logInfo("SubSystemConfigurationImpl::getSubSystemActions - getReferencedSystemFilterPools returned array of length zero.");
- // so there already exists references to more than one filter pool, but it might simply be a reference
- // to the default filter pool in the user's profile and another to reference to the default filter pool in
- // the team profile... let's see...
- else if (refdPools.length > 1)
- {
- for (int idx = 0; !advancedUser && (idx < refdPools.length); idx++)
- {
- if (!refdPools[idx].isDefault() && (refdPools[idx].getOwningParentName()==null))
- advancedUser = true;
- }
- }
- if (advancedUser)
- {
- newFilterAction.setAllowFilterPoolSelection(refdPools); // show all pools referenced in this subsystem, and let them choose one
- }
- else
- {
- boolean anyAdded = false;
- SystemFilterPoolWrapperInformation poolWrapperInfo = getNewFilterWizardPoolWrapperInformation();
- ISystemProfile[] activeProfiles = RSEUIPlugin.getTheSystemRegistry().getActiveSystemProfiles();
- ISystemProfile activeProfile = selectedSubSystem.getHost().getSystemProfile();
- for (int idx = 0; idx < activeProfiles.length; idx++)
- {
- ISystemFilterPool defaultPool = getDefaultSystemFilterPool(factory, activeProfiles[idx]);
-
- if (defaultPool != null)
- {
- poolWrapperInfo.addWrapper(activeProfiles[idx].getName(), defaultPool, (activeProfiles[idx] == activeProfile)); // display name, pool to wrap, whether to preselect
- anyAdded = true;
- }
- }
- if (anyAdded)
- newFilterAction.setAllowFilterPoolSelection(poolWrapperInfo);
- }
- }
- }
-
- /**
- * Given a profile, return the first (hopefully only) default pool for this
- * profile.
- */
- public ISystemFilterPool getDefaultSystemFilterPool(ISubSystemConfiguration factory, ISystemProfile profile)
- {
- ISystemFilterPool pool = null;
- ISystemFilterPoolManager mgr = factory.getFilterPoolManager(profile);
- pool = mgr.getFirstDefaultSystemFilterPool(); // RETURN FIRST
- return pool;
- }
-
- /**
- * Overridable entry for child classes to supply their own flavour of ISystemFilterPoolWrapperInformation for
- * the new filter wizards.
- */
- protected SystemFilterPoolWrapperInformation getNewFilterWizardPoolWrapperInformation()
- {
- return new SystemFilterPoolWrapperInformation(SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_LABEL, SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_TOOLTIP,
- SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_VERBAGE);
- }
- /**
- * Overridable entry for child classes to supply their own "new" action(s) for creating a
- * filter pool.
- * By default, this creates an action for creating a new filter pool and a new filter pool reference.
- * @param selectedSubSystem the currently selected subsystem
- * @param shell The Shell of the view where this action was launched from
- * @return array of IAction objects to contribute to the popup menu
- */
- protected IAction[] getSubSystemNewFilterPoolActions(ISubSystemConfiguration factory, ISubSystem selectedSubSystem, Shell shell)
- {
- IAction[] actions = new IAction[2];
- actions[0] = new SystemFilterNewFilterPoolAction(shell);
- ((ISystemAction) actions[0]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0040"); //$NON-NLS-1$
- ((SystemFilterNewFilterPoolAction) actions[0]).setDialogHelp(RSEUIPlugin.HELPPREFIX + "wnfp0000"); //$NON-NLS-1$
- actions[1] = new SystemFilterCascadingNewFilterPoolReferenceAction(shell, selectedSubSystem.getSystemFilterPoolReferenceManager());
- ((ISystemAction) actions[1]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0041"); //$NON-NLS-1$
- return actions;
- }
- /**
- * Overridable entry for child classes to contribute subsystem actions
- * beyond the default supplied actions.
- * <p>
- * By default, returns null.
- * @return Vector of IAction objects.
- * @see #getSubSystemActions(ISubSystem,Shell)
- */
- protected Vector getAdditionalSubSystemActions(ISubSystemConfiguration factory, ISubSystem selectedSubSystem, Shell shell)
- {
- return null;
- }
-
-
-
-
-
-
- /**
- * Supply the image to be used for filter pool managers, within actions.
- * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
- */
- public ImageDescriptor getSystemFilterPoolManagerImage()
- {
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
- }
- /**
- * Supply the image to be used for filter pools, within actions.
- * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
- */
- public ImageDescriptor getSystemFilterPoolImage(ISystemFilterPool filterPool)
- {
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID);
- }
- /**
- * Supply the image to be used for filters, within actions.
- * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
- */
- public ImageDescriptor getSystemFilterImage(ISystemFilter filter)
- {
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID);
- }
- /*
- * Supply the image to be used for the given filter string, within actions.
- * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
- */
- public ImageDescriptor getSystemFilterStringImage(ISystemFilterString filterString)
- {
- return getSystemFilterStringImage(filterString.getString());
- }
-
- /*
- * Supply the image to be used for the given filter string string, within actions.
- * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
- */
- public ImageDescriptor getSystemFilterStringImage(String filterStringString)
- {
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERSTRING_ID);
- }
-
-
- // ------------------------------------------------
- // HELPER METHODS TO SIMPLY EVENT FIRING...
- // ------------------------------------------------
-
-
-
- // ------------------------------------------------
- // FILTER POOL MANAGER PROVIDER CALLBACK METHODS...
- // ------------------------------------------------
-
- // ---------------------
- // FILTER POOL EVENTS...
- // ---------------------
-
- /**
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter pool object within a subsystem of this factory.
- * Only supported and used by subsystems that support filters.
- * <p>
- * YOU DO NOT NEED TO OVERRIDE THIS METHOD.
- * <p>
- * Most actions are handled in this base, except if you have your own action for
- * creating a new filter. In this case, <b>override getNewFilterAction()</b>
- * To add additional actions, override {@link #getAdditionalFilterPoolActions(ISystemFilterPool selectedPool, Shell shell)}.
- *
- * @param selectedPool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- public IAction[] getFilterPoolActions(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- Vector childActions = new Vector();
- Vector ourChildActions = getAdditionalFilterPoolActions(factory, selectedPool, shell);
- if (ourChildActions != null)
- for (int idx = 0; idx < ourChildActions.size(); idx++)
- childActions.addElement(ourChildActions.elementAt(idx));
- IAction[] newActions = getNewFilterPoolFilterActions(factory, selectedPool, shell);
- if (newActions != null)
- {
- for (int idx = 0; idx < newActions.length; idx++)
- {
- childActions.addElement(newActions[idx]);
- //if (newActions[idx] instanceof SystemNewFilterAction)
- // ((SystemNewFilterAction) newActions[idx]).setCallBackConfigurator(this, null);
- }
- }
- if (filterPoolActions == null)
- {
- int nbr = 2;
- filterPoolActions = new IAction[nbr];
- SystemFilterCopyFilterPoolAction copyAction = new SystemFilterCopyFilterPoolAction(shell);
- copyAction.setPromptString(SystemResources.RESID_COPY_TARGET_PROFILE_PROMPT);
- copyAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0060"); //$NON-NLS-1$
- copyAction.setDialogHelp(RSEUIPlugin.HELPPREFIX + "dcfp0000"); //$NON-NLS-1$
- SystemFilterMoveFilterPoolAction moveAction = new SystemFilterMoveFilterPoolAction(shell);
- moveAction.setPromptString(SystemResources.RESID_MOVE_TARGET_PROFILE_PROMPT);
- moveAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0061"); //$NON-NLS-1$
- moveAction.setDialogHelp(RSEUIPlugin.HELPPREFIX + "dmfp0000"); //$NON-NLS-1$
- filterPoolActions[0] = copyAction;
- filterPoolActions[1] = moveAction;
- }
- for (int idx = 0; idx < filterPoolActions.length; idx++)
- {
- childActions.addElement(filterPoolActions[idx]);
- }
-
- IAction[] allFilterPoolActions = new IAction[childActions.size()];
- for (int idx = 0; idx < childActions.size(); idx++)
- allFilterPoolActions[idx] = (IAction) childActions.elementAt(idx);
-
- return allFilterPoolActions;
- }
- /**
- * Overridable entry for child classes to contribute filter pool actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return Vector of IAction objects.
- * @see #getFilterPoolActions(ISystemFilterPool,Shell)
- */
- protected Vector getAdditionalFilterPoolActions(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- return null;
- }
- /**
- * Overridable method to return the actions for creating a new filter in a filter pool.
- * By default returns one action created by calling {@link #getNewFilterPoolFilterAction(ISystemFilterPool, Shell)}.
- * <p>
- * If you have multiple actions for creating new filters, override this.
- * <p>
- * If you have only a single action for creating new filters, override getNewFilterPoolFilterAction (without the 's').
- * <p>
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- protected IAction[] getNewFilterPoolFilterActions(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- IAction[] actions = new IAction[1];
- actions[0] = getNewFilterPoolFilterAction(factory, selectedPool, shell);
- return actions;
- }
- /**
- * Overridable method to return the single action for creating a new filter in a filter pool.
- * By default returns a default supplied action for this.
- * <p>
- * If you have multiple actions for creating new filters, override getNewFilterPoolFilterActions (note the 's').
- * <p>
- * If you have only a single action for creating new filters, override this.
- * <p>
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- protected IAction getNewFilterPoolFilterAction(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- SystemNewFilterAction action = new SystemNewFilterAction(shell, selectedPool);
- action.setHelp(RSEUIPlugin.HELPPREFIX + "actn0042"); //$NON-NLS-1$
- action.setDialogHelp(RSEUIPlugin.HELPPREFIX + "wnfr0000"); //$NON-NLS-1$
- return action;
- }
- /**
- * Overridable method to return the action for creating a new nested filter inside another filter.
- * By default returns getNewFilterPoolFilterAction(selectedFilter.getParentFilterPool(),shell).
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- protected IAction getNewNestedFilterAction(ISubSystemConfiguration factory, ISystemFilter selectedFilter, Shell shell)
- {
- return getNewFilterPoolFilterAction(factory, selectedFilter.getParentFilterPool(), shell);
- }
- /**
- * Overridable method to return the action for changing an existing filter.
- * By default returns new SystemChangeFilterAction, unless the filter's isSingleFilterStringOnly()
- * returns true, in which case null is returned.
- *
- * @param selectedFilter the currently selected filter
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- protected IAction getChangeFilterAction(ISubSystemConfiguration factory, ISystemFilter selectedFilter, Shell shell)
- {
- /* We don't do this here now as this is overridable. Now done in SystemChangeFilterAction.
- * Also, single filter string doesn't mean non-editable.
- *
- if (selectedFilter.isSingleFilterStringOnly())
- {
- //System.out.println("filter " + selectedFilter + " is single filter string only");
- return null;
- }*/
- SystemChangeFilterAction action = new SystemChangeFilterAction(shell);
- action.setHelp(RSEUIPlugin.HELPPREFIX + "actn0081"); //$NON-NLS-1$
- action.setDialogHelp(RSEUIPlugin.HELPPREFIX + "dufr0000"); //$NON-NLS-1$
- return action;
- }
- /**
- * In addition to a change filter action, we now also support the same functionality
- * via a Properties page for filters. When this page is activated, this method is called
- * to enable customization of the page, given the selected filter.
- * <p>
- * By default, this method will call {@link #getChangeFilterAction(ISystemFilter, Shell)} to get
- * your change filter action, and will configure the given page from the dialog created by your
- * change filter action.
- * <p>
- * If your filter uses its own Change Filter dialog, versus subclassing or configuring
- * {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to override this method
- * and specify the following information for the supplied page (via its setters):
- * <ul>
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setFilterStringEditPane(org.eclipse.rse.ui.filters.SystemFilterStringEditPane)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setFilterStringValidator(org.eclipse.rse.ui.validators.ISystemValidator)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setListLabel(String, String)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setParentPoolPromptLabel(String, String)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setNamePromptLabel(String, String)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setNewListItemText(String)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setEditable(boolean)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setSupportsMultipleStrings(boolean)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemChangeFilterPropertyPage#setDescription(String)}
- * </ul>
- */
- public void customizeChangeFilterPropertyPage(ISubSystemConfiguration factory, SystemChangeFilterPropertyPage page, ISystemFilter selectedFilter, Shell shell)
- {
- // default behaviour is a total hack! We want to preserve all the configuration done on the
- // Change dialog, so we instantiate it merely so that we can copy the configuration information...
- IAction changeAction = getChangeFilterAction(factory, selectedFilter, shell);
- if (changeAction instanceof SystemChangeFilterAction)
- {
- SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction;
- changeFilterAction.setSelection(new StructuredSelection(selectedFilter));
- org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell);
- if (dlg instanceof SystemChangeFilterDialog)
- {
- SystemChangeFilterDialog changeFilterDlg = (SystemChangeFilterDialog)dlg;
- //changeFilterAction.callConfigureFilterDialog(changeFilterDlg); createDialog calls this already!
- page.setDuplicateFilterStringErrorMessage(changeFilterDlg.getDuplicateFilterStringErrorMessage());
- page.setFilterStringEditPane(changeFilterDlg.getFilterStringEditPane(shell));
- page.setFilterStringValidator(changeFilterDlg.getFilterStringValidator());
- page.setListLabel(changeFilterDlg.getListLabel(), changeFilterDlg.getListTip());
- page.setParentPoolPromptLabel(changeFilterDlg.getParentPoolPromptLabel(), changeFilterDlg.getParentPoolPromptTip());
- page.setNamePromptLabel(changeFilterDlg.getNamePromptLabel(), changeFilterDlg.getNamePromptTip());
- page.setNewListItemText(changeFilterDlg.getNewListItemText());
-
- page.setDescription(changeFilterDlg.getTitle());
- }
- }
- if (selectedFilter.isNonChangable())
- page.setEditable(false);
- //System.out.println("Selected filter: "+selectedFilter.getName()+", isSingleFilterStringOnly: "+selectedFilter.isSetSingleFilterStringOnly());
- boolean singleFilterString = selectedFilter.isSingleFilterStringOnly() || (selectedFilter.isNonChangable() && (selectedFilter.getFilterStringCount() == 1));
- if (singleFilterString)
- page.setSupportsMultipleStrings(false);
- }
-
- /**
- * In addition to a change filter action, we now also support the same functionality
- * via a Properties page for filter strings, in the Team View. When this page is activated,
- * this method is called to enable customization of the page, given the selected filter string.
- *
- * <p>
- * By default, this method will call {@link #getChangeFilterAction(ISystemFilter, Shell)} to get
- * your change filter action, and will configure the given page from the dialog created by your
- * change filter action.
- * <p>
- * If your filter uses its own Change Filter dialog, versus subclassing or configuring
- * {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to
- * override this method and specify the following information for the supplied page (via its setters):
- * <ul>
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setFilterStringEditPane(org.eclipse.rse.ui.filters.SystemFilterStringEditPane)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setFilterStringValidator(org.eclipse.rse.ui.validators.ISystemValidator)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setEditable(boolean)}
- * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setDescription(String)}
- * </ul>
- */
- public void customizeFilterStringPropertyPage(ISubSystemConfiguration factory, SystemFilterStringPropertyPage page, ISystemFilterString selectedFilterString, Shell shell)
- {
- // default behaviour is a total hack! We want to preserve all the configuration done on the
- // Change dialog, so we instantiate it merely so that we can copy the configuration information...
- ISystemFilter selectedFilter = selectedFilterString.getParentSystemFilter();
- IAction changeAction = getChangeFilterAction(factory, selectedFilter, shell);
- if (changeAction instanceof SystemChangeFilterAction)
- {
- SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction;
- changeFilterAction.setSelection(new StructuredSelection(selectedFilter));
- org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell);
- if (dlg instanceof SystemChangeFilterDialog)
- {
- SystemChangeFilterDialog changeFilterDlg = (SystemChangeFilterDialog)dlg;
- //changeFilterAction.callConfigureFilterDialog(changeFilterDlg); createDialog calls this!
- page.setDuplicateFilterStringErrorMessage(changeFilterDlg.getDuplicateFilterStringErrorMessage());
- page.setFilterStringEditPane(changeFilterDlg.getFilterStringEditPane(shell));
- page.setFilterStringValidator(changeFilterDlg.getFilterStringValidator());
- page.setDescription(changeFilterDlg.getTitle());
- }
- }
- if (selectedFilter.isNonChangable())
- page.setEditable(false);
- }
-
- // ---------------------------------
- // FILTER POOL REFERENCE METHODS...
- // ---------------------------------
-
-
- /**
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter pool reference object within a subsystem of this factory. Note,
- * these are added to the list returned by getFilterPoolActions().
- * Only supported by subsystems that support filters.
- * @param selectedPoolRef the currently selected pool reference
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- public IAction[] getFilterPoolReferenceActions(ISubSystemConfiguration factory, ISystemFilterPoolReference selectedPoolRef, Shell shell)
- {
- ISystemFilterPool selectedPool = selectedPoolRef.getReferencedFilterPool();
- Vector childActions = getAdditionalFilterPoolReferenceActions(factory, selectedPool, shell);
- int nbrChildActions = 0;
- if (childActions != null)
- nbrChildActions = childActions.size();
- int fpIdx = 0;
- if (filterPoolReferenceActions == null)
- {
- int nbr = 3;
- filterPoolReferenceActions = new IAction[nbr + nbrChildActions];
- filterPoolReferenceActions[fpIdx++] = getRemoveFilterPoolReferenceAction(factory, selectedPool, shell);
- filterPoolReferenceActions[fpIdx] = new SystemFilterMoveUpFilterPoolReferenceAction(shell);
- ((ISystemAction) filterPoolReferenceActions[fpIdx++]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0063"); //$NON-NLS-1$
- filterPoolReferenceActions[fpIdx] = new SystemFilterMoveDownFilterPoolReferenceAction(shell);
- ((ISystemAction) filterPoolReferenceActions[fpIdx++]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0064"); //$NON-NLS-1$
- }
-
- if (childActions != null)
- for (int idx = 0; idx < nbrChildActions; idx++)
- filterPoolReferenceActions[fpIdx++] = (IAction) childActions.elementAt(idx);
-
- return filterPoolReferenceActions;
- }
- /**
- * Overridable entry for child classes to contribute filter pool reference actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return Vector of IAction objects.
- * @see #getFilterPoolReferenceActions(ISystemFilterPoolReference,Shell)
- */
- protected Vector getAdditionalFilterPoolReferenceActions(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- return null;
- }
- /**
- * Overridable method to return the action for removing a filter pool reference.
- * By default returns new SystemRemoveFilterPoolReferenceAction.
- * @param pool the currently selected pool
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- protected IAction getRemoveFilterPoolReferenceAction(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
- {
- ISystemAction action = new SystemFilterRemoveFilterPoolReferenceAction(shell);
- action.setHelp(RSEUIPlugin.HELPPREFIX + "actn0062"); //$NON-NLS-1$
- return action;
- }
-
- // ---------------------------------
- // FILTER METHODS
- // ---------------------------------
-
-
-
- /**
- * Prompt the user to create a new filter as a result of the user expanding a promptable
- * filter.
- * <p>
- * This base implementation prompts using the generic filter prompt. You should override this but
- * copy this code to use as a base/example how to do this.
- *
- * @return the filter created by the user or null if they cancelled the prompting
- */
- public ISystemFilter createFilterByPrompting(ISubSystemConfiguration factory, ISystemFilterReference referenceToPromptableFilter, Shell shell) throws Exception
- {
- ISystemFilter filterPrompt = referenceToPromptableFilter.getReferencedFilter();
- ISystemFilterPool selectedPool = filterPrompt.getParentFilterPool();
-
- SystemNewFilterAction action = new SystemNewFilterAction(shell, selectedPool);
- Object simulatedSelectedParent = null;
- if (!factory.showFilterPools()) // if we are not showing filter pools, the parent will be the subsystem itself
- {
- simulatedSelectedParent = referenceToPromptableFilter.getProvider(); // this is the subsystem
- action.setCallBackConfigurator(this, simulatedSelectedParent);
- }
- else // if we are showing filter pools, the parent will be the selected filter pool reference
- {
- simulatedSelectedParent = referenceToPromptableFilter.getParentSystemFilterReferencePool();
- action.setCallBackConfigurator(this, referenceToPromptableFilter.getProvider());
- }
- action.setSelection(new StructuredSelection(simulatedSelectedParent)); // pretend parent node was selected
-
- action.run();
- ISystemFilter newFilter = action.getNewFilter();
- return newFilter;
- }
-
- /**
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter object.
- * <p>
- * Only supported and used by subsystems that support filters.
- * <p>
- * YOU DO NOT NEED TO OVERRIDE THIS METHOD.
- * <p>
- * Most actions are handled in this base, except if you have your own action for
- * creating a new nested filter. In this case, <b>override getNewFilterAction()</b>
- */
- public IAction[] getFilterActions(ISubSystemConfiguration factory, ISystemFilter selectedFilter, Shell shell)
- {
- Vector childActions = new Vector();
- Vector ourChildActions = getAdditionalFilterActions(factory, selectedFilter, shell);
- int pasteIndex = -1;
- if (ourChildActions != null)
- for (int idx = 0; idx < ourChildActions.size(); idx++)
- {
- // we want to make sure the order is kept consistent at
- // Copy, Paste, Move, Delete Rename
- if (ourChildActions.elementAt(idx) instanceof SystemPasteFromClipboardAction) pasteIndex = idx;
- else childActions.addElement(ourChildActions.elementAt(idx));
- }
-
- // Add our static default-supplied actions
- if (filterActions == null)
- {
- int additionalActions = 4;
- if (pasteIndex > -1) additionalActions++;
- int fsIdx = 0;
- filterActions = new IAction[additionalActions];
- SystemFilterCopyFilterAction copyAction = new SystemFilterCopyFilterAction(shell);
- copyAction.setPromptString(SystemResources.RESID_COPY_TARGET_FILTERPOOL_PROMPT);
- copyAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0082"); //$NON-NLS-1$
- copyAction.setDialogHelp(RSEUIPlugin.HELPPREFIX + "dcfr0000"); //$NON-NLS-1$
- filterActions[fsIdx++] = copyAction;
-
- // we want to make sure the order is kept consistent at
- // Copy, Paste, Move, Delete Rename
- if (pasteIndex > -1)
- {
- filterActions[fsIdx++] = (IAction) ourChildActions.elementAt(pasteIndex);
- }
-
- SystemFilterMoveFilterAction moveAction = new SystemFilterMoveFilterAction(shell);
- moveAction.setPromptString(SystemResources.RESID_MOVE_TARGET_FILTERPOOL_PROMPT);
- moveAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0083"); //$NON-NLS-1$
- moveAction.setDialogHelp(RSEUIPlugin.HELPPREFIX + "dmfr0000"); //$NON-NLS-1$
- filterActions[fsIdx++] = moveAction;
-
- filterActions[fsIdx] = new SystemFilterMoveUpFilterAction(shell);
- ((SystemFilterMoveUpFilterAction) filterActions[fsIdx++]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0084"); //$NON-NLS-1$
- filterActions[fsIdx] = new SystemFilterMoveDownFilterAction(shell);
- ((SystemFilterMoveDownFilterAction) filterActions[fsIdx++]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0085"); //$NON-NLS-1$
- }
- // add overridable dynamic actions
- if (factory.supportsNestedFilters())
- {
- IAction newNestedFilterAction = getNewNestedFilterAction(factory, selectedFilter, shell);
- if (newNestedFilterAction != null)
- childActions.addElement(newNestedFilterAction);
- }
- IAction chgFilterAction = getChangeFilterAction(factory, selectedFilter, shell);
- if (chgFilterAction != null)
- childActions.addElement(chgFilterAction);
- /*
- if (showFilterStrings())
- {
- IAction[] newStringActions = getNewFilterStringActions(selectedFilter, shell);
- if (newStringActions != null)
- for (int idx=0; idx<newStringActions.length; idx++)
- childActions.addElement(newStringActions[idx]);
- }
- */
- IAction[] allFilterActions = new IAction[childActions.size() + filterActions.length];
- int allIdx = 0;
- if (childActions != null)
- for (int idx = 0; idx < childActions.size(); idx++)
- allFilterActions[allIdx++] = (IAction) childActions.elementAt(idx);
- for (int idx = 0; idx < filterActions.length; idx++)
- allFilterActions[allIdx++] = filterActions[idx];
-
- return allFilterActions;
- }
-
-
- /**
- * Overridable entry for child classes to contribute filter actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @return Vector of IAction objects.
- * @see #getFilterActions(ISystemFilter,Shell)
- */
- protected Vector getAdditionalFilterActions(ISubSystemConfiguration factory, ISystemFilter selectedFilter, Shell shell)
- {
- return null;
- }
-
- // ---------------------------------
- // FILTER REFERENCE METHODS
- // ---------------------------------
-
- /**
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter reference object within a subsystem of this factory.
- * Only supported and used by subsystems that support filters.
- * <p>
- * YOU DO NOT NEED TO OVERRIDE THIS METHOD.
- * <p>
- * Most actions are handled in this base, except if you have your own action for
- * creating a new filter. In this case, <b>override getNewFilterAction()</b>
- * To add additional actions, override {@link #getAdditionalFilterReferenceActions(ISystemFilterReference, Shell)}.
- *
- * @param selectedFilterRef the currently selected filter reference
- * @param shell parent shell of viewer where the popup menu is being constructed
- */
- public IAction[] getFilterReferenceActions(ISubSystemConfiguration factory, ISystemFilterReference selectedFilterRef, Shell shell)
- {
- Vector childActions = getAdditionalFilterReferenceActions(factory, selectedFilterRef, shell);
- int nbrChildActions = 0;
- if (childActions != null)
- nbrChildActions = childActions.size();
- else
- childActions = new Vector();
- /*
- if (filterReferenceActions == null)
- {
- int nbr = 2;
- filterReferenceActions = new IAction[nbr];
- }
- for (int idx=0; idx<filterReferenceActions.length; idx++)
- {
- childActions.addElement(filterReferenceActions[idx]);
- ++nbrChildActions;
- }
- */
- IAction[] allFilterRefActions = new IAction[nbrChildActions];
- for (int idx = 0; idx < nbrChildActions; idx++)
- allFilterRefActions[idx] = (IAction) childActions.elementAt(idx);
-
- return allFilterRefActions;
- }
- /**
- * Overridable entry for child classes to contribute filter reference actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @param selectedFilterRef the currently selected filter reference
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return Vector of IAction objects.
- */
- protected Vector getAdditionalFilterReferenceActions(ISubSystemConfiguration factory, ISystemFilterReference selectedFilterRef, Shell shell)
- {
- return null;
- }
-
- // ---------------------------------
- // FILTER STRING METHODS
- // ---------------------------------
-
- /*
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter string object (and has set the preferences to see them).
- * Only supported and used by subsystems that support filters.
- * <p>
- * YOU DO NOT NEED TO OVERRIDE THIS METHOD.
- * <p>
- * Most actions are handled in this base, only override if you have something unique.
- *
- public IAction[] getFilterStringActions(SystemFilterString selectedFilterString, Shell shell)
- {
- Vector childActions = new Vector();
- Vector ourChildActions = getAdditionalFilterStringActions(selectedFilterString, shell);
- if (ourChildActions != null)
- for (int idx=0; idx<ourChildActions.size(); idx++)
- childActions.addElement(ourChildActions.elementAt(idx));
-
- if (filterStringActions == null)
- {
- filterStringActions = new IAction[4];
- filterStringActions[0] = new SystemFilterMoveUpFilterStringAction(shell);
- ((ISystemAction)filterStringActions[0]).setHelp(RSEUIPlugin.HELPPREFIX+"actn0093");
- filterStringActions[1] = new SystemFilterMoveDownFilterStringAction(shell);
- ((ISystemAction)filterStringActions[1]).setHelp(RSEUIPlugin.HELPPREFIX+"actn0094");
-
- SystemFilterCopyFilterStringAction copyAction = new SystemFilterCopyFilterStringAction(shell);
- copyAction.setPromptString(SystemResources.RESID_COPY_TARGET_FILTER_PROMPT));
- copyAction.setHelp(RSEUIPlugin.HELPPREFIX+"actn0091");
- copyAction.setDialogHelp(RSEUIPlugin.HELPPREFIX+"dcfs0000");
- filterStringActions[2] = copyAction;
- SystemFilterMoveFilterStringAction moveAction = new SystemFilterMoveFilterStringAction(shell);
- moveAction.setPromptString(SystemResources.RESID_MOVE_TARGET_FILTER_PROMPT));
- moveAction.setHelp(RSEUIPlugin.HELPPREFIX+"actn0093");
- moveAction.setDialogHelp(RSEUIPlugin.HELPPREFIX+"dmfs0000");
- filterStringActions[3] = moveAction;
- }
- IAction chgAction = getChangeFilterStringAction(selectedFilterString, shell);
- if (chgAction != null)
- childActions.addElement(chgAction);
- for (int idx=0; idx<filterStringActions.length; idx++)
- {
- childActions.addElement(filterStringActions[idx]);
- }
-
- IAction[] allFilterStringActions = new IAction[childActions.size()];
- for (int idx=0; idx<childActions.size(); idx++)
- allFilterStringActions[idx] = (IAction)childActions.elementAt(idx);
-
- return allFilterStringActions;
- }*/
- /*
- * Overridable entry for child classes to contribute filter string actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @param selectedFilterString the currently selected filter string
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return Vector of IAction objects.
- *
- protected Vector getAdditionalFilterStringActions(SystemFilterString selectedFilterString, Shell shell)
- {
- return null;
- }*/
- /*
- * Overridable entry for child classes to contribute their own change filter string action.
- * <p>
- * By default, this returns the default change filter string action.
- * @param selectedFilterString the currently selected filter string
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return change action.
- *
- protected IAction getChangeFilterStringAction(SystemFilterString selectedFilterString, Shell shell)
- {
- //IAction chgAction = new SystemFilterDefaultUpdateFilterStringAction(shell);
- //return chgAction;
- return null;
- }*/
-
- /*
- * Returns a list of actions for the popup menu when user right clicks on a
- * filter string reference object (and has set the preferences to see them).
- * <p>
- * Only supported and used by subsystems that support filters.
- * <p>
- * Most actions are handled in this base, only override if you have something unique.
- *
- public IAction[] getFilterStringReferenceActions(SystemFilterStringReference selectedFilterStringRef, Shell shell)
- {
- Vector childActions = new Vector();
- Vector ourChildActions = getAdditionalFilterStringReferenceActions(selectedFilterStringRef, shell);
- if (ourChildActions != null)
- for (int idx=0; idx<ourChildActions.size(); idx++)
- childActions.addElement(ourChildActions.elementAt(idx));
-
- if (filterStringReferenceActions == null)
- {
- }
- if (filterStringReferenceActions != null)
- {
- for (int idx=0; idx<filterStringReferenceActions.length; idx++)
- {
- childActions.addElement(filterStringReferenceActions[idx]);
- }
- }
- IAction[] allFilterStringRefActions = new IAction[childActions.size()];
- for (int idx=0; idx<childActions.size(); idx++)
- allFilterStringRefActions[idx] = (IAction)childActions.elementAt(idx);
-
- return allFilterStringRefActions;
- }*/
-
- /*
- * Overridable entry for child classes to contribute filter string refernce actions beyond the
- * default supplied actions.
- * <p>
- * By default, this returns null.
- * @param selectedFilterStringRef the currently selected filter string reference
- * @param shell parent shell of viewer where the popup menu is being constructed
- * @return Vector of IAction objects.
- *
- protected Vector getAdditionalFilterStringReferenceActions(SystemFilterStringReference selectedFilterStringRef, Shell shell)
- {
- return null;
- }*/
-
- // -------------------------
- // SERVER LAUNCH SUPPORT ...
- // -------------------------
-
- /**
- * Return the form used in the property page, etc for this server launcher.
- * Only called if {@link #supportsServerLaunchProperties()} returns true.
- * <p>
- * We return {@link org.eclipse.rse.ui.widgets.ServerLauncherForm}.
- * Override if appropriate.
- */
- public IServerLauncherForm getServerLauncherForm(ISubSystemConfiguration factory, Shell shell, ISystemMessageLine msgLine)
- {
- return new RemoteServerLauncherForm(shell, msgLine);
- }
-
- /**
- * Called by SystemRegistry's renameSystemProfile method to ensure we update our
- * filter pool manager names (and their folders)
- * <p>
- * Must be called AFTER changing the profile's name!!
- */
- public void renameSubSystemProfile(ISubSystemConfiguration factory, String oldProfileName, String newProfileName)
- {
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(), "Inside renameSubSystemProfile. newProfileName = "+newProfileName);
- ISystemProfile profile = factory.getSystemProfile(newProfileName);
- factory.renameFilterPoolManager(profile); // update filter pool manager name
- //if (profile.isDefaultPrivate()) // I don't remember why this was here, but it caused bad things, Phil.
- {
- // Rename the default filter pool for this profile, as it's name is derived from the profile.
- ISystemFilterPool defaultPoolForThisProfile = factory.getDefaultFilterPool(profile, oldProfileName);
- if (defaultPoolForThisProfile != null)
- try
- {
- factory.getFilterPoolManager(profile).renameSystemFilterPool(defaultPoolForThisProfile, SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()));
- }
- catch (Exception exc)
- {
- SystemBasePlugin.logError("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()), exc);
- System.out.println("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()) + ": " + exc);
- }
- }
- }
-
- /**
- * Return the validator for the password which is prompted for at runtime.
- * Returns null by default.
- */
- public ISystemValidator getPasswordValidator(ISubSystemConfiguration configuration)
- {
- return null;
- }
- /**
- * Return the validator for the port.
- * A default is supplied.
- * This must be castable to ICellEditorValidator for the property sheet support.
- */
- public ISystemValidator getPortValidator(ISubSystemConfiguration configuration)
- {
- ISystemValidator portValidator = new ValidatorPortInput();
- return portValidator;
- }
-
-
-
- public PropertyPage getPropertyPage(ISubSystem subsystem, Composite parent) {
- return ((SubSystem)subsystem).getPropertyPage(parent);
- }
-
-
- public ISystemValidator getUserIdValidator(ISubSystemConfiguration config) {
- return ((SubSystemConfiguration)config).getUserIdValidator();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapterFactory.java
deleted file mode 100644
index 37651c43b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapterFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-
-
-public class SubSystemConfigurationAdapterFactory implements IAdapterFactory
-{
-
- private ISubSystemConfigurationAdapter ssFactoryAdapter = new SubSystemConfigurationAdapter();
-
- /**
- * @see IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList()
- {
- return new Class[] {ISubSystemConfigurationAdapter.class};
- }
- /**
- * Called by our plugin's startup method to register our adaptable object types
- * with the platform. We prefer to do it here to isolate/encapsulate all factory
- * logic in this one place.
- */
- public void registerWithManager(IAdapterManager manager)
- {
- manager.registerAdapters(this, ISubSystemConfiguration.class);
- }
- /**
- * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType)
- {
- Object adapter = null;
- if (adaptableObject instanceof ISubSystemConfiguration)
- adapter = ssFactoryAdapter;
-
- return adapter;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAbstractAPIProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAbstractAPIProvider.java
deleted file mode 100644
index 11df1ea55..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAbstractAPIProvider.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * This is a base class that a provider of root nodes to the remote systems tree viewer part can
- * use as a parent class.
- */
-public abstract class SystemAbstractAPIProvider
- implements ISystemViewInputProvider
-{
-
-
- protected Shell shell;
- protected Viewer viewer;
- protected ISystemRegistry sr;
-
- protected Object[] emptyList = new Object[0];
- protected Object[] msgList = new Object[1];
- protected SystemMessageObject nullObject = null;
- protected SystemMessageObject canceledObject = null;
- protected SystemMessageObject errorObject = null;
-
-
- /**
- * Constructor
- */
- public SystemAbstractAPIProvider()
- {
- super();
- sr = RSEUIPlugin.getTheSystemRegistry();
- }
-
- /**
- * This is the method required by the IAdaptable interface.
- * Given an adapter class type, return an object castable to the type, or
- * null if this is not possible.
- */
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- /**
- * Set the shell in case it is needed for anything.
- * The label and content provider will call this.
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
-
- /**
- * Return the shell of the current viewer
- */
- public Shell getShell()
- {
- return shell;
- }
-
- /**
- * Set the viewer in case it is needed for anything.
- * The label and content provider will call this.
- */
- public void setViewer(Viewer viewer)
- {
- this.viewer = viewer;
- }
-
- /**
- * Return the viewer we are currently associated with
- */
- public Viewer getViewer()
- {
- return viewer;
- }
-
- /**
- * Return true to show the action bar (ie, toolbar) above the viewer.
- * The action bar contains connection actions, predominantly.
- * We return false
- */
- public boolean showActionBar()
- {
- return false;
- }
-
- /**
- * Return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typically
- * shown in dialogs that list only remote system objects.
- * We return false.
- */
- public boolean showButtonBar()
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return false.
- */
- public boolean showActions()
- {
- return false;
- }
-
- private void initMsgObjects()
- {
- nullObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),ISystemMessageObject.MSGTYPE_EMPTY, null);
- canceledObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LIST_CANCELLED),ISystemMessageObject.MSGTYPE_CANCEL, null);
- errorObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),ISystemMessageObject.MSGTYPE_ERROR, null);
- }
-
- /**
- * In getChildren, return checkForNull(children, true/false) vs your array directly.
- * This method checks for a null array which not allow and replaces it with an empty array.
- * If true is passed then it returns the "Empty list" message object if the array is null or empty
- */
- protected Object[] checkForNull(Object[] children, boolean returnNullMsg)
- {
- if ((children == null) || (children.length==0))
- {
- if (!returnNullMsg)
- return emptyList;
- else
- {
- if (nullObject == null)
- initMsgObjects();
- msgList[0] = nullObject;
- return msgList;
- }
- }
- else
- return children;
- }
-
- /**
- * Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()
- */
- protected Object[] getCancelledMessageObject()
- {
- if (canceledObject == null)
- initMsgObjects();
- msgList[0] = canceledObject;
- return msgList;
- }
-
- /**
- * Return the "Operation failed" msg as an object array so can be used to answer getChildren()
- */
- protected Object[] getFailedMessageObject()
- {
- if (errorObject == null)
- initMsgObjects();
- msgList[0] = errorObject;
- return msgList;
- }
-
- /**
- * Return true if we are listing connections or not, so we know whether we are interested in
- * connection-add events
- */
- public boolean showingConnections()
- {
- return false;
- }
-
- // ------------------
- // HELPER METHODS...
- // ------------------
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemActionViewerFilter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemActionViewerFilter.java
deleted file mode 100644
index 8935025cf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemActionViewerFilter.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * This class is a viewer filter that tests attributes of thise
- */
-public class SystemActionViewerFilter extends ViewerFilter {
-
- /**
- * Inner class representing a filter criterion.
- */
- private class FilterCriterion {
-
- private String name;
- private String value;
-
- /**
- * Constructor.
- * @param name the name.
- * @param value the value.
- */
- private FilterCriterion(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Returns the name.
- * @return the name.
- */
- private String getName() {
- return name;
- }
-
- /**
- * Returns the value.
- * @return the value.
- */
- private String getValue() {
- return value;
- }
- }
-
- // list to hold filter criteria for each object type
- private HashMap map;
-
- /**
- * Constructor.
- */
- public SystemActionViewerFilter() {
- super();
- map = new HashMap();
- }
-
- /**
- * Adds a filter criterion.
- * @param objectTypes object types that the filter criterion applies to.
- * @param name the name.
- * @param value the value.
- */
- public void addFilterCriterion(Class[] objectTypes, String name, String value) {
- FilterCriterion criterion = new FilterCriterion(name, value);
-
- // go through each object type
- for (int i = 0; i < objectTypes.length; i++) {
- Class type = objectTypes[i];
-
- List criteria = null;
-
- // we do not have object type, so add it
- if (!map.containsKey(type)) {
- criteria = new ArrayList();
- }
- // we already have object type, so get its list of criteria
- else {
- criteria = (List)(map.get(type));
- }
-
- // add criterion to list
- criteria.add(criterion);
-
- // put type and list of criteria in map
- map.put(type, criteria);
- }
- }
-
- /**
- * Removes all criteria.
- */
- public void removeAllCriterion() {
- map.clear();
- }
-
- /**
- * Checks if the object is an instance of any of the types in our list, and returns the
- * type for which the object is an instance.
- * @param obj the object.
- * @return the type for which the object is an instance, or <code>null</code> if no type was
- * found.
- */
- private Class isInstance(Object obj) {
-
- // get set of types
- Set keySet = map.keySet();
-
- // get the iterator
- Iterator iter = keySet.iterator();
-
- // go through iterator
- while (iter.hasNext()) {
- Class objType = (Class)(iter.next());
-
- // check if object is an instance of the object type
- if (objType.isInstance(obj)) {
- return objType;
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
-
- // check if the object is an instance of one of the object types we want to filter
- Class objType = isInstance(element);
-
- // no object type found, so let it through
- if (objType == null) {
- return true;
- }
-
- ISystemViewElementAdapter adapter = null;
-
- // get adapter
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable)element;
-
- adapter = (ISystemViewElementAdapter)(adaptable.getAdapter(ISystemViewElementAdapter.class));
-
- // get list of criteria
- List criteria = (List)(map.get(objType));
-
- // get iterator
- Iterator iter = criteria.iterator();
-
- // go through list of criterion, make sure one of them matches
- while (iter.hasNext()) {
- FilterCriterion criterion = (FilterCriterion)(iter.next());
-
- boolean testResult = adapter.testAttribute(element, criterion.getName(), criterion.getValue());
-
- if (testResult) {
- return true;
- }
- }
-
- return false;
- }
-
- return true;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxCellEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxCellEditor.java
deleted file mode 100644
index add173b21..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxCellEditor.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.text.MessageFormat;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
- * which allows the input array to be changed dynamically.
- * <p>
- * A cell editor that presents a list of items in a combo box.
- * The cell editor's value is the zero-based index of the selected
- * item.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- */
-public class SystemComboBoxCellEditor extends CellEditor
-{
- private boolean readOnly = false;
- /**
- * The list of items to present in the combo box.
- */
- private String[] items;
-
- /**
- * The zero-based index of the selected item.
- */
- private int selection;
-
- /**
- * The custom combo box control.
- */
- private CCombo comboBox;
- /**
- * Creates a new cell editor with a combo containing the given
- * list of choices and parented under the given control. The cell
- * editor value is the zero-based index of the selected item.
- * Initially, the cell editor has no cell validator and
- * the first item in the list is selected.
- *
- * @param parent the parent control
- * @param items the list of strings for the combo box
- */
- public SystemComboBoxCellEditor(Composite parent, String[] items)
- {
- super(parent);
- selection = 0;
- if (items != null)
- setItems(items);
- else
- setValueValid(true);
- }
- /**
- * Creates a new cell editor with a combo containing the given
- * list of choices and parented under the given control. The cell
- * editor value is the zero-based index of the selected item.
- * Initially, the cell editor has no cell validator and
- * the first item in the list is selected.
- *
- * @param parent the parent control
- * //@param whether or not this is readonly
- */
- //public SystemComboBoxCellEditor(Composite parent, boolean readOnly)
- public SystemComboBoxCellEditor(Composite parent)
- {
- super(parent);
- selection = 0;
- //this.readOnly = readOnly;
- setValueValid(true);
- }
- /**
- * Change the input items
- */
- public void setItems(String[] items)
- {
- this.items = items;
- populateComboBoxItems();
- setValueValid(true);
- }
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected Control createControl(Composite parent)
- {
- if (!readOnly)
- comboBox = new CCombo(parent, SWT.NONE);
- else
- comboBox = new CCombo(parent, SWT.READ_ONLY);
- comboBox.setFont(parent.getFont());
-
- comboBox.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- keyReleaseOccured(e);
- }
- });
-
- comboBox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
-
- // DKM - only process this when there is a selection change
- // fix for defect 138324
- if (selection == comboBox.getSelectionIndex() && comboBox.getText().equals(comboBox.getItem(comboBox.getSelectionIndex())))
- return; // no change
-
- // must set the selection before getting value
- selection = comboBox.getSelectionIndex();
- Object newValue = doGetValue();
-
-
- boolean newValidState = isCorrect(newValue);
- if (newValidState) {
- doSetValue(newValue);
- } else {
- // try to insert the current value into the error message.
- setErrorMessage(
- MessageFormat.format(getErrorMessage(), new Object[] {items[selection]}));
- }
- fireApplyEditorValue();
- }
- });
-
- comboBox.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) {
- e.doit = false;
- }
- }
- });
-
- return comboBox;
- }
- /**
- * The <code>ComboBoxCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method returns
- * the zero-based index of the current selection.
- *
- * @return the zero-based index of the current selection wrapped
- * as an <code>Integer</code>
- */
- protected Object doGetValue()
- {
- return new Integer(selection);
- }
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected void doSetFocus()
- {
- comboBox.setFocus();
- }
- /**
- * The <code>ComboBoxCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method
- * accepts a zero-based index of a selection.
- *
- * @param value the zero-based index of the selection wrapped
- * as an <code>Integer</code>
- */
- protected void doSetValue(Object value)
- {
- if (!(value instanceof Integer))
- {
- String[] items = comboBox.getItems();
- for (int i = 0; i < items.length; i++)
- {
- String item = items[i];
- if (item.equals(value))
- {
- selection = i;
- }
- }
- return;
- }
-
- //Assert.isTrue(comboBox != null && (value instanceof Integer));
- int newselection = ((Integer) value).intValue();
- if (newselection != selection)
- {
- selection = newselection;
- }
- String curText = comboBox.getText();
- if (!comboBox.getItem(selection).equals(curText))
- {
- comboBox.select(selection);
- }
- }
- /**
- * Add the items to the combo box.
- */
- private void populateComboBoxItems()
- {
- if (comboBox != null && items != null)
- {
- comboBox.removeAll();
- for (int i = 0; i < items.length; i++)
- comboBox.add(items[i], i);
- setValueValid(true);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxPropertyDescriptor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxPropertyDescriptor.java
deleted file mode 100644
index eb06f625e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemComboBoxPropertyDescriptor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-/**
- * A variation of the Eclipse-supplied ComboBoxPropertyDescriptor for
- * displaying properties are a list. This list will be different for each
- * selected object, hence we need the ability to change that list as each
- * object is selected.
- */
-public class SystemComboBoxPropertyDescriptor
- extends PropertyDescriptor
-{
- private SystemComboBoxCellEditor editor;
-
- /**
- * The list of possible values to display in the combo box
- */
- protected String[] values;
- /**
- * Creates an property descriptor with the given id, display name, and list
- * of value labels to display in the combo box cell editor.
- *
- * @param id the id of the property
- * @param displayName the name to display for the property
- * @param valuesArray the list of possible values to display in the combo box
- */
- public SystemComboBoxPropertyDescriptor(Object id, String displayName, String[] valuesArray)
- {
- super(id, displayName);
- values = valuesArray;
- }
- /**
- * Creates an property descriptor with the given id, display name, but no list.
- * You must call setValues.
- *
- * @param id the id of the property
- * @param displayName the name to display for the property
- */
- public SystemComboBoxPropertyDescriptor(Object id, String displayName)
- {
- super(id, displayName);
- }
- /**
- * The <code>ComboBoxPropertyDescriptor</code> implementation of this
- * <code>IPropertyDescriptor</code> method creates and returns a new
- * <code>ComboBoxCellEditor</code>.
- * <p>
- * The editor is configured with the current validator if there is one.
- * </p>
- */
- public CellEditor createPropertyEditor(Composite parent)
- {
- //editor = new SystemComboBoxCellEditor(parent, false); // last parm = readonly
- editor = new SystemComboBoxCellEditor(parent);
- editor.setItems(values);
- if (getValidator() != null)
- editor.setValidator(getValidator());
- return editor;
- }
- /**
- * Set the values to display in the list.
- */
- public void setValues(String[] values)
- {
- this.values = values;
- if (editor != null)
- editor.setItems(values);
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java
deleted file mode 100644
index 6041d6f1f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemResourceSet;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemRemoteResourceSet;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.GenericMessages;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.UIJob;
-
-
-/**
- * Runnable to perform actual transfer operation.
- *
- */
-public class SystemDNDTransferRunnable extends Job
-{
-
- public static final int SRC_TYPE_RSE_RESOURCE = 0;
- public static final int SRC_TYPE_ECLIPSE_RESOURCE = 1;
- public static final int SRC_TYPE_OS_RESOURCE = 2;
- public static final int SRC_TYPE_TEXT = 3;
- public static final int SRC_TYPE_UNKNOWN = 4;
-
- private List _srcObjects;
- private List _resultSrcObjects;
- private List _resultTgtObjects;
- private List _setList;
-
-
- private Object _currentTarget;
- private int _sourceType;
- private Viewer _originatingViewer;
- private boolean _ok;
-
- public SystemDNDTransferRunnable(Object target, ArrayList srcObjects, Viewer originatingViewer, int sourceType)
- {
- super(GenericMessages.TransferOperation_message);
- _srcObjects = srcObjects;
- _currentTarget = target;
- _sourceType = sourceType;
- _originatingViewer = originatingViewer;
- _resultSrcObjects = new ArrayList(_srcObjects.size());
- _resultTgtObjects = new ArrayList();
- _setList = new ArrayList();
- this.setUser(true);
- }
-
- protected SystemRemoteResourceSet getSetFor(ISubSystem subSystem, ISystemDragDropAdapter adapter)
- {
- for (int i = 0; i < _setList.size(); i++)
- {
- SystemRemoteResourceSet set = (SystemRemoteResourceSet)_setList.get(i);
- if (set.getAdapter() == adapter && set.getSubSystem() == subSystem)
- {
- return set;
- }
- }
-
- // no existing set - create one
- SystemRemoteResourceSet newSet = new SystemRemoteResourceSet(subSystem, adapter);
- _setList.add(newSet);
- return newSet;
- }
-
- protected boolean transferRSEResources(IProgressMonitor monitor, Object target, ISubSystem targetSubSystem, ISystemDragDropAdapter targetAdapter)
- {
-
-
- // transfer local artificts and categorize remote objects
- for (int i = 0; i < _srcObjects.size() && _ok; i++)
- {
- Object srcObject = _srcObjects.get(i);
- _resultSrcObjects.add(srcObject);
-
- if (srcObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) srcObject);
- return _ok;
- }
- else if (srcObject != null)
- {
- ISystemDragDropAdapter srcAdapter = (ISystemDragDropAdapter) ((IAdaptable) srcObject).getAdapter(ISystemDragDropAdapter.class);
-
- if (srcAdapter != null)
- {
- if (srcObject instanceof IHost)
- {
- Object tempObject = srcAdapter.doDrag(srcObject, false, monitor);
- if (targetAdapter.validateDrop(tempObject, target, false))
- {
- targetAdapter.doDrop(tempObject, target, false, false, _sourceType, monitor);
- _resultTgtObjects.add(tempObject);
- }
- }
- else
- {
- ISubSystem srcSubSystem = srcAdapter.getSubSystem(srcObject);
- if (srcSubSystem.isConnected() ||
- srcObject instanceof ISystemFilterReference ||
- srcObject instanceof ISubSystem)
- {
- SystemRemoteResourceSet set = getSetFor(srcSubSystem, srcAdapter);
- set.addResource(srcObject);
- }
- }
- }
- }
- }
-
- String targetPath = targetAdapter.getAbsoluteName(target);
- boolean sameSubSystemType = true;
- String targetType = "";
- if (targetSubSystem != null)
- {
- targetType = targetSubSystem.getName();
- }
-
- // now we have things divided into sets
- // transfer 1 set at a time
- for (int s = 0; s < _setList.size(); s++)
- {
- SystemRemoteResourceSet set = (SystemRemoteResourceSet)_setList.get(s);
-
-
-
-
- ISubSystem srcSubSystem = set.getSubSystem();
- ISystemDragDropAdapter srcAdapter = set.getAdapter();
-
- String srcType = srcSubSystem.getName();
- sameSubSystemType = targetType.equals(srcType);
-
- if (!sameSubSystemType && targetSubSystem != null)
- {
- ISystemResourceSet tempObjects = srcAdapter.doDrag(set, monitor);
-
- if (tempObjects == null)
- {
- // drag failed
- operationFailed(monitor);
- showInvalidTransferMessage(set, targetPath);
- }
- else if (tempObjects.hasMessage())
- {
- operationFailed(monitor);
- showErrorMessage(tempObjects.getMessage());
- }
- else
- {
- if (targetAdapter.validateDrop(tempObjects, target, (targetSubSystem == srcSubSystem)))
- {
- // special case for filters
- if (target instanceof ISystemFilterReference)
- {
- ISubSystemConfiguration factory = targetSubSystem.getSubSystemConfiguration();
- if (factory.supportsDropInFilters())
- {
- target = targetSubSystem.getTargetForFilter((ISystemFilterReference)target);
- targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
- }
- }
-
-
- ISystemResourceSet droppedObjects = targetAdapter.doDrop(tempObjects, target, sameSubSystemType, (targetSubSystem == srcSubSystem), _sourceType, monitor);
- if (droppedObjects == null)
- {
- operationFailed(monitor);
- }
- else if (droppedObjects.hasMessage())
- {
- operationFailed(monitor);
- showErrorMessage(droppedObjects.getMessage());
- }
- else
- {
- List results = droppedObjects.getResourceSet();
- for (int d = 0; d < results.size(); d++)
- {
- _resultTgtObjects.add(results.get(d));
- }
- }
- }
- else
- {
- // invalid drop
- operationFailed(monitor);
- showInvalidTransferMessage(set, targetPath);
- }
- }
- }
- else
- {
- // special case for filters
- if (target instanceof ISystemFilterReference)
- {
- ISubSystemConfiguration factory = targetSubSystem.getSubSystemConfiguration();
- if (factory.supportsDropInFilters())
- {
- target = targetSubSystem.getTargetForFilter((ISystemFilterReference)target);
- targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- }
- }
- if (targetAdapter.validateDrop(set, target, (targetSubSystem == srcSubSystem)))
- {
-
- ISystemResourceSet droppedObjects = targetAdapter.doDrop(set, target, sameSubSystemType, (targetSubSystem == srcSubSystem), _sourceType, monitor);
- if (droppedObjects == null)
- {
- operationFailed(monitor);
- }
- else if (droppedObjects.hasMessage())
- {
- operationFailed(monitor);
- showErrorMessage(droppedObjects.getMessage());
- }
- else
- {
- List results = droppedObjects.getResourceSet();
- for (int d = 0; d < results.size(); d++)
- {
- _resultTgtObjects.add(results.get(d));
- }
- }
- }
- else
- {
- // invalid drop
- operationFailed(monitor);
- showInvalidTransferMessage(set, targetPath);
- }
- }
- }
-
- return _ok;
- }
-
- protected boolean transferRSEResourcesToEclipseResource(IProgressMonitor monitor, IResource target, ISubSystem targetSubSystem)
- {
- for (int i = 0; i < _srcObjects.size() && _ok; i++)
- {
- Object srcObject = _srcObjects.get(i);
-
- _resultSrcObjects.add(srcObject);
-
- if (srcObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) srcObject);
- }
- else if (srcObject != null)
- {
- ISystemDragDropAdapter srcAdapter = (ISystemDragDropAdapter) ((IAdaptable) srcObject).getAdapter(ISystemDragDropAdapter.class);
- Object tempFile = srcAdapter.doDrag(srcObject, true, monitor);
- if (tempFile instanceof IResource)
- {
- IResource res = (IResource)tempFile;
- try
- {
- IPath destPath = target.getFullPath();
- destPath = destPath.append(res.getName());
- res.copy(destPath, false, monitor);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- return true;
- }
-
- protected boolean transferNonRSEResources(IProgressMonitor monitor, Object target, ISubSystem targetSubSystem, ISystemDragDropAdapter targetAdapter)
- {
-
- for (int i = 0; i < _srcObjects.size() && _ok; i++)
- {
- Object srcObject = _srcObjects.get(i);
-
- _resultSrcObjects.add(srcObject);
-
- if (srcObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) srcObject);
- }
- else if (srcObject != null)
- {
-
-
- // special case for filters
- if (target instanceof ISystemFilterReference)
- {
-
- ISubSystemConfiguration factory = targetSubSystem.getSubSystemConfiguration();
- if (factory.supportsDropInFilters() && factory.providesCustomDropInFilters())
- {
- ((ISystemFilterReference)target).markStale(true);
-
- target = targetSubSystem.getTargetForFilter((ISystemFilterReference)target);
- targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- }
- }
-
- if (_sourceType == SRC_TYPE_ECLIPSE_RESOURCE)
- {
-
- if (srcObject instanceof IResource)
- {
- // Eclipse resource transfer
- IResource resource = (IResource) srcObject;
- Object droppedObject = targetAdapter.doDrop(resource, target, false, false, _sourceType, monitor);
- if (droppedObject == null)
- operationFailed(monitor);
- else
- _resultTgtObjects.add(droppedObject);
- }
- }
- else if (_sourceType == SRC_TYPE_OS_RESOURCE)
- {
- if (srcObject instanceof String)
- {
- // non-Eclipse file transfer
- String file = (String) srcObject;
-
- Object droppedObject = targetAdapter.doDrop(file, target, false, false, _sourceType, monitor);
- if (droppedObject == null)
- operationFailed(monitor);
- else
- _resultTgtObjects.add(droppedObject);
- }
- }
- else if (_sourceType == SRC_TYPE_TEXT)
- {
- if (srcObject instanceof String)
- {
- String text = (String) srcObject;
- Object droppedObject = targetAdapter.doDrop(text, target, false, false, _sourceType, monitor);
- if (droppedObject == null)
- operationFailed(monitor);
- else
- _resultTgtObjects.add(droppedObject);
- }
- }
- else if (_sourceType == SRC_TYPE_RSE_RESOURCE)
- {
- ISystemDragDropAdapter srcAdapter = (ISystemDragDropAdapter) ((IAdaptable) srcObject).getAdapter(ISystemDragDropAdapter.class);
-
- if (srcAdapter != null)
- {
- if (srcObject instanceof IHost)
- {
- Object tempObject = srcAdapter.doDrag(srcObject, false, monitor);
- if (targetAdapter.validateDrop(tempObject, target, false))
- {
- targetAdapter.doDrop(tempObject, target, false, false, _sourceType, monitor);
- _resultTgtObjects.add(tempObject);
- }
- }
- else
- {
- ISubSystem srcSubSystem = srcAdapter.getSubSystem(srcObject);
-
- if (srcSubSystem.isConnected() ||
- srcObject instanceof ISystemFilterReference ||
- srcObject instanceof ISubSystem)
- {
- String srcType = srcSubSystem.getName();
- String srcPath = srcAdapter.getAbsoluteName(srcObject);
- String targetPath = targetAdapter.getAbsoluteName(target);
- boolean sameSubSystemType = true;
- if (targetSubSystem != null)
- {
- String targetType = targetSubSystem.getName();
- sameSubSystemType = targetType.equals(srcType);
- }
-
- if (!sameSubSystemType)
- {
- Object tempObject = srcAdapter.doDrag(srcObject, sameSubSystemType, monitor);
- if (tempObject == null)
- {
- // drag failed
- operationFailed(monitor);
- showInvalidTransferMessage(srcPath, targetPath);
- }
- else if (tempObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) tempObject);
- }
- else
- {
-
- if (targetAdapter.validateDrop(tempObject, target, (targetSubSystem == srcSubSystem)))
- {
- // special case for filters
- if (target instanceof ISystemFilterReference)
- {
- ISubSystemConfiguration factory = targetSubSystem.getSubSystemConfiguration();
- if (factory.supportsDropInFilters() && factory.providesCustomDropInFilters())
- {
- target = targetSubSystem.getTargetForFilter((ISystemFilterReference)target);
- targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- }
- }
-
- Object droppedObject = targetAdapter.doDrop(tempObject, target, sameSubSystemType, (targetSubSystem == srcSubSystem), _sourceType, monitor);
- if (droppedObject == null)
- {
- operationFailed(monitor);
- }
- else if (droppedObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) droppedObject);
- }
- else
- _resultTgtObjects.add(droppedObject);
- }
- else
- {
- // invalid drop
- operationFailed(monitor);
- showInvalidTransferMessage(srcPath, targetPath);
- }
- }
- }
- else if (srcObject != target && !srcPath.equals(targetPath))
- {
- // special case for filters
-
- if (target instanceof ISystemFilterReference)
- {
- ISubSystemConfiguration factory = targetSubSystem.getSubSystemConfiguration();
- if (factory.supportsDropInFilters() && factory.providesCustomDropInFilters())
- {
- target = targetSubSystem.getTargetForFilter((ISystemFilterReference)target);
- targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- }
- }
- if (targetAdapter.validateDrop(srcObject, target, (targetSubSystem == srcSubSystem)))
- {
-
- Object droppedObject = targetAdapter.doDrop(srcObject, target, sameSubSystemType, (targetSubSystem == srcSubSystem), _sourceType, monitor);
- if (droppedObject == null)
- {
- operationFailed(monitor);
- }
- else if (droppedObject instanceof SystemMessage)
- {
- operationFailed(monitor);
- showErrorMessage((SystemMessage) droppedObject);
- }
- else
- _resultTgtObjects.add(droppedObject);
- }
- else
- {
- // invalid drop
- operationFailed(monitor);
- showInvalidTransferMessage(srcPath, targetPath);
- }
- }
- else
- {
- // can't drop src onto itself
- // invalid drop
- operationFailed(monitor);
- showInvalidTransferMessage(srcPath, targetPath);
- }
- }
- }
- }
- }
- }
- if (monitor != null && monitor.isCanceled())
- {
- _ok = false;
- return _ok;
- }
- }
-
-
- return true;
- }
-
- public IStatus run(IProgressMonitor monitor)
- {
-
- _ok = true;
-
- Object target = _currentTarget;
- ISubSystem targetSubSystem = null;
- //boolean expandFolder = false;
-
-
- if (target instanceof IAdaptable)
- {
- ISystemDragDropAdapter targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- if (targetAdapter != null)
- {
- targetSubSystem = targetAdapter.getSubSystem(target);
-
- if (targetSubSystem != null && !targetSubSystem.isConnected())
- {
- try
- {
- targetSubSystem.connect();
- }
- catch (Exception e)
- {
- }
- }
-
- SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPYGENERIC_PROGRESS);
- if (monitor != null)
- monitor.beginTask(copyMessage.getLevelOneText(), IProgressMonitor.UNKNOWN);
-
- if (_sourceType == SRC_TYPE_RSE_RESOURCE)
- {
- transferRSEResources(monitor, target, targetSubSystem, targetAdapter);
- }
- else
- {
- transferNonRSEResources(monitor, target, targetSubSystem, targetAdapter);
- }
- }
- else if (target instanceof IResource)
- {
- transferRSEResourcesToEclipseResource(monitor, (IResource)target, targetSubSystem);
- }
- }
-
- // fire refresh for target
- if (_ok && monitor != null) // I added this test: phil
- {
- monitor.done();
- }
-
-
- if (target != null && target instanceof ISystemContainer)
- {
- ((ISystemContainer)target).markStale(true);
- }
-
- RefreshJob refresh = new RefreshJob(target, targetSubSystem);
- refresh.schedule();
- return Status.OK_STATUS;
- }
-
- public class RefreshJob extends UIJob
- {
- private Object _target;
- private ISubSystem _targetSubSystem;
- public RefreshJob(Object target, ISubSystem targetSubSystem)
- {
- super("Refresh");
- _target = target;
- _targetSubSystem = targetSubSystem;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- if (_resultTgtObjects.size() > 0)
- {
- boolean doRefresh = _ok;
- for (int t = 0; t < _resultTgtObjects.size() && t < _resultSrcObjects.size(); t++)
- {
- Object tgt = _resultTgtObjects.get(t);
- Object src = _resultSrcObjects.get(t);
- if (tgt == src || tgt == null)
- {
- doRefresh = false;
- }
- else
- {
- doRefresh = true;
- }
- }
-
- if (_originatingViewer instanceof TreeViewer)
- {
- try
- {
- TreeViewer viewer = (TreeViewer) _originatingViewer;
- viewer.setExpandedState(_target, true);
- }
- catch (Exception e)
- {
-
- }
- }
-
- if (doRefresh)
- {
- registry.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED, _resultTgtObjects, _target, _targetSubSystem, null, _originatingViewer);
- }
- }
- registry.fireEvent(new SystemResourceChangeEvent(_target, ISystemResourceChangeEvents.EVENT_REFRESH, _target));
- return Status.OK_STATUS;
- }
- }
-
- private void operationFailed(IProgressMonitor monitor)
- {
-
- _ok = false;
- if (monitor != null)
- monitor.done();
- }
-
- private void showInvalidTransferMessage(String srcPath, String targetPath)
- {
- SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_TRANSFER_INVALID);
- errorMessage.makeSubstitution(srcPath, targetPath);
- showErrorMessage(errorMessage);
- }
-
- private void showInvalidTransferMessage(ISystemResourceSet resourceSet, String targetPath)
- {
- SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_TRANSFER_INVALID);
- errorMessage.makeSubstitution(resourceSet.toString(), targetPath);
- showErrorMessage(errorMessage);
- }
-
- private void showErrorMessage(SystemMessage errorMessage)
- {
- Display.getDefault().asyncExec(new ShowErrorRunnable(errorMessage));
- }
-
- public class ShowErrorRunnable implements Runnable
- {
- SystemMessage _errorMessage;
- public ShowErrorRunnable(SystemMessage errorMessage)
- {
- _errorMessage = errorMessage;
- }
-
- public void run()
- {
- Shell shell = SystemBasePlugin.getActiveWorkbenchShell();
- SystemMessageDialog dlg = new SystemMessageDialog(shell, _errorMessage);
- dlg.open();
- }
-
- }
-
- public boolean dropOkay()
- {
- return _ok;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDecoratingLabelProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDecoratingLabelProvider.java
deleted file mode 100644
index d8aed0a7f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDecoratingLabelProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mjberger
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class SystemDecoratingLabelProvider extends DecoratingLabelProvider implements ITableLabelProvider
-{
- private ITableLabelProvider _tableLabelProvider;
-
- public SystemDecoratingLabelProvider(ITableLabelProvider provider, ILabelDecorator decorator) {
- super((ILabelProvider)provider, decorator);
- // TODO Auto-generated constructor stub
- _tableLabelProvider = provider;
- }
-
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- if (columnIndex == 0) //TODO: Make this more generic
- {
- return getImage(element);
- }
- return _tableLabelProvider.getColumnImage(element, columnIndex);
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- if (columnIndex == 0) //TODO: Make this more generic
- {
- return getText(element);
- }
- return _tableLabelProvider.getColumnText(element, columnIndex);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDeferredTableTreeContentManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDeferredTableTreeContentManager.java
deleted file mode 100644
index ed6d235a4..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDeferredTableTreeContentManager.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.progress.DeferredTreeContentManager;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-public class SystemDeferredTableTreeContentManager extends
- DeferredTreeContentManager {
-
- private SystemTableTreeViewProvider _provider;
- private SystemTableTreeView _view;
- public SystemDeferredTableTreeContentManager(SystemTableTreeViewProvider provider, SystemTableTreeView viewer) {
- super(provider, viewer);
- _provider = provider;
- _view = viewer;
- }
-
-
- protected void addChildren(Object parent, Object[] children, IProgressMonitor monitor) {
- super.addChildren(parent, children, monitor);
-
- _provider.setCachedObjects(parent, children);
- IPropertyDescriptor[] descriptors = _view.getUniqueDescriptors();
- if (descriptors == null)
- {
- Display.getDefault().asyncExec(new RelayoutView(parent));
- }
- }
-
-
- public class RelayoutView implements Runnable
- {
- private Object _parent;
- public RelayoutView(Object parent)
- {
- _parent = parent;
- }
-
- public void run()
- {
- _view.computeLayout();
- _view.refresh(true);
- //SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- //registry.fireEvent(new SystemResourceChangeEvent(_parent, ISystemResourceChangeEvents.EVENT_PROPERTYSHEET_UPDATE, _parent));
- }
- }
-
-
-}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDropActionDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDropActionDelegate.java
deleted file mode 100644
index 74f1530af..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDropActionDelegate.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.part.IDropActionDelegate;
-
-
-
-/**
- * This class is used for dropping RSE src objects on known non-RSE targets
- *
- */
-public class SystemDropActionDelegate implements IDropActionDelegate
-{
-
- public static final String ID = "org.eclipse.rse.ui.view.DropActions"; //ID fixed, by Phil
-
-
- /** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
- public boolean run(Object data, Object target)
- {
- String localPath = null;
- IResource resource = null;
-
-
-
-
- if (target instanceof IResource)
- {
- resource = (IResource) target;
- localPath = resource.getLocation().toOSString();
- }
- else if (target instanceof String)
- {
- localPath = (String)target;
- }
- else if (target instanceof IAdaptable)
- {
- Object resourceObj = ((IAdaptable)target).getAdapter(IResource.class);
- if (resourceObj != null && resourceObj instanceof IResource)
- {
- resource = (IResource)resourceObj;
- localPath = resource.getLocation().toOSString();
- }
- }
-
-
- if (localPath != null)
- {
-
- if (data instanceof byte[])
- {
- byte[] result = (byte[]) data;
-
- // get the sources
- //StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
- String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
- ArrayList srcObjects = new ArrayList();
- ArrayList rulesList = new ArrayList();
- int j = 0;
- //while (tokenizer.hasMoreTokens())
- for (int i = 0; i <tokens.length; i++)
- {
- String srcStr = tokens[i];
-
- Object srcObject = getObjectFor(srcStr);
- srcObjects.add(srcObject);
- }
-
- SystemDNDTransferRunnable runnable = new SystemDNDTransferRunnable(target, srcObjects, null, SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE);
-
- runnable.schedule();
-
- if (resource != null)
- {
- try
- {
- resource.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
- catch (CoreException e)
- {
- }
- }
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- }
-
- /** FIXME - IREmoteFile is systems.core independent now
- IRemoteFileSubSystem localFS = getLocalFileSubSystem();
- try
- {
- IRemoteFile rsfTarget = localFS.getRemoteFileObject(localPath);
-
- if (data instanceof byte[])
- {
- byte[] result = (byte[]) data;
-
- // get the sources
- //StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
- String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
- ArrayList srcObjects = new ArrayList();
- ArrayList rulesList = new ArrayList();
- int j = 0;
- //while (tokenizer.hasMoreTokens())
- for (int i = 0; i <tokens.length; i++)
- {
- String srcStr = tokens[i];
-
- Object srcObject = getObjectFor(srcStr);
- srcObjects.add(srcObject);
- if (srcObject instanceof ISchedulingRule)
- {
- rulesList.add(srcObject);
- j++;
- }
- else if (srcObject instanceof IRemoteFile)
- {
- rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)srcObject));
- j++;
- }
- }
- if (resource != null)
- {
- rulesList.add(resource);
- j++;
- }
-
- ISchedulingRule[] rules = (ISchedulingRule[])rulesList.toArray(new ISchedulingRule[rulesList.size()]);
- MultiRule rule = null;
- if (j > 0)
- {
- rule = new MultiRule(rules);
- }
-
- Viewer currentViewer = null; // todo: figure out how to determine the current viewer! Phil
- SystemDNDTransferRunnable runnable = new SystemDNDTransferRunnable(rsfTarget, srcObjects, currentViewer, SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE);
-
- runnable.setRule(rule);
-
- runnable.schedule();
-
- if (resource != null)
- {
- try
- {
- resource.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
- catch (CoreException e)
- {
- }
- }
- RSEUIPlugin.getTheSystemRegistry().clearRunnableContext();
- }
- }
- catch (SystemMessageException e)
- {
- }
- **/
- return true;
- }
-
- return false;
- }
- /**
- * Method for decoding an source object ID to the actual source object.
- * We determine the profile, connection and subsystem, and then
- * we use the SubSystem.getObjectWithKey() method to get at the
- * object.
- *
- */
- private Object getObjectFor(String str)
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- // first extract subsystem id
- int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
- if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
- {
- int profileDelim = str.indexOf("."); //$NON-NLS-1$
- if (profileDelim != -1)
- {
- String profileId = str.substring(0, profileDelim);
- String connectionId = str.substring(profileDelim + 1, str.length());
- ISystemProfile profile = registry.getSystemProfile(profileId);
- return registry.getHost(profile, connectionId);
- }
- }
-
-
- int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
- if (subsystemDelim == -1) // not remote object, therefore likely to be a subsystem
- {
- return registry.getSubSystem(str);
- }
- else
- {
- String subSystemId = str.substring(0, subsystemDelim);
- String srcKey = str.substring(subsystemDelim + 1, str.length());
-
-
- ISubSystem subSystem = registry.getSubSystem(subSystemId);
- if (subSystem != null)
- {
- Object result = null;
- try
- {
- result = subSystem.getObjectWithAbsoluteName(srcKey);
- }
- catch (SystemMessageException e)
- {
- return e.getSystemMessage();
- }
- catch (Exception e)
- {
- }
- if (result != null)
- {
- return result;
- }
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND);
- msg.makeSubstitution(srcKey, subSystem.getHostAliasName());
- return msg;
- }
- }
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_CONNECTION_NOTFOUND);
- msg.makeSubstitution(subSystemId);
- return msg;
- }
- }
- }
-
- protected IRunnableContext getRunnableContext(Shell shell)
- {
- IRunnableContext irc = RSEUIPlugin.getTheSystemRegistry().getRunnableContext();
- if (irc != null)
- {
- return irc;
- }
-
- irc = new ProgressMonitorDialog(shell);
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
- return irc;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemEmptyListAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemEmptyListAPIProviderImpl.java
deleted file mode 100644
index 5141a872d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemEmptyListAPIProviderImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.model.IHost;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is a special-case provider when we want the list to be empty.
- */
-public class SystemEmptyListAPIProviderImpl
- extends SystemAbstractAPIProvider
- implements ISystemViewInputProvider
-{
-
-
- protected Object[] emptyList = new Object[0];
-
- /**
- * Constructor
- */
- public SystemEmptyListAPIProviderImpl()
- {
- super();
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * <p>We return an empty list.
- */
- public Object[] getSystemViewRoots()
- {
- return emptyList;
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return false.
- */
- public boolean hasSystemViewRoots()
- {
- return false;
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>We return an empty list
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return emptyList; //
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>we return false
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-
- /**
- * Return true to show the action bar (ie, toolbar) above the viewer.
- * The action bar contains connection actions, predominantly.
- */
- public boolean showActionBar()
- {
- return false;
- }
- /**
- * Return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typicall
- * shown in dialogs that list only remote system objects.
- */
- public boolean showButtonBar()
- {
- return true;
- }
- /**
- * Return true to show right-click popup actions on objects in the tree.
- */
- public boolean showActions()
- {
- return false;
- }
-
-
-
- // ----------------------------------
- // OUR OWN METHODS...
- // ----------------------------------
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritablePropertyData.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritablePropertyData.java
deleted file mode 100644
index b789e2ffe..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritablePropertyData.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.ui.SystemPropertyResources;
-/**
- * This class captures the data needed to populate a
- * InheritableTextCellEditor.
- */
-public class SystemInheritablePropertyData
-{
- private String localValue="";
- private String inheritedValue="";
- private boolean isLocal;
- private boolean notApplicable = false;
-
- private String inheritedXlatedString;
-
- public SystemInheritablePropertyData()
- {
- super();
- setInheritedDisplayString(SystemPropertyResources.RESID_PROPERTY_INHERITED);
- }
-
- /**
- * Identify this value as "not applicable". This causes
- * this string to be displayed, and prevents users from editing this property.
- */
- public void setNotApplicable(boolean set)
- {
- notApplicable = set;
- }
- /**
- * Get the notApplicable flag. Default is false.
- */
- public boolean getNotApplicable()
- {
- return notApplicable;
- }
-
- /**
- * Gets the localValue
- * @return Returns a String
- */
- public String getLocalValue()
- {
- return localValue;
- }
- /**
- * Sets the localValue
- * @param localValue The localValue to set
- */
- public void setLocalValue(String localValue)
- {
- if (localValue == null)
- localValue = ""; // to prevent equals() from crashing
- this.localValue = localValue;
- }
-
- /**
- * Gets the inheritedValue
- * @return Returns a String
- */
- public String getInheritedValue()
- {
- return inheritedValue;
- }
- /**
- * Sets the inheritedValue
- * @param inheritedValue The inheritedValue to set
- */
- public void setInheritedValue(String inheritedValue)
- {
- if (inheritedValue == null)
- inheritedValue = ""; // to prevent equals() from crashing
- this.inheritedValue = inheritedValue;
- }
-
-
- /**
- * Gets the isLocal
- * @return Returns a boolean
- */
- public boolean getIsLocal()
- {
- return isLocal;
- }
- /**
- * Sets the isLocal
- * @param isLocal The isLocal to set
- */
- public void setIsLocal(boolean isLocal)
- {
- this.isLocal = isLocal;
- }
-
- /**
- * Set the string to append to the inherited value in display-only mode
- */
- public void setInheritedDisplayString(String s)
- {
- inheritedXlatedString = s;
- }
-
- /**
- * Convert to string for readonly-property sheet value
- */
- public String toString()
- {
- if (notApplicable)
- return SystemPropertyResources.RESID_TERM_NOTAPPLICABLE;
- String value = null;
- if (isLocal)
- value = localValue;
- else
- //value = " (*INHERITED)";
- value = inheritedValue + " " + inheritedXlatedString;
- return value;
- }
-
- /**
- * The property sheet viewer will decide to call the adapter back when Enter is pressed,
- * only if the result of calling equals() on the previous and current versions of this
- * object returns false. If we did not have this method, they'd always return true.
- */
- public boolean equals(Object other)
- {
- if (other instanceof SystemInheritablePropertyData)
- {
- SystemInheritablePropertyData otherData = (SystemInheritablePropertyData)other;
- boolean equal =
- ((isLocal == otherData.getIsLocal()) &&
- (localValue.equals(otherData.getLocalValue())) &&
- (inheritedValue.equals(otherData.getInheritedValue())) );
- /*
- System.out.println("inside equals. Result? " + equal + " Local value: " + localValue);
- if (!equal)
- {
- System.out.println("... isLocal.......: " + isLocal + " vs " + otherData.getIsLocal());
- System.out.println("... localValue....: '" + localValue + "' vs '" + otherData.getLocalValue() + "'");
- System.out.println("... inheritedValue: '" + inheritedValue + "' vs " + otherData.getInheritedValue() + "'");
- }
- */
- return equal;
- }
- else
- return super.equals(other);
- }
-
- /**
- * For debugging
- */
- public void printDetails()
- {
- System.out.println("SystemInheritablePropertyData: ");
- System.out.println("...localValue = "+localValue);
- System.out.println("...inheritedValue = "+inheritedValue);
- System.out.println("...isLocal = "+isLocal);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextCellEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextCellEditor.java
deleted file mode 100644
index 3112b8b8c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextCellEditor.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.text.MessageFormat;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.rse.ui.widgets.InheritableEntryField;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * A cell editor that manages an inheritable text entry field.
- * The cell editor's value is the text string itself.
- */
-public class SystemInheritableTextCellEditor
- //extends DialogCellEditor
- extends CellEditor
- implements SelectionListener
-{
- protected InheritableEntryField textField;
- protected Text text;
- protected SystemInheritablePropertyData data;
- private String toggleButtonToolTipText, entryFieldToolTipText;
-
- private ModifyListener modifyListener;
-
- /**
- * State information for updating action enablement
- */
- private boolean isSelection = false;
- private boolean isDeleteable = false;
- private boolean isSelectable = false;
-
- /**
- * Creates a new text string cell editor parented under the given control.
- * The cell editor value is the string itself, which is initially the empty string.
- * Initially, the cell editor has no cell validator.
- *
- * @param parent the parent control
- */
- public SystemInheritableTextCellEditor(Composite parent)
- {
- super(parent);
- }
- /**
- * Checks to see if the "deleteable" state (can delete/
- * nothing to delete) has changed and if so fire an
- * enablement changed notification.
- */
- private void checkDeleteable()
- {
- boolean oldIsDeleteable = isDeleteable;
- isDeleteable = isDeleteEnabled();
- if (oldIsDeleteable != isDeleteable)
- {
- fireEnablementChanged(DELETE);
- }
- }
-
-
- /**
- * Checks to see if the "selectable" state (can select)
- * has changed and if so fire an enablement changed notification.
- */
- private void checkSelectable()
- {
- boolean oldIsSelectable = isSelectable;
- isSelectable = isSelectAllEnabled();
- if (oldIsSelectable != isSelectable)
- {
- fireEnablementChanged(SELECT_ALL);
- }
- }
- /**
- * Checks to see if the selection state (selection /
- * no selection) has changed and if so fire an
- * enablement changed notification.
- */
- private void checkSelection()
- {
- boolean oldIsSelection = isSelection;
- isSelection = getTextField().getSelectionCount() > 0;
- if (oldIsSelection != isSelection)
- {
- fireEnablementChanged(COPY);
- fireEnablementChanged(CUT);
- }
- }
- /**
- * Return the entry field of the composite control
- */
- private Text getTextField()
- {
- return textField.getTextField();
- }
-
- public InheritableEntryField getInheritableEntryField()
- {
- return textField;
- }
-
- /**
- * Gets the toggleButtonToolTipText
- * @return Returns a String
- */
- public String getToggleButtonToolTipText()
- {
- return toggleButtonToolTipText;
- }
- /**
- * Sets the toggleButtonToolTipText
- * @param toggleButtonToolTipText The toggleButtonToolTipText to set
- */
- public void setToggleButtonToolTipText(String toggleButtonToolTipText)
- {
- this.toggleButtonToolTipText = toggleButtonToolTipText;
- if (textField != null)
- textField.setToggleToolTipText(toggleButtonToolTipText);
- }
-
- /**
- * Gets the entryFieldToolTipText
- * @return Returns a String
- */
- public String getEntryFieldToolTipText()
- {
- return entryFieldToolTipText;
- }
- /**
- * Sets the entryFieldToolTipText
- * @param entryFieldToolTipText The entryFieldToolTipText to set
- */
- public void setEntryFieldToolTipText(String entryFieldToolTipText)
- {
- this.entryFieldToolTipText = entryFieldToolTipText;
- if (textField != null)
- textField.setTextFieldToolTipText(entryFieldToolTipText);
- }
-
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected Control createControl(Composite parent)
- {
- // specify no borders on text widget as cell outline in
- // table already provides the look of a border.
- textField = new InheritableEntryField(parent, SWT.NULL, SWT.BORDER, SWT.SINGLE);
- textField.setToggleButtonHeight(14);
- textField.setBackground(parent.getBackground());
- textField.addSelectionListener(this);
- if (toggleButtonToolTipText != null)
- textField.setToggleToolTipText(toggleButtonToolTipText);
- if (entryFieldToolTipText != null)
- textField.setTextFieldToolTipText(entryFieldToolTipText);
- text = getTextField();
- text.addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- // The call to inherited keyReleaseOccurred is what causes the apply
- // event if the key pressed is Enter.
- keyReleaseOccured(e);
- // as a result of processing the above call, clients may have
- // disposed this cell editor
- if ((getControl() == null) || getControl().isDisposed())
- return;
- checkSelection(); // see explaination below
- checkDeleteable();
- checkSelectable();
- }
- });
- text.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN)
- {
- e.doit = false;
- }
- }
- });
- // We really want a selection listener but it is not supported so we
- // use a key listener and a mouse listener to know when selection changes
- // may have occured
- text.addMouseListener(new MouseAdapter()
- {
- public void mouseUp(MouseEvent e) {
- checkSelection();
- checkDeleteable();
- checkSelectable();
- }
- });
- text.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- }
-
- public void focusLost(FocusEvent e) {
- SystemInheritableTextCellEditor.this.focusLost();
- }
- });
- textField.getToggleButton().addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- SystemInheritableTextCellEditor.this.focusLost();
- }
-
- public void focusGained(FocusEvent e) {
- }
- });
-
- text.setFont(parent.getFont());
- //text.setBackground(parent.getBackground());
- text.setText("");//$NON-NLS-1$
- text.addModifyListener(getModifyListener());
- setValueValid(true);
- return textField;
- }
-
- protected void focusLost()
- {
- super.focusLost();
- }
-
- /**
- * Return current data.
- *
- * @return the SystemInheritablePropertyData data object
- */
- protected Object doGetValue()
- {
- SystemInheritablePropertyData outputData = new SystemInheritablePropertyData();
- outputData.setIsLocal(textField.isLocal());
- outputData.setLocalValue(textField.getLocalText());
- outputData.setInheritedValue(textField.getInheritedText());
- return outputData;
- }
-
-
- /* (non-Javadoc)
- * Method declared on CellEditor.
- */
- protected void doSetFocus()
- {
- if (text != null)
- {
- if (text.isEnabled())
- {
- text.selectAll();
- text.setFocus();
- }
- else
- {
- textField.setToggleButtonFocus();
- }
-
- checkSelection();
- checkDeleteable();
- checkSelectable();
- }
- }
- /**
- * The <code>TextCellEditor</code> implementation of
- * this <code>CellEditor</code> framework method accepts
- * a SystemInheritablePropertyData data object.
- *
- * @param value a SystemInheritablePropertyData object
- */
- protected void doSetValue(Object value)
- {
- Assert.isTrue(text != null && (value instanceof SystemInheritablePropertyData));
- textField.removeModifyListener(getModifyListener());
- data = (SystemInheritablePropertyData)value;
- textField.setLocalText(data.getLocalValue());
- textField.setInheritedText(data.getInheritedValue());
- textField.setLocal(data.getIsLocal());
- textField.addModifyListener(getModifyListener());
- }
- /**
- * Processes a modify event that occurred in this text cell editor.
- * This framework method performs validation and sets the error message
- * accordingly, and then reports a change via <code>fireEditorValueChanged</code>.
- * Subclasses should call this method at appropriate times. Subclasses
- * may extend or reimplement.
- *
- * @param e the SWT modify event
- */
- protected void editOccured(ModifyEvent e)
- {
- String value = text.getText();
- if (value == null)
- value = "";
- Object typedValue = value;
- boolean oldValidState = isValueValid();
- boolean newValidState = isCorrect(typedValue);
- if (!newValidState)
- {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] {value}));
- }
- valueChanged(oldValidState, newValidState);
- }
- /**
- * Since a text editor field is scrollable we don't
- * set a minimumSize.
- */
- public LayoutData getLayoutData()
- {
- return new LayoutData();
- }
- /**
- * Return the modify listener.
- */
- private ModifyListener getModifyListener()
- {
- if (modifyListener == null)
- {
- modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e)
- {
- editOccured(e);
- }
- };
- }
- return modifyListener;
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method returns <code>true</code> if
- * the current selection is not empty.
- */
- public boolean isCopyEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return text.getSelectionCount() > 0;
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method returns <code>true</code> if
- * the current selection is not empty.
- */
- public boolean isCutEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return text.getSelectionCount() > 0;
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method returns <code>true</code>
- * if there is a selection or if the caret is not positioned
- * at the end of the text.
- */
- public boolean isDeleteEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount();
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method always returns <code>true</code>.
- */
- public boolean isPasteEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return true;
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method always returns <code>true</code>.
- */
- public boolean isSaveAllEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return true;
- }
- /**
- * Returns <code>true</code> if this cell editor is
- * able to perform the select all action.
- * <p>
- * This default implementation always returns
- * <code>false</code>.
- * </p>
- * <p>
- * Subclasses may override
- * </p>
- * @return <code>true</code> if select all is possible,
- * <code>false</code> otherwise
- */
- public boolean isSelectAllEnabled()
- {
- if (text == null || text.isDisposed() || !text.isEnabled())
- return false;
- return text.getText().length() > 0;
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method copies the
- * current selection to the clipboard.
- */
- public void performCopy()
- {
- text.copy();
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method cuts the
- * current selection to the clipboard.
- */
- public void performCut()
- {
- text.cut();
- checkSelection();
- checkDeleteable();
- checkSelectable();
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method deletes the
- * current selection or, if there is no selection,
- * the character next character from the current position.
- */
- public void performDelete()
- {
- if (text.getSelectionCount() > 0)
- // remove the contents of the current selection
- text.insert("");
- else
- {
- // remove the next character
- int pos = text.getCaretPosition();
- if (pos < text.getCharCount())
- {
- text.setSelection(pos, pos + 1);
- text.insert("");
- }
- }
- checkSelection();
- checkDeleteable();
- checkSelectable();
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method pastes the
- * the clipboard contents over the current selection.
- */
- public void performPaste()
- {
- text.paste();
- checkSelection();
- checkDeleteable();
- checkSelectable();
- }
- /**
- * The <code>TextCellEditor</code> implementation of this
- * <code>CellEditor</code> method selects all of the
- * current text.
- */
- public void performSelectAll()
- {
- text.selectAll();
- checkSelection();
- checkDeleteable();
- }
-
- // Selection Listener methods for InheritableTextCellEditor toggle switches
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- public void widgetSelected(SelectionEvent e)
- {
- //System.out.println("Got widget selected event. isLocal() = " + textField.isLocal()+", text='"+textField.getText()+"'");
- boolean isLocal = textField.isLocal();
- String value = text.getText();
- data.setIsLocal(isLocal);
- boolean oldValidState = isValueValid();
- boolean newValidState = isLocal?isCorrect(value):true; //isCorrect(typedValue);
- if (!newValidState)
- {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] {value}));
- }
- valueChanged(oldValidState, newValidState);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextPropertyDescriptor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextPropertyDescriptor.java
deleted file mode 100644
index d3893b9d0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemInheritableTextPropertyDescriptor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-/**
- * A variation of the Eclipse-supplied TextPropertyDescriptor for
- * displaying text string properties that are inheritable.
- */
-public class SystemInheritableTextPropertyDescriptor
- extends PropertyDescriptor
-{
- private SystemInheritableTextCellEditor editor;
- private String toggleButtonToolTipText, entryFieldToolTipText;
- private boolean editable = true;
-
- /**
- * Creates a property descriptor with the given id, display name
- *
- * @param id the id of the property
- * @param displayName the name to display for the property
- */
- public SystemInheritableTextPropertyDescriptor(Object id, String displayName)
- {
- super(id, displayName);
- }
- /**
- * Call this with false in special circumstances to user's disable ability to edit this value.
- * Default is true
- * @see #getEditable()
- */
- public void setEditable(boolean allow)
- {
- editable = allow;
- }
- /**
- * Query the allow-editing value. Default is true.
- */
- public boolean getEditable()
- {
- return editable;
- }
-
- /**
- * Return an instance of SystemInheritableTextCellEditor, unless
- * our editable property is false, in which case we return null;
- */
- public CellEditor createPropertyEditor(Composite parent)
- {
- if (!editable)
- return null;
- editor = new SystemInheritableTextCellEditor(parent);
- if (getValidator() != null)
- editor.setValidator(getValidator());
- if (toggleButtonToolTipText != null)
- editor.setToggleButtonToolTipText(toggleButtonToolTipText);
- if (entryFieldToolTipText != null)
- editor.setEntryFieldToolTipText(entryFieldToolTipText);
- return editor;
- }
-
-
- /**
- * Gets the toggleButtonToolTipText
- * @return Returns a String
- */
- public String getToggleButtonToolTipText()
- {
- return toggleButtonToolTipText;
- }
- /**
- * Sets the toggleButtonToolTipText
- * @param toggleButtonToolTipText The toggleButtonToolTipText to set
- */
- public void setToggleButtonToolTipText(String toggleButtonToolTipText)
- {
- this.toggleButtonToolTipText = toggleButtonToolTipText;
- }
-
- /**
- * Gets the entryFieldToolTipText
- * @return Returns a String
- */
- public String getEntryFieldToolTipText()
- {
- return entryFieldToolTipText;
- }
- /**
- * Sets the entryFieldToolTipText
- * @param entryFieldToolTipText The entryFieldToolTipText to set
- */
- public void setEntryFieldToolTipText(String entryFieldToolTipText)
- {
- this.entryFieldToolTipText = entryFieldToolTipText;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemLongRunningRequestEvent.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemLongRunningRequestEvent.java
deleted file mode 100644
index 4c620cd8b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemLongRunningRequestEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.swt.widgets.Event;
-
-/**
- * An event object as passed for ISystemLongRunningRequestListener methods.
- */
-public class SystemLongRunningRequestEvent extends Event
-{
-
- /**
- * Constructor for SystemLongRunningRequestEvent
- */
- public SystemLongRunningRequestEvent()
- {
- super();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPerspectiveLayout.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPerspectiveLayout.java
deleted file mode 100644
index 7afbcd785..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPerspectiveLayout.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.rse.ui.view.scratchpad.SystemScratchpadViewPart;
-import org.eclipse.rse.ui.view.team.SystemTeamViewPart;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-
-/**
- * This class is responsible for laying out the views in the RSE perspective
- */
-public class SystemPerspectiveLayout implements IPerspectiveFactory
-{
-
- public static final String ID = "org.eclipse.rse.ui.view.SystemPerspective"; // matches id in plugin.xml, layout tag
- /**
- * Defines the initial layout for a perspective.
- * This method is only called when a new perspective is created. If
- * an old perspective is restored from a persistence file then
- * this method is not called.
- *
- * @param factory the factory used to add views to the perspective
- */
- public void createInitialLayout(IPageLayout layout)
- {
- String editorArea = layout.getEditorArea();
-
- IFolderLayout folder= layout.createFolder("org.eclipse.rse.ui.view.NavFolder", IPageLayout.LEFT,
- (float)0.25, editorArea);
- //folder.addView(IPageLayout.ID_RES_NAV);
- folder.addView(SystemViewPart.ID);
- folder.addView(SystemTeamViewPart.ID);
-
- folder= layout.createFolder("org.eclipse.rse.ui.view.MiscFolder", IPageLayout.BOTTOM,
- (float).60, editorArea);
-
- folder.addView(SystemTableViewPart.ID);
- //folder.addView(SystemMonitorViewPart.ID);
- folder.addView(IPageLayout.ID_TASK_LIST); // put in the desktop-supplied task list view
-
-
- folder= layout.createFolder("org.eclipse.rse.ui.view.OutlineFolder", IPageLayout.RIGHT,
- (float).80, editorArea);
-
- folder.addView(IPageLayout.ID_OUTLINE); // put in desktop-supplied outline view
- // unfortunately we can't do the following as snippets aren't in wswb, according to DKM
-
- folder= layout.createFolder("org.eclipse.rse.ui.view.PropertiesFolder", IPageLayout.BOTTOM,
- (float).75, "org.eclipse.rse.ui.view.NavFolder");
- //layout.addView(IPageLayout.ID_PROP_SHEET, IPageLayout.BOTTOM,
- // (float)0.75, "org.eclipse.rse.ui.view.NavFolder"); // put in desktop-supplied property sheet view
- folder.addView(IPageLayout.ID_PROP_SHEET);
- folder.addView(SystemScratchpadViewPart.ID);
-
- // update Show View menu with our views
- layout.addShowViewShortcut(SystemViewPart.ID);
- layout.addShowViewShortcut(SystemTableViewPart.ID);
-
- layout.addShowViewShortcut(SystemTableViewPart.ID);
- layout.addShowViewShortcut(SystemViewPart.ID);
- layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
- // update Perspective Open menu with our perspective
- layout.addPerspectiveShortcut(ID);
-
- // Add action sets to the tool bar.
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPropertySheetForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPropertySheetForm.java
deleted file mode 100644
index 6e0740cfa..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemPropertySheetForm.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-
-
-
-/**
- * This re-usable widget is for a property-sheet widget that is imbeddable in dialogs.
- * It is similar to the workbench property sheet but there are some important differences.
- */
-public class SystemPropertySheetForm extends Composite
-{
-
- private PropertySheetPage tree = null;
- private boolean enabledMode = true;
- //private ISystemViewInputProvider inputProvider = null;
- //private ISystemViewInputProvider emptyProvider = new SystemEmptyListAPIProviderImpl();
- public static final int DEFAULT_WIDTH = 300;
- public static final int DEFAULT_HEIGHT = 250;
-
- /**
- * Constructor
- * @param shell The owning window
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically SWT.NULL
- * @param msgLine where to show messages and tooltip text
- */
- public SystemPropertySheetForm(Shell shell, Composite parent, int style, ISystemMessageLine msgLine)
- {
- this(shell, parent, style, msgLine, 1, 1);
- }
- /**
- * Constructor when you want to span more than one column or row
- * @param shell The owning window
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically SWT.NULL
- * @param horizontalSpan how many columns in parent composite to span
- * @param verticalSpan how many rows in parent composite to span
- * @param msgLine where to show messages and tooltip text
- */
- public SystemPropertySheetForm(Shell shell, Composite parent, int style, ISystemMessageLine msgLine, int horizontalSpan, int verticalSpan)
- {
- super(parent, style);
- prepareComposite(1, horizontalSpan, verticalSpan);
- createPropertySheetView(shell);
- addOurSelectionListener();
- addOurMouseListener();
- addOurKeyListener();
- }
-
- /**
- * Return the system view tree viewer
- */
- public PropertySheetPage getPropertySheetView()
- {
- return tree;
- }
- /**
- * Return the underlying control
- */
- public Control getControl()
- {
- return tree.getControl();
- }
-
- /**
- * Set the tree's tooltip text
- */
- public void setToolTipText(String tip)
- {
- tree.getControl().setToolTipText(tip);
- }
- /**
- * Refresh contents
- */
- public void refresh()
- {
- tree.refresh();
- }
-
- /**
- * Method declared on ISelectionListener.
- */
- public void selectionChanged(ISelection selection)
- {
- tree.selectionChanged(null, selection);
- }
-
- /**
- * Disable/Enable all the child controls.
- */
- public void setEnabled(boolean enabled)
- {
- enabledMode = enabled;
- }
-
- // -----------------------
- // INTERNAL-USE METHODS...
- // -----------------------
- /**
- * Prepares this composite control and sets the default layout data.
- * @param Number of columns the new group will contain.
- */
- protected Composite prepareComposite(int numColumns,
- int horizontalSpan, int verticalSpan)
- {
- Composite composite = this;
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.widthHint = DEFAULT_WIDTH;
- data.heightHint = DEFAULT_HEIGHT;
- data.horizontalSpan = horizontalSpan;
- data.verticalSpan = verticalSpan;
- composite.setLayoutData(data);
- return composite;
- }
-
- protected void createPropertySheetView(Shell shell)
- {
- tree = new PropertySheetPage();
- tree.createControl(this);
- Control c = tree.getControl();
- GridData treeData = new GridData();
- treeData.horizontalAlignment = GridData.FILL;
- treeData.verticalAlignment = GridData.FILL;
- treeData.grabExcessHorizontalSpace = true;
- treeData.grabExcessVerticalSpace = true;
- treeData.widthHint = 220;
- treeData.heightHint= 200;
- c.setLayoutData(treeData);
- //tree.setShowActions(showActions);
-
- }
-
-
- protected void addOurSelectionListener()
- {
- // Add the button listener
- SelectionListener selectionListener = new SelectionListener()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- };
- public void widgetSelected(SelectionEvent event)
- {
- if (!enabledMode)
- return;
- Object src = event.getSource();
- };
- };
- //tree.getControl().addSelectionListener(selectionListener);
- }
-
- protected void addOurMouseListener()
- {
- MouseListener mouseListener = new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- if (!enabledMode)
- return;
- //requestActivation();
- }
- };
- tree.getControl().addMouseListener(mouseListener);
- }
-
- protected void addOurKeyListener()
- {
- KeyListener keyListener = new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- if (!enabledMode)
- {
- //e.doit = false;
- return;
- }
- //handleKeyPressed(e);
- }
- };
- tree.getControl().addKeyListener(keyListener);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResolveFilterStringAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResolveFilterStringAPIProviderImpl.java
deleted file mode 100644
index eb3bdc091..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResolveFilterStringAPIProviderImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are used to show the resolution of a single filter string.
- */
-public class SystemResolveFilterStringAPIProviderImpl extends SystemTestFilterStringAPIProviderImpl
-{
-
-
-
- /**
- * Constructor
- * @param subsystem The subsystem that will resolve the filter string
- * @param filterString The filter string to test
- */
- public SystemResolveFilterStringAPIProviderImpl(ISubSystem subsystem, String filterString)
- {
- super(subsystem, filterString);
- } // end constructor
-
-
- /**
- * Return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typicall
- * shown in dialogs that list only remote system objects.
- */
- public boolean showButtonBar()
- {
- return false;
- } // end showButtonBar()
-
-} // end class SystemResolveFilterStringAPIProviderImpl \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionForm.java
deleted file mode 100644
index 065715bf8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionForm.java
+++ /dev/null
@@ -1,616 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
-import org.eclipse.rse.ui.widgets.SystemHostCombo;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-public class SystemResourceSelectionForm implements ISelectionChangedListener
-{
- private Shell _shell;
- private boolean _multipleSelection = true;
- protected static final int PROMPT_WIDTH = 400; // The maximum width of the dialog's prompt, in pixels.
-
- private SystemResourceSelectionInputProvider _inputProvider;
- private SystemHostCombo _connectionCombo;
- private SystemViewForm _systemViewForm;
- private Composite _propertySheetContainer;
- protected SystemPropertySheetForm _ps;
-
- private Text _pathText;
- private boolean _isValid;
- private ISystemMessageLine _msgLine;
- protected Object previousSelection = null;
- private IValidatorRemoteSelection _selectionValidator = null;
- private boolean showPropertySheet = false;
-
-
- protected Object caller;
- protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog;
-
- protected String _verbage = null;
- protected Label verbageLabel;
- private Composite _container;
-
- // history
- private HashMap _history;
-
- // outputs
- protected IHost outputConnection = null;
- protected Object[] outputObjects = null;
-
-
- public SystemResourceSelectionForm(Shell shell, Composite parent, Object caller,
- SystemResourceSelectionInputProvider inputProvider, String verbage,
- boolean multipleSelection,
- ISystemMessageLine msgLine)
- {
- _msgLine= msgLine;
- _history = new HashMap();
- _inputProvider = inputProvider;
- _multipleSelection = multipleSelection;
- _shell = shell;
- _verbage = verbage;
- this.caller = caller;
- callerInstanceOfWizardPage = (caller instanceof WizardPage);
- callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
-
- createControls(parent);
- }
-
- public void setMessageLine(ISystemMessageLine msgLine)
- {
- _msgLine = msgLine;
- }
-
- /**
- * Return first selected object
- */
- public Object getSelectedObject()
- {
- if ((outputObjects != null) && (outputObjects.length>=1))
- return outputObjects[0];
- else
- return null;
- }
- /**
- * Return all selected objects.
- * @see #setMultipleSelectionMode(boolean)
- */
- public Object[] getSelectedObjects()
- {
- return outputObjects;
- }
-
- public void createControls(Composite parent)
- {
- _container = SystemWidgetHelpers.createComposite(parent, showPropertySheet ? 2 : 1);
- //Composite container = new Composite(parent, SWT.NULL);
-
-
- // INNER COMPOSITE
- int gridColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createFlushComposite(_container, gridColumns);
-
- // PROPERTY SHEET COMPOSITE
- if (showPropertySheet)
- {
- createPropertySheet(_container, _shell);
- }
-
-
- // MESSAGE/VERBAGE TEXT AT TOP
- verbageLabel = SystemWidgetHelpers.createVerbiage(composite_prompts, _verbage, gridColumns, false, PROMPT_WIDTH);
-
-
- boolean allowMultipleConnnections = _inputProvider.allowMultipleConnections();
- if (!allowMultipleConnnections)
- {
- //Label connectionLabel = SystemWidgetHelpers.createLabel(composite_prompts, _inputProvider.getSystemConnection().getHostName());
- }
- else
- {
- String[] systemTypes = _inputProvider.getSystemTypes();
- String category = _inputProvider.getCategory();
-
- if (systemTypes != null)
- {
- _connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, _inputProvider.getSystemTypes(), _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection());
- }
- else if (category != null)
- {
- _connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection(), category);
- }
- else
- {
- _connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, "*", _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection()); //$NON-NLS-1$
-
- }
- _connectionCombo.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent evt)
- {
- IHost connection = _connectionCombo.getHost();
- connectionChanged(connection);
- }}
- );
- }
-
- _pathText = SystemWidgetHelpers.createReadonlyTextField(composite_prompts);
- _systemViewForm = new SystemViewForm(_shell, composite_prompts, SWT.NULL, _inputProvider, !_multipleSelection, _msgLine);
- _systemViewForm.addSelectionChangedListener(this);
-
-
- GridLayout layout = new GridLayout();
- GridData gdata = new GridData(GridData.FILL_BOTH);
- composite_prompts.setLayout(layout);
- composite_prompts.setLayoutData(gdata);
-
- doInitializeFields();
- }
-
- private void doInitializeFields()
- {
- setPageComplete();
- return;
- }
-
- /**
- * Create the property sheet viewer
- */
- private void createPropertySheet(Composite outerParent, Shell shell)
- {
- _propertySheetContainer = SystemWidgetHelpers.createFlushComposite(outerParent, 1);
- ((GridData)_propertySheetContainer.getLayoutData()).grabExcessVerticalSpace = true;
- ((GridData)_propertySheetContainer.getLayoutData()).verticalAlignment = GridData.FILL;
-
- // PROPERTY SHEET VIEWER
- _ps = new SystemPropertySheetForm(shell,_propertySheetContainer, SWT.BORDER, _msgLine);
- }
-
- public Control getInitialFocusControl()
- {
- return _systemViewForm.getTreeControl();
- }
-
- public void applyViewerFilter(SystemActionViewerFilter filter)
- {
- if (filter != null)
- {
- _systemViewForm.getSystemView().addFilter(filter);
- }
- }
-
- /**
- * Completes processing of the wizard page or dialog. If this
- * method returns true, the wizard/dialog will close;
- * otherwise, it will stay active.
- *
- * @return true if no errors
- */
- public boolean verify()
- {
- if (_isValid)
- {
- if (_msgLine != null)
- {
- _msgLine.clearErrorMessage();
- }
- return true;
- }
- else
- {
- return false;
- }
- }
-
- protected ISystemViewElementAdapter getAdapter(Object selection)
- {
- if (selection != null && selection instanceof IAdaptable)
- {
- return (ISystemViewElementAdapter)((IAdaptable)selection).getAdapter(ISystemViewElementAdapter.class);
- }
- return null;
- }
-
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object selection)
- {
- if (selection != null && selection instanceof IAdaptable)
- {
- return SystemAdapterHelpers.getRemoteAdapter(selection);
- }
- return null;
- }
-
- protected ISystemRemoteElementAdapter[] getRemoteAdapters(ISelection selection)
- {
- Object[] selectedObjects = getSelections(selection);
- ISystemRemoteElementAdapter[] adapters = new ISystemRemoteElementAdapter[selectedObjects.length];
- for (int idx=0; idx<adapters.length; idx++)
- {
- adapters[idx] = getRemoteAdapter(selectedObjects[idx]);
- }
- return adapters;
- }
-
-
- public void connectionChanged(IHost connection)
- {
- IHost previousConnection = _inputProvider.getSystemConnection();
- if (previousConnection != connection)
- {
-
- _inputProvider.setSystemConnection(connection, false);
-
- _systemViewForm.refresh();
- Object oldSelection = _history.get(connection);
- if (oldSelection != null)
- {
- setPreSelection(oldSelection);
- }
- }
- }
-
- public void setVerbage(String verbage)
- {
- _verbage = verbage;
- }
-
- public boolean setPreSelection(Object selection)
- {
- ISystemViewElementAdapter adapter = getAdapter(selection);
- if (adapter != null)
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- ISubSystem ss = adapter.getSubSystem(selection);
- IHost connection = ss.getHost();
- if (_inputProvider.allowMultipleConnections())
- {
- if (_connectionCombo.getHost()!= connection)
- {
- _connectionCombo.select(connection);
- }
- }
- List filterRefs = registry.findFilterReferencesFor(selection, ss);
-
- SystemView systemView = _systemViewForm.getSystemView();
- if (filterRefs.size() > 0)
- {
- ISystemFilterReference ref = (ISystemFilterReference)filterRefs.get(0);
- systemView.setExpandedElements(new Object[] {ref});
- systemView.refreshRemoteObject(selection, selection, true);
- return true;
- }
- else
- {
- Object parent = adapter.getParent(selection);
- if (setPreSelection(parent))
- {
- systemView.refreshRemoteObject(selection, selection, true);
- return true;
- }
- }
- }
- return false;
- }
-
-
- protected void setPathText(String text)
- {
- _pathText.setText(text);
- }
-
-
- public Object[] getOutputObjects()
- {
- return outputObjects;
- }
-
- /**
- * Return selected connection
- */
- public IHost getSelectedConnection()
- {
- return outputConnection;
- }
-
- /**
- * Return first item currently selected.
- */
- protected Object getFirstSelection(ISelection selection)
- {
- IStructuredSelection sSelection = (IStructuredSelection)selection;
- if (sSelection != null)
- {
- Iterator selectionIterator = sSelection.iterator();
- if (selectionIterator.hasNext())
- return selectionIterator.next();
- else
- return null;
- }
- return null;
- }
- /**
- * Return all items currently selected.
- */
- protected Object[] getSelections(ISelection selection)
- {
- IStructuredSelection sSelection = (IStructuredSelection)selection;
- if (sSelection != null)
- {
- Object[] selectedObjects = new Object[sSelection.size()];
- Iterator selectionIterator = sSelection.iterator();
- int idx = 0;
- while (selectionIterator.hasNext())
- selectedObjects[idx++] = selectionIterator.next();
- return selectedObjects;
- }
- return null;
- }
-
-
- private void setPathTextFromSelection(Object selection)
- {
- ISystemViewElementAdapter adapter = getAdapter(selection);
- String text = adapter.getAbsoluteName(selection);
-
- setPathText(text);
- }
-
- /**
- * Show or hide the property sheet. This is called after the contents are created when the user
- * toggles the Details button.
- * @param shell Use getShell() in your dialog or wizard page
- * @param contents Use getContents() in your dialog or wizard page
- * @return new state -> true if showing, false if hiding
- */
- public boolean toggleShowPropertySheet(Shell shell, Control contents)
- {
- Point windowSize = shell.getSize();
- Point oldSize = contents.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (showPropertySheet) // hiding?
- {
- _ps.dispose();
-
- _propertySheetContainer.dispose();
- _ps = null;
- _propertySheetContainer = null;
- ((GridLayout)_container.getLayout()).numColumns = 1;
- }
- else // showing?
- {
- //createPropertySheet((Composite)contents, shell);
- ((GridLayout)_container.getLayout()).numColumns = 2;
- createPropertySheet(_container, shell);
- }
-
- Point newSize = contents.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- shell.setSize(new Point(windowSize.x + (newSize.x - oldSize.x), windowSize.y));
-
- if (_ps != null)
- {
- ISelection s = _systemViewForm.getSelection();
- if (s != null)
- _ps.selectionChanged(s);
- }
-
- showPropertySheet = !showPropertySheet;
- return showPropertySheet;
- }
-
-
-// ---------------------------------------------------
- // METHODS FOR SELECTION CHANGED LISTENER INTERFACE...
- // ---------------------------------------------------
- /**
- * User selected something in the _systemViewForm.
- */
- public void selectionChanged(SelectionChangedEvent e)
- {
- _isValid = true;
- ISelection selection = e.getSelection();
- outputObjects = null;
- int selectionSize = ((IStructuredSelection)selection).size();
- if ((selectionSize > 1) && !_systemViewForm.sameParent())
- {
- clearErrorMessage();
-
- setPathText(""); //$NON-NLS-1$
- setPageComplete();
- return; // don't enable OK/Add if selections from different parents
- }
-
- if (_ps != null)
- _ps.selectionChanged(selection);
-
- Object selectedObject = getFirstSelection(selection);
- if (selectedObject == previousSelection && selectionSize == 1)
- {
- // DKM we null set this before, so we need to reset it
- outputObjects = getSelections(selection);
- return;
- }
- clearErrorMessage();
- setPathText(""); //$NON-NLS-1$
- setPageComplete();
-
- previousSelection = selectedObject;
- if (selectedObject != null)
- {
-
- ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(selectedObject);
- if (remoteAdapter != null)
- {
- setPathTextFromSelection(selectedObject);
-
- outputObjects = getSelections(selection);
- outputConnection = remoteAdapter.getSubSystem(selectedObject).getHost();
-
- _history.put(outputConnection, previousSelection);
- }
- else
- {
- ISystemViewElementAdapter elementAdapter = (ISystemViewElementAdapter)((IAdaptable)selectedObject).getAdapter(ISystemViewElementAdapter.class);
- if (elementAdapter != null)
- {
- setPathTextFromSelection(selectedObject);
-
- outputObjects = getSelections(selection);
- outputConnection = elementAdapter.getSubSystem(selectedObject).getHost();
-
- _history.put(outputConnection, previousSelection);
- }
- }
-
-
- if (_selectionValidator != null)
- {
- SystemMessage selectionMsg = _selectionValidator.isValid(outputConnection, getSelections(selection), getRemoteAdapters(selection));
-
- if (selectionMsg != null)
- {
- _isValid = false;
- setErrorMessage(selectionMsg);
- }
- }
- setPageComplete();
- }
-
- }
-
- /**
- * This method can be called by the dialog or wizard page host, to decide whether to enable
- * or disable the next, final or ok buttons. It returns true if the minimal information is
- * available and is correct.
- */
- public boolean isPageComplete()
- {
- return ( (_pathText.getText().length() > 0) ) && _isValid;
- }
-
- /**
- * Inform caller of page-complete status of this form
- */
- public void setPageComplete()
- {
- if (callerInstanceOfWizardPage)
- {
- ((WizardPage)caller).setPageComplete(isPageComplete());
- }
- else if (callerInstanceOfSystemPromptDialog)
- {
- ((SystemPromptDialog)caller).setPageComplete(isPageComplete());
- }
- }
-
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected object.
- * <p>
- * Default is false
- */
- public void setShowPropertySheet(boolean show)
- {
- this.showPropertySheet = show;
- }
-
-
-
- /**
- * Specify a validator to use when the user selects a remote file or folder.
- * This allows you to decide if OK should be enabled or not for that remote file or folder.
- */
- public void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
- {
- _selectionValidator = selectionValidator;
- }
-
- protected void clearErrorMessage()
- {
- if (_msgLine != null)
- _msgLine.clearErrorMessage();
- }
- protected void setErrorMessage(String msg)
- {
- if (_msgLine != null)
- if (msg != null)
- _msgLine.setErrorMessage(msg);
- else
- _msgLine.clearErrorMessage();
- }
- protected void setErrorMessage(SystemMessage msg)
- {
- if (_msgLine != null)
- if (msg != null)
- _msgLine.setErrorMessage(msg);
- else
- _msgLine.clearErrorMessage();
- }
-
-
- /**
- * Set the message shown as the text at the top of the form. Eg, "Select a file"
- */
- public void setMessage(String message)
- {
- this._verbage = message;
- if (verbageLabel != null)
- verbageLabel.setText(message);
- }
- /**
- * Set the tooltip text for the remote systems tree from which an item is selected.
- */
- public void setSelectionTreeToolTipText(String tip)
- {
- _systemViewForm.setToolTipText(tip);
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java
deleted file mode 100644
index c0181d935..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-public abstract class SystemResourceSelectionInputProvider extends SystemAbstractAPIProvider
-{
- private IHost _connection;
- private boolean _onlyConnection = false;
- private boolean _allowNew = true;
- private String[] _systemTypes;
- private String _category = null;
-
- public SystemResourceSelectionInputProvider(IHost connection)
- {
- _connection = connection;
- }
-
- public SystemResourceSelectionInputProvider()
- {
- _connection = null;
- }
-
- public IHost getSystemConnection()
- {
- return _connection;
- }
-
- public boolean allowMultipleConnections()
- {
- return !_onlyConnection;
- }
-
- public void setAllowNewConnection(boolean flag)
- {
- _allowNew = flag;
- }
-
- public boolean allowNewConnection()
- {
- return _allowNew;
- }
-
- public void setSystemConnection(IHost connection, boolean onlyConnection)
- {
- _connection = connection;
- _onlyConnection = onlyConnection;
- }
-
- public String[] getSystemTypes()
- {
- return _systemTypes;
- }
-
- public void setSystemTypes(String[] types)
- {
- _systemTypes = types;
- }
-
- public Object[] getSystemViewRoots()
- {
- if (_connection == null)
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- _connection = registry.getHosts()[0];
-
- }
- return getConnectionChildren(_connection);
- }
-
- public boolean hasSystemViewRoots()
- {
- return false;
- }
-
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- if (selectedConnection != null)
- {
- return getSubSystem(selectedConnection).getChildren();
- }
- return null;
- }
-
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- if (selectedConnection != null)
- {
- return getSubSystem(selectedConnection).hasChildren();
- }
- return false;
- }
-
- protected abstract ISubSystem getSubSystem(IHost selectedConnection);
-
-
- public void setCategory(String category)
- {
- _category = category;
- }
-
- public String getCategory()
- {
- return _category;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java
deleted file mode 100644
index ba1c1b8c3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.filters.SystemFilterSimple;
-import org.eclipse.rse.internal.model.SystemNewConnectionPromptObject;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * <p>
- * It is used when the contents are used to allow the user to select a remote system object.
- * The tree will begin with the filter pool references or filter references (depending on
- * the user's preferences setting) of the given subsystem.
- * <p>
- * Alternatively, a filter string can be given and the contents will be the result of resolving
- * that filter string.
- */
-public class SystemSelectRemoteObjectAPIProviderImpl
- extends SystemAbstractAPIProvider
- implements ISystemViewInputProvider
-{
-
-
- protected ISubSystem subsystem = null;
- protected String filterString = null;
- protected ISystemViewElementAdapter subsystemAdapter = null;
-
- // For mode when we want to list the connections ...
- protected boolean listConnectionsMode = false;
- protected boolean showNewConnectionPrompt = false;
- protected boolean singleConnectionMode = false;
- protected String subsystemFactoryId;
- protected String subsystemFactoryCategory;
- protected String filterSuffix;
- protected String[] systemTypes;
- protected String preSelectFilterChild;
- protected Object preSelectFilterChildObject;
- protected ISystemFilter[] quickFilters;
- protected IHost[] inputConnections;
- protected SystemNewConnectionPromptObject connPrompt = null;
- protected Object[] connPromptAsArray;
- protected ISystemSelectRemoteObjectAPIProviderCaller caller;
- protected boolean multiConnections = false;
-
- /**
- * Constructor that takes the input needed to drive the list. Specifically,
- * we need to know what connections to list, and when a connection is expanded,
- * what subsystems to query for the remote objects.
- * <p>
- * This can be done by giving one of two possible pieces of information:
- * <ul>
- * <li>a subsystem factory Id, which scopes the connections to those containing subsystems
- * owned by this factory, and scopes subsystems to only those from this factory.
- * <li>The subsystem factory Id is usually the right choice, unless you want to include
- * connections and subsystems from multiple subsystem factories, such as is the case
- * for universal files ... there is one base factory but it is subclassed a number of
- * times. For this and any other case we also allow scoping by subsystem factory
- * category. All connections from any factory of this category are included, and
- * subsystems of factories from this category are used to populate the list.
- * </ul>
- * <p>
- * You must supply one of these. There is no need to supply both.
- * <p>
- * Also, it is often desired to restrict what system types the user can create new connections for.
- * While this could be deduced from the first two pieces of information, it is safer to ask the
- * caller to explicitly identify these. If null is passed, then there is no restrictions.
- *
- * @param factoryId The subsystemFactoryId to restrict connections and subsystems to
- * An alternative to factoryCategory. Specify only one, pass null for the other.
- * @param factoryCategory The subsystemFactory category to restrict connections and subsystems to.
- * An alternative to factoryId. Specify only one, pass null for the other.
- * @param showNewConnectionPrompt true if to show "New Connection" prompt, false if not to
- * @param systemTypes Optional list of system types to restrict the "New Connection" wizard to. Pass null for no restrictions
- */
- public SystemSelectRemoteObjectAPIProviderImpl(String factoryId, String factoryCategory,
- boolean showNewConnectionPrompt, String[] systemTypes)
- {
- super();
- this.subsystemFactoryId = factoryId;
- this.subsystemFactoryCategory = factoryCategory;
- this.systemTypes = systemTypes;
- this.showNewConnectionPrompt = showNewConnectionPrompt;
- this.listConnectionsMode = true;
- }
-
- /**
- * Set the caller to callback to for some events, such as the expansion of a prompting
- * transient filter.
- */
- public void setCaller(ISystemSelectRemoteObjectAPIProviderCaller caller)
- {
- this.caller = caller;
- }
-
- /**
- * Specify whether the user should see the "New Connection..." special connection prompt
- */
- public void setShowNewConnectionPrompt(boolean show)
- {
- this.showNewConnectionPrompt = show;
- }
-
- /**
- * Specify system types to restrict what types of connections the user can create, and see.
- * This will override subsystemFactoryId,if that has been set!
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemTypes(String[] systemTypes)
- {
- this.systemTypes = systemTypes;
- }
-
- /**
- * Constructor when there is a subsystem
- * @param subsystem The subsystem that will resolve the filter string
- */
- public SystemSelectRemoteObjectAPIProviderImpl(ISubSystem subsystem)
- {
- super();
- setSubSystem(subsystem);
- }
-
- /**
- * Constructor when there is no subsystem yet
- * @see #setSubSystem(ISubSystem)
- */
- public SystemSelectRemoteObjectAPIProviderImpl()
- {
- super();
- }
-
- /**
- * Default or Restrict to a specific connection.
- * If default mode, it is preselected.
- * If only mode, it is the only connection listed.
- * @param connection The connection to default or restrict to
- * @param onlyMode true if this is to be the only connection shown in the list
- */
- public void setSystemConnection(IHost connection, boolean onlyMode)
- {
- this.inputConnections = new IHost[] {connection};
- this.singleConnectionMode = onlyMode;
- if (onlyMode)
- multiConnections = false;
- }
-
- /**
- * Change the input subsystem
- */
- public void setSubSystem(ISubSystem subsystem)
- {
- this.subsystem = subsystem;
- if (subsystem != null)
- this.subsystemAdapter = getAdapter(subsystem);
- else
- this.subsystemAdapter = null;
- }
-
- /**
- * Set the filter string to use to resolve the inputs.
- * If this is an absolute filter string, it gets turned into a quick filter string,
- * so that the user sees it and can expand it. If it is a relative filter string
- * to apply to all expansions, it is used to decorate all filtering as the user drills down.
- */
- public void setFilterString(String string)
- {
- // WARNING: ENTERING BIG HUGE HACK AREA!
- this.filterString = string;
- filterSuffix = null;
- if (string == null)
- return;
-
- if (string.endsWith(",")) //$NON-NLS-1$
- {
- int idx = string.indexOf('/');
- if (idx == -1)
- idx = string.indexOf('\\');
- if (idx == -1)
- {
- filterSuffix = string;
- }
- }
-
- if (filterSuffix != null)
- filterString = null;
-
- SystemBasePlugin.logDebugMessage(this.getClass().getName(), "*** FILTER SUFFIX = '" + filterSuffix + "' ***");
- }
-
- /**
- * Set the quick filters to be exposed to the user. These will be shown to the
- * user when they expand a connection.
- * @see org.eclipse.rse.filters.SystemFilterSimple
- */
- public void setQuickFilters(ISystemFilter[] filters)
- {
- this.quickFilters = filters;
- }
-
- /**
- * Set child of the first filter to preselect
- */
- public void setPreSelectFilterChild(String name)
- {
- this.preSelectFilterChild = name;
- }
-
- /**
- * Get the name of the item to select when the first filter is expanded.
- * Called by the filter adapter.
- */
- public String getPreSelectFilterChild()
- {
- return preSelectFilterChild;
- }
-
- /**
- * Set actual child object of the first filter to preselect. Called
- * by the filter adapter once the children are resolved and a match on
- * the name is found.
- */
- public void setPreSelectFilterChildObject(Object obj)
- {
- this.preSelectFilterChildObject = obj;
- }
-
- /**
- * Get the actual object of the item to select when the first filter is expanded.
- * Called by the GUI form after expansion, so it can select this object
- */
- public Object getPreSelectFilterChildObject()
- {
- return preSelectFilterChildObject;
- }
-
- /**
- * Adorn filter string with any relative attributes requested. Eg "/nf" for folders only
- */
- public String decorateFilterString(Object selectedObject, String inputFilterString)
- {
- // this is a hack explicitly for the universal file system. We want to propogate "type filters"
- // like "/nf" and "class," on down the chain, even though we start by showing the user's filters.
- // When those filters are finally expanded, the filter adapter calls us to do this adornment.
-
- if (inputFilterString == null)
- return inputFilterString;
- else if ((filterSuffix != null) && (inputFilterString.indexOf(filterSuffix)==-1))
- {
- SystemBasePlugin.logDebugMessage(this.getClass().getName(), "*** INPUT FILTER = '" + inputFilterString + "' ***");
- String result = inputFilterString;
- if (filterSuffix.equals(" /nf")) //$NON-NLS-1$
- result = inputFilterString + filterSuffix;
- else
- {
- /** FIXME - can't be coupled with IRemoteFile
- RemoteFileFilterString rffs =
- new RemoteFileFilterString((IRemoteFileSubSystemConfiguration)getSubSystemConfiguration(selectedObject), inputFilterString);
- rffs.setFile(filterSuffix);
- result = rffs.toString();
- */
- result = inputFilterString;
- }
- SystemBasePlugin.logDebugMessage(this.getClass().getName(), "*** ADORNED FILTER = '" + result + "' ***");
- return result;
- }
- else
- return inputFilterString;
- }
-
- /**
- * For performance reasons, pre-check to see if filter decoration is even necessary...
- */
- public boolean filtersNeedDecoration(Object selectedObject)
- {
- ISubSystemConfiguration ssf = getSubSystemConfiguration(selectedObject);
- if (ssf == null)
- return false;
- /** FIXME - can't be coupled with IRemoteFile
- return ((ssf instanceof IRemoteFileSubSystemConfiguration) && (filterSuffix != null));
- */
- return false;
-
- }
-
- /**
- * get subsystem factory from filter or filter string
- */
- private ISubSystemConfiguration getSubSystemConfiguration(Object selectedObject)
- {
- if (selectedObject instanceof ISystemFilterReference)
- {
- ISubSystem ss = (ISubSystem)((ISystemFilterReference)selectedObject).getProvider();
- return ss.getSubSystemConfiguration();
- }
- else if (selectedObject instanceof ISystemFilterStringReference)
- {
- ISubSystem ss = (ISubSystem)((ISystemFilterStringReference)selectedObject).getProvider();
- return ss.getSubSystemConfiguration();
- }
- else
- return null;
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- */
- public Object[] getSystemViewRoots()
- {
- if (listConnectionsMode)
- return getConnections();
-
- if (subsystemAdapter == null)
- {
- return emptyList;
- }
-
- Object[] children = null;
-
- if (filterString == null)
- children = subsystemAdapter.getChildren(subsystem);
- else
- {
- children = resolveFilterString(subsystem, filterString);
- }
-
- return checkForNull(children, true);
- }
-
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- */
- public boolean hasSystemViewRoots()
- {
- if (listConnectionsMode)
- return true;
- else
- {
- boolean hasroots = false;
- if (subsystemAdapter == null)
- hasroots = false;
- else if (filterString != null)
- hasroots = true;
- else
- hasroots = subsystemAdapter.hasChildren(subsystem);
-
- return hasroots;
- }
- }
-
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- if (!listConnectionsMode)
- return null; // not applicable, never get called
- else
- {
- Object[] children = null;
- ISubSystem[] subsystems = getSubSystems(selectedConnection);
-
- if ((subsystems != null) && (subsystems.length > 0))
- {
- ISubSystem subsystem = subsystems[0]; // always just use first. Hopefully never a problem!
-
- if (subsystems.length > 1)
- SystemBasePlugin.logWarning(this.getClass().getName() + ": More than one subsystem meeting criteria. SSFID = "+subsystemFactoryId+", SSFCat = "+subsystemFactoryCategory);
-
- if (quickFilters != null)
- {
- // DKM - quick filters are only work properly for first subsystem, so for now, I'm only
- // only going to use them for the initial subsystem
- //boolean useFilters = false;
-
- // Phil
- // 50167: re-using the same filter object for every connection causes
- // grief, so we have to clone the filter for each connection.
- if (multiConnections)
- {
- // walk through quick filters, and create a clone for each one
- children = new ISystemFilter[quickFilters.length];
-
- for (int idx=0; idx<quickFilters.length; idx++)
- {
- SystemFilterSimple quickFilter = (SystemFilterSimple)quickFilters[idx];
- children[idx] = new SystemFilterSimple(quickFilter.getName());
- quickFilter.clone((ISystemFilter)children[idx]);
- ((SystemFilterSimple)children[idx]).setParent(subsystem);
- }
- }
-
- else
- {
- // walk through quickFilters and if they are transient, assign current subsystem as parent
- for (int idx=0; idx<quickFilters.length; idx++)
- {
- if ((quickFilters[idx] instanceof SystemFilterSimple))
- {
- ((SystemFilterSimple)quickFilters[idx]).setParent(subsystem);
- }
- }
-
- children = quickFilters;
- }
- }
-
- else if ((filterString == null) || (filterSuffix != null))
- {
- children = subsystem.getChildren();
- }
- else
- {
- children = resolveFilterString(subsystem, filterString);
- }
- }
-
- return checkForNull(children, true);
- }
- }
-
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return true;
- }
-
- /**
- * Return true to show the action bar (ie, toolbar) above the viewer.
- * The action bar contains connection actions, predominantly.
- * We return false.
- */
- public boolean showActionBar()
- {
- return false;
- }
-
- /**
- * Return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typically
- * shown in dialogs that list only remote system objects.
- * We return false.
- */
- public boolean showButtonBar()
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
- /**
- * Return true if we are listing connections or not, so we know whether we are interested in
- * connection-add events
- */
- public boolean showingConnections()
- {
- return listConnectionsMode;
- }
-
-
- // ----------------------------------
- // OUR OWN METHODS...
- // ----------------------------------
-
- /**
- * Return the connections appropriate for our subsystem factory ID or category
- * requirements.
- */
- protected Object[] getConnections()
- {
- if (singleConnectionMode && !showNewConnectionPrompt)
- return inputConnections;
- if ((connPrompt == null) && showNewConnectionPrompt)
- {
- connPrompt = new SystemNewConnectionPromptObject();
- connPromptAsArray = new Object[1];
- connPromptAsArray[0] = connPrompt;
- }
- if ((connPrompt!=null) && (systemTypes != null))
- {
- connPrompt.setSystemTypes(systemTypes);
- }
-
- IHost[] conns = null;
-
- if (singleConnectionMode)
- conns = inputConnections;
- else if (systemTypes != null)
- conns = sr.getHostsBySystemTypes(systemTypes);
- else if (subsystemFactoryId != null)
- conns = sr.getHostsBySubSystemConfigurationId(subsystemFactoryId);
- else if (subsystemFactoryCategory != null)
- conns = sr.getHostsBySubSystemConfigurationCategory(subsystemFactoryCategory);
- else
- conns = sr.getHosts();
-
- Object[] children = null;
-
- if (showNewConnectionPrompt)
- {
- if ((conns == null) || (conns.length == 0))
- children = connPromptAsArray;
- else
- {
- multiConnections = (conns.length>1); // 50167pc
- children = new Object[1+conns.length];
- children[0] = connPrompt;
- for (int idx=0; idx<conns.length; idx++)
- children[idx+1] = conns[idx];
- }
- }
- else
- {
- children = conns;
- multiConnections = ((conns!=null) && (conns.length>1)); // 50167pc
- }
-
- return checkForNull(children, false);
- }
-
- /**
- * Given a connection, return the subsystem(s) appropriate for the given
- * ssfactoryid or category
- */
- protected ISubSystem[] getSubSystems(IHost selectedConnection)
- {
- ISubSystem[] subsystems = null;
- if (subsystemFactoryId != null)
- subsystems = sr.getSubSystems(subsystemFactoryId, selectedConnection);
- else if (subsystemFactoryCategory != null)
- subsystems = sr.getSubSystemsBySubSystemConfigurationCategory(subsystemFactoryCategory, selectedConnection);
- else
- subsystems = sr.getSubSystems(selectedConnection);
- return subsystems;
- }
-
- /**
- * Return the result of asking a given subsystem to resolve a filter string
- */
- protected Object[] resolveFilterString(ISubSystem subsystem, String filterString)
- {
- Object[] children = null;
- try
- {
- children = subsystem.resolveFilterString(filterString);
- } catch (InterruptedException exc)
- {
- if (canceledObject == null)
- children = getCancelledMessageObject();
- } catch (Exception exc)
- {
- children = getFailedMessageObject();
- SystemBasePlugin.logError("Error in SystemTestFilterStringAPIProviderImpl#getSystemViewRoots()",exc);
- }
- return children;
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- return SystemAdapterHelpers.getAdapter(o);
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- return SystemAdapterHelpers.getRemoteAdapter(o);
- }
-
-
- /**
- * Prompt the user to create a new filter as a result of the user expanding a promptable
- * transient filter
- * <p>
- * Simply passes the request on to the caller.
- * <p>
- * NOT SUPPORTED YET!
- *
- * @return the filter created by the user or null if they cancelled the prompting
- */
- public ISystemFilter createFilterByPrompting(ISystemFilter filterPrompt, Shell shell)
- throws Exception
- {
- if (caller!=null)
- return caller.createFilterByPrompting(filterPrompt, shell);
- else
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeView.java
deleted file mode 100644
index 289a3eb83..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeView.java
+++ /dev/null
@@ -1,1901 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.StringCompare;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
-import org.eclipse.rse.ui.actions.SystemShowInTableAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableTree;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.progress.PendingUpdateAdapter;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-/**
- * This subclass of the standard JFace tabletree viewer is used to
- * show a generic tabletree view of the selected object
- * <p>
- *
- */
-public class SystemTableTreeView
-// TODO change TreeViewer to TableTreeViewer when Eclipse fixes SWT viewer
-//extends TableTreeViewer
-extends TreeViewer
-implements IMenuListener, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget, ISystemResourceChangeListener, ISystemRemoteChangeListener, ISelectionChangedListener, ISelectionProvider
-{
-
-
- protected Composite getTableTree()
- {
- // TODO - turn back to table tree
- return getTree();
- }
-
- // TODO - turn back into tabletree
- // inner class to support cell editing - only use with table
- private ICellModifier cellModifier = new ICellModifier()
- {
- public Object getValue(Object element, String property)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapter.setPropertySourceInput(element);
- Object value = adapter.getPropertyValue(property);
- if (value == null)
- {
- value = ""; //$NON-NLS-1$
- }
- return value;
- }
-
- public boolean canModify(Object element, String property)
- {
- boolean modifiable = true;
- return modifiable;
- }
-
- public void modify(Object element, String property, Object value)
- {
- if (element instanceof TableItem && value != null)
- {
- Object obj = ((TableItem) element).getData();
- ISystemViewElementAdapter adapter = getAdapter(obj);
- if (adapter != null)
- {
- adapter.setPropertyValue(property, value);
-
- SelectionChangedEvent event = new SelectionChangedEvent(SystemTableTreeView.this, getSelection());
-
- // fire the event
- fireSelectionChanged(event);
- }
- }
- }
- };
-
- private class HeaderSelectionListener extends SelectionAdapter
- {
-
- public HeaderSelectionListener()
- {
- _upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID);
- _downI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID);
- }
-
-
- /**
- * Handles the case of user selecting the
- * header area.
- * <p>If the column has not been selected previously,
- * it will set the sorter of that column to be
- * the current table view sorter. Repeated
- * presses on the same column header will
- * toggle sorting order (ascending/descending).
- */
- public void widgetSelected(SelectionEvent e)
- {
- Tree table = getTree();
- if (!table.isDisposed())
- {
- // column selected - need to sort
- TreeColumn tcolumn = (TreeColumn)e.widget;
- int column = table.indexOf(tcolumn);
- SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
- if (oldSorter != null && column == oldSorter.getColumnNumber())
- {
- oldSorter.setReversed(!oldSorter.isReversed());
- if (tcolumn.getImage() == _upI)
- {
- tcolumn.setImage(_downI);
- }
- else
- {
- tcolumn.setImage(_upI);
- }
- }
- else
- {
- setSorter(new SystemTableViewSorter(column, SystemTableTreeView.this, _columnManager));
- tcolumn.setImage(_downI);
- }
-
- // unset image of other columns
- TreeColumn[] allColumns = table.getColumns();
- for (int i = 0; i < allColumns.length; i++)
- {
- if (i != column)
- {
- if (allColumns[i].getImage() != null)
- {
- allColumns[i].setImage(null);
- }
- }
- }
- refresh();
- }
- }
- }
- private Object _objectInput;
- //private ArrayList _attributeColumns;
- private TableLayout _layout;
- protected SystemTableTreeViewProvider _provider;
- private HeaderSelectionListener _columnSelectionListener;
- private SystemTableViewColumnManager _columnManager;
- private MenuManager _menuManager;
- private int _charWidth = 3;
- private SystemTableViewFilter _filter;
- private IPropertyDescriptor[] _uniqueDescriptors;
-
- // these variables were copied from SystemView to allow for limited support
- // of actions. I say limited because somethings don't yet work properly.
- protected SystemRefreshAction _refreshAction;
- protected PropertyDialogAction _propertyDialogAction;
- protected SystemRemotePropertiesAction _remotePropertyDialogAction;
- protected SystemOpenExplorerPerspectiveAction _openToPerspectiveAction;
- protected SystemShowInTableAction _showInTableAction;
-
- // global actions
- // Note the Edit menu actions are set in SystemViewPart. Here we use these
- // actions from our own popup menu actions.
- protected SystemCommonDeleteAction _deleteAction;
- // for global delete menu item
- protected SystemCommonRenameAction _renameAction;
- // for common rename menu item
- protected SystemCommonSelectAllAction _selectAllAction;
- // for common Ctrl+A select-all
-
- protected boolean _selectionShowRefreshAction;
- protected boolean _selectionShowOpenViewActions;
- protected boolean _selectionShowDeleteAction;
- protected boolean _selectionShowRenameAction;
- protected boolean _selectionEnableDeleteAction;
- protected boolean _selectionEnableRenameAction;
-
- protected boolean _selectionIsRemoteObject = true;
- protected boolean _selectionFlagsUpdated = false;
-
- private IWorkbenchPart _workbenchPart = null;
-
- private int[] _lastWidths = null;
- private ISystemMessageLine _messageLine;
- protected boolean menuListenerAdded = false;
-
-
- private static final int LEFT_BUTTON = 1;
- private int mouseButtonPressed = LEFT_BUTTON;
-
- private Image _upI;
- private Image _downI;
-
-
- /**
- * Constructor for the table view
- *
- */
- public SystemTableTreeView(Tree tableTree, ISystemMessageLine msgLine)
- {
- super(tableTree);
- _messageLine = msgLine;
- //_attributeColumns = new ArrayList();
- _layout = new TableLayout();
-
- _columnManager = new SystemTableViewColumnManager(this);
- _provider = new SystemTableTreeViewProvider(_columnManager);
- _columnSelectionListener = new HeaderSelectionListener();
-
-
- setContentProvider(_provider);
- setLabelProvider(_provider);
-
- _filter = new SystemTableViewFilter();
- addFilter(_filter);
-
- _charWidth = tableTree.getFont().getFontData()[0].getHeight() / 2;
- computeLayout();
-
- _menuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- _menuManager.setRemoveAllWhenShown(true);
- _menuManager.addMenuListener(this);
- Menu menu = _menuManager.createContextMenu(tableTree);
- tableTree.setMenu(menu);
-
- addSelectionChangedListener(this);
-
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().addSystemRemoteChangeListener(this);
-
- initDragAndDrop();
-
- tableTree.setVisible(false);
- // key listening for delete press
- getControl().addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- handleKeyPressed(e);
- }
- });
- getControl().addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- mouseButtonPressed = e.button; //d40615
- }
- });
- }
-
- public Layout getLayout()
- {
- return _layout;
- }
-
- public void setWorkbenchPart(IWorkbenchPart part)
- {
- _workbenchPart = part;
- }
-
- public void setViewFilters(String[] filter)
- {
- if (_filter.getFilters() != filter)
- {
- _filter.setFilters(filter);
- refresh();
- }
- }
-
- public String[] getViewFilters()
- {
- return _filter.getFilters();
- }
-
- /**
- * Return the popup menu for the table
- */
- public Menu getContextMenu()
- {
- return getTableTree().getMenu();
- }
- /**
- * Return the popup menu for the table
- */
- public MenuManager getContextMenuManager()
- {
- return _menuManager;
- }
-
- /**
- * Called whenever the input for the view changes
- */
- public void inputChanged(Object newObject, Object oldObject)
- {
- if (newObject instanceof IAdaptable)
- {
- getTableTree().setVisible(true);
- _objectInput = newObject;
-
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- Object[] children = provider.getChildren(_objectInput);
-
- computeLayout();
-
- // reset the filter
- setViewFilters(null);
-
- super.inputChanged(newObject, oldObject);
-
- }
- else if (newObject == null)
- {
- getTableTree().setVisible(false);
- _objectInput = null;
- computeLayout();
-
- setViewFilters(null);
- }
- }
-
- public Object getInput()
- {
- return _objectInput;
- }
-
- /**
- * Convenience method for retrieving the view adapter for an object
- */
- protected ISystemViewElementAdapter getAdapter(Object obj)
- {
- return SystemAdapterHelpers.getAdapter(obj, this);
- }
-
- public SystemTableViewColumnManager getColumnManager()
- {
- return _columnManager;
- }
-
- private IPropertyDescriptor[] getCustomDescriptors(ISystemViewElementAdapter adapter)
- {
- return _columnManager.getVisibleDescriptors(adapter);
- }
-
- public IPropertyDescriptor[] getUniqueDescriptors()
- {
- return _uniqueDescriptors;
- }
-
- /**
- * Used to determine what the columns should be on the table.
- */
- public IPropertyDescriptor[] getVisibleDescriptors(Object object)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- Object[] children = provider.getChildren(object);
- return getVisibleDescriptors(children);
- }
-
- private IPropertyDescriptor[] getVisibleDescriptors(Object[] children)
- {
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- ISystemViewElementAdapter adapter = getAdapter(child);
- adapter.setPropertySourceInput(child);
- return getCustomDescriptors(adapter);
- }
-
- return new IPropertyDescriptor[0];
- }
-
-
-
- public IPropertyDescriptor getNameDescriptor(Object object)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- Object[] children = provider.getChildren(object);
- return getNameDescriptor(children);
- }
-
- private IPropertyDescriptor getNameDescriptor(Object[] children)
- {
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- return getAdapter(child).getPropertyDescriptors()[0];
- }
-
- return null;
- }
-
- /**
- * Used to determine the formats of each descriptor.
- */
- private ArrayList getFormatsIn()
- {
- ArrayList results = new ArrayList();
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- Object[] children = provider.getChildren(_objectInput);
-
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
-
- Object adapter = child.getAdapter(ISystemViewElementAdapter.class);
- if (adapter instanceof ISystemViewElementAdapter)
- {
- ISystemViewElementAdapter ad = (ISystemViewElementAdapter) adapter;
- ad.setPropertySourceInput(child);
- IPropertyDescriptor[] descriptors = ad.getUniquePropertyDescriptors();
- for (int i = 0; i < descriptors.length; i++)
- {
- IPropertyDescriptor descriptor = descriptors[i];
-
- try
- {
- Object key = descriptor.getId();
-
- Object propertyValue = ad.getPropertyValue(key, false);
- results.add(propertyValue.getClass());
- }
- catch (Exception e)
- {
- results.add(String.class);
- }
-
- }
- }
- }
-
- return results;
- }
- protected void computeLayout()
- {
- computeLayout(false);
- }
-
- private boolean sameDescriptors(IPropertyDescriptor[] descriptors1, IPropertyDescriptor[] descriptors2)
- {
- if (descriptors1 == null || descriptors2 == null)
- {
- return false;
- }
- if (descriptors1.length == descriptors2.length)
- {
- boolean same = true;
- for (int i = 0; i < descriptors1.length && same; i++)
- {
- same = descriptors1[i] == descriptors2[i];
- }
- return same;
- }
- else
- {
- return false;
- }
- }
-
- private CellEditor getCellEditor(Tree parent, IPropertyDescriptor descriptor)
- {
- CellEditor editor = descriptor.createPropertyEditor(parent);
- if (editor instanceof SystemInheritableTextCellEditor)
- {
- ((SystemInheritableTextCellEditor) editor).getInheritableEntryField().setAllowEditingOfInheritedText(true);
- }
-
- return editor;
- }
-
- /**
- * Determines what columns should be shown in this view. The columns may change
- * anytime the view input changes. The columns in the control are modified and
- * columns may be added or deleted as necessary to make it conform to the
- * new data.
- */
- public void computeLayout(boolean force)
- {
- if (_objectInput == null)
- return;
-
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- if (provider == null)
- return;
- Object[] children = provider.getChildren(_objectInput);
-
- // if no children, don't update
- if (children == null || children.length == 0 || (children.length == 1 && children[0] instanceof PendingUpdateAdapter))
- {
- return;
- }
-
- IPropertyDescriptor[] descriptors = getVisibleDescriptors(children);
- IPropertyDescriptor nameDescriptor = getNameDescriptor(children);
-
- int n = descriptors.length; // number of columns we need (name column + other columns)
- if (nameDescriptor != null)
- n += 1;
- if (n == 0)
- return; // there is nothing to lay out!
-
-
- if (sameDescriptors(descriptors,_uniqueDescriptors) && !force)
- {
- setLastColumnWidths(getCurrentColumnWidths());
- return;
- }
- _uniqueDescriptors = descriptors;
- Tree tree = getTree();
- if (tree == null || tree.isDisposed())
- return;
-
- // set column attributes, create new columns if necessary
- TreeColumn[] columns = tree.getColumns();
- int numColumns = columns.length; // number of columns in the control
- CellEditor editors[] = new CellEditor[n];
- String headings[] = new String[n];
- String propertyIds[] = new String[n];
- ArrayList formats = getFormatsIn();
-
-
- _layout = new TableLayout();
- for (int i = 0; i < n; i++)
- { // for each column
- String name = null;
- String propertyId = null;
- CellEditor editor = null;
- int alignment = SWT.LEFT;
- int weight = 100;
- if (i == 0)
- {
- // this is the first column -- treat it special
- name = SystemPropertyResources.RESID_PROPERTY_NAME_LABEL;
- propertyId = (String) nameDescriptor.getId();
- editor = getCellEditor(tree, nameDescriptor);
- weight = 200;
- }
- else
- { // these columns come from the regular descriptors
- IPropertyDescriptor descriptor = descriptors[i - 1];
-
- Class format = (Class) formats.get(i - 1);
- name = descriptor.getDisplayName();
- propertyId = (String) descriptor.getId();
- editor = getCellEditor(tree, descriptor);
- if (format != String.class)
- alignment = SWT.RIGHT;
- }
- TreeColumn tc = null;
- if (i >= numColumns)
- {
- tc = new TreeColumn(tree, alignment, i);
- tc.addSelectionListener(_columnSelectionListener);
-
- }
- else
- {
- tc = columns[i];
- tc.setAlignment(alignment);
- }
- _layout.addColumnData(new ColumnWeightData(weight));
- tc.setText(name);
- if (i == 0)
- {
- // tc.setImage(_downI);
- }
- headings[i] = name;
- editors[i] = editor;
- propertyIds[i] = propertyId;
- }
- setColumnProperties(propertyIds);
- setCellEditors(editors);
- setCellModifier(cellModifier);
-
- // dispose of any extra columns the tree control may have
- for (int i = n; i < numColumns; i++)
- {
- columns[i].dispose();
- columns[i] = null;
- }
-
- // compute column widths
- columns = tree.getColumns();
- numColumns = columns.length;
- Rectangle clientA = tree.getClientArea();
- int totalWidth = clientA.width - 5;
- if (totalWidth <= 0)
- {
- // find a default
- totalWidth = 500;
- }
-
-
- int[] lastWidths = getLastColumnWidths();
- if (numColumns > 1)
- {
- // check if previous widths can be used
- if (lastWidths != null && lastWidths.length == numColumns)
- {
-
- // use previously established widths
- setCurrentColumnWidths(lastWidths);
- }
- else
- {
- if (totalWidth > 0)
- {
- // no previous widths or number of columns has changed - need to calculate
- int averageWidth = totalWidth / numColumns;
- int firstWidth = Math.max(averageWidth, 150);
- averageWidth = (totalWidth - firstWidth) / (numColumns - 1);
- averageWidth = Math.max(averageWidth, 80);
- columns[0].setWidth(firstWidth);
- for (int i = 1; i < numColumns; i++)
- {
-
- columns[i].setWidth(averageWidth);
- }
- setLastColumnWidths(getCurrentColumnWidths());
- }
- }
- tree.setHeaderVisible(true);
- }
- else
- {
-
- if (numColumns == 1)
- {
- int width = totalWidth;
- if (lastWidths != null && lastWidths.length == 1)
- {
- width = (totalWidth > lastWidths[0]) ? totalWidth : lastWidths[0];
- }
-
-
- int maxWidth = provider.getMaxCharsInColumnZero() * _charWidth;
- if (maxWidth > width)
- {
- width = maxWidth;
- }
-
- if (width > 0)
- {
- columns[0].setWidth(width);
- }
- tree.setHeaderVisible(false);
- }
- }
- }
-
- public int[] getCurrentColumnWidths()
- {
- Composite tree = getTableTree();
-
- return new int[0];
- }
-
- public void setCurrentColumnWidths(int[] widths)
- {
- Composite tree = getTableTree();
- }
-
- public int[] getLastColumnWidths()
- {
- return _lastWidths;
- }
-
- public void setLastColumnWidths(int[] widths)
- {
- _lastWidths = widths;
- }
-
- protected void initDragAndDrop()
- {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance(), EditorInputTransfer.getInstance(), FileTransfer.getInstance()};
-
- addDragSupport(ops, transfers, new SystemViewDataDragAdapter(this));
- addDropSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDropAdapter(this));
- }
-
- /**
- * Used to asynchronously update the view whenever properties change.
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- try
- {
- Tree tree = getTree();
- boolean isDisposed = tree.isDisposed();
- if (isDisposed)
- {
- dispose();
- return;
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- boolean madeChange = false;
- Object parent = event.getParent();
- Object child = event.getSource();
- int eventType = event.getType();
- switch (eventType)
- {
- case ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE :
- case ISystemResourceChangeEvents.EVENT_PROPERTYSHEET_UPDATE :
- {
- Widget w = findItem(child);
-
- if (w != null)
- {
- updateItem(w, child);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_ADD :
- case ISystemResourceChangeEvents.EVENT_ADD_RELATIVE :
- {
- boolean addingConnection = (child instanceof IHost);
- if (_objectInput instanceof ISystemRegistry && addingConnection)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
-
- if (provider != null)
- {
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- computeLayout();
- internalRefresh(_objectInput);
- }
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_REFRESH:
- {
- Widget w = findItem(parent);
- if (w != null)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
- internalRefresh(parent);
- }
- }
- break;
- default :
- break;
-
- }
-
- if (child == _objectInput || parent == _objectInput)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
-
- if (provider != null)
- {
- if (!madeChange)
- {
- //provider.flushCache();
- madeChange = true;
- }
-
- computeLayout();
- try
- {
- internalRefresh(_objectInput);
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError(e.getMessage());
- }
- }
- }
- }
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- boolean madeChange = false;
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
- //boolean originatedHere = (event.getOriginatingViewer() == this);
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- String remoteResourceParentName = getRemoteResourceAbsoluteName(remoteResourceParent);
- String remoteResourceName = getRemoteResourceAbsoluteName(remoteResource);
- if (remoteResourceName == null)
- return;
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
-
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
- {
- if (remoteResourceParent == getInput())
- {
- Widget w = findItem(remoteResource);
- if (w != null)
- {
- updateItem(w, remoteResource);
- }
-
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
- {
- String inputResourceName = getRemoteResourceAbsoluteName(getInput());
- if (remoteResourceParentName != null && remoteResourceParentName.equals(inputResourceName))
- {
- if (provider == null)
- {
- return;
- }
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- refresh();
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- {
- Object dchild = remoteResource;
-
- ISystemViewElementAdapter dadapt = getAdapter(dchild);
- if (dadapt != null)
- {
- ISubSystem dSubSystem = dadapt.getSubSystem(dchild);
- String dkey = dadapt.getAbsoluteName(dchild);
-
- if (provider != null)
- {
- Object[] children = provider.getChildren(_objectInput);
- for (int i = 0; i < children.length; i++)
- {
- Object existingChild = children[i];
- if (existingChild != null)
- {
- ISystemViewElementAdapter eadapt = getAdapter(existingChild);
- ISubSystem eSubSystem = eadapt.getSubSystem(existingChild);
-
- if (dSubSystem == eSubSystem)
- {
- String ekey = eadapt.getAbsoluteName(existingChild);
- if (ekey.equals(dkey))
- {
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
-
- // do a full refresh
- refresh();
- }
- }
- }
-
- }
- }
- }
- }
- }
-
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- String oldName = event.getOldName();
- Object child = event.getResource();
-
- if (provider != null)
- {
- Object[] previousResults = provider.getCache();
- if (previousResults != null)
- {
- for (int i = 0; i < previousResults.length; i++)
- {
- Object previousResult = previousResults[i];
-
- if (previousResult == child)
- {
- Widget widget = findItem(previousResult);
- if (widget != null)
- {
- widget.setData(child);
- updateItem(widget, child);
- return;
- }
- }
- else
- {
- String previousName = getAdapter(previousResult).getAbsoluteName(previousResult);
-
- if (previousName != null && previousName.equals(oldName))
- {
- provider.flushCache();
- internalRefresh(_objectInput);
- return;
- }
- }
- }
-
- }
- }
- }
-
- break;
- }
- }
-
- /**
- * Turn a given remote object reference into a fully qualified absolute name
- */
- private String getRemoteResourceAbsoluteName(Object remoteResource)
- {
- if (remoteResource == null)
- return null;
- String remoteResourceName = null;
- if (remoteResource instanceof String)
- remoteResourceName = (String) remoteResource;
- else
- {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra == null)
- return null;
- remoteResourceName = ra.getAbsoluteName(remoteResource);
- }
- return remoteResourceName;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- _selectionFlagsUpdated = false;
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null)
- return;
-
- _selectionFlagsUpdated = false;
- ISystemViewElementAdapter adapter = getAdapter(firstSelection);
- if (adapter != null)
- {
- displayMessage(adapter.getStatusLineText(firstSelection));
- if ((mouseButtonPressed == LEFT_BUTTON))
- adapter.selectionChanged(firstSelection);
- }
- else
- clearMessage();
- }
-
- public void dispose()
- {
- removeAsListener();
-
- Composite tree = getTableTree();
-
- boolean isDisposed = tree.isDisposed();
-
- // dispose control if not disposed
- if (!isDisposed) {
- tree.dispose();
- }
- }
-
- /**
- * Display a message/status on the message/status line
- */
- public void displayMessage(String msg)
- {
- if (_messageLine != null)
- _messageLine.setMessage(msg);
- }
-
- /**
- * Convenience method for retrieving the view adapter for an object's children
- */
- public ISystemViewElementAdapter getAdapterForContents()
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider) getContentProvider();
- if (provider != null)
- {
- Object[] children = provider.getChildren(getInput());
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- return getAdapter(child);
- }
- }
- return null;
- }
-
- /**
- * Clear message/status shown on the message/status line
- */
- public void clearMessage()
- {
- if (_messageLine != null)
- _messageLine.clearMessage();
- }
-
- /**
- * Remove as listener.
- */
- public void removeAsListener() {
-
- // remove listeners
- removeSelectionChangedListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemRemoteChangeListener(this);
-
- // for debugging
- //Composite tree = getTableTree();
- //boolean isDisposed = tree.isDisposed();
- }
-
-
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected PropertyDialogAction getPropertyDialogAction()
- {
- if (_propertyDialogAction == null)
- {
- _propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this);
- //propertyDialogAction.setToolTipText(" ");
- }
- _propertyDialogAction.selectionChanged(getSelection());
- return _propertyDialogAction;
- }
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected SystemRemotePropertiesAction getRemotePropertyDialogAction()
- {
- if (_remotePropertyDialogAction == null)
- {
- _remotePropertyDialogAction = new SystemRemotePropertiesAction(getShell());
- }
- _remotePropertyDialogAction.setSelection(getSelection());
- return _remotePropertyDialogAction;
- }
- /**
- * Return the select All action
- */
- protected IAction getSelectAllAction()
- {
- if (_selectAllAction == null)
- _selectAllAction = new SystemCommonSelectAllAction(getShell(), this, this);
- return _selectAllAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getRenameAction()
- {
- if (_renameAction == null)
- _renameAction = new SystemCommonRenameAction(getShell(), this);
- return _renameAction;
- }
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getDeleteAction()
- {
- if (_deleteAction == null)
- _deleteAction = new SystemCommonDeleteAction(getShell(), this);
- return _deleteAction;
- }
-
- /**
- * Return the refresh action
- */
- protected IAction getRefreshAction()
- {
- if (_refreshAction == null)
- _refreshAction = new SystemRefreshAction(getShell());
- return _refreshAction;
- }
- /*
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- *
- protected SystemCascadingOpenToAction getOpenToAction()
- {
- if (openToAction == null)
- openToAction = new SystemCascadingOpenToAction(getShell(),getWorkbenchWindow());
- return openToAction;
- } NOT USED YET */
- /**
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- protected SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction()
- {
- if (_openToPerspectiveAction == null)
- {
- IWorkbench desktop = PlatformUI.getWorkbench();
- IWorkbenchWindow win = desktop.getActiveWorkbenchWindow();
-
- _openToPerspectiveAction = new SystemOpenExplorerPerspectiveAction(getShell(), win);
- }
- //getWorkbenchWindow());
- return _openToPerspectiveAction;
- }
-
- protected SystemShowInTableAction getShowInTableAction()
- {
- if (_showInTableAction == null)
- {
- _showInTableAction = new SystemShowInTableAction(getShell());
- }
- //getWorkbenchWindow());
- return _showInTableAction;
- }
-
- public Shell getShell()
- {
- return getTableTree().getShell();
- }
-
- /**
- * Required method from ISystemDeleteTarget.
- * Decides whether to even show the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowDeleteAction;
- }
- /**
- * Required method from ISystemDeleteTarget
- * Decides whether to enable the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableDeleteAction;
- }
-
- /*
- * Required method from ISystemDeleteTarget
- */
- public boolean doDelete(IProgressMonitor monitor)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- //Object multiSource[] = new Object[selectedCount];
- //int idx = 0;
- Object element = null;
- //Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- boolean ok = true;
- boolean anyOk = false;
- Vector deletedVector = new Vector();
- try
- {
- while (ok && elements.hasNext())
- {
- element = elements.next();
- //multiSource[idx++] = element;
- adapter = getAdapter(element);
- ok = adapter.doDelete(getShell(), element, monitor);
- if (ok)
- {
- anyOk = true;
- deletedVector.addElement(element);
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException))
- msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(element, msg));
- ok = false;
- }
- if (anyOk)
- {
- Object[] deleted = new Object[deletedVector.size()];
- for (int idx = 0; idx < deleted.length; idx++)
- deleted[idx] = deletedVector.elementAt(idx);
- if (_selectionIsRemoteObject)
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, deletedVector, null, null, null, this);
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(deleted, ISystemResourceChangeEvents.EVENT_DELETE_MANY, getInput()));
- }
- return ok;
- }
-
- // ---------------------------
- // ISYSTEMRENAMETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemRenameTarget.
- * Decides whether to even show the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowRenameAction;
- }
- /**
- * Required method from ISystemRenameTarget
- * Decides whether to enable the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableRenameAction;
- }
-
- // default implementation
- // in default table, parent is input
- protected Object getParentForContent(Object element)
- {
- return _objectInput;
- }
-
- /**
- * Required method from ISystemRenameTarget
- */
- public boolean doRename(String[] newNames)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- Object element = null;
-
- ISystemViewElementAdapter adapter = null;
- ISystemRemoteElementAdapter remoteAdapter = null;
- String oldFullName = null;
- boolean ok = true;
- try
- {
- int nameIdx = 0;
- while (ok && elements.hasNext())
- {
- element = elements.next();
- adapter = getAdapter(element);
- Object parentElement = getParentForContent(element);
-
- remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter != null)
- oldFullName = remoteAdapter.getAbsoluteName(element);
- // pre-rename
- ok = adapter.doRename(getShell(), element, newNames[nameIdx++]);
- if (ok)
- {
- if (remoteAdapter != null) {
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, remoteAdapter.getSubSystem(element), oldFullName, this);
- }
- else {
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement));
- }
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- //String msg = exc.getMessage();
- //if ((msg == null) || (exc instanceof ClassCastException))
- // msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(element, exc),
- //msg),
- exc);
- ok = false;
- }
- return ok;
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- ISystemRemoteElementAdapter adapter = null;
- if (!(o instanceof IAdaptable))
- adapter = (ISystemRemoteElementAdapter) Platform.getAdapterManager().getAdapter(o, ISystemRemoteElementAdapter.class);
- else
- adapter = (ISystemRemoteElementAdapter) ((IAdaptable) o).getAdapter(ISystemRemoteElementAdapter.class);
- if ((adapter != null) && (adapter instanceof ISystemViewElementAdapter))
- ((ISystemViewElementAdapter) adapter).setViewer(this);
- return adapter;
- }
-
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection)
- {
- return true;
- }
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection)
- {
-
- Composite tree = getTableTree();
-
- Tree theTree = (Tree) tree;
- theTree.setSelection(theTree.getItems());
- TreeItem[] items = theTree.getItems();
- Object[] objects = new Object[items.length];
- for (int idx = 0; idx < items.length; idx++)
- objects[idx] = items[idx].getData();
- fireSelectionChanged(new SelectionChangedEvent(this, new StructuredSelection(objects)));
-
- }
-
- public void menuAboutToShow(IMenuManager manager)
- {
- SystemView.createStandardGroups(manager);
-
- if (!menuListenerAdded)
- {
- if (manager instanceof MenuManager)
- {
- Menu m = ((MenuManager)manager).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- if (_messageLine != null)
- ml.setShowToolTipText(true, _messageLine);
- m.addMenuListener(ml);
- }
- }
- }
- fillContextMenu(manager);
- }
-
- public ISelection getSelection()
- {
- ISelection selection = super.getSelection();
- if (selection == null || selection.isEmpty())
- {
- // make the selection the parent
- ArrayList list = new ArrayList();
- if (_objectInput != null)
- {
- list.add(_objectInput);
- selection = new StructuredSelection(list);
- }
- }
-
- return selection;
- }
-
- public void fillContextMenu(IMenuManager menu) {
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
-
- boolean allSelectionsFromSameParent = true;
- int selectionCount = selection.size();
-
-
-
- if (selectionCount == 0) // nothing selected
- {
- return;
- }
- else
- {
-
- if (selectionCount == 1) {
-
- if (selection.getFirstElement() == getInput()) {
- //return;
- }
- }
-
- if (selectionCount > 1)
- {
- allSelectionsFromSameParent = sameParent();
-
- if (!allSelectionsFromSameParent)
- {
- if (selectionHasAncestryRelationship())
- {
- // don't show the menu because actions with
- // multiple select on objects that are ancestors
- // of each other is problematic
- // still create the standard groups
- SystemView.createStandardGroups(menu);
- return;
- }
- }
- }
-
- // Partition into groups...
- SystemView.createStandardGroups(menu);
-
- // ADD COMMON ACTIONS...
-
- // COMMON RENAME ACTION...
- if (canRename())
- {
- if (showRename())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getRenameAction());
- }
-
- // ADAPTER SPECIFIC ACTIONS
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- Iterator elements = selection.iterator();
- Hashtable adapters = new Hashtable();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapters.put(adapter, element); // want only unique adapters
- }
- Enumeration uniqueAdapters = adapters.keys();
- Shell shell = getShell();
- while (uniqueAdapters.hasMoreElements())
- {
- ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter) uniqueAdapters.nextElement();
- nextAdapter.addActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- if (nextAdapter instanceof AbstractSystemViewAdapter)
- {
-
- AbstractSystemViewAdapter aVA = (AbstractSystemViewAdapter)nextAdapter;
- // add remote actions
- aVA.addCommonRemoteActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- // add dynamic menu popups
- aVA.addDynamicPopupMenuActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADDITIONS);
- }
- }
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx = 0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) && (((ActionContributionItem) items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) (((ActionContributionItem) items[idx]).getAction());
- item.setInputs(getShell(), this, selection);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager) items[idx];
- item.setInputs(getShell(), this, selection);
- }
- }
-
- // COMMON DELETE ACTION...
- if (canDelete() && showDelete())
- {
- //menu.add(getDeleteAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getDeleteAction());
- ((ISystemAction) getDeleteAction()).setInputs(getShell(), this, selection);
- menu.add(new Separator());
- }
-
- // PROPERTIES ACTION...
- // This is supplied by the system, so we pretty much get it for free. It finds the
- // registered propertyPages extension points registered for the selected object's class type.
- //propertyDialogAction.selectionChanged(selection);
-
- if (!_selectionIsRemoteObject) // is not a remote object
- {
- PropertyDialogAction pdAction = getPropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- {
-
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- }
- // OPEN IN NEW PERSPECTIVE ACTION... if (fromSystemViewPart && showOpenViewActions())
- {
- //SystemCascadingOpenToAction openToAction = getOpenToAction();
- SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
- SystemShowInTableAction showInTableAction = getShowInTableAction();
- openToPerspectiveAction.setSelection(selection);
- showInTableAction.setSelection(selection);
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToAction.getSubMenu());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToPerspectiveAction);
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, showInTableAction);
-
- }
- }
- else // is a remote object
- {
- //Object firstSelection = selection.getFirstElement();
- //ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(firstSelection);
- //logMyDebugMessage(this.getClass().getName(), ": there is a remote adapter");
- SystemRemotePropertiesAction pdAction = getRemotePropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- //else
- //logMyDebugMessage(this.getClass().getName(), ": but it is not applicable for selection");
- // --------------------------------------------------------------------------------------------------------------------
- // look for and add any popup menu actions registered via our org.eclipse.rse.core.popupMenus extension point...
- // --------------------------------------------------------------------------------------------------------------------
- if (_workbenchPart != null)
- {
- SystemPopupMenuActionContributorManager.getManager().contributeObjectActions(_workbenchPart, ourMenu, this, null);
- }
- }
-
- }
- }
-
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent()
- {
- boolean same = true;
-
- Tree tree = getTree();
-
- TreeItem[] items = tree.getSelection();
-
- if ((items == null) || (items.length ==0)) {
- return true;
- }
-
- TreeItem prevParent = null;
- TreeItem currParent = null;
-
- for (int idx = 0; idx < items.length; idx++)
- {
- currParent = items[idx].getParentItem();
-
- if ((idx>0) && (currParent != prevParent)) {
- same = false;
- break;
- }
- else
- {
- prevParent = currParent;
- }
- }
- return same;
- }
-
- private boolean selectionHasAncestryRelationship() {
- Tree tree = getTree();
-
- TreeItem[] items = tree.getSelection();
-
- for (int idx=0; idx<items.length; idx++)
- {
- TreeItem item = items[idx];
-
- for (int c=0; c < items.length; c++)
- {
- if (item != items[c])
- {
- if (isAncestorOf(item, items[c], false))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Returns whether an item is an ancestor of another item. The ancestor can be direct or indirect.
- * @param container the item which might be an ancestor.
- * @param item the child.
- * @param direct <code>true</code> if the container must be a direct ancestor of the child item,
- * <code>false</code> otherwise.
- * @return <code>true</code> if there is an ancestry relationship, <code>false</code> otherwise.
- */
- private boolean isAncestorOf(TreeItem container, TreeItem item, boolean direct)
- {
- TreeItem[] children = null;
-
- // does not have to be a direct ancestor
- if (!direct) {
- // get the children of the container's parent, i.e. the container's siblings
- // as well as itself
- TreeItem parent = container.getParentItem();
-
- // check if parent is null
- // parent is null if the container is a root item
- if (parent != null) {
- children = parent.getItems();
- }
- else {
- children = getTree().getItems();
- }
- }
- // must be a direct ancestor
- else {
- // get the children of the container
- children = container.getItems();
- }
-
- // go through all the children
- for (int i = 0; i < children.length; i++) {
-
- TreeItem child = children[i];
-
- // if one of the children matches the child item, return true
- if (child == item && direct) {
- return true;
- }
- // otherwise, go through children, and see if any of those are ancestors of
- // the child item
- else if (child.getItemCount() > 0) {
-
- // we check for direct ancestry
- if (isAncestorOf(child, item, true)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * --------------------------------------------------------------------------------
- * For many actions we have to walk the selection list and examine each selected
- * object to decide if a given common action is supported or not.
- * <p>
- * Walking this list multiple times while building the popup menu is a performance
- * hit, so we have this common method that does it only once, setting instance
- * variables for all of the decisions we are in interested in.
- * --------------------------------------------------------------------------------
- */
- protected void scanSelections()
- {
- // initial these variables to true. Then if set to false even once, leave as false always...
- _selectionShowRefreshAction = true;
- _selectionShowOpenViewActions = true;
- _selectionShowDeleteAction = true;
- _selectionShowRenameAction = true;
- _selectionEnableDeleteAction = true;
- _selectionEnableRenameAction = true;
- _selectionIsRemoteObject = true;
- _selectionFlagsUpdated = true;
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (_selectionShowRefreshAction)
- _selectionShowRefreshAction = adapter.showRefresh(element);
-
- if (_selectionShowOpenViewActions)
- _selectionShowOpenViewActions = adapter.showOpenViewActions(element);
-
- if (_selectionShowDeleteAction)
- _selectionShowDeleteAction = adapter.showDelete(element);
-
- if (_selectionShowRenameAction)
- _selectionShowRenameAction = adapter.showRename(element);
-
- if (_selectionEnableDeleteAction)
- _selectionEnableDeleteAction = _selectionShowDeleteAction && adapter.canDelete(element);
- //System.out.println("ENABLE DELETE SET TO " + selectionEnableDeleteAction);
-
- if (_selectionEnableRenameAction)
- _selectionEnableRenameAction = _selectionShowRenameAction && adapter.canRename(element);
-
- if (_selectionIsRemoteObject)
- _selectionIsRemoteObject = (getRemoteAdapter(element) != null);
- }
-
- }
-
-
- public void positionTo(String name)
- {
- ArrayList selectedItems = new ArrayList();
- Tree tree = getTree();
- TreeItem topItem = null;
- for (int i = 0; i < tree.getItemCount(); i++)
- {
- TreeItem item = tree.getItem(i);
- Object data = item.getData();
- if (data instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = getAdapter(data);
- String itemName = adapter.getName(data);
-
- if (StringCompare.compare(name, itemName, false))
- {
- if (topItem == null)
- {
- topItem = item;
- }
- selectedItems.add(item);
- }
- }
- }
-
- if (selectedItems.size() > 0)
- {
- TreeItem[] tItems = new TreeItem[selectedItems.size()];
- for (int i = 0; i < selectedItems.size(); i++)
- {
- tItems[i] = (TreeItem) selectedItems.get(i);
- }
-
- tree.setSelection(tItems);
- tree.setTopItem(topItem);
- setSelection(getSelection(), true);
- }
- }
-
-
- protected void handleKeyPressed(KeyEvent event)
- {
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection) getSelection()).size() > 0))
- {
- scanSelections();
- if (showDelete() && canDelete())
- {
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction) getDeleteAction();
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(this);
- dltAction.run();
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeViewProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeViewProvider.java
deleted file mode 100644
index e0406dd26..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableTreeViewProvider.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.progress.DeferredTreeContentManager;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-/**
- * This is the content and label provider for the SystemTableTreeView.
- * This class is used both to populate the SystemTableTreeView but also
- * to resolve the icon and labels for the cells in the table/tree.
- *
- */
-public class SystemTableTreeViewProvider implements ILabelProvider, ITableLabelProvider, ITreeContentProvider
-{
-
-
- private ListenerList listeners = new ListenerList(1);
-
- protected Object[] _lastResults = null;
- protected Object _lastObject = null;
- protected SimpleDateFormat _dateFormat = new SimpleDateFormat();
- protected Viewer _viewer = null;
- protected int _maxCharsInColumnZero = 0;
- private SystemDeferredTableTreeContentManager manager;
- private boolean _disableDeferredQueries = false;
-
- /**
- * The cache of images that have been dispensed by this provider.
- * Maps ImageDescriptor->Image.
- */
- private Map imageTable = new Hashtable(40);
- private SystemTableViewColumnManager _columnManager;
- private HashMap cache;
- /**
- * Constructor for table view provider where a column manager is present.
- * In this case, the columns are customizable by the user.
- * @param columnManager
- */
- public SystemTableTreeViewProvider(SystemTableViewColumnManager columnManager)
- {
- super();
- _columnManager= columnManager;
- cache = new HashMap();
- }
-
- public void inputChanged(Viewer visualPart, Object oldInput, Object newInput)
- {
- _viewer = visualPart;
- if (_viewer instanceof AbstractTreeViewer)
- {
- manager = new SystemDeferredTableTreeContentManager(this, (SystemTableTreeView)_viewer);
- }
- }
-
- public void setCache(Object[] newCache)
- {
- _lastResults = newCache;
- }
-
- public Object[] getCache()
- {
- return _lastResults;
- }
-
- public boolean flushCache()
- {
- if (_lastResults == null)
- {
- return false;
- }
- if (_lastObject instanceof ISystemContainer)
- {
- ((ISystemContainer)_lastObject).markStale(true);
- }
-
- _lastResults = null;
- return true;
- }
-
- public boolean isDeleted(Object element)
- {
- return false;
- }
-
- public Object[] getChildren(Object object)
- {
-
- return getElements(object);
- }
-
- public Object getParent(Object object)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- return adapter.getParent(object);
- }
- else
- {
- return null;
- }
- }
-
- public boolean hasChildren(Object object)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- return adapter.hasChildren(object);
- }
- if (manager != null) {
- if (manager.isDeferredAdapter(object))
- return manager.mayHaveChildren(object);
- }
- return false;
- }
-
- public Object getElementAt(Object object, int i)
- {
-
- return null;
- }
-
-
-
- protected ISystemViewElementAdapter getAdapterFor(Object object)
- {
- ISystemViewElementAdapter result = null;
- if (_viewer != null)
- {
- result = SystemAdapterHelpers.getAdapter(object, _viewer);
- }
- else
- {
- result = SystemAdapterHelpers.getAdapter(object);
- }
- if (result == null)
- {
- return null;
- }
- result.setPropertySourceInput(object);
- return result;
- }
-
- public Object[] getElements(Object object)
- {
- Object[] results = null;
- if (object == _lastObject && _lastResults != null)
- {
- return _lastResults;
- }
- else
- if (object instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- adapter.setViewer(_viewer);
-
-
-
- if (adapter != null && adapter.hasChildren(object))
- {
- if (supportsDeferredQueries())
- {
- if (manager != null && adapter.supportsDeferredQueries())
- {
- ISubSystem ss = adapter.getSubSystem(object);
- if (ss != null)
- {
- // if (ss.isConnected())
- {
-
- results = manager.getChildren(object);
- }
- }
- }
- }
- else
- {
- results = adapter.getChildren(object);
- }
- if (adapter instanceof SystemViewRootInputAdapter)
- {
- ArrayList filterredResults = new ArrayList();
- for (int i = 0; i < results.length; i++)
- {
- Object result = results[i];
- ISystemViewElementAdapter cadapter = getAdapterFor(result);
- if (!(cadapter instanceof SystemViewPromptableAdapter))
- {
- filterredResults.add(result);
- }
- }
- results = filterredResults.toArray();
- }
-
- _lastResults = results;
- _lastObject = object;
- }
- }
- if (results == null)
- {
- return new Object[0];
- }
-
- return results;
- }
-
-
- public String getText(Object object)
- {
- String result = null;
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- result = adapter.getText(object);
- }
- else
- {
- IWorkbenchAdapter wadapter = (IWorkbenchAdapter)((IAdaptable) object).getAdapter(IWorkbenchAdapter.class);
-
- if (wadapter == null)
- {
- return object.toString();
- }
- return wadapter.getLabel(object);
- }
- int len = result.length();
- if (len > _maxCharsInColumnZero)
- {
- _maxCharsInColumnZero = len;
- }
- return result;
- }
-
- public int getMaxCharsInColumnZero()
- {
- return _maxCharsInColumnZero;
- }
-
- public Image getImage(Object object)
- {
- ImageDescriptor descriptor = null;
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- descriptor = adapter.getImageDescriptor(object);
- }
- else
- {
- IWorkbenchAdapter wadapter = (IWorkbenchAdapter)((IAdaptable) object).getAdapter(IWorkbenchAdapter.class);
- if (wadapter == null)
- {
- return null;
- }
- else
- {
- descriptor = wadapter.getImageDescriptor(object);
- }
- }
-
- Image image = null;
- if (descriptor != null)
- {
- Object iobj = imageTable.get(descriptor);
- if (iobj == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- else
- {
- image = (Image) iobj;
- }
- }
-
- return image;
- }
-
-
- public String getColumnText(Object obj, int index)
- {
- if (index == 0)
- {
- // get the first descriptor
- return getText(obj);
- }
- else
- {
-
- index = index - 1;
- ISystemViewElementAdapter adapter = getAdapterFor(obj);
- if (adapter == null)
- {
- return null;
- }
-
-
- IPropertyDescriptor[] descriptors = null;
- if (_columnManager != null)
- {
- descriptors = _columnManager.getVisibleDescriptors(adapter);
- }
- else
- {
- descriptors = adapter.getUniquePropertyDescriptors();
- }
-
- if (descriptors.length > index)
- {
- IPropertyDescriptor descriptor = descriptors[index];
-
- try
- {
- Object key = descriptor.getId();
-
- Object propertyValue = adapter.getPropertyValue(key);
-
- if (propertyValue instanceof String)
- {
- return (String) propertyValue;
- }
- else if (propertyValue instanceof Date)
- {
- return _dateFormat.format((Date)propertyValue);
- }
- else
- if (propertyValue != null)
- {
- return propertyValue.toString();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- return ""; //$NON-NLS-1$
- }
-
- }
-
- public Image getColumnImage(Object obj, int i)
- {
- if (i == 0)
- {
- return getImage(obj);
- }
- else
- {
- return null;
- }
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- listeners.add(listener);
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- listeners.remove(listener);
- }
-
- /**
- * Cache the objects for the given parent.
- * @param parent the parent object.
- * @param children the children to cache.
- */
- public void setCachedObjects(Object parent, Object[] children) {
- cache.put(parent, children);
- _lastObject = parent;
- _lastResults = children;
- }
-
- /**
- * Returns the cached objects for the given parent.
- * @param parent the parent object.
- * @return the cached children.
- */
- public Object[] getCachedObjects(Object parent) {
- return (Object[])(cache.get(parent));
- }
-
- /**
- * The visual part that is using this content provider is about
- * to be disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- }
-
- public void disableDeferredQueries(boolean disable)
- {
- _disableDeferredQueries = disable;
- }
-
- protected boolean supportsDeferredQueries()
- {
- if (_disableDeferredQueries)
- return false;
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.USE_DEFERRED_QUERIES);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableView.java
deleted file mode 100644
index 08cce3137..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableView.java
+++ /dev/null
@@ -1,1909 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.StringCompare;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
-import org.eclipse.rse.ui.actions.SystemShowInTableAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-/**
- * This subclass of the standard JFace table viewer is used to
- * show a generic table view of the selected object in the Systems view
- * <p>
- */
-public class SystemTableView
- extends TableViewer
- implements IMenuListener, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget, ISystemResourceChangeListener, ISystemRemoteChangeListener, ISelectionChangedListener, ISelectionProvider
-{
-
-
- // inner class to support cell editing
- private ICellModifier cellModifier = new ICellModifier()
- {
- public Object getValue(Object element, String property)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapter.setPropertySourceInput(element);
- Object value = adapter.getPropertyValue(property);
- if (value == null)
- {
- value = "";
- }
- return value;
- }
-
- public boolean canModify(Object element, String property)
- {
- boolean modifiable = true;
- return modifiable;
- }
-
- public void modify(Object element, String property, Object value)
- {
- if (element instanceof TableItem && value != null)
- {
- Object obj = ((TableItem) element).getData();
- ISystemViewElementAdapter adapter = getAdapter(obj);
- if (adapter != null)
- {
- adapter.setPropertyValue(property, value);
-
- SelectionChangedEvent event = new SelectionChangedEvent(SystemTableView.this, getSelection());
-
- // fire the event
- fireSelectionChanged(event);
- }
- }
- }
- };
-
- private class HeaderSelectionListener extends SelectionAdapter
- {
-
- public HeaderSelectionListener()
- {
- _upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID);
- _downI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID);
- }
-
-
- /**
- * Handles the case of user selecting the
- * header area.
- * <p>If the column has not been selected previously,
- * it will set the sorter of that column to be
- * the current table view sorter. Repeated
- * presses on the same column header will
- * toggle sorting order (ascending/descending).
- */
- public void widgetSelected(SelectionEvent e)
- {
- Table table = getTable();
- if (!table.isDisposed())
- {
- // column selected - need to sort
- TableColumn tcolumn = (TableColumn)e.widget;
- int column = table.indexOf(tcolumn);
- SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
- if (oldSorter != null && column == oldSorter.getColumnNumber())
- {
- oldSorter.setReversed(!oldSorter.isReversed());
- if (tcolumn.getImage() == _upI)
- {
- tcolumn.setImage(_downI);
- }
- else
- {
- tcolumn.setImage(_upI);
- }
- }
- else
- {
- setSorter(new SystemTableViewSorter(column, SystemTableView.this, _columnManager));
- tcolumn.setImage(_downI);
- }
-
- // unset image of other columns
- TableColumn[] allColumns = table.getColumns();
- for (int i = 0; i < allColumns.length; i++)
- {
- if (i != column)
- {
- if (allColumns[i].getImage() != null)
- {
- allColumns[i].setImage(null);
- }
- }
- }
- refresh();
- }
- }
- }
-
- private Object _objectInput;
- private TableLayout _layout;
- protected SystemTableViewProvider _provider;
- private HeaderSelectionListener _columnSelectionListener;
- private MenuManager _menuManager;
- private SystemTableViewFilter _filter;
- private IPropertyDescriptor[] _uniqueDescriptors;
- private SystemTableViewColumnManager _columnManager;
-
- // these variables were copied from SystemView to allow for limited support
- // of actions. I say limited because somethings don't yet work properly.
- protected SystemRefreshAction _refreshAction;
- protected PropertyDialogAction _propertyDialogAction;
- protected SystemRemotePropertiesAction _remotePropertyDialogAction;
- protected SystemOpenExplorerPerspectiveAction _openToPerspectiveAction;
- protected SystemShowInTableAction _showInTableAction;
-
- // global actions
- // Note the Edit menu actions are set in SystemViewPart. Here we use these
- // actions from our own popup menu actions.
- protected SystemCommonDeleteAction _deleteAction;
- // for global delete menu item
- protected SystemCommonRenameAction _renameAction;
- // for common rename menu item
- protected SystemCommonSelectAllAction _selectAllAction;
- // for common Ctrl+A select-all
-
- protected boolean _selectionShowRefreshAction;
- protected boolean _selectionShowOpenViewActions;
- protected boolean _selectionShowDeleteAction;
- protected boolean _selectionShowRenameAction;
- protected boolean _selectionEnableDeleteAction;
- protected boolean _selectionEnableRenameAction;
-
- protected boolean _selectionIsRemoteObject = true;
- protected boolean _selectionFlagsUpdated = false;
-
- private IWorkbenchPart _workbenchPart = null;
- private ISystemMessageLine _messageLine;
-
- private int[] _lastWidths = null;
- private int _charWidth = 3;
-
- private boolean _showColumns = true;
-
- private Image _upI;
- private Image _downI;
-
- protected boolean menuListenerAdded = false;
-
- private static final int LEFT_BUTTON = 1;
- private int mouseButtonPressed = LEFT_BUTTON;
- /**
- * Constructor for the table view
- *
- */
- public SystemTableView(Table table, ISystemMessageLine msgLine)
- {
- super(table);
- _layout = new TableLayout();
- _messageLine = msgLine;
-
- _columnManager = new SystemTableViewColumnManager(this);
- _provider = getProvider();
- _columnSelectionListener = new HeaderSelectionListener();
-
- setContentProvider(_provider);
-
- setLabelProvider(new SystemDecoratingLabelProvider(_provider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
- //setLabelProvider(_provider);
-
- _filter = new SystemTableViewFilter();
- addFilter(_filter);
-
- _charWidth = table.getFont().getFontData()[0].getHeight() / 2;
- computeLayout();
-
- _menuManager = new MenuManager("#PopupMenu");
- _menuManager.setRemoveAllWhenShown(true);
- _menuManager.addMenuListener(this);
- Menu menu = _menuManager.createContextMenu(table);
- table.setMenu(menu);
-
- addSelectionChangedListener(this);
-
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().addSystemRemoteChangeListener(this);
-
- initDragAndDrop();
-
- table.setVisible(false);
-
- // key listening for delete press
- getControl().addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- handleKeyPressed(e);
- }
- });
- getControl().addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- mouseButtonPressed = e.button; //d40615
- }
- });
-
-
- _upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_ARROW_UP_ID);
- _downI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID);
- }
-
- protected SystemTableViewProvider getProvider()
- {
- if (_provider == null)
- {
- _provider = new SystemTableViewProvider(_columnManager);
- }
- return _provider;
- }
-
- public void showColumns(boolean flag)
- {
- _showColumns = flag;
- }
-
-
- public Layout getLayout()
- {
- return _layout;
- }
-
- public void setWorkbenchPart(IWorkbenchPart part)
- {
- _workbenchPart = part;
- }
-
- public void setViewFilters(String[] filter)
- {
- if (_filter.getFilters() != filter)
- {
- _filter.setFilters(filter);
- refresh();
- }
- }
-
- public String[] getViewFilters()
- {
- return _filter.getFilters();
- }
-
- /**
- * Return the popup menu for the table
- */
- public Menu getContextMenu()
- {
- return getTable().getMenu();
- }
- /**
- * Return the popup menu for the table
- */
- public MenuManager getContextMenuManager()
- {
- return _menuManager;
- }
-
- /**
- * Called whenever the input for the view changes
- */
- public void inputChanged(Object newObject, Object oldObject)
- {
- if (newObject instanceof IAdaptable)
- {
- getTable().setVisible(true);
- _objectInput = newObject;
- computeLayout();
-
- // reset the filter
- //setViewFilters(null);
-
- super.inputChanged(newObject, oldObject);
-
- }
- else if (newObject == null)
- {
- getTable().setVisible(false);
- _objectInput = null;
- computeLayout();
-
- setViewFilters(null);
- }
- }
-
- public Object getInput()
- {
- return _objectInput;
- }
-
- /**
- * Convenience method for retrieving the view adapter for an object
- */
- protected ISystemViewElementAdapter getAdapter(Object obj)
- {
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(obj, this);
- if (adapter != null)
- adapter.setPropertySourceInput(obj);
- return adapter;
- }
-
- /**
- * Convenience method for retrieving the view adapter for an object's children
- */
- public ISystemViewElementAdapter getAdapterForContents()
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
- Object[] children = provider.getChildren(getInput());
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- return getAdapter(child);
- }
- return null;
- }
-
- /**
- * Used to determine what the columns should be on the table.
- */
- public IPropertyDescriptor[] getVisibleDescriptors(Object object)
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
- Object[] children = provider.getChildren(object);
- return getVisibleDescriptors(children);
- }
-
- private IPropertyDescriptor[] getVisibleDescriptors(Object[] children)
- {
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- return getCustomDescriptors(getAdapter(child));
- }
-
- return new IPropertyDescriptor[0];
- }
-
- public SystemTableViewColumnManager getColumnManager()
- {
- return _columnManager;
- }
-
- public IPropertyDescriptor getNameDescriptor(Object object)
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
- Object[] children = provider.getChildren(object);
- return getNameDescriptor(children);
- }
-
- private IPropertyDescriptor getNameDescriptor(Object[] children)
- {
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
- return getAdapter(child).getPropertyDescriptors()[0];
- }
-
- return null;
- }
-
- /**
- * Used to determine the formats of each descriptor.
- */
- private ArrayList getFormatsIn()
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
- Object[] children = provider.getChildren(_objectInput);
- return getFormatsIn(children);
- }
-
- private IPropertyDescriptor[] getCustomDescriptors(ISystemViewElementAdapter adapter)
- {
- return _columnManager.getVisibleDescriptors(adapter);
- }
-
- private ArrayList getFormatsIn(Object[] children)
- {
- ArrayList results = new ArrayList();
-
- if (children != null && children.length > 0)
- {
- IAdaptable child = (IAdaptable) children[0];
-
- Object adapter = child.getAdapter(ISystemViewElementAdapter.class);
- if (adapter instanceof ISystemViewElementAdapter)
- {
- ISystemViewElementAdapter ad = (ISystemViewElementAdapter) adapter;
- ad.setPropertySourceInput(child);
-
- IPropertyDescriptor[] descriptors = getCustomDescriptors(ad);
- for (int i = 0; i < descriptors.length; i++)
- {
- IPropertyDescriptor descriptor = descriptors[i];
-
- try
- {
- Object key = descriptor.getId();
-
- Object propertyValue = ad.getPropertyValue(key, false);
- results.add(propertyValue.getClass());
- }
- catch (Exception e)
- {
- results.add(String.class);
- }
-
- }
- }
- }
-
- return results;
- }
-
- public void computeLayout()
- {
- computeLayout(false);
- }
-
- private CellEditor getCellEditor(Table parent, IPropertyDescriptor descriptor)
- {
- CellEditor editor = descriptor.createPropertyEditor(parent);
- if (editor instanceof SystemInheritableTextCellEditor)
- {
- ((SystemInheritableTextCellEditor) editor).getInheritableEntryField().setAllowEditingOfInheritedText(true);
- }
-
- return editor;
- }
-
- private boolean sameDescriptors(IPropertyDescriptor[] descriptors1, IPropertyDescriptor[] descriptors2)
- {
- if (descriptors1 == null || descriptors2 == null)
- {
- return false;
- }
- if (descriptors1.length == descriptors2.length)
- {
- boolean same = true;
- for (int i = 0; i < descriptors1.length && same; i++)
- {
- same = descriptors1[i] == descriptors2[i];
- }
- return same;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Determines what columns should be shown in this view. The columns may change
- * anytime the view input changes. The columns in the control are modified and
- * columns may be added or deleted as necessary to make it conform to the
- * new data.
- */
- public void computeLayout(boolean force)
- {
- if (_showColumns == false)
- return;
- if (_objectInput == null)
- return;
-
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
- Object[] children = provider.getChildren(_objectInput);
-
- // if no children, don't update
- if (children == null || children.length == 0)
- {
- return;
- }
-
- IPropertyDescriptor[] descriptors = getVisibleDescriptors(children);
- IPropertyDescriptor nameDescriptor = getNameDescriptor(children);
-
- int n = descriptors.length; // number of columns we need (name column + other columns)
- if (nameDescriptor != null)
- n += 1;
- if (n == 0)
- return; // there is nothing to lay out!
-
-
- if (sameDescriptors(descriptors,_uniqueDescriptors) && !force)
- {
- setLastColumnWidths(getCurrentColumnWidths());
- return;
- }
- _uniqueDescriptors = descriptors;
- Table table = getTable();
- if (table == null || table.isDisposed())
- return;
-
- // set column attributes, create new columns if necessary
- TableColumn[] columns = table.getColumns();
- int numColumns = columns.length; // number of columns in the control
- CellEditor editors[] = new CellEditor[n];
- String headings[] = new String[n];
- String propertyIds[] = new String[n];
- ArrayList formats = getFormatsIn();
-
-
- _layout = new TableLayout();
- for (int i = 0; i < n; i++)
- { // for each column
- String name = null;
- String propertyId = null;
- CellEditor editor = null;
- int alignment = SWT.LEFT;
- int weight = 100;
- if (i == 0)
- {
- // this is the first column -- treat it special
- name = SystemPropertyResources.RESID_PROPERTY_NAME_LABEL;
- propertyId = (String) nameDescriptor.getId();
- editor = getCellEditor(table, nameDescriptor);
- weight = 200;
- }
- else
- { // these columns come from the regular descriptors
- IPropertyDescriptor descriptor = descriptors[i - 1];
-
- Class format = (Class) formats.get(i - 1);
- name = descriptor.getDisplayName();
- propertyId = (String) descriptor.getId();
- editor = getCellEditor(table, descriptor);
- if (format != String.class)
- alignment = SWT.RIGHT;
- }
- TableColumn tc = null;
- if (i >= numColumns)
- {
- tc = new TableColumn(table, alignment, i);
- tc.setMoveable(true);
- tc.addSelectionListener(_columnSelectionListener);
- }
- else
- {
- tc = columns[i];
- tc.setAlignment(alignment);
- }
- _layout.addColumnData(new ColumnWeightData(weight));
- tc.setText(name);
- if (i == 0)
- {
- // tc.setImage(_downI);
- }
- headings[i] = name;
- editors[i] = editor;
- propertyIds[i] = propertyId;
- }
- setColumnProperties(propertyIds);
- setCellEditors(editors);
- setCellModifier(cellModifier);
-
- // dispose of any extra columns the table control may have
- for (int i = n; i < numColumns; i++)
- {
- columns[i].dispose();
- columns[i] = null;
- }
-
- // compute column widths
- columns = table.getColumns();
- numColumns = columns.length;
- Rectangle clientA = table.getClientArea();
- int totalWidth = clientA.width - 5;
- if (totalWidth <= 0)
- {
- // find a default
- totalWidth = 500;
- }
-
-
- int[] lastWidths = getLastColumnWidths();
- if (numColumns > 1)
- {
- // check if previous widths can be used
- if (lastWidths != null && lastWidths.length == numColumns)
- {
-
- // use previously established widths
- setCurrentColumnWidths(lastWidths);
- }
- else
- {
- if (totalWidth > 0)
- {
- // no previous widths or number of columns has changed - need to calculate
- int averageWidth = totalWidth / numColumns;
- int firstWidth = Math.max(averageWidth, 150);
- averageWidth = (totalWidth - firstWidth) / (numColumns - 1);
- averageWidth = Math.max(averageWidth, 80);
- columns[0].setWidth(firstWidth);
- for (int i = 1; i < numColumns; i++)
- {
-
- columns[i].setWidth(averageWidth);
- }
- setLastColumnWidths(getCurrentColumnWidths());
- }
- }
- table.setHeaderVisible(true);
- }
- else
- {
-
- if (numColumns == 1)
- {
- int width = totalWidth;
- if (lastWidths != null && lastWidths.length == 1)
- {
- width = (totalWidth > lastWidths[0]) ? totalWidth : lastWidths[0];
- }
-
-
- int maxWidth = provider.getMaxCharsInColumnZero() * _charWidth;
- if (maxWidth > width)
- {
- width = maxWidth;
- }
-
- if (width > 0)
- {
- columns[0].setWidth(width);
- }
- table.setHeaderVisible(false);
- }
- }
- }
-
- public int[] getCurrentColumnWidths()
- {
- Table table = getTable();
- if (table != null && !table.isDisposed())
- {
- int[] widths = new int[table.getColumnCount()];
- TableColumn[] columns = table.getColumns();
- for (int i = 0; i < columns.length; i++)
- {
- widths[i] = columns[i].getWidth();
- }
- return widths;
- }
-
- return new int[0];
- }
-
- public void setCurrentColumnWidths(int[] widths)
- {
- Table table = getTable();
- if (table != null && !table.isDisposed())
- {
- TableColumn[] columns = table.getColumns();
- for (int i = 0; i < columns.length && i < widths.length; i++)
- {
- columns[i].setWidth(widths[i]);
- }
- }
- }
-
- public int[] getLastColumnWidths()
- {
- return _lastWidths;
- }
-
- public void setLastColumnWidths(int[] widths)
- {
- _lastWidths = widths;
- }
-
- protected void initDragAndDrop()
- {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance(), EditorInputTransfer.getInstance(), FileTransfer.getInstance()};
-
- addDragSupport(ops, transfers, new SystemViewDataDragAdapter(this));
- addDropSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDropAdapter(this));
- }
-
- /**
- * Used to asynchronously update the view whenever properties change.
- * @see org.eclipse.rse.model.ISystemResourceChangeListener#systemResourceChanged(org.eclipse.rse.model.ISystemResourceChangeEvent)
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
-
- boolean madeChange = false;
- Object parent = event.getParent();
- Object child = event.getSource();
- int eventType = event.getType();
- switch (eventType)
- {
- case ISystemResourceChangeEvents.EVENT_RENAME_FILTER_REFERENCE:
- case ISystemResourceChangeEvents.EVENT_CHANGE_FILTER_REFERENCE:
- case ISystemResourceChangeEvents.EVENT_CHANGE_FILTERSTRING_REFERENCE:
- {
- if (_objectInput instanceof ISystemFilterReference)
- {
- if (child == ((ISystemFilterReference)_objectInput).getReferencedFilter())
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
-
- if (provider != null)
- {
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- computeLayout();
- try
- {
- internalRefresh(_objectInput);
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError(e.getMessage());
- }
- }
-
- }
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE :
- case ISystemResourceChangeEvents.EVENT_PROPERTYSHEET_UPDATE :
- case ISystemResourceChangeEvents.EVENT_ICON_CHANGE:
- {
- try
- {
- Widget w = findItem(child);
- if (w != null)
- {
- updateItem(w, child);
- }
- }
- catch (Exception e)
- {
-
- }
- }
- return;
- //break;
-
- case ISystemResourceChangeEvents.EVENT_DELETE:
- case ISystemResourceChangeEvents.EVENT_DELETE_MANY:
- {
- if (child instanceof ISystemFilterReference)
- {
- Widget w = findItem(child);
- if (w != null)
- {
- remove(child);
- }
- }
- }
- break;
-
- case ISystemResourceChangeEvents.EVENT_ADD :
- case ISystemResourceChangeEvents.EVENT_ADD_RELATIVE :
- {
- boolean addingConnection = (child instanceof IHost);
- if (_objectInput instanceof ISystemRegistry && addingConnection)
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
-
- if (provider != null)
- {
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- computeLayout();
- internalRefresh(_objectInput);
- }
- }
- }
- break;
-
- case ISystemResourceChangeEvents.EVENT_REFRESH:
- {
- if (child == RSEUIPlugin.getTheSystemRegistry())
- {
- // treat this as refresh all
- child = _objectInput;
- }
- }
- break;
- default :
- break;
-
- }
-
- if (child == _objectInput || parent == _objectInput)
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
-
- if (provider != null)
- {
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- computeLayout();
- try
- {
- internalRefresh(_objectInput);
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError(e.getMessage());
- }
- }
- }
- }
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeListener#systemRemoteResourceChanged(org.eclipse.rse.model.ISystemRemoteChangeEvent)
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- boolean madeChange = false;
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
- boolean originatedHere = (event.getOriginatingViewer() == this);
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- String remoteResourceParentName = getRemoteResourceAbsoluteName(remoteResourceParent);
- String remoteResourceName = getRemoteResourceAbsoluteName(remoteResource);
- if (remoteResourceName == null)
- return;
- SystemTableViewProvider provider = (SystemTableViewProvider) getContentProvider();
-
- if (_objectInput instanceof ISystemContainer && ((ISystemContainer)_objectInput).isStale())
- {
- provider.flushCache();
- refresh();
- return;
- }
-
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
- {
- if (remoteResourceParent == getInput())
- {
- Widget w = findItem(remoteResource);
- if (w != null)
- {
- updateItem(w, remoteResource);
- }
-
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
- {
- String inputResourceName = getRemoteResourceAbsoluteName(getInput());
- if (remoteResourceParentName != null && remoteResourceParentName.equals(inputResourceName))
- {
- if (provider == null)
- {
- return;
- }
- if (!madeChange)
- {
- provider.flushCache();
- madeChange = true;
- }
-
- refresh();
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- {
- Object dchild = remoteResource;
-
- ISystemViewElementAdapter dadapt = getAdapter(dchild);
- if (dadapt != null)
- {
- ISubSystem dSubSystem = dadapt.getSubSystem(dchild);
- String dkey = dadapt.getAbsoluteName(dchild);
-
- if (provider != null)
- {
- Object[] children = provider.getChildren(_objectInput);
- for (int i = 0; i < children.length; i++)
- {
- Object existingChild = children[i];
- if (existingChild != null)
- {
- ISystemViewElementAdapter eadapt = getAdapter(existingChild);
- ISubSystem eSubSystem = eadapt.getSubSystem(existingChild);
-
- if (dSubSystem == eSubSystem)
- {
- String ekey = eadapt.getAbsoluteName(existingChild);
- if (ekey.equals(dkey))
- {
- if (!madeChange)
- {
- if (_objectInput instanceof ISystemContainer)
- {
- ((ISystemContainer)_objectInput).markStale(true);
- }
-
- provider.flushCache();
- madeChange = true;
-
- // do a full refresh
- refresh();
- }
- }
- }
-
- }
- }
- }
- }
- }
-
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- String oldName = event.getOldName();
- Object child = event.getResource();
-
- if (provider != null)
- {
- Object[] previousResults = provider.getCache();
- if (previousResults != null)
- {
- for (int i = 0; i < previousResults.length; i++)
- {
- Object previousResult = previousResults[i];
-
- if (previousResult == child)
- {
- Widget widget = findItem(previousResult);
- if (widget != null)
- {
- widget.setData(child);
- updateItem(widget, child);
- return;
- }
- }
- else
- {
- String previousName = getAdapter(previousResult).getAbsoluteName(previousResult);
-
- if (previousName != null && previousName.equals(oldName))
- {
- provider.flushCache();
- internalRefresh(_objectInput);
- return;
- }
- }
- }
-
- }
- }
- }
-
- break;
-
- /*
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- if (remoteResourceParent == getInput())
- {
- if (provider != null)
- {
- provider.flushCache();
- }
-
- refresh();
- }
-
- }
- break;
- */
- }
- }
-
- /**
- * Turn a given remote object reference into a fully qualified absolute name
- */
- private String getRemoteResourceAbsoluteName(Object remoteResource)
- {
- if (remoteResource == null)
- return null;
- String remoteResourceName = null;
- if (remoteResource instanceof String)
- remoteResourceName = (String) remoteResource;
- else
- {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra == null)
- return null;
- remoteResourceName = ra.getAbsoluteName(remoteResource);
- }
- return remoteResourceName;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null)
- return;
-
- _selectionFlagsUpdated = false;
- ISystemViewElementAdapter adapter = getAdapter(firstSelection);
- if (adapter != null)
- {
- displayMessage(adapter.getStatusLineText(firstSelection));
- if ((mouseButtonPressed == LEFT_BUTTON))
- adapter.selectionChanged(firstSelection);
- }
- else
- clearMessage();
- }
-
- public void dispose()
- {
- removeSelectionChangedListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemRemoteChangeListener(this);
- _menuManager.removeAll();
-
- Table table = getTable();
-
- if (!table.isDisposed())
- {
- table.removeAll();
- TableColumn[] columns = table.getColumns();
- for (int i = 0; i < columns.length; i++)
- {
- TableColumn column = columns[i];
- if (column != null && !column.isDisposed())
- {
- column.removeSelectionListener(_columnSelectionListener);
- column.dispose();
- column = null;
- }
- }
-
- table.dispose();
- }
- }
-
- /*
- * Everything below is basically stuff copied and pasted from SystemsView
- * -There needs to be cleaning up of the below code as some of this stuff
- * is broken for the table view
- *
- *
- public void createStandardGroups(IMenuManager menu)
- {
- if (!menu.isEmpty())
- return;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW));
- // new->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO));
- // expand to->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND));
- // expand, collapse
- // goto into, go->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH));
- // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH));
- // browse with ->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN));
- // open xxx
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH));
- // work with->
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_SHOW)); // show->type hierarchy, in-navigator
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD));
- // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE));
- // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE));
- // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER));
- // move up, move down
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE));
- // getters/setters, etc. Typically in editor
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH));
- // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION));
- // connection-related actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT));
- // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS));
- // actions queried from adapters
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS));
- // user or BP/ISV additions
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM));
- // Team
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_COMPAREWITH));
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_REPLACEWITH));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES));
- // Properties
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected PropertyDialogAction getPropertyDialogAction()
- {
- if (_propertyDialogAction == null)
- {
- _propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this);
- //propertyDialogAction.setToolTipText(" ");
- }
- _propertyDialogAction.selectionChanged(getSelection());
- return _propertyDialogAction;
- }
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected SystemRemotePropertiesAction getRemotePropertyDialogAction()
- {
- if (_remotePropertyDialogAction == null)
- {
- _remotePropertyDialogAction = new SystemRemotePropertiesAction(getShell());
- }
- _remotePropertyDialogAction.setSelection(getSelection());
- return _remotePropertyDialogAction;
- }
- /**
- * Return the select All action
- */
- protected IAction getSelectAllAction()
- {
- if (_selectAllAction == null)
- _selectAllAction = new SystemCommonSelectAllAction(getShell(), this, this);
- return _selectAllAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getRenameAction()
- {
- if (_renameAction == null)
- _renameAction = new SystemCommonRenameAction(getShell(), this);
- return _renameAction;
- }
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getDeleteAction()
- {
- if (_deleteAction == null)
- _deleteAction = new SystemCommonDeleteAction(getShell(), this);
- return _deleteAction;
- }
-
- /**
- * Return the refresh action
- */
- protected IAction getRefreshAction()
- {
- if (_refreshAction == null)
- _refreshAction = new SystemRefreshAction(getShell());
- return _refreshAction;
- }
- /*
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- *
- protected SystemCascadingOpenToAction getOpenToAction()
- {
- if (openToAction == null)
- openToAction = new SystemCascadingOpenToAction(getShell(),getWorkbenchWindow());
- return openToAction;
- } NOT USED YET */
- /**
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- protected SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction()
- {
- if (_openToPerspectiveAction == null)
- {
- IWorkbench desktop = PlatformUI.getWorkbench();
- IWorkbenchWindow win = desktop.getActiveWorkbenchWindow();
-
- _openToPerspectiveAction = new SystemOpenExplorerPerspectiveAction(getShell(), win);
- }
- //getWorkbenchWindow());
- return _openToPerspectiveAction;
- }
-
- protected SystemShowInTableAction getShowInTableAction()
- {
- if (_showInTableAction == null)
- {
- _showInTableAction = new SystemShowInTableAction(getShell());
- }
- //getWorkbenchWindow());
- return _showInTableAction;
- }
-
- public Shell getShell()
- {
- return getTable().getShell();
- }
-
- /**
- * Required method from ISystemDeleteTarget.
- * Decides whether to even show the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowDeleteAction;
- }
- /**
- * Required method from ISystemDeleteTarget
- * Decides whether to enable the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableDeleteAction;
- }
-
- /*
- * Required method from ISystemDeleteTarget
- */
- public boolean doDelete(IProgressMonitor monitor)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- //Object multiSource[] = new Object[selectedCount];
- //int idx = 0;
- Object element = null;
- //Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- boolean ok = true;
- boolean anyOk = false;
- Vector deletedVector = new Vector();
- try
- {
- while (ok && elements.hasNext())
- {
- element = elements.next();
- //multiSource[idx++] = element;
- adapter = getAdapter(element);
- ok = adapter.doDelete(getShell(), element, monitor);
- if (ok)
- {
- anyOk = true;
- deletedVector.addElement(element);
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException))
- msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(element, msg));
- ok = false;
- }
- if (anyOk)
- {
- Object[] deleted = new Object[deletedVector.size()];
- for (int idx = 0; idx < deleted.length; idx++)
- deleted[idx] = deletedVector.elementAt(idx);
- if (_selectionIsRemoteObject)
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, deletedVector, null, null, null, this);
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(deleted, ISystemResourceChangeEvents.EVENT_DELETE_MANY, getInput()));
- }
- return ok;
- }
-
- // ---------------------------
- // ISYSTEMRENAMETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemRenameTarget.
- * Decides whether to even show the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowRenameAction;
- }
- /**
- * Required method from ISystemRenameTarget
- * Decides whether to enable the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableRenameAction;
- }
-
- // default implementation
- // in default table, parent is input
- protected Object getParentForContent(Object element)
- {
- return _objectInput;
- }
-
- /**
- * Required method from ISystemRenameTarget
- */
- public boolean doRename(String[] newNames)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- int selectedCount = selection.size();
- Object element = null;
-
- ISystemViewElementAdapter adapter = null;
- ISystemRemoteElementAdapter remoteAdapter = null;
- String oldFullName = null;
- boolean ok = true;
- try
- {
- int nameIdx = 0;
- while (ok && elements.hasNext())
- {
- element = elements.next();
- adapter = getAdapter(element);
- Object parentElement = getParentForContent(element);
-
- remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter != null)
- oldFullName = remoteAdapter.getAbsoluteName(element);
- // pre-rename
- ok = adapter.doRename(getShell(), element, newNames[nameIdx++]);
- if (ok)
- {
- if (remoteAdapter != null)
- {
- // do rename here
- Widget widget = findItem(element);
- if (widget != null)
- {
- updateItem(widget, element);
- }
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, remoteAdapter.getSubSystem(element), oldFullName, this);
-
- }
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement));
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- //String msg = exc.getMessage();
- //if ((msg == null) || (exc instanceof ClassCastException))
- // msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(element, exc),
- //msg),
- exc);
- ok = false;
- }
- return ok;
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- ISystemRemoteElementAdapter adapter = null;
- if (!(o instanceof IAdaptable))
- adapter = (ISystemRemoteElementAdapter) Platform.getAdapterManager().getAdapter(o, ISystemRemoteElementAdapter.class);
- else
- adapter = (ISystemRemoteElementAdapter) ((IAdaptable) o).getAdapter(ISystemRemoteElementAdapter.class);
- if ((adapter != null) && (adapter instanceof ISystemViewElementAdapter))
- ((ISystemViewElementAdapter) adapter).setViewer(this);
- return adapter;
- }
-
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection)
- {
- return true;
- }
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection)
- {
- Table table = getTable();
- TableItem[] items = table.getItems();
-
- table.setSelection(items);
- Object[] objects = new Object[items.length];
- for (int idx = 0; idx < items.length; idx++)
- objects[idx] = items[idx].getData();
- fireSelectionChanged(new SelectionChangedEvent(this, new StructuredSelection(objects)));
- }
-
- public void menuAboutToShow(IMenuManager manager)
- {
- SystemView.createStandardGroups(manager);
-
- fillContextMenu(manager);
-
- if (!menuListenerAdded)
- {
- if (manager instanceof MenuManager)
- {
- Menu m = ((MenuManager)manager).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- if (_messageLine != null)
- ml.setShowToolTipText(true, _messageLine);
- m.addMenuListener(ml);
- }
- }
- }
-
- }
-
- public ISelection getSelection()
- {
- ISelection selection = super.getSelection();
- if (selection == null || selection.isEmpty())
- {
- // make the selection the parent
- ArrayList list = new ArrayList();
- if (_objectInput != null)
- {
- list.add(_objectInput);
- selection = new StructuredSelection(list);
- }
- }
-
- return selection;
- }
-
- public void fillContextMenu(IMenuManager menu)
- {
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- int selectionCount = selection.size();
-
- {
-
- // ADD COMMON ACTIONS...
- // no need for refresh of object in table
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getRefreshAction());
-
- // COMMON RENAME ACTION...
- if (canRename())
- {
- if (showRename())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getRenameAction());
- }
-
- // ADAPTER SPECIFIC ACTIONS
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- Iterator elements = selection.iterator();
- Hashtable adapters = new Hashtable();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapters.put(adapter, element); // want only unique adapters
- }
- Enumeration uniqueAdapters = adapters.keys();
- Shell shell = getShell();
- while (uniqueAdapters.hasMoreElements())
- {
- ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter) uniqueAdapters.nextElement();
- nextAdapter.addActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- if (nextAdapter instanceof AbstractSystemViewAdapter)
- {
- AbstractSystemViewAdapter aVA = (AbstractSystemViewAdapter)nextAdapter;
- // add remote actions
- aVA.addCommonRemoteActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- // add dynamic menu popups
- aVA.addDynamicPopupMenuActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADDITIONS);
- }
- }
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx = 0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) && (((ActionContributionItem) items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) (((ActionContributionItem) items[idx]).getAction());
- //item.setShell(getShell());
- //item.setSelection(selection);
- //item.setViewer(this);
- item.setInputs(getShell(), this, selection);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager) items[idx];
- //item.setShell(getShell());
- //item.setSelection(selection);
- //item.setViewer(this);
- item.setInputs(getShell(), this, selection);
- }
- }
-
- // COMMON DELETE ACTION...
- if (canDelete() && showDelete())
- {
- //menu.add(getDeleteAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getDeleteAction());
- ((ISystemAction) getDeleteAction()).setInputs(getShell(), this, selection);
- menu.add(new Separator());
- }
-
- // PROPERTIES ACTION...
- // This is supplied by the system, so we pretty much get it for free. It finds the
- // registered propertyPages extension points registered for the selected object's class type.
- //propertyDialogAction.selectionChanged(selection);
-
- if (!_selectionIsRemoteObject) // is not a remote object
- {
- PropertyDialogAction pdAction = getPropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- {
-
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- }
- // OPEN IN NEW PERSPECTIVE ACTION... if (fromSystemViewPart && showOpenViewActions())
- {
- //SystemCascadingOpenToAction openToAction = getOpenToAction();
- SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
- SystemShowInTableAction showInTableAction = getShowInTableAction();
- openToPerspectiveAction.setSelection(selection);
- showInTableAction.setSelection(selection);
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToAction.getSubMenu());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToPerspectiveAction);
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, showInTableAction);
-
- }
- }
- else // is a remote object
- {
- //Object firstSelection = selection.getFirstElement();
- //ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(firstSelection);
- //logMyDebugMessage(this.getClass().getName(), ": there is a remote adapter");
- SystemRemotePropertiesAction pdAction = getRemotePropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- //else
- //logMyDebugMessage(this.getClass().getName(), ": but it is not applicable for selection");
- // --------------------------------------------------------------------------------------------------------------------
- // look for and add any popup menu actions registered via our org.eclipse.rse.core.popupMenus extension point...
- // --------------------------------------------------------------------------------------------------------------------
- if (_workbenchPart != null)
- {
- SystemPopupMenuActionContributorManager.getManager().contributeObjectActions(_workbenchPart, ourMenu, this, null);
- }
- }
-
- }
- }
-
- /**
- * --------------------------------------------------------------------------------
- * For many actions we have to walk the selection list and examine each selected
- * object to decide if a given common action is supported or not.
- * <p>
- * Walking this list multiple times while building the popup menu is a performance
- * hit, so we have this common method that does it only once, setting instance
- * variables for all of the decisions we are in interested in.
- * --------------------------------------------------------------------------------
- */
- protected void scanSelections()
- {
- // initial these variables to true. Then if set to false even once, leave as false always...
- _selectionShowRefreshAction = true;
- _selectionShowOpenViewActions = true;
- _selectionShowDeleteAction = true;
- _selectionShowRenameAction = true;
- _selectionEnableDeleteAction = true;
- _selectionEnableRenameAction = true;
- _selectionIsRemoteObject = true;
- _selectionFlagsUpdated = true;
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (_selectionShowRefreshAction)
- _selectionShowRefreshAction = adapter.showRefresh(element);
-
- if (_selectionShowOpenViewActions)
- _selectionShowOpenViewActions = adapter.showOpenViewActions(element);
-
- if (_selectionShowDeleteAction)
- _selectionShowDeleteAction = adapter.showDelete(element);
-
- if (_selectionShowRenameAction)
- _selectionShowRenameAction = adapter.showRename(element);
-
- if (_selectionEnableDeleteAction)
- _selectionEnableDeleteAction = _selectionShowDeleteAction && adapter.canDelete(element);
- //System.out.println("ENABLE DELETE SET TO " + selectionEnableDeleteAction);
-
- if (_selectionEnableRenameAction)
- _selectionEnableRenameAction = _selectionShowRenameAction && adapter.canRename(element);
-
- if (_selectionIsRemoteObject)
- _selectionIsRemoteObject = (getRemoteAdapter(element) != null);
- }
-
- }
-
- public void positionTo(String name)
- {
- ArrayList selectedItems = new ArrayList();
- Table table = getTable();
- int topIndex = 0;
- for (int i = 0; i < table.getItemCount(); i++)
- {
- TableItem item = table.getItem(i);
- Object data = item.getData();
- if (data instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = getAdapter(data);
- String itemName = adapter.getName(data);
-
- if (StringCompare.compare(name, itemName, false))
- {
- if (topIndex == 0)
- {
- topIndex = i;
- }
- selectedItems.add(item);
- }
- }
- }
-
- if (selectedItems.size() > 0)
- {
- TableItem[] tItems = new TableItem[selectedItems.size()];
- for (int i = 0; i < selectedItems.size(); i++)
- {
- tItems[i] = (TableItem) selectedItems.get(i);
- }
-
- table.setSelection(tItems);
- table.setTopIndex(topIndex);
- setSelection(getSelection(), true);
- }
- }
-
- void handleKeyPressed(KeyEvent event)
- {
- //System.out.println("Key Pressed");
- //System.out.println("...event character : " + event.character + ", "+(int)event.character);
- //System.out.println("...event state mask: " + event.stateMask);
- //System.out.println("...CTRL : " + SWT.CTRL);
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection) getSelection()).size() > 0))
- {
- scanSelections();
- /* DKM - 53694
- if (showDelete() && canDelete())
- {
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction) getDeleteAction();
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(this);
- dltAction.run();
- }
- */
- }
- }
-
- /**
- * Display a message/status on the message/status line
- */
- public void displayMessage(String msg)
- {
- if (_messageLine != null)
- _messageLine.setMessage(msg);
- }
- /**
- * Clear message/status shown on the message/status line
- */
- public void clearMessage()
- {
- if (_messageLine != null)
- _messageLine.clearMessage();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewColumnManager.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewColumnManager.java
deleted file mode 100644
index e66855728..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewColumnManager.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.HashMap;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-/**
- * @author dmcknigh
- */
-public class SystemTableViewColumnManager
-{
- private Viewer _viewer;
- protected HashMap _descriptorCache;
- public SystemTableViewColumnManager(Viewer viewer)
- {
- _viewer = viewer;
- _descriptorCache = new HashMap();
- }
-
- protected IPropertyDescriptor[] getCachedDescriptors(ISystemViewElementAdapter adapter)
- {
- Object descriptors = _descriptorCache.get(adapter);
- if (descriptors != null && descriptors instanceof IPropertyDescriptor[])
- {
- return (IPropertyDescriptor[])descriptors;
- }
- return null;
- }
-
- protected void putCachedDescriptors(ISystemViewElementAdapter adapter, IPropertyDescriptor[] descriptors)
- {
- _descriptorCache.put(adapter, descriptors);
- }
-
- public void setCustomDescriptors(ISystemViewElementAdapter adapter, IPropertyDescriptor[] descriptors)
- {
- putCachedDescriptors(adapter, descriptors);
- SystemPreferencesManager mgr = SystemPreferencesManager.getPreferencesManager();
- String historyKey = getHistoryKey(adapter);
- String[] history = new String[descriptors.length];
- for (int i = 0; i < descriptors.length; i++)
- {
- history[i] = descriptors[i].getId().toString();
- }
-
- mgr.setWidgetHistory(historyKey, history);
- }
-
- /**
- * Gets the property descriptors to display as columns in the table
- * The set of descriptors and their order may change depending on user customizations
- * @param adapter
- * @return
- */
- public IPropertyDescriptor[] getVisibleDescriptors(ISystemViewElementAdapter adapter)
- {
- if (adapter != null)
- {
- IPropertyDescriptor[] descriptors = getCachedDescriptors(adapter);
- if (descriptors == null)
- {
- return getCustomDescriptors(adapter);
- }
- else
- {
- return descriptors;
- }
- }
-
- return new IPropertyDescriptor[0];
- }
-
- private String getHistoryKey(ISystemViewElementAdapter adapter)
- {
- String adapterName = adapter.getClass().getName();
- String viewName = _viewer.getClass().getName();
- return adapterName + ":" + viewName;
- }
-
- protected IPropertyDescriptor[] getCustomDescriptors(ISystemViewElementAdapter adapter)
- {
- IPropertyDescriptor[] uniqueDescriptors = adapter.getUniquePropertyDescriptors();
-
- SystemPreferencesManager mgr = SystemPreferencesManager.getPreferencesManager();
- String historyKey = getHistoryKey(adapter);
- String[] history = mgr.getWidgetHistory(historyKey);
-
- // determine the order and which of the uniqueDescriptors to use based on the history
- if (history != null && history.length > 0)
- {
- int len = history.length;
- if (uniqueDescriptors != null && uniqueDescriptors.length < len)
- {
- len = uniqueDescriptors.length;
- }
- IPropertyDescriptor[] customDescriptors = new IPropertyDescriptor[len];
- for (int i = 0; i < len; i++)
- {
- String propertyName = history[i];
- // find the associated descriptor
- boolean found = false;
- for (int d = 0; d < uniqueDescriptors.length && !found; d++)
- {
- IPropertyDescriptor descriptor = uniqueDescriptors[d];
- if (propertyName.equals(descriptor.getId().toString()))
- {
- customDescriptors[i] = descriptor;
- found = true;
- }
- }
- // DKM - problem here - no such descriptor exists anymore
- if (found == false)
- {
- // invalidate the current history
- setCustomDescriptors(adapter, uniqueDescriptors);
- return uniqueDescriptors;
- }
- }
- return customDescriptors;
- }
- else
- {
- setCustomDescriptors(adapter, uniqueDescriptors);
- }
-
- return uniqueDescriptors;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewFilter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewFilter.java
deleted file mode 100644
index 560c3a692..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewFilter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableTreeViewer;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.rse.services.clientserver.StringCompare;
-
-
-/**
- * This class is used for filtering in the SystemTableView. The filter
- * determines what objects to show in the view.
- *
- */
-public class SystemTableViewFilter extends ViewerFilter
-{
-
- private String[] _filters;
-
- public SystemTableViewFilter()
- {
- super();
-
- }
-
- public void setFilters(String[] filters)
- {
- _filters = filters;
- }
-
- public String[] getFilters()
- {
- return _filters;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element)
- {
- boolean result = true;
- if (viewer instanceof TableViewer)
- {
- if (_filters != null)
- {
- TableViewer tviewer = (TableViewer) viewer;
- ITableLabelProvider labelProvider = (ITableLabelProvider) tviewer.getLabelProvider();
-
- for (int i = 0; i < _filters.length && result; i++)
- {
- String filter = _filters[i];
-
- if (filter != null && filter.length() > 0)
- {
- String text = labelProvider.getColumnText(element, i);
- if (!StringCompare.compare(filter, text, true))
- {
- result = false;
- }
- }
- }
- }
- }
- else if (viewer instanceof TreeViewer)
- {
- if (_filters != null)
- {
- TreeViewer tviewer = (TreeViewer) viewer;
- ITableLabelProvider labelProvider = (ITableLabelProvider) tviewer.getLabelProvider();
-
- for (int i = 0; i < _filters.length && result; i++)
- {
- String filter = _filters[i];
-
- if (filter != null && filter.length() > 0)
- {
- String text = labelProvider.getColumnText(element, i);
- if (!StringCompare.compare(filter, text, true))
- {
- result = false;
- }
- }
- }
- }
- }
-
- return result;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewPart.java
deleted file mode 100644
index 75a1ee371..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewPart.java
+++ /dev/null
@@ -1,1838 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemTablePrintAction;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.dialogs.SystemSelectAnythingDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.osgi.framework.Bundle;
-
-
-
-/**
- * Comment goes here
- */
-public class SystemTableViewPart extends ViewPart implements ISelectionListener, ISelectionChangedListener,
- ISystemMessageLine, ISystemResourceChangeListener, ISystemRemoteChangeListener, IRSEViewPart
-{
-
-
- class BrowseAction extends Action
- {
-
- public BrowseAction()
- {
- }
-
- public BrowseAction(String label, ImageDescriptor des)
- {
- super(label, des);
-
- setToolTipText(label);
- }
-
- public void checkEnabledState()
- {
- if (_viewer != null && _viewer.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
-
- public void run()
- {
- }
- }
-
- class ForwardAction extends BrowseAction
- {
- public ForwardAction()
- {
- super(SystemResources.ACTION_HISTORY_MOVEFORWARD_LABEL, getEclipseImageDescriptor("elcl16/forward_nav.gif"));
-
- setTitleToolTip(SystemResources.ACTION_HISTORY_MOVEFORWARD_TOOLTIP);
- setDisabledImageDescriptor(getEclipseImageDescriptor("dlcl16/forward_nav.gif"));
- }
-
- public void checkEnabledState()
- {
- if (_isLocked && _browseHistory != null && _browseHistory.size() > 0)
- {
- if (_browsePosition < _browseHistory.size() - 1)
- {
- setEnabled(true);
- return;
- }
- }
-
- setEnabled(false);
- }
-
- public void run()
- {
- _browsePosition++;
-
- HistoryItem historyItem = (HistoryItem) _browseHistory.get(_browsePosition);
- setInput(historyItem);
- }
- }
-
- class BackwardAction extends BrowseAction
- {
- public BackwardAction()
- {
- super(SystemResources.ACTION_HISTORY_MOVEBACKWARD_LABEL, getEclipseImageDescriptor("elcl16/backward_nav.gif"));
- setTitleToolTip(SystemResources.ACTION_HISTORY_MOVEBACKWARD_TOOLTIP);
- setDisabledImageDescriptor(getEclipseImageDescriptor("dlcl16/backward_nav.gif"));
- }
-
- public void checkEnabledState()
- {
- if (_isLocked && _browseHistory != null && _browseHistory.size() > 0)
- {
- if (_browsePosition > 0)
- {
- setEnabled(true);
- return;
- }
- }
-
- setEnabled(false);
- }
-
- public void run()
- {
- _browsePosition--;
-
- HistoryItem historyItem = (HistoryItem) _browseHistory.get(_browsePosition);
- setInput(historyItem);
- }
- }
-
- class UpAction extends BrowseAction
- {
- private IAdaptable _parent;
- public UpAction()
- {
- super(SystemResources.ACTION_MOVEUP_LABEL, getEclipseImageDescriptor("elcl16/up_nav.gif"));
-
- setDisabledImageDescriptor(getEclipseImageDescriptor("dlcl16/up_nav.gif"));
- }
-
- public void checkEnabledState()
- {
- if (_viewer.getInput() != null)
- {
- SystemTableViewProvider provider = (SystemTableViewProvider) _viewer.getContentProvider();
-
- // assume there is a parent
- if (provider != null)
- {
- Object parent = provider.getParent(_viewer.getInput());
- if (parent instanceof IAdaptable)
- {
- _parent = (IAdaptable) parent;
- boolean enabled = _parent != null;
- setEnabled(enabled);
- }
- }
- else
- {
- _parent = null;
- setEnabled(false);
- }
- }
- else
- {
- _parent = null;
- setEnabled(false);
- }
- }
-
- public void run()
- {
- if (_parent != null)
- {
- setInput(_parent);
- }
- }
- }
-
- class LockAction extends BrowseAction
- {
- public LockAction()
- {
- super();
- setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_LOCK_ID));
- String label = determineLabel();
- setText(label);
- setToolTipText(label);
- }
-
- /**
- * Sets as checked or unchecked, depending on the lock state. Also changes the text and tooltip.
- */
- public void checkEnabledState()
- {
- setChecked(_isLocked);
- String label = determineLabel();
- setText(label);
- setToolTipText(label);
- }
-
- public void run()
- {
- _isLocked = !_isLocked;
- showLock();
- }
-
- /**
- * Returns the label depending on lock state.
- * @return the label.
- */
- public String determineLabel() {
-
- if (!_isLocked) {
- return SystemResources.ACTION_LOCK_LABEL;
- }
- else {
- return SystemResources.ACTION_UNLOCK_LABEL;
- }
- }
-
- /**
- * Returns the tooltip depending on lock state.
- * @return the tooltip.
- */
- public String determineTooltip() {
-
- if (!_isLocked) {
- return SystemResources.ACTION_LOCK_TOOLTIP;
- }
- else {
- return SystemResources.ACTION_UNLOCK_TOOLTIP;
- }
- }
- }
-
- class RefreshAction extends BrowseAction
- {
- public RefreshAction()
- {
- super(SystemResources.ACTION_REFRESH_LABEL,
- //RSEUIPlugin.getDefault().getImageDescriptor(ICON_SYSTEM_REFRESH_ID));
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID));
- }
-
- public void run()
- {
- Object inputObject = _viewer.getInput();
- if (inputObject instanceof ISystemContainer)
- {
- ((ISystemContainer)inputObject).markStale(true);
- }
- ((SystemTableViewProvider) _viewer.getContentProvider()).flushCache();
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- registry.fireEvent(new SystemResourceChangeEvent(inputObject, ISystemResourceChangeEvents.EVENT_REFRESH, inputObject));
-
- //_viewer.refresh();
-
- // refresh layout too
- //_viewer.computeLayout(true);
-
- }
- }
-
- class SelectAllAction extends BrowseAction
- {
- public SelectAllAction()
- {
- super(SystemResources.ACTION_SELECT_ALL_LABEL, null);
- setToolTipText(SystemResources.ACTION_SELECT_ALL_TOOLTIP);
- }
-
- public void checkEnabledState()
- {
- if (_viewer != null && _viewer.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
- public void run()
- {
- _viewer.getTable().selectAll();
- // force viewer selection change
- _viewer.setSelection(_viewer.getSelection());
- }
- }
-
- class SelectInputAction extends BrowseAction
- {
- public SelectInputAction()
- {
- super(SystemResources.ACTION_SELECT_INPUT_LABEL, null);
- setToolTipText(SystemResources.ACTION_SELECT_INPUT_TOOLTIP);
- }
-
- public void checkEnabledState()
- {
- setEnabled(true);
- }
-
- public void run()
- {
-
- SystemSelectAnythingDialog dlg = new SystemSelectAnythingDialog(_viewer.getShell(), SystemResources.ACTION_SELECT_INPUT_DLG);
- Object inputObject = _viewer.getInput();
- if (inputObject == null)
- {
- inputObject = RSEUIPlugin.getTheSystemRegistry();
- }
- dlg.setInputObject(inputObject);
- if (dlg.open() == Window.OK)
- {
- Object selected = dlg.getSelectedObject();
- if (selected != null && selected instanceof IAdaptable)
- {
- IAdaptable adaptable = (IAdaptable)selected;
- ((ISystemViewElementAdapter)adaptable.getAdapter(ISystemViewElementAdapter.class)).setViewer(_viewer);
- setInput(adaptable);
- }
- }
- }
- }
-
- class PositionToAction extends BrowseAction
- {
- class PositionToDialog extends SystemPromptDialog
- {
- private String _name;
- private Combo _cbName;
- public PositionToDialog(Shell shell, String title, HistoryItem historyItem)
- {
- super(shell, title);
- }
-
- public String getPositionName()
- {
- return _name;
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
- _name = _cbName.getText();
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _cbName;
- }
-
- public Control createInner(Composite parent)
- {
- Composite c = SystemWidgetHelpers.createComposite(parent, 2);
-
- Label aLabel = new Label(c, SWT.NONE);
- aLabel.setText(SystemPropertyResources.RESID_PROPERTY_NAME_LABEL);
-
- _cbName = SystemWidgetHelpers.createCombo(c, null);
- GridData textData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _cbName.setLayoutData(textData);
- _cbName.setText("*");
- _cbName.setToolTipText(SystemResources.RESID_TABLE_POSITIONTO_ENTRY_TOOLTIP);
-
- this.getShell().setText(SystemResources.RESID_TABLE_POSITIONTO_LABEL);
- setHelp();
- return c;
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gnpt0000");
- }
- }
-
- public PositionToAction()
- {
- super(SystemResources.ACTION_POSITIONTO_LABEL, null);
- setToolTipText(SystemResources.ACTION_POSITIONTO_TOOLTIP);
- }
-
- public void run()
- {
-
- PositionToDialog posDialog = new PositionToDialog(getViewer().getShell(), getTitle(), _currentItem);
- if (posDialog.open() == Window.OK)
- {
- String name = posDialog.getPositionName();
-
- _viewer.positionTo(name);
- }
- }
- }
-
- class SubSetAction extends BrowseAction
- {
- class SubSetDialog extends SystemPromptDialog
- {
- private String[] _filters;
- private Text[] _controls;
- private IPropertyDescriptor[] _uniqueDescriptors;
- private HistoryItem _historyItem;
-
- public SubSetDialog(Shell shell, IPropertyDescriptor[] uniqueDescriptors, HistoryItem historyItem)
- {
- super(shell, SystemResources.RESID_TABLE_SUBSET_LABEL);
- _uniqueDescriptors = uniqueDescriptors;
- _historyItem = historyItem;
- }
-
- public String[] getFilters()
- {
- return _filters;
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
-
- for (int i = 0; i < _controls.length; i++)
- {
- _filters[i] = _controls[i].getText();
- }
-
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _controls[0];
- }
-
- public Control createInner(Composite parent)
- {
- Composite c = SystemWidgetHelpers.createComposite(parent, 2);
-
- int numberOfFields = _uniqueDescriptors.length;
- _controls = new Text[numberOfFields + 1];
- _filters = new String[numberOfFields + 1];
-
- Label nLabel = new Label(c, SWT.NONE);
- nLabel.setText(SystemPropertyResources.RESID_PROPERTY_NAME_LABEL);
-
- String[] histFilters = null;
- if (_historyItem != null)
- {
- histFilters = _historyItem.getFilters();
- }
-
- _controls[0] = SystemWidgetHelpers.createTextField(c, null);
- GridData textData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _controls[0].setLayoutData(textData);
- _controls[0].setText("*");
- _controls[0].setToolTipText(SystemResources.RESID_TABLE_SUBSET_ENTRY_TOOLTIP);
-
- if (histFilters != null)
- {
- _controls[0].setText(histFilters[0]);
- }
-
- for (int i = 0; i < numberOfFields; i++)
- {
- IPropertyDescriptor des = _uniqueDescriptors[i];
-
- Label aLabel = new Label(c, SWT.NONE);
- aLabel.setText(des.getDisplayName());
-
- _controls[i + 1] = SystemWidgetHelpers.createTextField(c, null);
- GridData textData3 = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _controls[i + 1].setLayoutData(textData3);
- _controls[i + 1].setText("*");
- if (histFilters != null)
- {
- _controls[i + 1].setText(histFilters[i + 1]);
- _controls[i + 1].setToolTipText(SystemResources.RESID_TABLE_SUBSET_ENTRY_TOOLTIP);
- }
- }
-
- setHelp();
- return c;
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gnss0000");
- }
- }
-
- public SubSetAction()
- {
- super(SystemResources.ACTION_SUBSET_LABEL, null);
- setToolTipText(SystemResources.ACTION_SUBSET_TOOLTIP);
- }
-
- public void run()
- {
- SubSetDialog subsetDialog = new SubSetDialog(getViewer().getShell(), _viewer.getVisibleDescriptors(_viewer.getInput()), _currentItem);
- if (subsetDialog.open() == Window.OK)
- {
- String[] filters = subsetDialog.getFilters();
- _currentItem.setFilters(filters);
- _viewer.setViewFilters(filters);
-
- }
- }
- }
-
- class HistoryItem
- {
- private String[] _filters;
- private IAdaptable _object;
-
- public HistoryItem(IAdaptable object, String[] filters)
- {
- _object = object;
- _filters = filters;
- }
-
- public IAdaptable getObject()
- {
- return _object;
- }
-
- public String[] getFilters()
- {
- return _filters;
- }
-
- public void setFilters(String[] filters)
- {
- _filters = filters;
- }
- }
-
- class RestoreStateRunnable extends UIJob
- {
- private IMemento _memento;
- public RestoreStateRunnable(IMemento memento)
- {
- super("Restore RSE Table");
- _memento = memento;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- IMemento memento = _memento;
- String profileId = memento.getString(TAG_TABLE_VIEW_PROFILE_ID);
- String connectionId = memento.getString(TAG_TABLE_VIEW_CONNECTION_ID);
- String subsystemId = memento.getString(TAG_TABLE_VIEW_SUBSYSTEM_ID);
- String filterID = memento.getString(TAG_TABLE_VIEW_FILTER_ID);
- String objectID = memento.getString(TAG_TABLE_VIEW_OBJECT_ID);
-
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- Object input = null;
- if (subsystemId == null)
- {
- if (connectionId != null)
- {
-
- ISystemProfile profile = registry.getSystemProfile(profileId);
- input = registry.getHost(profile, connectionId);
- }
- else
- {
- // TODO why did we use null for a while?
- //input = null;
- input = registry;
- }
- }
- else
- {
- // from the subsystem ID determine the profile, system and subsystem
- ISubSystem subsystem = registry.getSubSystem(subsystemId);
-
- if (subsystem != null)
- {
- if (filterID == null && objectID == null)
- {
- input = subsystem;
- }
- else
- {
-
- if (!subsystem.isConnected())
- {
- try
- {
- subsystem.connect();
- }
- catch (Exception e)
- {
- return Status.CANCEL_STATUS;
- }
- }
- if (subsystem.isConnected())
- {
-
- if (filterID != null)
- {
- try
- {
- input = subsystem.getObjectWithAbsoluteName(filterID);
- }
- catch (Exception e)
- {
- }
- }
- else
- {
-
- if (objectID != null)
- {
-
- try
- {
- input = subsystem.getObjectWithAbsoluteName(objectID);
- }
- catch (Exception e)
- {
- return Status.CANCEL_STATUS;
- }
- }
- } // end else
- } // end if (subsystem.isConnected)
- } // end else
- } // end if (subsystem != null)
- } // end else
-
- if (input != null && input instanceof IAdaptable)
- {
- _mementoInput = (IAdaptable) input;
- if (_mementoInput != null && _viewer != null)
- {
- String columnWidths = memento.getString(TAG_TABLE_VIEW_COLUMN_WIDTHS_ID);
- if (columnWidths != null)
- {
- StringTokenizer tok = new StringTokenizer(columnWidths, ",");
- int[] colWidths = new int[tok.countTokens()];
- int t = 0;
- while (tok.hasMoreTokens())
- {
- String columnStr = tok.nextToken();
- colWidths[t] = Integer.parseInt(columnStr);
- t++;
- }
-
- _viewer.setLastColumnWidths(colWidths);
- }
-
- setInput(_mementoInput);
- }
- }
- return Status.OK_STATUS;
- }
-
- }
-
-
-
- private class SelectColumnsAction extends BrowseAction
- {
-
- class SelectColumnsDialog extends SystemPromptDialog
- {
- private ISystemViewElementAdapter _adapter;
- private SystemTableViewColumnManager _columnManager;
- private IPropertyDescriptor[] _uniqueDescriptors;
- private ArrayList _currentDisplayedDescriptors;
- private ArrayList _availableDescriptors;
-
- private List _availableList;
- private List _displayedList;
-
- private Button _addButton;
- private Button _removeButton;
- private Button _upButton;
- private Button _downButton;
-
-
- public SelectColumnsDialog(Shell shell, ISystemViewElementAdapter viewAdapter, SystemTableViewColumnManager columnManager)
- {
- super(shell, SystemResources.RESID_TABLE_SELECT_COLUMNS_LABEL);
- _adapter = viewAdapter;
- _columnManager = columnManager;
- _uniqueDescriptors = viewAdapter.getUniquePropertyDescriptors();
- IPropertyDescriptor[] initialDisplayedDescriptors = _columnManager.getVisibleDescriptors(_adapter);
- _currentDisplayedDescriptors = new ArrayList(initialDisplayedDescriptors.length);
- for (int i = 0; i < initialDisplayedDescriptors.length;i++)
- {
- if (!_currentDisplayedDescriptors.contains(initialDisplayedDescriptors[i]))
- _currentDisplayedDescriptors.add(initialDisplayedDescriptors[i]);
- }
- _availableDescriptors = new ArrayList(_uniqueDescriptors.length);
- for (int i = 0; i < _uniqueDescriptors.length;i++)
- {
- if (!_currentDisplayedDescriptors.contains(_uniqueDescriptors[i]))
- {
- _availableDescriptors.add(_uniqueDescriptors[i]);
- }
- }
- }
-
-
- public void handleEvent(Event e)
- {
- Widget source = e.widget;
- if (source == _addButton)
- {
- int[] toAdd = _availableList.getSelectionIndices();
- addToDisplay(toAdd);
- }
- else if (source == _removeButton)
- {
- int[] toAdd = _displayedList.getSelectionIndices();
- removeFromDisplay(toAdd);
- }
- else if (source == _upButton)
- {
- int index = _displayedList.getSelectionIndex();
- moveUp(index);
- _displayedList.select(index - 1);
- }
- else if (source == _downButton)
- {
- int index = _displayedList.getSelectionIndex();
- moveDown(index);
- _displayedList.select(index + 1);
- }
-
- // update button enable states
- updateEnableStates();
- }
-
- public IPropertyDescriptor[] getDisplayedColumns()
- {
- IPropertyDescriptor[] displayedColumns = new IPropertyDescriptor[_currentDisplayedDescriptors.size()];
- for (int i = 0; i< _currentDisplayedDescriptors.size();i++)
- {
- displayedColumns[i]= (IPropertyDescriptor)_currentDisplayedDescriptors.get(i);
- }
- return displayedColumns;
- }
-
- private void updateEnableStates()
- {
- boolean enableAdd = false;
- boolean enableRemove = false;
- boolean enableUp = false;
- boolean enableDown = false;
-
- int[] availableSelected = _availableList.getSelectionIndices();
- for (int i = 0; i < availableSelected.length; i++)
- {
- int index = availableSelected[i];
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
- if (!_currentDisplayedDescriptors.contains(descriptor))
- {
- enableAdd = true;
- }
- }
-
- if (_displayedList.getSelectionCount()>0)
- {
- enableRemove = true;
-
- int index = _displayedList.getSelectionIndex();
- if (index > 0)
- {
- enableUp = true;
- }
- if (index < _displayedList.getItemCount()-1)
- {
- enableDown = true;
- }
- }
-
- _addButton.setEnabled(enableAdd);
- _removeButton.setEnabled(enableRemove);
- _upButton.setEnabled(enableUp);
- _downButton.setEnabled(enableDown);
-
- }
-
- private void moveUp(int index)
- {
- Object obj = _currentDisplayedDescriptors.remove(index);
- _currentDisplayedDescriptors.add(index - 1, obj);
- refreshDisplayedList();
- }
-
- private void moveDown(int index)
- {
- Object obj = _currentDisplayedDescriptors.remove(index);
- _currentDisplayedDescriptors.add(index + 1, obj);
-
- refreshDisplayedList();
- }
-
- private void addToDisplay(int[] toAdd)
- {
- ArrayList added = new ArrayList();
- for (int i = 0; i < toAdd.length; i++)
- {
- int index = toAdd[i];
-
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
-
- if (!_currentDisplayedDescriptors.contains(descriptor))
- {
- _currentDisplayedDescriptors.add(descriptor);
- added.add(descriptor);
- }
- }
-
- for (int i = 0; i < added.size(); i++)
- {
- _availableDescriptors.remove(added.get(i));
- }
-
-
- refreshAvailableList();
- refreshDisplayedList();
-
- }
-
- private void removeFromDisplay(int[] toRemove)
- {
- for (int i = 0; i < toRemove.length; i++)
- {
- int index = toRemove[i];
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_currentDisplayedDescriptors.get(index);
- _currentDisplayedDescriptors.remove(index);
- _availableDescriptors.add(descriptor);
- }
- refreshDisplayedList();
- refreshAvailableList();
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
-
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _availableList;
- }
-
- public Control createInner(Composite parent)
- {
- Composite main = SystemWidgetHelpers.createComposite(parent, 1);
-
- Label label = SystemWidgetHelpers.createLabel(main, SystemResources.RESID_TABLE_SELECT_COLUMNS_DESCRIPTION_LABEL);
-
- Composite c = SystemWidgetHelpers.createComposite(main, 4);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- _availableList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL, this, true);
-
- Composite addRemoveComposite = SystemWidgetHelpers.createComposite(c, 1);
- addRemoveComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
- _addButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_LABEL,
- this);
- _addButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP);
-
- _removeButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL,
- this);
- _removeButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP);
-
- _displayedList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL, this, false);
-
- Composite upDownComposite = SystemWidgetHelpers.createComposite(c, 1);
- upDownComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
- _upButton = SystemWidgetHelpers.createPushButton(upDownComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_LABEL,
- this);
- _upButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP);
-
- _downButton = SystemWidgetHelpers.createPushButton(upDownComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL,
- this);
- _downButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP);
-
- initLists();
-
- setHelp();
- return c;
- }
-
- private void initLists()
- {
- refreshAvailableList();
- refreshDisplayedList();
- updateEnableStates();
- }
-
- private void refreshAvailableList()
- {
- _availableList.removeAll();
- // initialize available list
- for (int i = 0; i < _availableDescriptors.size(); i++)
- {
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(i);
- _availableList.add(descriptor.getDisplayName());
- }
- }
-
- private void refreshDisplayedList()
- {
- _displayedList.removeAll();
- // initialize display list
- for (int i = 0; i < _currentDisplayedDescriptors.size(); i++)
- {
-
- Object obj = _currentDisplayedDescriptors.get(i);
- if (obj != null && obj instanceof IPropertyDescriptor)
- {
- _displayedList.add(((IPropertyDescriptor)obj).getDisplayName());
- }
- }
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gntc0000");
- }
- }
-
- public SelectColumnsAction()
- {
- super(SystemResources.ACTION_SELECTCOLUMNS_LABEL, null);
- setToolTipText(SystemResources.ACTION_SELECTCOLUMNS_TOOLTIP);
- setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID));
- }
-
- public void checkEnabledState()
- {
- if (_viewer != null && _viewer.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
- public void run()
- {
- SystemTableViewColumnManager mgr = _viewer.getColumnManager();
- ISystemViewElementAdapter adapter = _viewer.getAdapterForContents();
- SelectColumnsDialog dlg = new SelectColumnsDialog(getShell(), adapter, mgr);
- if (dlg.open() == Window.OK)
- {
- mgr.setCustomDescriptors(adapter, dlg.getDisplayedColumns());
- _viewer.computeLayout(true);
- _viewer.refresh();
- }
- }
- }
-
- private HistoryItem _currentItem;
-
- private SystemTableView _viewer;
-
- protected ArrayList _browseHistory;
- protected int _browsePosition;
-
- private ForwardAction _forwardAction = null;
- private BackwardAction _backwardAction = null;
- private UpAction _upAction = null;
-
- private LockAction _lockAction = null;
- private RefreshAction _refreshAction = null;
- private SystemRefreshAction _refreshSelectionAction = null;
-
- private SelectInputAction _selectInputAction = null;
- private PositionToAction _positionToAction = null;
- private SubSetAction _subsetAction = null;
- private SystemTablePrintAction _printTableAction = null;
- private SelectColumnsAction _selectColumnsAction = null;
-
- // common actions
- private SystemCopyToClipboardAction _copyAction;
- private SystemPasteFromClipboardAction _pasteAction;
- private SystemCommonDeleteAction _deleteAction;
-
- private IMemento _memento = null;
- private IAdaptable _mementoInput = null;
- private Object _lastSelection = null;
-
- private boolean _isLocked = false;
-
- // for ISystemMessageLine
- private String _message, _errorMessage;
- private SystemMessage sysErrorMessage;
- private IStatusLineManager _statusLine = null;
-
- // constants
- public static final String ID = "org.eclipse.rse.ui.view.systemTableView"; // matches id in plugin.xml, view tag
-
- // Restore memento tags
- public static final String TAG_TABLE_VIEW_PROFILE_ID = "tableViewProfileID";
- public static final String TAG_TABLE_VIEW_CONNECTION_ID = "tableViewConnectionID";
- public static final String TAG_TABLE_VIEW_SUBSYSTEM_ID = "tableViewSubsystemID";
- public static final String TAG_TABLE_VIEW_OBJECT_ID = "tableViewObjectID";
- public static final String TAG_TABLE_VIEW_FILTER_ID = "tableViewFilterID";
-
- // Subset memento tags
- public static final String TAG_TABLE_VIEW_SUBSET = "subset";
-
- // layout memento tags
- public static final String TAG_TABLE_VIEW_COLUMN_WIDTHS_ID = "columnWidths";
-
- public void setFocus()
- {
- if (_viewer.getInput() == null)
- {
- if (_memento != null)
- {
- restoreState(_memento);
- }
- else
- {
- setInput(RSEUIPlugin.getTheSystemRegistry());
- }
- }
-
- _viewer.getControl().setFocus();
- }
-
- public SystemTableView getViewer()
- {
- return _viewer;
- }
-
- public Viewer getRSEViewer()
- {
- return _viewer;
- }
-
- public void createPartControl(Composite parent)
- {
- Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- _viewer = new SystemTableView(table, this);
- _viewer.setWorkbenchPart(this);
-
- table.setLinesVisible(true);
-
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.addSelectionListener(this);
- _viewer.addSelectionChangedListener(this);
- getSite().setSelectionProvider(_viewer);
-
- _viewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- handleDoubleClick(event);
- }
- });
-
- _isLocked = true;
- fillLocalToolBar();
-
- _browseHistory = new ArrayList();
- _browsePosition = 0;
-
- // register global edit actions
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- Clipboard clipboard = registry.getSystemClipboard();
-
- CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
-
- _copyAction = new SystemCopyToClipboardAction(_viewer.getShell(), clipboard);
- _pasteAction = new SystemPasteFromClipboardAction(_viewer.getShell(), clipboard);
- _deleteAction = new SystemCommonDeleteAction(_viewer.getShell(), _viewer);
-
- editorActionHandler.setCopyAction(_copyAction);
- editorActionHandler.setPasteAction(_pasteAction);
- editorActionHandler.setDeleteAction(_deleteAction);
- editorActionHandler.setSelectAllAction(new SelectAllAction());
-
- registry.addSystemResourceChangeListener(this);
- registry.addSystemRemoteChangeListener(this);
-
- SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "sysd0000");
-
- getSite().registerContextMenu(_viewer.getContextMenuManager(), _viewer);
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection sel)
- {
- if (part != this && (part instanceof SystemViewPart))
- {
- if (!_isLocked)
- {
- if (sel instanceof IStructuredSelection)
- {
- Object first = ((IStructuredSelection) sel).getFirstElement();
- if (_lastSelection != first)
- {
- _lastSelection = first;
- if (first instanceof IAdaptable)
- {
- {
- IAdaptable adapt = (IAdaptable) first;
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) adapt.getAdapter(ISystemViewElementAdapter.class);
- if (va != null && !(va instanceof SystemViewPromptableAdapter))
- {
- if (va.hasChildren(adapt) && adapt != _viewer.getInput())
- {
- setInput(adapt);
- }
- }
- }
- }
- }
- }
- }
- }
- else
- if (part == this)
- {
- updateActionStates();
- }
- }
-
- public void dispose()
- {
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.removeSelectionListener(this);
- _viewer.removeSelectionChangedListener(this);
-
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- if (_viewer != null)
- {
- _viewer.dispose();
- }
-
- super.dispose();
- }
-
- private void handleDoubleClick(DoubleClickEvent event)
- {
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
- if (element == null)
- return;
-
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) element).getAdapter(ISystemViewElementAdapter.class);
- boolean alreadyHandled = false;
- if (adapter != null)
- {
- alreadyHandled = adapter.handleDoubleClick(element);
-
- if (!alreadyHandled && adapter.hasChildren(element))
- {
- setInput((IAdaptable) element);
- }
- }
- }
-
- public void updateActionStates()
- {
- if (_refreshAction == null)
- fillLocalToolBar();
-
- _backwardAction.checkEnabledState();
- _forwardAction.checkEnabledState();
- _upAction.checkEnabledState();
- _lockAction.checkEnabledState();
- _refreshAction.checkEnabledState();
-
- _selectInputAction.checkEnabledState();
- _positionToAction.checkEnabledState();
- _subsetAction.checkEnabledState();
-
- _printTableAction.checkEnabledState();
- _selectColumnsAction.checkEnabledState();
- }
-
- private ImageDescriptor getEclipseImageDescriptor(String relativePath)
- {
- String iconPath = "icons/full/"; //$NON-NLS-1$
- try
- {
- Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
- URL installURL = bundle.getEntry("/");
- URL url = new URL(installURL, iconPath + relativePath);
- return ImageDescriptor.createFromURL(url);
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- public void fillLocalToolBar()
- {
-
- if (_refreshAction == null)
- {
- // refresh action
- _refreshAction = new RefreshAction();
-
- // history actions
- _backwardAction = new BackwardAction();
- _forwardAction = new ForwardAction();
-
- // parent/child actions
- _upAction = new UpAction();
-
- // lock action
- _lockAction = new LockAction();
-
- _selectInputAction = new SelectInputAction();
- _positionToAction = new PositionToAction();
- _subsetAction = new SubSetAction();
-
- _printTableAction = new SystemTablePrintAction(getTitle(), _viewer);
- _selectColumnsAction = new SelectColumnsAction();
- }
-
- updateActionStates();
-
- IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolBarManager = actionBars.getToolBarManager();
- IMenuManager menuMgr = actionBars.getMenuManager();
-
-
- _refreshSelectionAction = new SystemRefreshAction(getShell());
- actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), _refreshSelectionAction);
- _refreshSelectionAction.setSelectionProvider(_viewer);
-
- _statusLine = actionBars.getStatusLineManager();
-
- addToolBarItems(toolBarManager);
- addToolBarMenuItems(menuMgr);
- }
-
- private void addToolBarMenuItems(IMenuManager menuManager)
- {
- menuManager.removeAll();
- menuManager.add(_selectColumnsAction);
- menuManager.add(new Separator("View"));
- menuManager.add(_selectInputAction);
- menuManager.add(new Separator("Filter"));
- menuManager.add(_positionToAction);
- menuManager.add(_subsetAction);
-
- //DKM - this action is useless - remove it
- // menuManager.add(new Separator("Print"));
- // menuManager.add(_printTableAction);
-
- }
-
- private void addToolBarItems(IToolBarManager toolBarManager)
- {
- toolBarManager.removeAll();
-
- _lockAction.setChecked(_isLocked);
-
- toolBarManager.add(_lockAction);
- toolBarManager.add(_refreshAction);
-
-
- toolBarManager.add(new Separator("Navigate"));
- // only support history when we're locked
- if (_isLocked)
- {
- toolBarManager.add(_backwardAction);
- toolBarManager.add(_forwardAction);
- }
-
- toolBarManager.add(_upAction);
-
- toolBarManager.add(new Separator("View"));
- toolBarManager.add(_selectColumnsAction);
- }
-
- public void showLock()
- {
- if (_upAction != null)
- {
- IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
- toolBarManager.removeAll();
-
- updateActionStates();
-
- addToolBarItems(toolBarManager);
- }
- }
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- // listener for this view
- updateActionStates();
-
- IStructuredSelection sel = (IStructuredSelection) e.getSelection();
- _copyAction.setEnabled(_copyAction.updateSelection(sel));
- _pasteAction.setEnabled(_pasteAction.updateSelection(sel));
- _deleteAction.setEnabled(_deleteAction.updateSelection(sel));
- }
-
- public void setInput(IAdaptable object)
- {
- setInput(object, null, _isLocked);
-
- if (!_isLocked)
- {
- _currentItem = new HistoryItem(object, null);
- }
- }
-
- public void setInput(HistoryItem historyItem)
- {
- setInput(historyItem.getObject(), historyItem.getFilters(), false);
- _currentItem = historyItem;
- }
-
- public void setInput(IAdaptable object, String[] filters, boolean updateHistory)
- {
- if (_viewer != null /*&& object != null*/)
- {
- setTitle(object);
- _viewer.setInput(object);
-
- if (_refreshSelectionAction != null)
- {
- _refreshSelectionAction.updateSelection(new StructuredSelection(object));
- }
- if (filters != null)
- {
- _viewer.setViewFilters(filters);
- }
-
- if (updateHistory)
- {
- while (_browsePosition < _browseHistory.size() - 1)
- {
- _browseHistory.remove(_browseHistory.get(_browseHistory.size() - 1));
- }
-
- _currentItem = new HistoryItem(object, filters);
-
- _browseHistory.add(_currentItem);
- _browsePosition = _browseHistory.lastIndexOf(_currentItem);
- }
-
- updateActionStates();
-
- }
- }
-
- public void setTitle(IAdaptable object)
- {
- if (object == null)
- {
- setContentDescription("");
- }
- else
- {
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) object.getAdapter(ISystemViewElementAdapter.class);
- if (va != null)
- {
- String type = va.getType(object);
- String name = va.getName(object);
- //setPartName(type + " " + name);
-
- setContentDescription(type + " "+ name);
-
- //SystemTableViewProvider provider = (SystemTableViewProvider) _viewer.getContentProvider();
- //setTitleImage(provider.getImage(object));
- }
- }
- }
-
- /**
- * Used to asynchronously update the view whenever properties change.
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- Object child = event.getSource();
- Object input = _viewer.getInput();
- switch (event.getType())
- {
- case ISystemResourceChangeEvents.EVENT_RENAME:
- {
- if (child == input)
- {
- setTitle((IAdaptable) child);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_DELETE:
- case ISystemResourceChangeEvents.EVENT_DELETE_MANY:
- {
- if (child instanceof ISystemFilterReference)
- {
-
- if (child == input)
- {
- removeFromHistory(input);
- }
- }
- }
- break;
- default:
- break;
- }
- }
-
- protected void removeFromHistory(Object c)
- {
- // if the object is in history, remove it since it's been deleted
- for (int i = 0; i < _browseHistory.size(); i++)
- {
- HistoryItem hist = (HistoryItem)_browseHistory.get(i);
- if (hist.getObject() == c)
- {
-
- _browseHistory.remove(hist);
- if (_browsePosition >= i)
- {
- _browsePosition--;
- if (_browsePosition < 0)
- {
- _browsePosition = 0;
- }
- }
- if (hist == _currentItem)
- {
- if (_browseHistory.size() > 0)
- {
- _currentItem = (HistoryItem)_browseHistory.get(_browsePosition);
- setInput(_currentItem.getObject(), null, false);
- }
- else
- {
- _currentItem = null;
- setInput((IAdaptable)null, null, false);
- }
-
-
- }
- }
- }
- }
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
-
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
-
- Object child = event.getResource();
-
-
- Object input = _viewer.getInput();
- if (input == child || child instanceof Vector)
- {
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
- break;
-
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
- break;
-
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- if (child instanceof Vector)
- {
- Vector vec = (Vector)child;
- for (int v = 0; v < vec.size(); v++)
- {
- Object c = vec.get(v);
-
- removeFromHistory(c);
- /*
- if (c == input)
- {
- setInput((IAdaptable)null, null, false);
-
- return;
- }
- */
- }
- }
- else
- {
- removeFromHistory(child);
- //setInput((IAdaptable)null);
-
- return;
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- setInput((IAdaptable)child);
- }
-
- break;
- }
- }
- }
-
- public Shell getShell()
- {
- return _viewer.getShell();
- }
-
- private void restoreState(IMemento memento)
- {
- RestoreStateRunnable rsr = new RestoreStateRunnable(memento);
- rsr.setRule(RSEUIPlugin.getTheSystemRegistry());
- rsr.schedule();
- _memento = null;
- }
-
- /**
- * Initializes this view with the given view site. A memento is passed to
- * the view which contains a snapshot of the views state from a previous
- * session. Where possible, the view should try to recreate that state
- * within the part controls.
- * <p>
- * The parent's default implementation will ignore the memento and initialize
- * the view in a fresh state. Subclasses may override the implementation to
- * perform any state restoration as needed.
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException
- {
- super.init(site, memento);
-
- if (memento != null && SystemPreferencesManager.getPreferencesManager().getRememberState())
- {
- _memento = memento;
-
- }
- }
-
- /**
- * Method declared on IViewPart.
- */
- public void saveState(IMemento memento)
- {
- super.saveState(memento);
-
- if (!SystemPreferencesManager.getPreferencesManager().getRememberState())
- return;
-
- if (_viewer != null)
- {
- Object input = _viewer.getInput();
-
- if (input != null)
- {
- if (input instanceof ISystemRegistry)
- {
-
- }
- else if (input instanceof IHost)
- {
- IHost connection = (IHost) input;
- String connectionID = connection.getAliasName();
- String profileID = connection.getSystemProfileName();
- memento.putString(TAG_TABLE_VIEW_CONNECTION_ID, connectionID);
- memento.putString(TAG_TABLE_VIEW_PROFILE_ID, profileID);
- }
- else
- {
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) ((IAdaptable) input).getAdapter(ISystemViewElementAdapter.class);
-
- ISubSystem subsystem = va.getSubSystem(input);
- if (subsystem != null)
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- String subsystemID = registry.getAbsoluteNameForSubSystem(subsystem);
- String profileID = subsystem.getHost().getSystemProfileName();
- String connectionID = subsystem.getHost().getAliasName();
- String objectID = va.getAbsoluteName(input);
-
- memento.putString(TAG_TABLE_VIEW_PROFILE_ID, profileID);
- memento.putString(TAG_TABLE_VIEW_CONNECTION_ID, connectionID);
- memento.putString(TAG_TABLE_VIEW_SUBSYSTEM_ID, subsystemID);
-
- if (input instanceof ISystemFilterReference)
- {
- memento.putString(TAG_TABLE_VIEW_FILTER_ID, objectID);
- memento.putString(TAG_TABLE_VIEW_OBJECT_ID, null);
- }
- else
- if (input instanceof ISubSystem)
- {
- memento.putString(TAG_TABLE_VIEW_OBJECT_ID, null);
- memento.putString(TAG_TABLE_VIEW_FILTER_ID, null);
- }
- else
- {
- memento.putString(TAG_TABLE_VIEW_OBJECT_ID, objectID);
- memento.putString(TAG_TABLE_VIEW_FILTER_ID, null);
- }
- }
- }
-
- Table table = _viewer.getTable();
- if (table != null && !table.isDisposed())
- {
- String columnWidths = new String();
- TableColumn[] columns = table.getColumns();
- for (int i = 0; i < columns.length; i++)
- {
- TableColumn column = columns[i];
- int width = column.getWidth();
- if (i == columns.length - 1)
- {
- columnWidths += width;
- }
- else
- {
- columnWidths += width + ",";
- }
- }
- memento.putString(TAG_TABLE_VIEW_COLUMN_WIDTHS_ID, columnWidths);
- }
- }
- }
- }
-
-
-// -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- _errorMessage = null;
- sysErrorMessage = null;
- if (_statusLine != null)
- _statusLine.setErrorMessage(_errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- _message = null;
- if (_statusLine != null)
- _statusLine.setMessage(_message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return _errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return _message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this._errorMessage = message;
- if (_statusLine != null)
- _statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this._message = message;
- if (_statusLine != null)
- _statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewProvider.java
deleted file mode 100644
index 0ddcee105..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewProvider.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-
-/**
- * This is the content and label provider for the SystemTableView.
- * This class is used both to populate the SystemTableView but also
- * to resolve the icon and labels for the cells in the table.
- *
- */
-public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvider, ITreeContentProvider
-{
-
-
- private ListenerList listeners = new ListenerList(1);
-
- protected Object[] _lastResults = null;
- protected Object _lastObject = null;
- protected SimpleDateFormat _dateFormat = new SimpleDateFormat();
- protected Viewer _viewer = null;
- protected int _maxCharsInColumnZero = 0;
-
- /**
- * The cache of images that have been dispensed by this provider.
- * Maps ImageDescriptor->Image.
- */
- private Map imageTable = new Hashtable(40);
- private SystemTableViewColumnManager _columnManager;
- private HashMap cache;
- /**
- * Constructor for table view provider where a column manager is present.
- * In this case, the columns are customizable by the user.
- * @param columnManager
- */
- public SystemTableViewProvider(SystemTableViewColumnManager columnManager)
- {
- super();
- _columnManager= columnManager;
- cache = new HashMap();
- }
-
- /**
- * Constructor for table view provider where a column manager is not present.
- * In this case, the column can not be customized
- * @param columnManager
- */
- public SystemTableViewProvider()
- {
- super();
- _columnManager= null;
- }
-
-
- public void inputChanged(Viewer visualPart, Object oldInput, Object newInput)
- {
- _viewer = visualPart;
- }
-
-
-
-
-
-
- public boolean isDeleted(Object element)
- {
- return false;
- }
-
- public Object[] getChildren(Object object)
- {
- return getElements(object);
- }
-
- public Object getParent(Object object)
- {
- return getAdapterFor(object).getParent(object);
- }
-
- public boolean hasChildren(Object object)
- {
- return false;
- }
-
- public Object getElementAt(Object object, int i)
- {
-
- return null;
- }
-
- protected ISystemViewElementAdapter getAdapterFor(Object object)
- {
- ISystemViewElementAdapter result = null;
- if (_viewer != null)
- {
- result = SystemAdapterHelpers.getAdapter(object, _viewer);
- }
- else
- {
- result = SystemAdapterHelpers.getAdapter(object);
- }
- result.setPropertySourceInput(object);
- return result;
- }
-
- public Object[] getElements(Object object)
- {
- Object[] results = null;
- if (object == _lastObject && _lastResults != null)
- {
- return _lastResults;
- }
- else
- if (object instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- adapter.setViewer(_viewer);
- results = adapter.getChildren(object);
- if (adapter instanceof SystemViewRootInputAdapter)
- {
- ArrayList filterredResults = new ArrayList();
- for (int i = 0; i < results.length; i++)
- {
- Object result = results[i];
- ISystemViewElementAdapter cadapter = getAdapterFor(result);
- if (!(cadapter instanceof SystemViewPromptableAdapter))
- {
- filterredResults.add(result);
- }
- }
- results = filterredResults.toArray();
- }
-
- _lastResults = results;
- _lastObject = object;
- }
- }
- if (results == null)
- {
- return new Object[0];
- }
-
- return results;
- }
-
- public String getText(Object object)
- {
- String result = getAdapterFor(object).getText(object);
- int len = result.length();
- if (len > _maxCharsInColumnZero)
- {
- _maxCharsInColumnZero = len;
- }
- return result;
- }
-
- public int getMaxCharsInColumnZero()
- {
- return _maxCharsInColumnZero;
- }
-
- public Image getImage(Object object)
- {
- ImageDescriptor descriptor = getAdapterFor(object).getImageDescriptor(object);
-
- Image image = null;
- if (descriptor != null)
- {
- Object iobj = imageTable.get(descriptor);
- if (iobj == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- else
- {
- image = (Image) iobj;
- }
- }
- return image;
- }
-
- public String getColumnText(Object obj, int index)
- {
- if (index == 0)
- {
- // get the first descriptor
- return getText(obj);
- }
- else
- {
-
- index = index - 1;
- ISystemViewElementAdapter adapter = getAdapterFor(obj);
-
- IPropertyDescriptor[] descriptors = null;
- if (_columnManager != null)
- {
- descriptors = _columnManager.getVisibleDescriptors(adapter);
- }
- else
- {
- descriptors = adapter.getUniquePropertyDescriptors();
- }
-
- if (descriptors.length > index)
- {
- IPropertyDescriptor descriptor = descriptors[index];
-
- try
- {
- Object key = descriptor.getId();
-
- Object propertyValue = adapter.getPropertyValue(key);
-
- if (propertyValue instanceof String)
- {
- return (String) propertyValue;
- }
- else if (propertyValue instanceof Date)
- {
- return _dateFormat.format((Date)propertyValue);
- }
- else
- if (propertyValue != null)
- {
- return propertyValue.toString();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- return ""; //$NON-NLS-1$
- }
-
- }
-
- public Image getColumnImage(Object obj, int i)
- {
- if (i == 0)
- {
- return getImage(obj);
- }
- else
- {
- return null;
- }
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- listeners.add(listener);
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- listeners.remove(listener);
- }
-
- /**
- * Cache the objects for the given parent.
- * @param parent the parent object.
- * @param children the children to cache.
- */
- public void setCachedObjects(Object parent, Object[] children) {
- cache.put(parent, children);
- }
-
- /**
- * Returns the cached objects for the given parent.
- * @param parent the parent object.
- * @return the cached children.
- */
- public Object[] getCachedObjects(Object parent) {
- return (Object[])(cache.get(parent));
- }
-
-
- public void setCache(Object[] newCache)
- {
- _lastResults = newCache;
- }
-
- public Object[] getCache()
- {
- return _lastResults;
- }
-
- public boolean flushCache()
- {
- if (_lastResults == null)
- {
- return false;
- }
- if (_lastObject instanceof ISystemContainer)
- {
- // ((ISystemContainer)_lastObject).markStale(true);
- }
-
- _lastResults = null;
- return true;
- }
-
- public void dispose()
- {
- // TODO Auto-generated method stub
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewSorter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewSorter.java
deleted file mode 100644
index 4f56981f2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTableViewSorter.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.Date;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * This class is used for sorting in the SystemTableView. The sorter
- * determines what and how to sort based on property descriptors.
- *
- */
-public class SystemTableViewSorter extends ViewerSorter
-{
-
-
- private boolean _reverseSort;
-
- private int _columnNumber;
-
- private StructuredViewer _view;
- private SystemTableViewColumnManager _columnManager;
-
- public SystemTableViewSorter(int columnNumber, StructuredViewer view, SystemTableViewColumnManager columnManager)
- {
- super();
- _reverseSort = false;
- _columnNumber = columnNumber;
- _view = view;
- _columnManager = columnManager;
- }
-
- public boolean isSorterProperty(java.lang.Object element, java.lang.Object property)
- {
- return true;
- }
-
- public int category(Object element)
- {
- return 0;
- }
-
- public int getColumnNumber()
- {
- return _columnNumber;
- }
-
- public boolean isReversed()
- {
- return _reverseSort;
- }
-
- public void setReversed(boolean newReversed)
- {
- _reverseSort = newReversed;
- }
-
- public int compare(Viewer v, Object e1, Object e2)
- {
- Object name1 = getValueFor(e1, _columnNumber);
- Object name2 = getValueFor(e2, _columnNumber);
-
- try
- {
- Object n1 = name1;
- Object n2 = name2;
-
- if (n1.toString().length() == 0)
- return 1;
-
- if (isReversed())
- {
- n1 = name2;
- n2 = name1;
- }
-
- if (n1 instanceof String)
- {
- return ((String) n1).compareTo((String) n2);
- }
- else if (n1 instanceof Date)
- {
- return ((Date) n1).compareTo((Date) n2);
- }
- else if (n1 instanceof Long)
- {
- return ((Long) n1).compareTo((Long) n2);
- }
- else if (n1 instanceof Integer)
- {
- return ((Integer) n1).compareTo((Integer) n2);
- }
- else
- {
- return collator.compare(n1, n2);
- }
- }
- catch (Exception e)
- {
- return 0;
- }
-
- }
-
- private Object getValueFor(Object obj, int index)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(obj);
- if (index == 0)
- {
- return adapter.getText(obj);
- }
-
- Widget widget = _view.testFindItem(obj);
- if (widget != null)
- {
-
- }
-
- index = index - 1;
- IPropertyDescriptor[] descriptors = null;
- if (_columnManager != null)
- {
- descriptors = _columnManager.getVisibleDescriptors(adapter);
- }
- else
- {
- descriptors = adapter.getUniquePropertyDescriptors();
- }
- if (descriptors.length > index)
- {
- IPropertyDescriptor descriptor = descriptors[index];
-
- try
- {
- Object key = descriptor.getId();
-
- Object propertyValue = adapter.getPropertyValue(key, false);
- return propertyValue;
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- return "";
- }
-
- private ISystemViewElementAdapter getAdapterFor(Object object)
- {
- IAdaptable adapt = (IAdaptable) object;
- if (adapt != null)
- {
- ISystemViewElementAdapter result = (ISystemViewElementAdapter) adapt.getAdapter(ISystemViewElementAdapter.class);
- result.setPropertySourceInput(object);
-
- return result;
- }
-
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java
deleted file mode 100644
index 16b9c15ba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are used to show the resolution of a single filter string.
- */
-public class SystemTestFilterStringAPIProviderImpl
- extends SystemAbstractAPIProvider
- implements ISystemViewInputProvider
-{
-
-
- protected String filterString = null;
- protected ISubSystem subsystem = null;
- protected Object[] emptyList = new Object[0];
- protected Object[] msgList = new Object[1];
- protected SystemMessageObject nullObject = null;
- protected SystemMessageObject canceledObject = null;
- protected SystemMessageObject errorObject = null;
- /**
- * Constructor
- * @param subsystem The subsystem that will resolve the filter string
- * @param filterString The filter string to test
- */
- public SystemTestFilterStringAPIProviderImpl(ISubSystem subsystem, String filterString)
- {
- super();
- this.subsystem = subsystem;
- this.filterString = filterString;
- }
-
- private void initMsgObjects()
- {
- nullObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),ISystemMessageObject.MSGTYPE_EMPTY, null);
- canceledObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LIST_CANCELLED),ISystemMessageObject.MSGTYPE_CANCEL, null);
- errorObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),ISystemMessageObject.MSGTYPE_ERROR, null);
- }
-
- /**
- * Change the input subsystem
- */
- public void setSubSystem(ISubSystem subsystem)
- {
- this.subsystem = subsystem;
- }
- /**
- * Change the input filter string
- */
- public void setFilterString(String filterString)
- {
- this.filterString = filterString;
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * We return the result of asking the subsystem to resolve the filter string.
- */
- public Object[] getSystemViewRoots()
- {
- Object[] children = emptyList;
- if (subsystem == null)
- return children;
- try
- {
- children = subsystem.resolveFilterString(filterString);
- if ((children == null) || (children.length==0))
- {
- if (nullObject == null)
- initMsgObjects();
- msgList[0] = nullObject;
- children = msgList;
- }
- } catch (InterruptedException exc)
- {
- if (canceledObject == null)
- initMsgObjects();
- msgList[0] = canceledObject;
- children = msgList;
- } catch (Exception exc)
- {
- if (errorObject == null)
- initMsgObjects();
- msgList[0] = errorObject;
- children = msgList;
- SystemBasePlugin.logError("Error in SystemTestFilterStringAPIProviderImpl#getSystemViewRoots()",exc);
- }
- return children;
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return true on the assumption the filter string will resolve to something.
- */
- public boolean hasSystemViewRoots()
- {
- return true;
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>NOT APPLICABLE TO US
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null; //
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>NOT APPLICABLE TO US
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return true;
- }
-
- /**
- * Return true to show the action bar (ie, toolbar) above the viewer.
- * The action bar contains connection actions, predominantly.
- */
- public boolean showActionBar()
- {
- return false;
- }
- /**
- * Return true to show the button bar above the viewer.
- * The tool bar contains "Get List" and "Refresh" buttons and is typicall
- * shown in dialogs that list only remote system objects.
- */
- public boolean showButtonBar()
- {
- return true;
- }
- /**
- * Return true to show right-click popup actions on objects in the tree.
- */
- public boolean showActions()
- {
- return false;
- }
-
-
-
- // ----------------------------------
- // OUR OWN METHODS...
- // ----------------------------------
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java
deleted file mode 100644
index 5e088faba..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java
+++ /dev/null
@@ -1,5051 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berber (IBM) - Patch to remove non-standard expand/collapse from menu.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemElapsedTimer;
-import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainer;
-import org.eclipse.rse.core.filters.ISystemFilterContainerReference;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemRemoteElementResourceSet;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCascadingGoToAction;
-import org.eclipse.rse.ui.actions.SystemCollapseAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemExpandAction;
-import org.eclipse.rse.ui.actions.SystemNewConnectionAction;
-import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
-import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
-import org.eclipse.rse.ui.actions.SystemShowInTableAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.TreeEvent;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.views.framelist.GoIntoAction;
-
-/**
- * This subclass of the standard JFace tree viewer is used to show a tree
- * view of connections to remote systems, which can be manipulated and expanded
- * to access remote objects in the remote system.
- */
-/*
- * At one time implemented the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
- */
-public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
- ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
-{
-
- protected Shell shell; // shell hosting this viewer
- protected ISystemViewInputProvider inputProvider; // who is supplying our tree root elements?
- protected ISystemViewInputProvider previousInputProvider; // who is supplying our tree root elements?
- protected Object previousInput;
- protected IHost previousInputConnection;
- // protected actions
- protected SystemNewConnectionAction newConnectionAction;
- protected SystemRefreshAction refreshAction;
- protected PropertyDialogAction propertyDialogAction;
- protected SystemRemotePropertiesAction remotePropertyDialogAction;
- protected SystemCollapseAction collapseAction; // defect 41203
- protected SystemExpandAction expandAction; // defect 41203
- protected SystemOpenExplorerPerspectiveAction openToPerspectiveAction;
-
- protected SystemShowInTableAction showInTableAction;
- protected SystemShowInMonitorAction showInMonitorAction;
- protected GoIntoAction goIntoAction;
- protected SystemCascadingGoToAction gotoActions;
- // global actions
- // Note the Edit menu actions are set in SystemViewPart. Here we use these
- // actions from our own popup menu actions.
- protected SystemCommonDeleteAction deleteAction; // for global delete menu item
- protected SystemCommonRenameAction renameAction; // for common rename menu item
- protected SystemCommonSelectAllAction selectAllAction; // for common Ctrl+A select-all
- // special flags needed when building popup menu, set after examining selections
- protected boolean selectionShowRefreshAction;
- protected boolean selectionShowOpenViewActions;
- protected boolean selectionShowGenericShowInTableAction;
- protected boolean selectionShowDeleteAction;
- protected boolean selectionShowRenameAction;
- protected boolean selectionEnableDeleteAction;
- protected boolean selectionEnableRenameAction;
- protected boolean selectionIsRemoteObject;
- protected boolean selectionHasAncestorRelation;
- protected boolean selectionFlagsUpdated = false;
- // misc
- protected MenuManager menuMgr;
- protected boolean showActions = true;
- protected boolean hardCodedConnectionSelected = false;
- protected boolean mixedSelection = false;
- protected boolean specialMode = false;
- protected boolean menuListenerAdded = false;
- protected boolean fromSystemViewPart = false;
- protected boolean areAnyRemote = false;
- protected boolean enabledMode = true;
- protected Widget previousItem = null;
- protected int searchDepth = 0;
- //protected Vector remoteItemsToSkip = null;
- protected Cursor busyCursor;
- protected TreeItem inputTreeItem = null;
- protected static final int SEARCH_INFINITE = 10; // that's far enough down to search!
- public boolean debug = false;
- public boolean debugRemote = false;
- public boolean debugProperties = debug && false;
- public boolean doTimings = false;
- public SystemElapsedTimer elapsedTime = new SystemElapsedTimer();
- // for support of Expand To actions ... transient filters really.
- // we need to record these per tree node they are applied to.
- protected Hashtable expandToFiltersByObject; // most efficient way to find these is by binary object
- protected Hashtable expandToFiltersByTreePath; // however, we lose that after a refresh so we also record by tree path
-
- // message line
- protected ISystemMessageLine messageLine = null;
- // button pressed
- protected static final int LEFT_BUTTON = 1;
- protected int mouseButtonPressed = LEFT_BUTTON; //d40615
- protected boolean expandingTreeOnly = false; //d40615
- protected ViewerFilter[] initViewerFilters = null;
-
- protected List _setList;
-
- /**
- * Constructor
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Composite parent, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(parent);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Constructor to use when you want to specify styles for the tree widget
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param style The style to give the tree widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(parent, style);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Constructor to use when you want to specify styles for the tree widget
- * @param shell The shell hosting this tree viewer widget
- * @param parent The composite widget into which to place this widget
- * @param style The style to give the tree widget
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- * @param initViewerFilters the initial viewer filters to apply.
- */
- public SystemView(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine, ViewerFilter[] initViewerFilters) {
- super(parent, style);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- this.initViewerFilters = initViewerFilters;
- init();
- }
-
- /**
- * Constructor to use when you create your own tree widget.
- * @param shell The shell hosting this tree viewer widget
- * @param tree The Tree widget you created.
- * @param inputProvider The input object which will supply the initial root objects in the tree.
- * Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.
- * @param msgLine Where to display messages and tooltip text
- */
- public SystemView(Shell shell, Tree tree, ISystemViewInputProvider inputProvider, ISystemMessageLine msgLine) {
- super(tree);
- this.shell = shell;
- this.inputProvider = inputProvider;
- this.inputProvider.setShell(shell); // DY: defect 44544
- this.messageLine = msgLine;
- init();
- }
-
- /**
- * Set the input provider. Sometimes this is delayed, or can change.
- * @param inputProvider the input provider for this view.
- */
- public void setInputProvider(ISystemViewInputProvider inputProvider) {
- this.inputProvider = inputProvider;
- inputProvider.setViewer(this);
- inputProvider.setShell(getShell()); // DY: Defect 44544, shell was not being set for Test dialogs, when they
- // tried to connect there was not shell for the password prompt
- // and an error message (expand failed) occured.
- setInput(inputProvider);
- }
-
- /**
- * Get the SystemViewPart that encapsulates us.
- * Will be null unless fromSystemViewPart is true.
- */
- public SystemViewPart getSystemViewPart() {
- if (fromSystemViewPart)
- return ((SystemViewPart) messageLine);
- else
- return null;
- }
-
- /**
- * Get the workbench window containing this view part. Will only be non-null for the explorer view part,
- * not when used within, say, a dialog
- */
- protected IWorkbenchWindow getWorkbenchWindow() {
- if (fromSystemViewPart)
- return getSystemViewPart().getSite().getWorkbenchWindow();
- else
- return null;
- }
-
- /**
- * Get the workbench part containing this view. Will only be non-null for the explorer view part,
- * not when used within, say, a dialog
- */
- protected IWorkbenchPart getWorkbenchPart() {
- return getSystemViewPart();
- }
-
- /**
- * Disable/Enable the viewer. We do this by blocking keystrokes without visually greying out
- */
- public void setEnabled(boolean enabled) {
- enabledMode = enabled;
- }
-
- /**
- * Sets the label and content provider for the system view.
- * This can be called externally if a custom RSE label and content provider is desired
- * @param lcProvider the provider
- */
- public void setLabelAndContentProvider(SystemViewLabelAndContentProvider lcProvider) {
- ILabelDecorator decorator = null;
- if (PlatformUI.isWorkbenchRunning()) {
- IWorkbench wb = PlatformUI.getWorkbench();
- decorator = wb.getDecoratorManager().getLabelDecorator();
- }
- setLabelProvider(new DecoratingLabelProvider(lcProvider, decorator));
- setContentProvider(lcProvider);
- }
-
- protected void init() {
- _setList = new ArrayList();
- busyCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
- setUseHashlookup(true); // new for our 2nd release. Attempt to fix 38 minutes to refresh for 15K elements
-
- // set content provider
- SystemViewLabelAndContentProvider lcProvider = new SystemViewLabelAndContentProvider();
- setLabelAndContentProvider(lcProvider);
-
- // set initial viewer filters
- if (initViewerFilters != null) {
-
- for (int i = 0; i < initViewerFilters.length; i++) {
- addFilter(initViewerFilters[i]);
- }
- }
-
- fromSystemViewPart = ((messageLine != null) && (messageLine instanceof SystemViewPart));
-
- // set the tree's input. Provides initial roots.
- if (inputProvider != null) {
- inputProvider.setViewer(this);
- setInput(inputProvider);
- if (fromSystemViewPart) {
- previousInputConnection = getInputConnection(getWorkbenchPart().getSite().getPage().getInput());
- }
- }
- //addDoubleClickListener(this);
- addSelectionChangedListener(this);
- addTreeListener(this);
- // ----------------------------------------
- // register with system registry for events
- // ----------------------------------------
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().addSystemRemoteChangeListener(this);
- // -----------------------------
- // Enable right-click popup menu
- // -----------------------------
- menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- Menu menu = menuMgr.createContextMenu(getTree());
- getTree().setMenu(menu);
- // -------------------------------------------
- // Enable specific keys: dbl-click, Delete, F5
- // -------------------------------------------
- addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleDoubleClick(event);
- }
- });
- getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- getControl().addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- mouseButtonPressed = e.button; //d40615
- if (!enabledMode) {
- //e.doit = false;
- return;
- }
- }
- });
-
- initRefreshKey();
-
- // initialize drag and drop
- initDragAndDrop();
- }
-
- /**
- * Create the KeyListener for doing the refresh on the viewer.
- */
- protected void initRefreshKey() {
- /* DKM - no need for explicit key listener since we
- * have global action
- getControl().addKeyListener(new KeyAdapter()
- {
- public void keyReleased(KeyEvent event)
- {
- if (!enabledMode)
- return;
- if (event.keyCode == SWT.F5)
- {
- //if (debug)
- // System.out.println("F5 pressed");
- refreshAll();
- }
- }
- });
- */
- }
-
- /**
- * Handles double clicks in viewer.
- * Opens editor if file double-clicked.
- */
- protected void handleDoubleClick(DoubleClickEvent event) {
- if (!enabledMode) {
- //event.doit = false;
- return;
- }
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
- if (element == null) return;
- ISystemViewElementAdapter adapter = getAdapter(element);
- boolean alreadyHandled = false;
- if (adapter != null) alreadyHandled = adapter.handleDoubleClick(element);
- if (!alreadyHandled && isExpandable(element)) {
- boolean expandedState = getExpandedState(element);
- setExpandedState(element, !expandedState);
- // DY: fire collapse / expand event
- if (expandedState) {
- fireTreeCollapsed(new TreeExpansionEvent(this, element));
- } else {
- fireTreeExpanded(new TreeExpansionEvent(this, element));
- }
- return;
- }
- }
-
- /**
- * Handles key events in viewer.
- */
- void handleKeyPressed(KeyEvent event) {
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection) getSelection()).size() > 0)) {
- scanSelections("handleKeyPressed");
- /* DKM - 53694
- if (showDelete() && canDelete())
- {
-
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction)getDeleteAction();
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(this);
- dltAction.run();
-
- }
- */
- } else if ((event.character == '-') && (event.stateMask == SWT.CTRL)) {
- collapseAll();
- } else if ((event.character == 1) && // for some reason Ctrl+A comes in as Ctrl plus the number 1!
- (event.stateMask == SWT.CTRL) && !fromSystemViewPart) {
- //System.out.println("Inside Ctrl+A processing");
- if (enableSelectAll(null)) doSelectAll(null);
- } else if ((event.character == '-') && (((IStructuredSelection) getSelection()).size() > 0)) {
- //System.out.println("Inside Ctrl+- processing");
- collapseSelected();
- } else if ((event.character == '+') && (((IStructuredSelection) getSelection()).size() > 0)) {
- //System.out.println("Inside Ctrl++ processing");
- expandSelected();
- }
-
- }
-
- /**
- * Handles a collapse-selected request
- */
- public void collapseSelected() {
- TreeItem[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- for (int idx = 0; idx < selectedItems.length; idx++)
- selectedItems[idx].setExpanded(false);
- }
- }
-
- /**
- * Handles an expand-selected request
- */
- public void expandSelected() {
- TreeItem[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- for (int idx = 0; idx < selectedItems.length; idx++) {
- if (!selectedItems[idx].getExpanded()) {
- createChildren(selectedItems[idx]);
- }
- selectedItems[idx].setExpanded(true);
- }
- }
- }
-
- /**
- * Display a message/status on the message/status line
- */
- public void displayMessage(String msg) {
- if (messageLine != null) messageLine.setMessage(msg);
- }
-
- /**
- * Clear message/status shown on the message/status line
- */
- public void clearMessage() {
- if (messageLine != null) messageLine.clearMessage();
- }
-
- /**
- * Turn off right-click actions
- */
- public void setShowActions(boolean show) {
- this.showActions = show;
- }
-
- /**
- * Return the input provider
- */
- public ISystemViewInputProvider getInputProvider() {
- inputProvider.setViewer(this); // just in case. Added by Phil in V5.0
- inputProvider.setShell(getShell()); // just in case. Added by Phil
- return inputProvider;
- }
-
- /**
- * Return the popup menu for the tree
- */
- public Menu getContextMenu() {
- return getTree().getMenu();
- }
-
- /**
- * Return the popup menu for the tree
- */
- public MenuManager getContextMenuManager() {
- return menuMgr;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getNewConnectionAction() {
- if (newConnectionAction == null) newConnectionAction = new SystemNewConnectionAction(getShell(), true, this); // true=>from popup menu
- return newConnectionAction;
- }
-
- /**
- * Return the refresh action
- */
- public IAction getRefreshAction() {
- if (refreshAction == null) refreshAction = new SystemRefreshAction(getShell());
- return refreshAction;
- }
-
- /**
- * @return the collapse action. Lazily creates it.
- */
- public IAction getCollapseAction() {
- if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
- return collapseAction;
- }
-
- /**
- * @return the expand action. Lazily creates it.
- */
- public IAction getExpandAction() {
- if (expandAction == null) expandAction = new SystemExpandAction(getShell());
- return expandAction;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public PropertyDialogAction getPropertyDialogAction() {
- if (propertyDialogAction == null) {
- propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this);
- //propertyDialogAction.setToolTipText(" ");
- }
- propertyDialogAction.selectionChanged(getSelection());
- return propertyDialogAction;
- }
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- public SystemRemotePropertiesAction getRemotePropertyDialogAction() {
- if (remotePropertyDialogAction == null) {
- remotePropertyDialogAction = new SystemRemotePropertiesAction(getShell());
- }
- remotePropertyDialogAction.setSelection(getSelection());
- return remotePropertyDialogAction;
- }
-
- /**
- * Return the select All action
- */
- public IAction getSelectAllAction() {
- if (selectAllAction == null) selectAllAction = new SystemCommonSelectAllAction(getShell(), this, this);
- return selectAllAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getRenameAction() {
- if (renameAction == null) renameAction = new SystemCommonRenameAction(getShell(), this);
- return renameAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- public IAction getDeleteAction() {
- if (deleteAction == null) deleteAction = new SystemCommonDeleteAction(getShell(), this);
- return deleteAction;
- }
-
- /*
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- *
- protected SystemCascadingOpenToAction getOpenToAction()
- {
- if (openToAction == null)
- openToAction = new SystemCascadingOpenToAction(getShell(),getWorkbenchWindow());
- return openToAction;
- } NOT USED YET */
-
- /**
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- public SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction() {
- if (openToPerspectiveAction == null) openToPerspectiveAction = new SystemOpenExplorerPerspectiveAction(getShell(), getWorkbenchWindow());
- return openToPerspectiveAction;
- }
-
- public SystemShowInTableAction getShowInTableAction() {
- if (showInTableAction == null) showInTableAction = new SystemShowInTableAction(getShell());
- return showInTableAction;
- }
-
- public SystemShowInMonitorAction getShowInMonitorAction() {
- if (showInMonitorAction == null) showInMonitorAction = new SystemShowInMonitorAction(getShell());
- return showInMonitorAction;
- }
-
- /**
- * Get the common "Go Into" action for drilling down in the Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- public GoIntoAction getGoIntoAction() {
- if (goIntoAction == null) {
- goIntoAction = new GoIntoAction(getSystemViewPart().getFrameList());
- goIntoAction.setText(SystemResources.ACTION_CASCADING_GOINTO_LABEL);
- goIntoAction.setToolTipText(SystemResources.ACTION_CASCADING_GOINTO_TOOLTIP);
- }
- return goIntoAction;
- }
-
- /**
- * Get the common "Go To->" cascading menu action for navigating the frame list.
- */
- public SystemCascadingGoToAction getGoToActions() {
- if (gotoActions == null) gotoActions = new SystemCascadingGoToAction(getShell(), getSystemViewPart());
- return gotoActions;
- }
-
- /**
- * Helper method to collapse a node in the tree.
- * Called when a currently expanded subsystem is disconnected.
- * @param forceRefresh true if children should be deleted from memory so re-expand forces refresh.
- */
- public void collapseNode(Object element, boolean forceRefresh) {
- // First, collapse this element and all its children.
- collapseToLevel(element, ALL_LEVELS);
-
- // Collapsed just changes expanded state but leaves existing child
- // widgets in memory so they are re-shown on next expansion.
- // To force the next expand to re-get the children, we have to delete the
- // children.
- if (forceRefresh) {
- refresh(element); // look at AbstractTreeViewer.updateChildren which this
- // will call. If the element is collapsed (which we just
- // did) then its children are simply disposed of, and
- // not re-queried. Just what we want!
- }
- }
-
- /**
- * This is method is called to populate the popup menu
- */
- public void fillContextMenu(IMenuManager menu) {
- if (!showActions) return;
- //SystemViewPlugin.getDefault().logMessage("inside fillContextMenu");
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- boolean allSelectionsFromSameParent = true;
- int selectionCount = selection.size();
-
- if (selectionCount == 0) // nothing selected
- {
- menu.add(getNewConnectionAction());
- } else {
- if (selectionCount > 1) {
- allSelectionsFromSameParent = sameParent();
- if (!allSelectionsFromSameParent) {
- if (selectionHasAncestryRelationship()) {
- // don't show the menu because actions with
- // multiple select on objects that are ancestors
- // of each other is problematic
- // still create the standard groups
- createStandardGroups(menu);
- return;
- }
- }
- }
- // Partition into groups...
- createStandardGroups(menu);
-
- // PRESET INSTANCE VARIABLES ABOUT WHAT COMMON ACTIONS ARE TO BE SHOWN...
- // PERFORMANCE TWEAK: OUR GLOBAL DELETE ACTION LISTENS FOR SELECTION CHANGES, AND
- // WHEN THAT CHANGES, WILL CALL CANDELETE() HERE. THAT IN TURN WILL CALL SCANSELECTIONS.
- // THIS MEANS SCAN SELECTIONS GETS CALL TWICE ON MOST RIGHT CLICK ACTIONS.
- if (!selectionFlagsUpdated) // might already be called by the global delete action wh
- scanSelections("fillContextMenu");
-
- // ADD COMMON ACTIONS...
-
- // COMMON REFRESH ACTION...
- if (showRefresh()) {
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getRefreshAction());
-
- // MJB: Removed as per bugzilla entry # 145843
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getExpandAction()); // defect 41203
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getCollapseAction()); // defect 41203
- }
-
- // COMMON RENAME ACTION...
- if (showRename()) {
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getRenameAction());
- ((ISystemAction) getRenameAction()).setInputs(getShell(), this, selection);
- }
-
- // ADAPTER SPECIFIC ACTIONS
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- // yantzi:artemis 6.0 (defect 53970), do not show adapter specific actions when
- // there is not a common adapter for all selected elements (i.e. there are 2 or
- // more selected elements that have different adapters
- Iterator elements = selection.iterator();
- //Hashtable adapters = new Hashtable();
- ISystemViewElementAdapter adapter = null;
- boolean skipAdapterActions = false;
-
- while (elements.hasNext() && !skipAdapterActions) {
- Object element = elements.next();
- if (adapter == null) {
- adapter = getAdapter(element);
- } else if (adapter != getAdapter(element)) {
- // selected elements have different adapters
- skipAdapterActions = true;
- }
- //if (adapter != null)
- // adapters.put(adapter,element); // want only unique adapters
- }
-
- //Enumeration uniqueAdapters = adapters.keys();
- if (!skipAdapterActions && adapter != null) {
- Shell shell = getShell();
-
- //while (uniqueAdapters.hasMoreElements())
- //{
- // ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter)uniqueAdapters.nextElement();
- adapter.addActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
- if (adapter instanceof AbstractSystemViewAdapter) {
-
- AbstractSystemViewAdapter aVA = (AbstractSystemViewAdapter) adapter;
- // add remote actions
- aVA.addCommonRemoteActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- // add dynamic menu popups
- aVA.addDynamicPopupMenuActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADDITIONS);
- }
- //}
- }
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx = 0; idx < items.length; idx++) {
- if ((items[idx] instanceof ActionContributionItem) && (((ActionContributionItem) items[idx]).getAction() instanceof ISystemAction)) {
- ISystemAction item = (ISystemAction) (((ActionContributionItem) items[idx]).getAction());
- try {
- item.setInputs(getShell(), this, selection);
- } catch (Exception e) {
- SystemBasePlugin.logError("Error configuring action " + item.getClass().getName(), e);
- }
- } else if (items[idx] instanceof SystemSubMenuManager) {
- SystemSubMenuManager item = (SystemSubMenuManager) items[idx];
- item.setInputs(getShell(), this, selection);
- }
- }
-
- // COMMON DELETE ACTION...
- if (showDelete()) {
- //menu.add(getDeleteAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getDeleteAction());
- ((ISystemAction) getDeleteAction()).setInputs(getShell(), this, selection);
- menu.add(new Separator());
- }
-
- // PROPERTIES ACTION...
- // This is supplied by the system, so we pretty much get it for free. It finds the
- // registered propertyPages extension points registered for the selected object's class type.
- //propertyDialogAction.selectionChanged(selection);
-
- if (!selectionIsRemoteObject) // is not a remote object
- {
- PropertyDialogAction pdAction = getPropertyDialogAction();
- if (pdAction.isApplicableForSelection()) menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- // GO INTO ACTION...
- // OPEN IN NEW WINDOW ACTION...
- if (fromSystemViewPart && showOpenViewActions()) {
- GoIntoAction goIntoAction = getGoIntoAction();
- goIntoAction.setEnabled(selection.size() == 1);
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
-
- SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
- openToPerspectiveAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), openToPerspectiveAction);
-
- if (showGenericShowInTableAction()) {
- SystemShowInTableAction showInTableAction = getShowInTableAction();
- showInTableAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), showInTableAction);
-
- SystemShowInMonitorAction showInMonitorAction = getShowInMonitorAction();
- showInMonitorAction.setSelection(selection);
- menu.appendToGroup(openToPerspectiveAction.getContextMenuGroup(), showInMonitorAction);
-
- }
- }
- } else // is a remote object
- {
- //Object firstSelection = selection.getFirstElement();
- //ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(firstSelection);
- //logMyDebugMessage(this.getClass().getName(), ": there is a remote adapter");
- SystemRemotePropertiesAction pdAction = getRemotePropertyDialogAction();
- if (pdAction.isApplicableForSelection()) menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- //else
- //logMyDebugMessage(this.getClass().getName(), ": but it is not applicable for selection");
- // --------------------------------------------------------------------------------------------------------------------
- // look for and add any popup menu actions registered via our org.eclipse.rse.core.popupMenus extension point...
- // --------------------------------------------------------------------------------------------------------------------
- if (fromSystemViewPart) // these require an IWorkbenchPart as a parameter, so we can't support them from within dialogs
- addObjectActions(ourMenu);
- }
- // GO TO CASCADING ACTIONS...
- if (fromSystemViewPart && (selectionIsRemoteObject || showOpenViewActions())) {
- SystemCascadingGoToAction gotoActions = getGoToActions();
- gotoActions.setSelection(selection);
- menu.appendToGroup(gotoActions.getContextMenuGroup(), gotoActions.getSubMenu());
- }
- }
- }
-
- /**
- * Contributes popup menu actions and submenus registered for the object type(s) in the current selection.
- * Patterned after addObjectActions in PopupMenuExtender class supplied by Eclipse.
- */
- protected void addObjectActions(SystemMenuManager menu) {
- if (SystemPopupMenuActionContributorManager.getManager().contributeObjectActions(getWorkbenchPart(), menu, this, null)) {
- //menu.add(new Separator());
- }
- }
-
- /**
- * Called when the context menu is about to open.
- * Calls {@link #fillContextMenu(IMenuManager)}
- */
- public void menuAboutToShow(IMenuManager menu) {
- if (!enabledMode) return;
- fillContextMenu(menu);
- if (!menuListenerAdded) {
- if (menu instanceof MenuManager) {
- Menu m = ((MenuManager) menu).getMenu();
- if (m != null) {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- if (messageLine != null) ml.setShowToolTipText(true, messageLine);
- m.addMenuListener(ml);
- }
- }
- }
- //System.out.println("Inside menuAboutToShow: menu null? "+( ((MenuManager)menu).getMenu()==null));
- }
-
- /**
- * Creates the Systems plugin standard groups in a context menu.
- */
- public static IMenuManager createStandardGroups(IMenuManager menu) {
- if (!menu.isEmpty()) return menu;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand to->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND)); // expand, collapse
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH)); // open with->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH)); // work with->
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_SHOW)); // show->type hierarchy, in-navigator
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // connection-related actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_STARTSERVER)); // start/stop remote server actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM)); // Team
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_COMPAREWITH));
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_REPLACEWITH));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
-
- return menu;
- }
-
- /**
- * protected helper method to add an Action to a given menu.
- * To give the action the opportunity to grey out, we call selectionChanged, but
- * only if the action implements ISelectionChangedListener
- */
- protected void menuAdd(MenuManager menu, IAction action) {
- if (action instanceof ISelectionChangedListener) ((ISelectionChangedListener) action).selectionChanged(new SelectionChangedEvent(this, getSelection()));
- }
-
- /**
- * Determines whether the view has an ancestor relation selection so
- * that actions can be enable/disabled appropriately.
- * For example, delete needs to be disabled when a parent and it's child
- * are both selected.
- * @return true if the selection has one or more ancestor relations
- */
- protected boolean hasAncestorRelationSelection() {
-
- Item[] elements = getSelection(getControl());
- for (int i = 0; i < elements.length; i++) {
- TreeItem parentItem = (TreeItem) elements[i];
- for (int j = 0; j < elements.length; j++) {
- if (j != i) {
- if (isAncestorOf(parentItem, (TreeItem) elements[j])) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Handles selection changed in viewer.
- * Updates global actions.
- * Links to editor (if option enabled)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- selectionFlagsUpdated = false;
- _setList = new ArrayList();
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null) return;
-
- // added by Phil. Noticed Edit->Delete not enabled when it should be
- boolean enableDelete = true;
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (enableDelete && elements.hasNext()) {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter == null) continue;
- if (enableDelete) enableDelete = adapter.showDelete(element) && adapter.canDelete(element);
- }
- //System.out.println("Enabling delete action: "+enableDelete);
- //System.out.println("Enabling selectAll action: "+enableSelectAll(sel));
- ((SystemCommonDeleteAction) getDeleteAction()).setEnabled(enableDelete);
- ((SystemCommonSelectAllAction) getSelectAllAction()).setEnabled(enableSelectAll(sel)); // added by Phil. Noticed Edit->Select All not enabled when it should be
-
- ISystemViewElementAdapter adapter = getAdapter(firstSelection);
- if (adapter != null) {
- displayMessage(adapter.getStatusLineText(firstSelection));
- if ((mouseButtonPressed == LEFT_BUTTON) && (!expandingTreeOnly)) //d40615
- adapter.selectionChanged(firstSelection); //d40615
- } else
- clearMessage();
- //System.out.println("Inside selectionChanged in SystemView");
- expandingTreeOnly = false; //d40615
- if (debugProperties) {
- ISystemRemoteElementAdapter element = getRemoteAdapter(firstSelection);
- if (element == null)
- return;
- else {
- logMyDebugMessage(this.getClass().getName(), ": -----------------------------------------------------------");
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SSFID.......: " + element.getSubSystemConfigurationId(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE NAME........: " + element.getName(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE TYPECATEGORY: " + element.getRemoteTypeCategory(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE TYPE........: " + element.getRemoteType(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SUBTYPE.....: " + element.getRemoteSubType(firstSelection));
- logMyDebugMessage(this.getClass().getName(), ": REMOTE SUBSUBTYPE..: " + element.getRemoteSubSubType(firstSelection));
- }
- }
- }
-
- protected void logMyDebugMessage(String prefix, String msg) {
- if (!debugProperties) return;
- //RSEUIPlugin.logDebugMessage(prefix, msg);
- System.out.println(prefix + " " + msg);
- }
-
- /**
- * Convenience method for returning the shell of this viewer.
- */
- public Shell getShell() {
- //return shell;
- return getTree().getShell();
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object element) {
- return isSelected(element, (IStructuredSelection) getSelection());
- }
-
- /**
- * Helper method to determine if a given tree item is currently selected.
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isTreeItemSelected(Widget w) {
- boolean match = false;
- TreeItem[] items = getTree().getSelection();
- if ((items != null) && (items.length > 0)) {
- for (int idx = 0; !match && (idx < items.length); idx++)
- if (items[idx] == w) match = true;
- }
- return match;
- }
-
- /**
- * Helper method to determine if any of a given array of objects is currently selected
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object[] elementArray) {
- return isSelected(elementArray, (IStructuredSelection) getSelection());
- }
-
- /**
- * Helper method to determine if a given object is in given selection
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object element, IStructuredSelection selection) {
- boolean isSelected = false;
- Iterator elements = selection.iterator();
- while (!isSelected && elements.hasNext()) {
- if (element.equals(elements.next())) isSelected = true;
- }
- return isSelected;
- }
-
- /**
- * Helper method to determine if any of a given array of objects is in given selection
- * Does not consider if a child node of the given object is currently selected.
- */
- protected boolean isSelected(Object[] elementArray, IStructuredSelection selection) {
- boolean isSelected = false;
- Iterator elements = selection.iterator();
- while (!isSelected && elements.hasNext()) {
- Object nextSelection = elements.next();
- for (int idx = 0; !isSelected && (idx < elementArray.length); idx++) {
- if (elementArray[idx].equals(nextSelection)) isSelected = true;
- }
- }
- return isSelected;
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does consider if a child node of the given object is currently selected.
- */
- protected boolean isSelectedOrChildSelected(Object[] parentElements) {
- boolean isSelected = false;
- if ((parentElements == null) || (parentElements.length == 0)) return false;
- for (int idx = 0; !isSelected && (idx < parentElements.length); idx++)
- isSelected = isSelectedOrChildSelected(parentElements[idx]);
- return isSelected;
- }
-
- protected boolean searchToRoot(TreeItem selectedItem, TreeItem searchItem) {
- boolean found = false;
- boolean done = false;
- while (!found && !done) {
- if (selectedItem == searchItem)
- found = true;
- else {
- selectedItem = selectedItem.getParentItem();
- if (selectedItem == null) done = true;
- }
- }
- return found;
- }
-
- /**
- * Called after tree item collapsed. Updates the children of the tree item being
- * collapsed by removing the widgets associated with any transient message objects
- * that were in the tree.
- * @param event the event that caused the collapse. The event data will include the
- * tree element being collapsed.
- */
- public void treeCollapsed(TreeExpansionEvent event) {
- final Object element = event.getElement(); // get parent node being collapsed
- // we always allow adapters opportunity to show a different icon depending on collapsed state
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- String[] allProps = {IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE};
- update(element, allProps); // for refreshing non-structural properties in viewer when model changes
- }
- });
- }
-
- /**
- * Called after tree item expanded.
- * We need this hook to potentially undo user expand request.
- * @param event the SWT TreeExpansionEvent that caused the expansion.
- */
- public void treeExpanded(TreeExpansionEvent event) {
- expandingTreeOnly = true;
- final Object element = event.getElement();
- // we always allow adapters opportunity to show a different icon depending on expanded state
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- updatePropertySheet();
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- update(element, allProps); // for refreshing non-structural properties in viewer when model changes
- }
- });
- }
-
- /* (non-Javadoc)
- * Here only for observability.
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeCollapse(org.eclipse.swt.events.TreeEvent)
- */
- protected void handleTreeCollapse(TreeEvent event) {
- super.handleTreeCollapse(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeExpand(org.eclipse.swt.events.TreeEvent)
- */
- protected void handleTreeExpand(TreeEvent event) {
- TreeItem item = (TreeItem) event.item;
- // Remove any transient messages prior to finding children. They will be regenerated if they are needed.
- Item[] children = getItems(item);
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- Item child = children[i];
- Object data = child.getData();
- if (data instanceof ISystemMessageObject) {
- ISystemMessageObject message = (ISystemMessageObject) data;
- if (message.isTransient()) {
- remove(message);
- }
- }
- }
- }
- Shell shell = getShell();
- Object data = item.getData();
- boolean isTiming = (data != null) && doTimings;
- boolean showBusy = (data instanceof IHost) && ((IHost)data).isOffline();
- if (isTiming) elapsedTime.setStartTime();
- if (showBusy) SystemPromptDialog.setDisplayCursor(shell, busyCursor);
- super.handleTreeExpand(event);
- if (showBusy) SystemPromptDialog.setDisplayCursor(shell, null);
- if (isTiming) {
- elapsedTime.setEndTime();
- System.out.println("Time to expand for " + item.getItemCount() + " items: " + elapsedTime);
- }
- }
-
- /**
- * Clear current selection. Ignore widget disposed message.
- */
- protected void clearSelection() {
- try {
- setSelection((ISelection) null);
- } catch (Exception exc) {
- }
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o) {
-
- ISystemViewInputProvider provider = getInputProvider();
-
- // should never be null, but we check just to be safe
- // the input provider should be set because for things like connections, the select
- // dialogs may set a different input provider for the connection adapter which is subsequently
- // not updated when selecting a connection in the Remote Systems view.
- // This ensures that the input provider for the Remote Systems view is set for the adapter.
- if (provider != null) {
- return SystemAdapterHelpers.getAdapter(o, this, provider);
- } else {
- return SystemAdapterHelpers.getAdapter(o, this);
- }
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o) {
- return SystemAdapterHelpers.getRemoteAdapter(o, this);
- }
-
- /**
- *
- */
- public void handleDispose(DisposeEvent event) {
- //if (debug)
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Inside handleDispose for SystemView");
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemRemoteChangeListener(this);
- busyCursor.dispose();
- super.handleDispose(event);
- }
-
- /**
- * Return the connection of the selected object, whatever it is.
- */
- public IHost getSelectedConnection() {
- Object firstSelection = ((StructuredSelection) getSelection()).getFirstElement();
- if (firstSelection == null)
- return null;
- else if (firstSelection instanceof IHost)
- return (IHost) firstSelection;
- else if (firstSelection instanceof ISubSystem)
- return ((ISubSystem) firstSelection).getHost();
- else if (firstSelection instanceof ISystemFilterPoolReference)
- return ((ISubSystem) (((ISystemFilterPoolReference) firstSelection).getProvider())).getHost();
- else if (firstSelection instanceof ISystemFilterReference)
- return ((ISubSystem) (((ISystemFilterReference) firstSelection).getProvider())).getHost();
- else if (getRemoteAdapter(firstSelection) != null) {
- ISubSystem ss = getRemoteAdapter(firstSelection).getSubSystem(firstSelection);
- if (ss != null)
- return ss.getHost();
- else
- return null;
- } else
- return null;
- }
-
- /**
- * We override getSelection(Control) so that a list of items
- * under the same parent always gets returned in the order in which
- * they appear in the tree view. Otherwise, after a "move up" or
- * "move down", the order of selection can come back wrong.
- */
- protected Item[] getSelection(Control widget) {
- Tree tree = (Tree) widget;
- Item[] oldResult = tree.getSelection();
- if (oldResult != null && oldResult.length > 0) {
- if (oldResult[0] instanceof TreeItem) {
- Widget parentItem = ((TreeItem) oldResult[0]).getParentItem();
- if (parentItem == null) {
- parentItem = tree;
- }
- if (itemsShareParent(parentItem, oldResult)) {
- Item[] newResult = sortSelection(parentItem, oldResult);
- return newResult;
- }
- }
- }
- return oldResult;
- }
-
- protected boolean itemsShareParent(Widget parentItem, Item[] items) {
- for (int i = 0; i < items.length; i++) {
- Widget itemParent = ((TreeItem) items[i]).getParentItem();
- if (parentItem instanceof TreeItem) {
- if (itemParent != parentItem) {
- return false;
- }
- } else if (itemParent != null) {
- return false;
- }
- }
-
- return true;
- }
-
- protected Item[] sortSelection(Widget parentItem, Item[] oldResult) {
- Item[] newResult = new Item[oldResult.length];
- for (int i = 0; i < oldResult.length; i++) {
- Item first = removeFirstItem(parentItem, oldResult);
- newResult[i] = first;
- }
-
- return newResult;
- }
-
- protected Item removeFirstItem(Widget parentItem, Item[] items) {
- int firstIndex = 0;
- Item firstItem = null;
- int firstItemPosition = 0;
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null) {
- Item current = items[i];
- int position = getTreeItemPosition(parentItem, current, items);
-
- if (firstItem == null || position < firstItemPosition) {
- firstItem = current;
- firstItemPosition = position;
- firstIndex = i;
- }
- }
- }
-
- items[firstIndex] = null;
- return firstItem;
- }
-
- /**
- * Move one tree item to a new location
- */
- protected void moveTreeItem(Widget parentItem, Item item, Object src, int newPosition) {
- if (getExpanded(item)) {
- setExpanded(item, false);
- refresh(src); // flush items from memory
- }
-
- createTreeItem(parentItem, src, newPosition);
-
- //createTreeItem(parentItem, (new String("New")), newPosition);
- //remove(src);
-
- disassociate(item);
- item.dispose();
- // TODO: make this work so the selection order doesn't get screwed up!
- }
-
- /**
- * Move existing items a given number of positions within the same node.
- * If the delta is negative, they are all moved up by the given amount. If
- * positive, they are all moved down by the given amount.<p>
- */
- protected void moveTreeItems(Widget parentItem, Object[] src, int delta) {
- int[] oldPositions = new int[src.length];
- Item[] oldItems = new Item[src.length];
-
- for (int idx = 0; idx < src.length; idx++)
- oldItems[idx] = (Item) internalFindRelativeItem(parentItem, src[idx], 1);
- for (int idx = 0; idx < src.length; idx++) {
- oldPositions[idx] = getTreeItemPosition(parentItem, oldItems[idx]) + 1;
- }
-
- if (delta > 0) // moving down, process backwards
- {
- for (int idx = src.length - 1; idx >= 0; idx--) {
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta);
- }
- } else // moving up, process forewards
- {
- for (int idx = 0; idx < src.length; idx++) {
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta - 1);
- }
- }
- }
-
- protected int getTreeItemPosition(Widget parentItem, Item childItem) {
- return getTreeItemPosition(parentItem, childItem, null);
- }
-
- /**
- * Get the position of a tree item within its parent
- */
- protected int getTreeItemPosition(Widget parentItem, Item childItem, Item[] items) {
- int pos = -1;
- Item[] children = null;
- if (parentItem instanceof Item) {
- if (items == null)
- children = getItems((Item) parentItem);
- else
- children = items;
- } else
- children = getChildren(parentItem);
- for (int idx = 0; (pos == -1) && (idx < children.length); idx++) {
- if (children[idx] == childItem) pos = idx;
- }
- return pos;
- }
-
- /**
- * Expand a given filter, given a subsystem that contains a reference to the filter's pool.
- * This will expand down to the filter if needed
- * @param parentSubSystem - the subsystem containing a reference to the filter's parent pool
- * @param filter - the filter to find, reveal, and expand within the subsystem context
- * @return the filter reference to the filter if found and expanded. This is a unique binary address
- * within the object's in this tree, so can be used in the viewer methods to affect this particular
- * node.
- */
- public ISystemFilterReference revealAndExpand(ISubSystem parentSubSystem, ISystemFilter filter) {
- setExpandedState(parentSubSystem.getHost(), true); // expand the connection
- setExpandedState(parentSubSystem, true); // expand the subsystem
- Object filterParentInTree = parentSubSystem; // will be case unless in show filter pool mode
- // if showing filter pools, expand parent filter pool reference...
- if (SystemPreferencesManager.getPreferencesManager().getShowFilterPools()) {
- ISystemFilterPoolReference poolRef = parentSubSystem.getFilterPoolReferenceManager().getReferenceToSystemFilterPool(filter.getParentFilterPool());
- setExpandedState(poolRef, true);
- filterParentInTree = poolRef;
- }
- // now, find the filter reference, and expand it...
- Widget parentItem = findItem(filterParentInTree); // find tree widget of parent
- if ((parentItem == null) || !(parentItem instanceof Item)) return null;
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, filter, 1);
- if (child == null) return null;
- // found it! Now expand it...
- setExpandedState(child.getData(), true);
- return (ISystemFilterReference) child.getData();
- }
-
- // ------------------------------------
- // ISYSTEMRESOURCEChangeListener METHOD
- // ------------------------------------
-
- /**
- * Called when something changes in the model
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event) {
- ResourceChangedJob job = new ResourceChangedJob(event, this);
- job.setPriority(Job.INTERACTIVE);
- //job.setUser(true);
- job.schedule();
- /*
- Display display = Display.getCurrent();
- try {
- while (job.getResult() == null) {
- while (display != null && display.readAndDispatch()) {
- //Process everything on event queue
- }
- if (job.getResult() == null) Thread.sleep(200);
- }
- } catch (InterruptedException e) {
- }
- */
- }
-
- /**
- * Inner class which extends UIJob to connect this connection
- * on the UI Thread when no Shell is available from
- * the caller
- */
- public class ResourceChangedJob extends UIJob {
-
- protected ISystemResourceChangeEvent _event;
- protected SystemView _originatingViewer;
-
- public ResourceChangedJob(ISystemResourceChangeEvent event, SystemView originatingViewer) {
- super("Resource Changed...");
- _originatingViewer = originatingViewer;
- _event = event;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- int type = _event.getType();
- Object src = _event.getSource();
- Object parent = _event.getParent();
- String[] properties = new String[1];
- if (parent == RSEUIPlugin.getTheSystemRegistry()) parent = inputProvider;
- ISubSystem ss = null;
- Widget item = null;
- Widget parentItem = null;
- Object[] multiSource = null;
- Object previous = null;
- if (_event.getViewerItem() instanceof TreeItem)
- inputTreeItem = (TreeItem) _event.getViewerItem();
- else
- inputTreeItem = null;
- boolean wasSelected = false;
- boolean originatedHere = (_event.getOriginatingViewer() == null) || (_event.getOriginatingViewer() == _originatingViewer);
-
- //logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
- switch (type) {
- // SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
- case EVENT_RENAME_FILTER_REFERENCE:
- case EVENT_CHANGE_FILTER_REFERENCE:
- findAndUpdateFilter(_event, type);
- break;
- case EVENT_CHANGE_FILTERSTRING_REFERENCE:
- findAndUpdateFilterString(_event, type);
- break;
-
- case EVENT_ADD_FILTERSTRING_REFERENCE:
- case EVENT_DELETE_FILTERSTRING_REFERENCE:
- case EVENT_MOVE_FILTERSTRING_REFERENCES:
- //findAndUpdateFilterStringParent(event, type);
- //break;
- case EVENT_ADD_FILTER_REFERENCE:
- case EVENT_DELETE_FILTER_REFERENCE:
- case EVENT_MOVE_FILTER_REFERENCES:
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (((type == EVENT_DELETE_FILTERSTRING_REFERENCE) || (type == EVENT_DELETE_FILTER_REFERENCE)) && affectsInput(src)) {
- close();
- return Status.OK_STATUS;
- }
-
- findAndUpdateFilterParent(_event, type);
- break;
-
- case EVENT_ADD:
- case EVENT_ADD_RELATIVE:
- if (debug) {
- logDebugMsg("SV event: EVENT_ADD ");
- }
- clearSelection();
- //refresh(parent);
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- refresh(parent); // flush cached stuff so next call will show new item
- } else if ((parentItem instanceof Item) || // regular node
- (parent == inputProvider)) // root node. Hmm, hope this is going to work in all cases
- {
- boolean addingConnection = (src instanceof IHost);
- //System.out.println("ADDING CONNECTIONS.........................: " + addingConnection);
- //System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
- //System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
- if ((parent == inputProvider) && addingConnection && (_event.getParent() instanceof ISystemRegistry) && !inputProvider.showingConnections()) return Status.OK_STATUS; // only reflect new connections in main perspective. pc42742
- int pos = -1;
- if (type == EVENT_ADD_RELATIVE) {
- previous = _event.getRelativePrevious();
- if (previous != null) pos = getItemIndex(parentItem, previous);
- if (pos >= 0) pos++; // want to add after previous
- } else
- pos = _event.getPosition();
- //logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
- createTreeItem(parentItem, src, pos);
- setSelection(new StructuredSelection(src), true);
- }
- break;
- case EVENT_ADD_MANY:
- if (debug) {
- logDebugMsg("SV event: EVENT_ADD_MANY");
- }
- multiSource = _event.getMultiSource();
- clearSelection();
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- refresh(parent); // flush cached stuff so next call will show new items
- } else if (multiSource.length > 0) {
- boolean addingConnections = (multiSource[0] instanceof IHost);
- // are we restoring connections previously removed due to making a profile inactive,
- // and is one of these connections the one we were opened with?
- if (addingConnections && (_event.getParent() instanceof ISystemRegistry) && (inputProvider instanceof SystemEmptyListAPIProviderImpl)) {
- boolean done = false;
- for (int idx = 0; !done && (idx < multiSource.length); idx++) {
- if (multiSource[idx] == previousInputConnection) {
- done = true;
- setInputProvider(previousInputProvider);
- previousInput = null;
- previousInputProvider = null;
- }
- }
- if (done) return Status.OK_STATUS;
- }
- // are we adding connections and yet we are not a secondary perspective?
- // If so, this event does not apply to us.
- else if (addingConnections && (_event.getParent() instanceof ISystemRegistry) && !inputProvider.showingConnections()) return Status.OK_STATUS;
-
- for (int idx = 0; idx < multiSource.length; idx++) {
- if (debug && addingConnections) logDebugMsg("... new connection " + ((IHost) multiSource[idx]).getAliasName());
- createTreeItem(parentItem, multiSource[idx], -1);
- }
- setSelection(new StructuredSelection(multiSource), true);
- }
- break;
- case EVENT_REPLACE_CHILDREN:
- if (debug) {
- logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
- }
- multiSource = _event.getMultiSource();
- //logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
- clearSelection();
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if (multiSource.length > 0 && parentItem instanceof Item) {
- getControl().setRedraw(false);
- collapseNode(parent, true); // collapse and flush gui widgets from memory
- //setExpandedState(parent, true); // expand the parent
- setExpanded((Item) parentItem, true); // expand the parent without calling resolveFilterString
- TreeItem[] kids = ((TreeItem) parentItem).getItems(); // any kids? Like a dummy node?
- if (kids != null) for (int idx = 0; idx < kids.length; idx++)
- kids[idx].dispose();
- //boolean addingConnections = (multiSource[0] instanceof SystemConnection);
- for (int idx = 0; idx < multiSource.length; idx++) {
- //if (debug && addingConnections)
- // logDebugMsg("... new connection " + ((SystemConnection)multiSource[idx]).getAliasName());
- createTreeItem(parentItem, multiSource[idx], -1);
- }
- getControl().setRedraw(true);
- //setSelection(new StructuredSelection(multiSource),true);
- }
- break;
- case EVENT_CHANGE_CHILDREN:
- if (debug) {
- logDebugMsg("SV event: EVENT_CHANGE_CHILDREN. src=" + src + ", parent=" + parent);
- //Exception e = new Exception();
- //e.fillInStackTrace();
- //e.printStackTrace();
- }
- // I HAVE DECIDED TO CHANGE THE SELECTION ALGO TO ONLY RESELECT IF THE CURRENT
- // SELECTION IS A CHILD OF THE PARENT... PHIL
- boolean wasSrcSelected = false;
- if (src != null) {
- wasSrcSelected = isSelectedOrChildSelected(src);
- //System.out.println("WAS SELECTED? " + wasSrcSelected);
- }
- item = findItem(parent);
- //logDebugMsg(" parent = " + parent);
- //logDebugMsg(" item = " + item);
- // INTERESTING BUG HERE. GETEXPANDED WILL RETURN TRUE IF THE TREE ITEM HAS EVER BEEN
- // EXPANDED BUT IS NOW COLLAPSED! I CANNOT FIND ANY API IN TreeItem or TreeViewer THAT
- // WILL TELL ME IF A TREE ITEM IS SHOWING OR NOT!
- if ((item != null) && (item instanceof TreeItem) && ((TreeItem) item).getExpanded()) {
- if (wasSrcSelected) {
- //System.out.println("...Clearing selection");
- clearSelection();
- }
- //refresh(parent);
- if (debug) System.out.println("Found item and it was expanded for " + parent);
- getControl().setRedraw(false);
- collapseNode(parent, true); // collapse and flush gui widgets from memory
- setExpandedState(parent, true); // expand the parent
- getControl().setRedraw(true);
- if (wasSrcSelected) {
- //System.out.println("Setting selection to " + src);
- setSelection(new StructuredSelection(src), true);
- }
- } else
- collapseNode(parent, true);
- break;
- case EVENT_DELETE:
- if (debug) logDebugMsg("SV event: EVENT_DELETE ");
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (affectsInput(src)) {
- close();
- return Status.OK_STATUS;
- }
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else {
- wasSelected = isSelectedOrChildSelected(src);
- if (wasSelected) clearSelection();
- _originatingViewer.remove(src);
- if (wasSelected) setSelection(new StructuredSelection(parent), true);
- }
- break;
-
- case EVENT_DELETE_MANY:
- if (debug) logDebugMsg("SV event: EVENT_DELETE_MANY ");
- multiSource = _event.getMultiSource();
- // are we a secondary perspective, and our input or parent of our input was deleted?
- if (affectsInput(multiSource)) {
- close();
- return Status.OK_STATUS;
- }
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else if (parentItem instanceof Tree) {
- refresh();
- } else {
- wasSelected = isSelectedOrChildSelected(multiSource);
- if (wasSelected) clearSelection();
- if (_originatingViewer != null) _originatingViewer.remove(multiSource);
- if (wasSelected) setSelection(new StructuredSelection(parent), true);
- }
- break;
- /* Now done below in systemRemoteResourceChanged
- case EVENT_DELETE_REMOTE:
- if (debug)
- logDebugMsg("SV event: EVENT_DELETE_REMOTE ");
- deleteRemoteObject(src);
- break;
-
- case EVENT_DELETE_REMOTE_MANY:
- // multi-source: array of objects to delete
- if (debug)
- logDebugMsg("SV event: EVENT_DELETE_REMOTE_MANY ");
- multiSource = event.getMultiSource();
- //remoteItemsToSkip = null; // reset
- if ((multiSource == null) || (multiSource.length==0))
- return;
- for (int idx=0; idx<multiSource.length; idx++)
- deleteRemoteObject(multiSource[idx]);
- break;
- */
- case EVENT_RENAME:
- if (debug) logDebugMsg("SV event: EVENT_RENAME ");
- properties[0] = IBasicPropertyConstants.P_TEXT;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- break;
- /* Now done below in systemRemoteResourceChanged
- case EVENT_RENAME_REMOTE:
- // SRC: the updated remote object, after the rename
- // PARENT: the String from calling getAbsoluteName() on the remote adapter BEFORE updating the remote object's name
- if (debug)
- logDebugMsg("SV event: EVENT_RENAME_REMOTE ");
-
- renameRemoteObject(src, (String)parent);
- break;
- */
- case EVENT_ICON_CHANGE:
- if (debug) logDebugMsg("SV event: EVENT_ICON_CHANGE ");
-
- if (initViewerFilters != null && initViewerFilters.length > 0) {
- Widget w = findItem(src);
- if (w == null) {
- refresh(parent);
- } else {
- properties[0] = IBasicPropertyConstants.P_IMAGE;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
-
- }
- } else {
- properties[0] = IBasicPropertyConstants.P_IMAGE;
- update(src, properties); // for refreshing non-structural properties in viewer when model changes
- }
-
- //updatePropertySheet();
- break;
- //case EVENT_CHANGE:
- //if (debug)
- //logDebugMsg("SV event: EVENT_CHANGE ");
- //refresh(src); THIS IS AN EVIL OPERATION: CAUSES ALL EXPANDED NODES TO RE-REQUEST THEIR CHILDREN. OUCH!
- //updatePropertySheet();
- //break;
- case EVENT_REFRESH:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH ");
- //if (src != null)
- // refresh(src); // ONLY VALID WHEN USER TRULY WANTS TO REQUERY CHILDREN FROM HOST
- //else
- // refresh(); // refresh entire tree
- if ((src == null) || (src == RSEUIPlugin.getTheSystemRegistry()))
- refreshAll();
- else {
- //smartRefresh(src, false);
- smartRefresh(src, true);
- }
- updatePropertySheet();
- break;
- // refresh the parent of the currently selected items.
- // todo: intelligently re-select previous selections
- case EVENT_REFRESH_SELECTED_PARENT:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED_PARENT ");
- TreeItem[] items = getTree().getSelection();
- if ((items != null) && (items.length > 0) && (items[0] != null)) {
- //System.out.println("Selection not empty");
- parentItem = getParentItem(items[0]); // get parent of first selection. Only allowed to select items of same parent.
- if ((parentItem != null) && (parentItem instanceof Item)) {
- //System.out.println("parent of selection not empty: "+parentItem.getData());
- smartRefresh(new TreeItem[] { (TreeItem) parentItem });
- }
- //else
- //System.out.println("parent of selection is empty");
- }
- //else
- //System.out.println("Selection is empty");
- break;
- case EVENT_REFRESH_SELECTED:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED ");
- IStructuredSelection selected = (IStructuredSelection) getSelection();
- Iterator i = selected.iterator();
- // the following is a tweak. Refresh only re-queries the children. If the selected item has no
- // childen, then refresh does nothing. Instead of that outcome, we re-define it to mean refresh
- // the parent. The tricky part is to prevent multiple refreshes on multiple selections so we have
- // to pre-scan for this scenario.
- // We also want to re-select any remote objects currently selected. They lose their selection as their
- // memory address changes.
- Item parentElementItem = null;
- Vector selectedRemoteObjects = new Vector();
- ss = null;
- items = getTree().getSelection();
- int itemIdx = 0;
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- //System.out.println("Inside EVENT_REFRESH_SELECTED. FIRST SELECTED OBJECT = " + items[0].handle);
- while (i.hasNext()) {
-
- Object element = i.next();
- ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
- if ((parentElementItem == null) && (adapter != null) && (!adapter.hasChildren(element))) {
- //parentItem = getParentItem((Item)findItem(element));
- parentItem = getParentItem(items[itemIdx]);
- if ((parentItem != null) && (parentItem instanceof Item)) parentElementItem = (Item) parentItem; //.getData();
- }
- if (getRemoteAdapter(element) != null) {
- selectedRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- itemIdx++;
- }
- if (parentElementItem != null) {
- //refresh(parentElement);
- smartRefresh(new TreeItem[] { (TreeItem) parentElementItem });
- if (selectedRemoteObjects.size() > 0) {
- selectRemoteObjects(selectedRemoteObjects, ss, parentElementItem);
- }
- }
- // the following is another tweak. If an expanded object is selected for refresh, which has remote children,
- // and any of those children are expanded, then on refresh the resulting list may be in a different
- // order and the silly algorithm inside tree viewer will simply re-expand the children at the previous
- // relative position. If that position has changed, the wrong children are re-expanded!
- // How to fix this? Ugly code to get the query the list of expanded child elements prior to refresh,
- // collapse them, do the refresh, then re-expand them based on absolute name versus tree position.
- // Actually, to do this right we need to test if the children of the selected item are remote objects
- // versus just the selected items because they may have selected a filter!
- // We go straight the TreeItem level for performance and ease of programming.
- else {
- smartRefresh(getTree().getSelection());
- }
- if (doTimings) {
- timer.setEndTime();
- System.out.println("Time to refresh selected: " + timer);
- }
- //else
- //{
- //i = selected.iterator();
- //while (i.hasNext())
- //refresh(i.next());
- //}
-
- updatePropertySheet();
- break;
- case EVENT_REFRESH_SELECTED_FILTER:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_SELECTED_FILTER ");
- IStructuredSelection selectedItems = (IStructuredSelection) getSelection();
- Iterator j = selectedItems.iterator();
- // We climb up the tree here until we find a SystemFilterReference data member in the tree.
- // If we do find a reference of SystemFilterReference we refresh on it.
- // If we do not find a reference of SystemFilterReference we.....TODO: WHAT DO WE DO???
- // We also want to re-select any remote objects currently selected. They lose their selection as their
- // memory address changes.
- Item parentElemItem = null;
- Vector selRemoteObjects = new Vector();
- ss = null;
- if (j.hasNext()) {
- Object element = j.next();
- ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
- if ((parentElemItem == null) && (adapter != null)) {
- Item parItem = getParentItem((Item) findItem(element));
-
- if (parItem != null) parentElemItem = parItem; //.getData();
-
- while (parItem != null && !(parItem.getData() instanceof ISystemFilterReference)) {
- parItem = getParentItem(parItem);
-
- if (parItem != null) parentElemItem = parItem; //.getData();
- }
- }
- if (getRemoteAdapter(element) != null) {
- selRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- }
-
- if (parentElemItem != null && (parentElemItem.getData() instanceof ISystemFilterReference)) {
- smartRefresh(new TreeItem[] { (TreeItem) parentElemItem });
- if (selRemoteObjects.size() > 0) {
- selectRemoteObjects(selRemoteObjects, ss, parentElemItem);
- }
-
- updatePropertySheet();
- } else {
- // if we cannot find a parent element that has a system filter reference then we refresh
- // everything since the explorer must be within a filter
- _event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
- systemResourceChanged(_event);
- }
- break;
- case EVENT_REFRESH_REMOTE:
- if (debug) logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = " + src);
- refreshRemoteObject(src, parent, originatedHere);
- break;
- case EVENT_SELECT_REMOTE:
- if (debug) logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = " + src);
- //remoteItemsToSkip = null; // reset
- selectRemoteObjects(src, (ISubSystem) null, parent);
- break;
-
- case EVENT_MOVE_MANY:
- if (debug) logDebugMsg("SV event: EVENT_MOVE_MANY ");
- multiSource = _event.getMultiSource();
- if ((multiSource == null) || (multiSource.length == 0)) return Status.OK_STATUS;
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem))
- refresh(parent); // flush memory
- else {
- clearSelection();
- moveTreeItems(parentItem, multiSource, _event.getPosition());
- setSelection(new StructuredSelection(multiSource), true);
- }
- break;
- case EVENT_PROPERTY_CHANGE:
- if (debug) logDebugMsg("SV event: EVENT_PROPERTY_CHANGE ");
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- ISystemRemoteElementAdapter ra = getRemoteAdapter(src);
- if (ra != null) {
- updateRemoteObjectProperties(src);
- } else
- update(src, allProps); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- break;
- case EVENT_PROPERTYSHEET_UPDATE:
- if (debug) logDebugMsg("SV event: EVENT_PROPERTYSHEET_UPDATE ");
- updatePropertySheet();
- break;
- case EVENT_MUST_COLLAPSE:
- if (debug) logDebugMsg("SV event: EVENT_MUST_COLLAPSE ");
- collapseNode(src, true); // collapse and flush gui widgets from memory
- break;
- case EVENT_COLLAPSE_ALL:
- if (debug) logDebugMsg("SV event: EVENT_COLLAPSE_ALL ");
- collapseAll(); // collapse all
- if ((src != null) && (src instanceof String) && ((String) src).equals("false")) // defect 41203
- {
- } else
- refresh(); // flush gui widgets from memory
- break;
- case EVENT_COLLAPSE_SELECTED: // defect 41203
- if (debug) logDebugMsg("SV event: EVENT_COLLAPSE_SELECTED ");
- collapseSelected();
- break;
- case EVENT_EXPAND_SELECTED: // defect 41203
- if (debug) logDebugMsg("SV event: EVENT_EXPAND_SELECTED ");
- expandSelected();
- break;
-
- case EVENT_REVEAL_AND_SELECT:
- if (debug) logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
- parentItem = findItem(parent);
- if (parentItem == null) return Status.OK_STATUS;
- if ((parentItem instanceof Item) && !getExpanded((Item) parentItem)) {
- setExpandedState(parent, true);
- Object toSelect = src;
- //if (event.getMultiSource() != null)
- //toSelect = event.getMultiSource();
- //clearSelection();
- if (toSelect != null) {
- if (parent instanceof IRSEBaseReferencingObject) {
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, toSelect, 1);
- if (child != null) toSelect = child.getData();
- } else if ((parent instanceof ISystemFilterPoolReferenceManagerProvider) && !(src instanceof IRSEBaseReferencingObject)) {
- // we are in "don't show filter pools" mode and a new filter was created
- // (we get the actual filter, vs on pool ref creation when we get the pool ref)
- TreeItem child = (TreeItem) internalFindReferencedItem(parentItem, toSelect, 1);
- if (child != null) toSelect = child.getData();
- }
- setSelection(new StructuredSelection(toSelect), true);
- }
- }
- break;
- case EVENT_SELECT:
- if (debug) logDebugMsg("SV event: EVENT_SELECT ");
- item = findItem(src);
- if (item == null) // if not showing item, this is a no-op
- return Status.OK_STATUS;
- setSelection(new StructuredSelection(src), true);
- break;
- case EVENT_SELECT_EXPAND:
- if (debug) logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
- item = findItem(src);
- if (item == null) // if not showing item, this is a no-op
- return Status.OK_STATUS;
- if (!getExpanded((Item) item)) setExpandedState(src, true);
- setSelection(new StructuredSelection(src), true);
- break;
-
- }
- return Status.OK_STATUS;
- }
- }
-
- // ------------------------------------
- // ISYSTEMREMOTEChangeListener METHOD
- // ------------------------------------
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event) {
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
- boolean originatedHere = (event.getOriginatingViewer() == this);
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector) {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- getRemoteResourceAbsoluteName(remoteResourceParent); // DWD may not be necessary
- String remoteResourceName = getRemoteResourceAbsoluteName(remoteResource);
- if (remoteResourceName == null) return;
-
- ISubSystem ss = getSubSystem(event, remoteResource, remoteResourceParent);
-
- Vector filterMatches = null;
-
- switch (eventType) {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED:
- updatePropertySheet(); // just in case
- break;
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED:
- // we can easily lose our original selection so we need save and restore it if needed
- Vector prevSelection = null;
- TreeItem parentSelectionItem = null;
- if (originatedHere) {
- prevSelection = getRemoteSelection();
- parentSelectionItem = getSelectedParentItem();
- }
-
- // when a new remote resource is created, we need to interrogate all filters
- // within connections to the same hostname, to see if the filter results are
- // affected by this change. If so, we refresh the filter.
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- ArrayList selectedFilters = null;
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (isTreeItemSelected(filterItem)) // if this filter is currently selected, we will lose that selection!
- {
- if (selectedFilters == null) selectedFilters = new ArrayList();
- selectedFilters.add(filterItem);
- }
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- // now, refresh all occurrences of the remote parent object.
- refreshRemoteObject(remoteResourceParent, null, false);
- // restore selected filters...
- if (selectedFilters != null) setSelection(selectedFilters);
- // if the create event originated here, then expand the selected node and
- // select the new resource under it.
- if (originatedHere) {
- // first, restore previous selection...
- if (prevSelection != null) selectRemoteObjects(prevSelection, ss, parentSelectionItem);
- TreeItem selectedItem = getFirstSelectedTreeItem();
- if (selectedItem != null) {
- if (!selectedItem.getExpanded()) // if the filter is expanded, then we already refreshed it...
- {
- createChildren(selectedItem);
- selectedItem.setExpanded(true);
- }
- if (remoteResourceNames != null)
- selectRemoteObjects(remoteResourceNames, ss, selectedItem);
- else
- selectRemoteObjects(remoteResourceName, ss, selectedItem);
- }
- //else
- //System.out.println("Hmm, nothing selected");
- }
- break;
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED:
- // delete all existing references to the remote object(s)...
- if (remoteResourceNames != null) {
- for (int idx = 0; idx < remoteResourceNames.size(); idx++)
- deleteRemoteObject(remoteResourceNames.elementAt(idx), ss);
- } else
- deleteRemoteObject(remoteResourceName, ss);
-
- // now, find all filters that either list this remote resource or list the contents of it,
- // if it is a container... for expediency we only test for the first resource, even if given
- // a list of them...
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElement()) {
- // if the filter is expanded, we are ok. If not, we need to flush its memory...
- if (!getExpanded(filterItem)) refresh(filterItem.getData());
- } else // else this filter lists the contents of the deleted container element, so refresh it:
- {
- // if the filter is not expanded, we need to flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // if the filter is expanded, we need to refresh it
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
-
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED:
- // we can easily lose our original selection so we need save and restore it if needed
- prevSelection = null;
- parentSelectionItem = null;
- if (originatedHere) {
- prevSelection = getRemoteSelection();
- parentSelectionItem = getSelectedParentItem();
- }
-
- // rename all existing references to the remote object...
- renameRemoteObject(remoteResource, event.getOldName(), ss);
-
- // now, find all filters that list the contents of the OLD name container.
- filterMatches = findAllRemoteItemFilterReferences(event.getOldName(), ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElementContents()) // this filter lists the contents of the renamed container element, so refresh it:
- {
- // if the filter is not expanded, we need only flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // the filter is expanded, so refresh its contents. This will likely result in an empty list
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
- // now, find all filters that list the contents of the NEW name container.
- filterMatches = findAllRemoteItemFilterReferences(remoteResourceName, ss, null);
- if (filterMatches != null) {
- for (int idx = 0; idx < filterMatches.size(); idx++) {
- FilterMatch match = (FilterMatch) filterMatches.elementAt(idx);
- TreeItem filterItem = match.getTreeItem();
- if (match.listsElementContents()) // this filter lists the contents of the renamed container element, so refresh it:
- {
- // if the filter is not expanded, we need only flush its memory...
- if (!getExpanded(filterItem))
- refresh(filterItem.getData());
- else
- // the filter is expanded, so refresh its contents. This will likely result in an empty list
- smartRefresh(new TreeItem[] { filterItem }, null, true);
- }
- }
- }
-
- // restore selection
- if (originatedHere && (prevSelection != null)) {
- selectRemoteObjects(prevSelection, ss, parentSelectionItem);
- updatePropertySheet(); // just in case
- }
- break;
- }
- }
-
- /**
- * Turn selection into an array of remote object names
- */
- protected Vector getRemoteSelection() {
- Vector prevSelection = null;
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator i = selection.iterator();
- while (i.hasNext()) {
- Object element = i.next();
- ISystemRemoteElementAdapter ra = getRemoteAdapter(element);
- if (ra != null) {
- if (prevSelection == null) prevSelection = new Vector();
- prevSelection.addElement(ra.getAbsoluteName(element));
- }
- }
- return prevSelection;
- }
-
- /**
- * Turn a given remote object reference into a fully qualified absolute name
- */
- protected String getRemoteResourceAbsoluteName(Object remoteResource) {
- if (remoteResource == null) return null;
- String remoteResourceName = null;
- if (remoteResource instanceof String)
- remoteResourceName = (String) remoteResource;
- else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra == null) return null;
- remoteResourceName = ra.getAbsoluteName(remoteResource);
- }
- return remoteResourceName;
- }
-
- /**
- * Deduce the subsystem from the event or remote object
- */
- protected ISubSystem getSubSystem(ISystemRemoteChangeEvent event, Object remoteResource, Object remoteParent) {
- if (event.getSubSystem() != null) return event.getSubSystem();
- ISubSystem ss = null;
- if ((remoteResource != null) && !(remoteResource instanceof String)) {
- if (remoteResource instanceof Vector) {
- Vector v = (Vector) remoteResource;
- if (v.size() > 0) ss = getSubSystem(event, v.elementAt(0), null);
- } else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra != null) ss = ra.getSubSystem(remoteResource);
- }
- }
- if ((ss == null) && (remoteParent != null) && !(remoteParent instanceof String)) {
- if (remoteParent instanceof Vector) {
- Vector v = (Vector) remoteParent;
- if (v.size() > 0) ss = getSubSystem(event, null, v.elementAt(0));
- } else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteParent);
- if (ra != null) ss = ra.getSubSystem(remoteParent);
- }
- }
- return ss;
- }
-
- // ------------------------------------
- // MISCELLANEOUS METHODS...
- // ------------------------------------
-
- /**
- * Close us!
- */
- protected void close() {
- previousInputProvider = inputProvider;
- previousInput = getWorkbenchPart().getSite().getPage().getInput();
- ISystemViewInputProvider ip = new SystemEmptyListAPIProviderImpl();
- setInputProvider(ip);
- }
-
- /**
- * Test if the given input is our view's input object. This is designed to only
- * consider instances of ourself in non-primary perspectives.
- */
- protected boolean affectsInput(Object[] elements) {
- boolean affected = false;
- IWorkbenchPart viewPart = getWorkbenchPart();
- if ((viewPart != null) && (getInput() != RSEUIPlugin.getTheSystemRegistry()) && !(getInput() instanceof SystemEmptyListAPIProviderImpl)) {
- for (int idx = 0; !affected && (idx < elements.length); idx++)
- affected = affectsInput(elements[idx]);
- }
- return affected;
- }
-
- /**
- * Test if the given input is our view's input object. This is designed to only
- * consider instances of ourself in non-primary perspectives.
- */
- protected boolean affectsInput(Object element) {
- boolean affected = false;
- IWorkbenchPart viewPart = getWorkbenchPart();
- if ((viewPart != null) && (getInput() != RSEUIPlugin.getTheSystemRegistry()) && !(getInput() instanceof SystemEmptyListAPIProviderImpl)) {
-
- Object input = viewPart.getSite().getPage().getInput();
- if (input != null) {
- Object referencedElement = getReferencedObject(element);
- Object referencedInput = getReferencedObject(input);
- //System.out.println("TESTING1 " + input + " vs " + element);
- //System.out.println("TESTING2 " + referencedInput + " vs " + referencedElement);
- if ((input == element) || (referencedInput == referencedElement))
- affected = true;
- else {
- while (!affected && (input != null)) {
- input = getElementParent(input);
- if (input != null) {
- referencedInput = getReferencedObject(input);
- //System.out.println("...TESTING1 " + input + " vs " + element);
- //System.out.println("...TESTING2 " + referencedInput + " vs " + referencedElement);
- affected = ((input == element) || (referencedInput == referencedElement));
- }
- }
- }
- }
- }
- return affected;
- }
-
- protected Object getReferencedObject(Object inputObj) {
- if (inputObj instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference) inputObj).getReferencedFilterPool();
- else if (inputObj instanceof ISystemFilterReference)
- return ((ISystemFilterReference) inputObj).getReferencedFilter();
- else if (inputObj instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference) inputObj).getReferencedFilterString();
- else
- return inputObj;
- }
-
- protected Object getElementParent(Object inputObj) {
- if (inputObj instanceof IHost)
- return ((IHost) inputObj).getSystemProfile();
- else if (inputObj instanceof ISubSystem)
- return ((ISubSystem) inputObj).getHost();
- else if (inputObj instanceof ISystemFilterPoolReference)
- return ((ISystemFilterPoolReference) inputObj).getProvider(); // will be a subsystem
- else if (inputObj instanceof ISystemFilterPool)
- return ((ISystemFilterPool) inputObj).getProvider(); // will be a subsystem factory. Hmm!
- else if (inputObj instanceof ISystemFilterReference)
- return ((ISystemFilterReference) inputObj).getParent(); // will be filter reference or filter pool reference
- else if (inputObj instanceof ISystemFilter) {
- ISystemFilter filter = (ISystemFilter) inputObj;
- if (filter.getParentFilter() != null)
- return filter.getParentFilter();
- else
- return filter.getParentFilterPool();
- } else if (inputObj instanceof ISystemFilterStringReference)
- return ((ISystemFilterStringReference) inputObj).getParent(); // will be a SystemFilterReference
- else if (inputObj instanceof ISystemFilterString)
- return ((ISystemFilterString) inputObj).getParentSystemFilter();
- else
- return null;
- }
-
- protected IHost getInputConnection(Object inputObj) {
- if (inputObj instanceof IHost)
- return (IHost) inputObj;
- else if (inputObj instanceof ISubSystem)
- return ((ISubSystem) inputObj).getHost();
- else if (inputObj instanceof ISystemFilterPoolReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterPoolReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else if (inputObj instanceof ISystemFilterReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else if (inputObj instanceof ISystemFilterStringReference) {
- ISubSystem ss = (ISubSystem) ((ISystemFilterStringReference) inputObj).getProvider(); // will be a subsystem
- if (ss == null) return null;
- return ss.getHost();
- } else
- return null;
- }
-
- /**
- * Handy debug method to print a tree item
- */
- protected String printTreeItem(Item item) {
- if (item == null)
- return "";
- else if (item instanceof TreeItem) {
- TreeItem ti = (TreeItem) item;
- return printTreeItem(ti.getParentItem()) + "/" + ti.getText();
- } else
- return item.toString();
- }
-
- /**
- * Delete all occurrences of a given remote object
- */
- protected void deleteRemoteObject(Object deleteObject, ISubSystem subsystem) {
- Vector matches = null;
- String oldElementName = null;
-
- // STEP 1: get the object's remote adapter and subsystem
- if (deleteObject instanceof String)
- oldElementName = (String) deleteObject;
- else {
- ISystemRemoteElementAdapter rmtAdapter = getRemoteAdapter(deleteObject);
- if (rmtAdapter == null) return;
- oldElementName = rmtAdapter.getAbsoluteName(deleteObject);
- subsystem = rmtAdapter.getSubSystem(deleteObject);
- }
- // STEP 2: find all references to the object
- matches = findAllRemoteItemReferences(oldElementName, deleteObject, subsystem, matches);
- if (matches == null) {
- //System.out.println("matches is null");
- return;
- }
-
- boolean wasSelected = false;
- Item parentItem = null;
-
- boolean dupes = false;
- Object prevData = null;
- for (int idx = 0; !dupes && (idx < matches.size()); idx++) {
- Item match = (Item) matches.elementAt(idx);
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- if (match.getData() == prevData)
- dupes = true;
- else
- prevData = match.getData();
- }
- }
- //System.out.println("matches size = " + matches.size() + ", any binary duplicates? " + dupes);
-
- // STEP 3: process all references to the object
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- //System.out.println("...match " + idx + ": TreeItem? " + (match instanceof TreeItem) + ", disposed? " + ((TreeItem)match).isDisposed());
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- ((TreeItem) match).getParentItem(); // DWD may not be necessary
- Object data = match.getData();
- if (!wasSelected) {
- //wasSelected = isSelectedOrChildSelected(data);
- wasSelected = isTreeItemSelectedOrChildSelected(match);
- if (wasSelected) {
- clearSelection();
- parentItem = ((TreeItem) match).getParentItem();
- //System.out.println("...current item was selected");
- }
- }
- if (dupes) // defect 46818
- { // if there are multiple references to the same binary object, ...
- //System.out.println(".....calling refresh(data) on this match");
- /*
- if (pItem!=null)
- smartRefresh(new TreeItem[] {pItem}); // just refresh the parent node
- else
- refreshAll();
- */
- disassociate(match);
- match.dispose();
- } else {
- //System.out.println(".....calling remove(data) on this match");
- remove(data); // remove this item from the tree
- }
- }
- }
-
- // STEP 4: if we removed a selected item, select its parent
- if (wasSelected && (parentItem != null) && (parentItem instanceof TreeItem) && (parentItem.getData() != null)) {
- //System.out.println("Resetting selection to parent");
- setSelection(new StructuredSelection(parentItem.getData()), true);
- }
- return;
- }
-
- /**
- * Rename a remote object. Renames all references to it currently displayed in this tree.
- */
- protected void renameRemoteObject(Object renameObject, String oldElementName, ISubSystem subsystem) {
- String[] properties = new String[1];
- properties[0] = IBasicPropertyConstants.P_TEXT;
-
- // STEP 0: do we have the physical remote object that has been renamed? If so, update it directly
- /*
- Item item = (Item)findItem(renameObject);
- if (item != null)
- {
- update(renameObject, properties); // for refreshing non-structural properties in viewer when model changes
- if (item instanceof TreeItem)
- smartRefresh(new TreeItem[] {(TreeItem)item}); // we update the kids because they typically store references to their parent
- }
- */
-
- Vector matches = null;
-
- // STEP 1: get the object's remote adapter and subsystem
- //String newElementName = null;
- ISystemRemoteElementAdapter rmtAdapter = null;
- if (renameObject instanceof String) {
- //FIXME How to get the adapter based on the String name?
- //newElementName = (String)renameObject;
- } else {
- rmtAdapter = getRemoteAdapter(renameObject);
- subsystem = rmtAdapter.getSubSystem(renameObject);
- }
-
- // STEP 2: find all references to the old name object
- matches = findAllRemoteItemReferences(oldElementName, renameObject, subsystem, matches);
- if (matches == null) return;
-
- TreeItem[] selected = getTree().getSelection();
- getTree().deselectAll();
-
- boolean refresh = false;
- // STEP 3: process all references to the old name object
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
-
- if (data != renameObject) // not a binary match
- {
- if (rmtAdapter == null) rmtAdapter = getRemoteAdapter(data);
- refresh = rmtAdapter.refreshRemoteObject(data, renameObject); // old, new
- } else {
- refresh = true;
- }
-
-
- internalUpdate(match, data, properties);
-
- //update(data, properties); // for refreshing non-structural properties in viewer when model changes
- //System.out.println("Match found. refresh required? " + refresh);
-// if (refresh)
- //refreshRemoteObject(data,null,false);
- // smartRefresh(new TreeItem[] { (TreeItem) match });
- }
- }
-
- if (refresh)
- {
- smartRefresh((TreeItem[])matches.toArray(new TreeItem[matches.size()]));
- getTree().setSelection(selected);
- }
-
- // STEP 4: update property sheet, just in case.
- updatePropertySheet();
-
- return;
- }
-
- /**
- * Update properties of remote object. Update all references to this object
- */
- protected void updateRemoteObjectProperties(Object remoteObject) {
- Vector matches = new Vector();
-
- // STEP 1: get the object's remote adapter and subsystem
- ISystemRemoteElementAdapter rmtAdapter = getRemoteAdapter(remoteObject);
- ISubSystem subsystem = rmtAdapter.getSubSystem(remoteObject);
-
- // STEP 2: find all references to the object
- String oldElementName = rmtAdapter.getAbsoluteName(remoteObject);
- findAllRemoteItemReferences(oldElementName, remoteObject, subsystem, matches);
-
- // STEP 3: process all references to the object
- String[] allProps = { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
- if (data == remoteObject) // same binary object as given?
- update(data, allProps); // for refreshing non-structural properties in viewer when model changes
- else // match by name
- {
- rmtAdapter.refreshRemoteObject(data, remoteObject); // old, new
- update(data, allProps);
- }
- }
- }
-
- // STEP 4: update the property sheet in case we changed properties of first selected item
- updatePropertySheet();
- return;
- }
-
- /**
- * Refresh contents of remote container. Refreshes all references to this container including filters that
- * display the contents of this container.
- * @param remoteObject - either an actual remote object, or the absolute name of a remote object
- * @param toSelect - the child object to select after refreshing the given object. This will force the
- * object to be expanded, and then select this object which can be a remote object or absolute name of a
- * remote object. To simply force an expand of the remote object, without bothering to select a child,
- * pass an instance of SystemViewDummyObject.
- * @return true if a refresh done, false if given a non-remote object.
- */
- protected boolean refreshRemoteObject(Object remoteObject, Object toSelect, boolean originatedHere) {
- if (remoteObject == null) return false;
-
- // STEP 1: get the object's remote adapter and subsystem, or use its name if only given that
- ISystemRemoteElementAdapter rmtAdapter = null;
- ISubSystem subsystem = null;
- String oldElementName = null;
- if (!(remoteObject instanceof String)) {
- rmtAdapter = getRemoteAdapter(remoteObject);
- if (rmtAdapter == null) return false;
- subsystem = rmtAdapter.getSubSystem(remoteObject);
- oldElementName = rmtAdapter.getAbsoluteName(remoteObject);
- } else
- oldElementName = (String) remoteObject;
-
- Vector matches = new Vector();
- // STEP 2: find all references to the object
- findAllRemoteItemReferences(oldElementName, remoteObject, subsystem, matches);
- if (remoteObject instanceof String) remoteObject = getFirstRemoteObject(matches);
-
- if (remoteObject instanceof ISystemContainer) {
- ((ISystemContainer) remoteObject).markStale(true);
- }
-
- // STEP 3: process all references to the object
- boolean firstSelection = true;
- for (int idx = 0; idx < matches.size(); idx++) {
- Item match = (Item) matches.elementAt(idx);
- // a reference to this remote object
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- Object data = match.getData();
- smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object
- if (firstSelection && // for now, we just select the first binary occurrence we find
- (data == remoteObject)) // same binary object as given?
- {
- firstSelection = false;
- if ((toSelect != null) && originatedHere) {
- if (!getExpanded(match)) // assume if callers wants to select kids that they want to expand parent
- {
- createChildren(match);
- setExpanded(match, true);
- }
- // todo: handle cumulative selections.
- // STEP 4: If requested, select the kids in the newly refreshed object.
- // If the same binary object appears multiple times, select the kids in the first occurrence.
- // ... what else to do?
- if (!(toSelect instanceof SystemViewDummyObject)) selectRemoteObjects(toSelect, null, match); // select the given kids in this parent
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Given the result of findAllRemoteItemReferences, scan for first non-filter object
- */
- protected Object getFirstRemoteObject(Vector matches) {
- if ((matches == null) || (matches.size() == 0)) return null;
- Object firstRemote = matches.elementAt(0);
- if (firstRemote != null) firstRemote = ((Item) firstRemote).getData();
- return firstRemote;
- }
-
- /**
- * Refreshes the tree starting at the given widget.
- *
- * @param widget the widget
- * @param element the element
- * @param doStruct <code>true</code> if structural changes are to be picked up,
- * and <code>false</code> if only label provider changes are of interest
- */
- protected void ourInternalRefresh(Widget widget, Object element, boolean doStruct, boolean forceRemote, boolean doTimings) {
- final Widget fWidget = widget;
- final Object fElement = element;
- final boolean fDoStruct = doStruct;
-
- // we have to take special care if one of our kids are selected and it is a remote object...
- if (forceRemote || (isSelectionRemote() && isTreeItemSelectedOrChildSelected(widget))) {
- if (!isTreeItemSelected(widget)) // it is one of our kids that is selected
- {
- clearSelection(); // there is nothing much else we can do. Calling code will restore it anyway hopefully
- doOurInternalRefresh(fWidget, fElement, fDoStruct, doTimings);
- } else // it is us that is selected. This might be a refresh selected operation. TreeItem address won't change
- {
- doOurInternalRefresh(fWidget, fElement, fDoStruct, doTimings);
- }
- } else {
- final boolean finalDoTimings = doTimings;
- preservingSelection(new Runnable() {
- public void run() {
- doOurInternalRefresh(fWidget, fElement, fDoStruct, finalDoTimings);
- }
- });
- }
- }
-
- protected boolean isSelectionRemote() {
- ISelection s = getSelection();
- if ((s != null) && (s instanceof IStructuredSelection)) {
- IStructuredSelection ss = (IStructuredSelection) s;
- Object firstSel = ss.getFirstElement();
- if ((firstSel != null) && (getRemoteAdapter(firstSel) != null)) return true;
- }
- return false;
- }
-
- protected void doOurInternalRefresh(Widget widget, Object element, boolean doStruct, boolean doTimings) {
- if (debug) {
- logDebugMsg("in doOurInternalRefresh on " + getAdapter(element).getName(element));
- logDebugMsg("...current selection is " + getFirstSelectionName(getSelection()));
- }
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- if (widget instanceof Item) {
- //System.out.println("Inside doOurInternalRefresh. widget = " + ((TreeItem)widget).handle);
- if (doStruct) {
- updatePlus((Item) widget, element);
- }
- updateItem(widget, element);
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 1: time to updatePlus and updateItem:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- if (doStruct) {
- // pass null for children, to allow updateChildren to get them only if needed
- // Object[] newChildren = null;
- if ((widget instanceof Item) && getExpanded((Item) widget)) {
- // DKM - get raw children does a query but so does internalRefresh()
- // newChildren = getRawChildren(widget);
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 2: time to getRawChildren:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
- // DKM - without the else we get duplicate queries on expanded folder
- // uncommented - seems new results after query aren't showing up
- //else
- {
- internalRefresh(element);
- }
-
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 3: time to updateChildren:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
- // recurse
- Item[] children = getChildren(widget);
- if (children != null) {
- //SystemElapsedTimer timer2 = null;
- //int intervalCount = 0;
- //if (doTimings)
- //timer2 = new SystemElapsedTimer();
- for (int i = 0; i < children.length; i++) {
- Widget item = children[i];
- Object data = item.getData();
- if (data != null) doOurInternalRefresh(item, data, doStruct, false);
- /*
- if (doTimings)
- {
- ++intervalCount;
- if (intervalCount == 1000)
- {
- System.out.println("...time to recurse next 1000 children: " + timer2.setEndTime());
- intervalCount = 0;
- timer2.setStartTime();
- }
- }*/
- }
- }
- if (doTimings) {
- System.out.println("doOurInternalRefresh timer 4: time to recurse children:" + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- protected Object[] getRawChildren(Widget w) {
- Object parent = w.getData();
- if (w != null) {
- if (parent.equals(getRoot())) return super.getRawChildren(parent);
- Object[] result = ((ITreeContentProvider) getContentProvider()).getChildren(parent);
- if (result != null) return result;
- }
- return new Object[0];
- }
-
- /*
- protected void preservingSelection(Runnable updateCode)
- {
- super.preservingSelection(updateCode);
- System.out.println("After preservingSelection: new selection = "+getFirstSelectionName(getSelection()));
- }
- protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection)
- {
- System.out.println("Inside handleInvalidSelection: old = "+getFirstSelectionName(invalidSelection)+", new = "+getFirstSelectionName(newSelection));
- updateSelection(newSelection);
- }
- */
- protected String getFirstSelectionName(ISelection s) {
- if ((s != null) && (s instanceof IStructuredSelection)) {
- IStructuredSelection ss = (IStructuredSelection) s;
- Object firstSel = ss.getFirstElement();
- String name = null;
- if (firstSel != null) {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(firstSel);
- if (ra != null)
- name = ra.getAbsoluteName(firstSel);
- else
- name = getAdapter(firstSel).getName(firstSel);
- }
- return name;
- } else
- return null;
- }
-
- /**
- * Expand a remote object within the tree. Must be given its parent element within the tree,
- * in order to uniquely find it. If not given this, we expand the first occurrence we find!
- * @param remoteObject - either a remote object or a remote object absolute name
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentObject - the parent that owns the remote objects, to optimize searches. Can
- * be an object or the absolute name of a remote object.
- * @return the tree item of the remote object if found and expanded, else null
- */
- public Item expandRemoteObject(Object remoteObject, ISubSystem subsystem, Object parentObject) {
- // given the parent? Should be easy
- Item remoteItem = null;
- if (parentObject != null) {
- Item parentItem = null;
- if (parentObject instanceof Item)
- parentItem = (Item) parentObject;
- else if (parentObject instanceof String) // given absolute name of remote object
- parentItem = findFirstRemoteItemReference((String) parentObject, subsystem, (Item) null); // search all roots for the parent
- else // given actual remote object
- {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(parentObject);
- if (ra != null) {
- if (subsystem == null) subsystem = ra.getSubSystem(parentObject);
- parentItem = findFirstRemoteItemReference(ra.getAbsoluteName(parentObject), subsystem, (Item) null); // search all roots for the parent
- } else // else parent is not a remote object. Probably its a filter
- {
- Widget parentWidget = findItem(parentObject);
- if (parentWidget instanceof Item) parentItem = (Item) parentWidget;
- }
- }
- // ok, we have the parent item! Hopefully!
- if (remoteObject instanceof String)
- remoteItem = findFirstRemoteItemReference((String) remoteObject, subsystem, parentItem);
- else
- remoteItem = findFirstRemoteItemReference(remoteObject, parentItem);
- if (remoteItem == null) return null;
- setExpandedState(remoteItem.getData(), true);
- } else // not given a parent to refine search with. Better have a subsystem!!
- {
- if (remoteObject instanceof String)
- remoteItem = findFirstRemoteItemReference((String) remoteObject, subsystem, (Item) null);
- else {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteObject);
- if (ra != null) {
- if (subsystem == null) subsystem = ra.getSubSystem(remoteObject);
- remoteItem = findFirstRemoteItemReference(ra.getAbsoluteName(remoteObject), subsystem, (Item) null);
- }
- }
- if (remoteItem == null) return null;
- setExpandedState(remoteItem.getData(), true);
- }
- return remoteItem;
- }
-
- /**
- * Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null)
- * @param src - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute names
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentObject - the parent that owns the remote objects, to optimize searches.
- * @return true if found and selected
- */
- public boolean selectRemoteObjects(Object src, ISubSystem subsystem, Object parentObject) {
- //String parentName = null;
- // given a parent object? That makes it easy...
- if (parentObject != null) {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(parentObject);
- if (ra != null) {
- //parentName = ra.getAbsoluteName(parentObject);
- if (subsystem == null) subsystem = ra.getSubSystem(parentObject);
- Item parentItem = findFirstRemoteItemReference(parentObject, (Item) null); // search all roots for the parent
- return selectRemoteObjects(src, subsystem, parentItem);
- } else // else parent is not a remote object. Probably its a filter
- {
- Item parentItem = null;
- if (parentObject instanceof Item)
- parentItem = (Item) parentObject;
- else {
- Widget parentWidget = findItem(parentObject);
- if (parentWidget instanceof Item) parentItem = (Item) parentWidget;
- }
- if (parentItem != null)
- return selectRemoteObjects(src, (ISubSystem) null, parentItem);
- else
- return false;
- }
- } else
- //return selectRemoteObjects(src, (SubSystem)null, (Item)null); // Phil test
- return selectRemoteObjects(src, subsystem, (Item) null);
- }
-
- /**
- * Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null) and parent TreeItem to
- * start the search at (can be null)
- * @param src - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute names
- * @param subsystem - the subsystem that owns the remote objects, to optimize searches.
- * @param parentItem - the parent at which to start the search to find the remote objects. Else, starts at the roots.
- * @return true if found and selected
- */
- protected boolean selectRemoteObjects(Object src, ISubSystem subsystem, Item parentItem) {
- clearSelection();
- Item selItem = null;
-
- if (parentItem != null && parentItem.isDisposed()) {
- return false;
- }
-
- if ((parentItem != null) && !getExpanded(parentItem))
- //setExpanded(parentItem, true);
- setExpandedState(parentItem.getData(), true);
-
- //System.out.println("SELECT_REMOTE: PARENT = " + parent + ", PARENTITEM = " + parentItem);
- if (src instanceof Vector) {
- //String elementName = null;
- Vector selVector = (Vector) src;
- ArrayList selItems = new ArrayList();
- // our goal here is to turn the vector of names or remote objects into a collection of
- // actual TreeItems we matched them on...
- for (int idx = 0; idx < selVector.size(); idx++) {
- Object o = selVector.elementAt(idx);
- //elementName = null;
- if (o instanceof String)
- selItem = findFirstRemoteItemReference((String) o, subsystem, parentItem);
- else
- selItem = findFirstRemoteItemReference(o, parentItem);
-
- if (selItem != null) {
- selItems.add(selItem);
- // when selecting multiple items, we optimize by assuming they have the same parent...
- if ((parentItem == null) && (selItem instanceof TreeItem)) parentItem = ((TreeItem) selItem).getParentItem();
- }
- }
- if (selItems.size() > 0) {
- setSelection(selItems);
- updatePropertySheet();
- return true;
- }
- } else {
- if (src instanceof String)
- //selItem = (Item)findFirstRemoteItemReference((String)src, (SubSystem)null, parentItem); Phil test
- selItem = findFirstRemoteItemReference((String) src, subsystem, parentItem);
- else
- selItem = findFirstRemoteItemReference(src, parentItem);
-
- if (selItem != null) {
- ArrayList selItems = new ArrayList();
- selItems.add(selItem);
- setSelection(selItems);
- updatePropertySheet();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Refresh the whole tree. We have special code to reselect remote objects after the refresh
- */
- public void refreshAll() {
- IStructuredSelection selected = (IStructuredSelection) getSelection();
- Iterator i = selected.iterator();
- Object parentElement = null;
- Vector selectedRemoteObjects = new Vector();
- Widget parentItem = null;
- ISubSystem ss = null;
- while (i.hasNext()) {
- Object element = i.next();
- if (parentElement == null) {
- parentItem = getParentItem((Item) findItem(element));
- if ((parentItem != null) && (parentItem instanceof Item)) parentElement = ((Item) parentItem).getData();
- }
- if (getRemoteAdapter(element) != null) {
- selectedRemoteObjects.addElement(element);
- if (ss == null) ss = getRemoteAdapter(element).getSubSystem(element);
- }
- }
-
- //super.refresh();
- smartRefresh((Object) null, (selectedRemoteObjects.size() > 0));
-
- if (selectedRemoteObjects.size() > 0) {
- selectRemoteObjects(selectedRemoteObjects, ss, parentElement);
- }
- }
-
- /**
- * Do an intelligent refresh of an expanded item. The inherited algorithm for refresh is stupid,
- * in that it reexpands children based on their original ordinal position which can change after a
- * refresh, resulting in the wrong children being expanded. Currently this only truly comes to light
- * for remote objects, where refresh really can change the resulting list and hence each child's
- * ordinal position. So, to be safe we only override the inherited algorithm if any nested child
- * is a remote object
- */
- protected void smartRefresh(TreeItem[] itemsToRefresh) {
- smartRefresh(itemsToRefresh, null, false);
- }
-
- protected void smartRefresh(TreeItem[] itemsToRefresh, ArrayList expandedChildren, boolean forceRemote) {
- SystemElapsedTimer timer = null;
- if (doTimings) timer = new SystemElapsedTimer();
- areAnyRemote = false; // set in ExpandedItem constructor
- boolean fullRefresh = false;
- // for each selected tree item gather a list of expanded child nodes...
- if (expandedChildren == null)
- expandedChildren = new ArrayList();
- else
- fullRefresh = true;
- boolean[] wasExpanded = new boolean[itemsToRefresh.length];
- //boolean anyGivenItemsRemote = false;
- for (int idx = 0; idx < itemsToRefresh.length; idx++) {
- TreeItem currItem = itemsToRefresh[idx];
- // ...if this selected item is expanded, recursively gather up all its expanded descendents
- Object data = currItem.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- //if (adapter instanceof ISystemRemoteElementAdapter) {
- // anyGivenItemsRemote = true;
- //}
- if (currItem.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false); // collapse temp expansion of prompts
- else if (currItem.getExpanded()) {
- //expandedChildren.add(new ExpandedItem(currItem)); we don't need special processing for given items themselves as they will not be refreshed, only their kids
- if (doTimings) timer.setStartTime();
- gatherExpandedChildren((fullRefresh ? null : currItem), currItem, expandedChildren);
- wasExpanded[idx] = true;
- if (doTimings) System.out.println("Refresh Timer 1: time to gatherExpandedChildren: " + timer.setEndTime());
- } else
- wasExpanded[idx] = false;
- }
- // ok, we have found all expanded descendents of all selected items.
-
- // If none of the expanded sub-nodes are remote simply use the inherited algorithm for refresh
- if (!areAnyRemote) {
- for (int idx = 0; idx < itemsToRefresh.length; idx++)
- //ourInternalRefresh(itemsToRefresh[idx], itemsToRefresh[idx].getData(), wasExpanded[idx]);
- ourInternalRefresh(itemsToRefresh[idx], itemsToRefresh[idx].getData(), true, forceRemote, doTimings); // defect 42321
- return;
- }
- getControl().setRedraw(false);
- // If any selected nodes are remote use our own algorithm:
- // 1. collapse each given node and refresh it to remove the children from memory, then
- // expand it again. It doesn't matter if it is remote or not since its own memory
- // address won't change, only that of its children.
- for (int idx = 0; idx < itemsToRefresh.length; idx++) {
- TreeItem currItem = itemsToRefresh[idx];
- if (doTimings) timer.setStartTime();
- setExpanded(currItem, false); // collapse node
- if (doTimings) {
- System.out.println("Refresh Timer 2: time to setExpanded(false): " + timer.setEndTime());
- timer.setStartTime();
- }
- ourInternalRefresh(currItem, currItem.getData(), true, true, doTimings); // dispose of children, update plus
- if (doTimings) {
- System.out.println("Refresh Timer 3: time to do ourInternalRefresh(...): " + timer.setEndTime());
- timer.setStartTime();
- }
- if (wasExpanded[idx]) {
- createChildren(currItem); // re-expand
- if (doTimings) {
- System.out.println("Refresh Timer 4: time to createChildren(...): " + timer.setEndTime());
- timer.setStartTime();
- }
- currItem.setExpanded(true);
- if (doTimings) {
- System.out.println("Refresh Timer 5: time to setExpanded(true): " + timer.setEndTime());
- timer.setStartTime();
- }
- } else // hmm, item was not expanded so just flush its memory
- {
-
- }
- }
- // 2. expand each previously expanded sub-node, recursively
- for (int idx = 0; idx < expandedChildren.size(); idx++) {
- ExpandedItem itemToExpand = (ExpandedItem) expandedChildren.get(idx);
- if (itemToExpand.isRemote()) {
- // find remote item based on its original name and unchanged root parent
- Item item = null;
- //if (itemToExpand.parentItem != null)
- //item = (Item)recursiveFindRemoteItem(itemToExpand.parentItem, itemToExpand.remoteName, itemToExpand.subsystem);
- //else
- //item = (Item)findRemoteItem(itemToExpand.remoteName, itemToExpand.subsystem);
- item = findFirstRemoteItemReference(itemToExpand.remoteName, itemToExpand.subsystem, itemToExpand.parentItem);
- // if found, re-expand it
- if (item != null) {
- //setExpanded(item, true);
- createChildren(item);
- ((TreeItem) item).setExpanded(true);
- if (debug) System.out.println("Re-Expanded RemoteItem: " + itemToExpand.remoteName);
- } else if (debug) System.out.println("Re-Expand of RemoteItem '" + itemToExpand.remoteName + "' failed. Not found");
- } else {
- setExpandedState(itemToExpand.data, true);
- if (debug) System.out.println("Re-Expanded non-remote Item: " + itemToExpand.data);
- }
- }
- if (doTimings) {
- System.out.println("Refresh Timer 6: time to reExpanded expanded subnodes: " + timer.setEndTime());
- timer.setStartTime();
- }
- getControl().setRedraw(true);
- if (doTimings) {
- System.out.println("Refresh Timer 7: time to setRedraw(true): " + timer.setEndTime());
- timer.setStartTime();
- }
- }
-
- /**
- * Do an intelligent refresh of the given element. Can be null for full refresh
- */
- protected void smartRefresh(Object element, boolean forceRemote) {
- if ((element == null) || (element == getInput())) {
- // fullRefresh
- Tree tree = getTree();
- TreeItem[] roots = tree.getItems();
- boolean anyExpanded = false;
- areAnyRemote = false; // set in ExpandedItem constructor
- ArrayList expandedChildren = new ArrayList();
- if (roots != null) {
- for (int idx = 0; idx < roots.length; idx++) {
- TreeItem currItem = roots[idx];
- Object data = currItem.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- if (currItem.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false);
- else if (currItem.getExpanded()) {
- //setExpanded(roots[idx], false);
- expandedChildren.add(new ExpandedItem(null, currItem));
- anyExpanded = true;
- //gatherExpandedChildren(currItem, currItem, expandedChildren);
- }
- }
- }
- if (!anyExpanded)
- super.refresh();
- else {
- internalRefresh(getInput());
- roots = tree.getItems(); // re-query roots
- smartRefresh(roots, expandedChildren, forceRemote);
- }
- } else if (getRemoteAdapter(element) != null) {
-
- Item item = null;
- if (element instanceof String) {
- item = findFirstRemoteItemReference((String) element, (ISubSystem) null, (Item) null);
- if (item != null) {
- smartRefresh(new TreeItem[] { (TreeItem) item });
- }
- } else {
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(element);
- String elementName = adapter.getName(element);
- ISubSystem subSystem = adapter.getSubSystem(element);
-
- Vector matches = new Vector();
- findAllRemoteItemReferences(elementName, element, subSystem, matches);
- if (matches.size() > 0) {
- for (int i = 0; i < matches.size(); i++) {
- Item match = (Item) matches.get(i);
- if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
- smartRefresh(new TreeItem[] { (TreeItem) match });
- }
- }
- }
- }
-
- /*
- Item item = null;
- if (element instanceof String)
- item = findFirstRemoteItemReference((String)element, (SubSystem)null, (Item)null);
- else
- item = findFirstRemoteItemReference(element, (Item)null);
- if (item != null)
- smartRefresh(new TreeItem[] {(TreeItem)item});
-
- */
- } else {
- Item item = (Item) findItem(element);
- //System.out.println("Inside SV smartRefresh for "+element+". Item found? " + (item!=null));
- if (item != null) smartRefresh(new TreeItem[] { (TreeItem) item });
- }
- }
-
- class ExpandedItem {
- TreeItem item, parentItem;
- Object data;
- String remoteName;
- ISystemRemoteElementAdapter remoteAdapter;
- ISubSystem subsystem;
-
- ExpandedItem(TreeItem parentItem, TreeItem item) {
- this.parentItem = parentItem;
- this.item = item;
- this.data = item.getData();
- if (data != null) {
- remoteAdapter = getRemoteAdapter(data);
- if (remoteAdapter != null) {
- remoteName = remoteAdapter.getAbsoluteName(data);
- subsystem = remoteAdapter.getSubSystem(data);
- areAnyRemote = true;
- if (debug) System.out.println("ExpandedRemoteItem added. remoteName = " + remoteName);
- } else if (debug) System.out.println("ExpandedItem added. Data = " + data);
- } else if (debug) System.out.println("ExpandedItem added. Data = null");
- }
-
- boolean isRemote() {
- return (remoteAdapter != null);
- }
- }
-
- /**
- * Gather up all expanded children of the given tree item into a list that can be used later to
- * reexpand.
- * @param parentItem The root parent which will not be refreshed itself (only its kids) and hence will remain valid after refresh.
- * In a full refresh this will be null.
- * @param startingItem The starting item for this search. Usually same as parentItem, but changes via recursion
- * @param listToPopulate An array list that will be populated with instances of our inner class ExpandedItem
- */
- protected void gatherExpandedChildren(TreeItem parentItem, TreeItem startingItem, ArrayList listToPopulate) {
- TreeItem[] itemChildren = startingItem.getItems();
- if (itemChildren != null) {
- for (int idx = 0; idx < itemChildren.length; idx++) {
- TreeItem currChild = itemChildren[idx];
- Object data = currChild.getData();
- ISystemViewElementAdapter adapter = null;
- if (data != null) adapter = getAdapter(data);
- if (currChild.getExpanded() && (adapter != null) && adapter.isPromptable(data))
- setExpandedState(data, false);
- else if (currChild.getExpanded()) {
- listToPopulate.add(new ExpandedItem(parentItem, currChild));
- gatherExpandedChildren(parentItem, currChild, listToPopulate);
- }
- }
- }
- }
-
- /**
- * Get index of item given its data element
- */
- protected int getItemIndex(Widget parent, Object element) {
- int index = -1;
- Item[] kids = getChildren(parent);
- if (kids != null) for (int idx = 0; idx < kids.length; idx++)
- if (kids[idx].getData() == element) index = idx;
- return index;
- }
-
- /**
- * We don't show actual filters, only filter references that are unique generated
- * for each subtree of each subsystem. Yet, each event is relative to the filter,
- * not our special filter references. Hence, all this code!!
- * <p>
- * Special case handling for updates to filters which affect the filter
- * but not the filter parent:
- * 1. Existing filter renamed (RENAME)
- * 2. Existing filter's filter strings changed (CHANGE)
- * <p>
- * Assumption:
- * 1. event.getGrandParent() == subsystem (one event fired per affected subsystem)
- * 2. event.getSource() == filter or filter string (not the reference, the real filter or string)
- * 3. event.getParent() == parent of filter or filter string. One of:
- * a. filterPool reference or filter reference (nested)
- * b. filterPool for non-nested filters when showing filter pools
- * c. subsystem for non-nested filters when not showing filter pools
- * d. filter for nested filters
- * <p>
- * Our job here:
- * 1. Determine if we are even showing the given subsystem
- * 2. Find the reference to the updated filter in that subsystem's subtree
- * 3. Ask that parent to either update its name or collapse and refresh its children
- * 4. Forget selecting something ... the original item remains selected!
- */
- protected void findAndUpdateFilter(ISystemResourceChangeEvent event, int type) {
- ISystemFilter filter = (ISystemFilter) event.getSource();
- //Object parent = event.getParent();
- if (debug) {
- String eventType = null;
- switch (type) {
- case EVENT_RENAME_FILTER_REFERENCE:
- eventType = "EVENT_RENAME_FILTER_REFERENCE";
- break;
- case EVENT_CHANGE_FILTER_REFERENCE:
- eventType = "EVENT_CHANGE_FILTER_REFERENCE";
- break;
- }
- logDebugMsg("SV event: " + eventType);
- }
-
- // STEP 1. ARE WE EVEN SHOWING THE GIVEN SUBSYSTEM?
- ISubSystem ss = (ISubSystem) event.getGrandParent();
- Widget widget = findItem(ss);
-
- if (widget != null) {
-
- // STEP 2: ARE WE SHOWING A REFERENCE TO RENAMED OR UPDATED FILTER?
- Widget item = null;
-
- Control c = getControl();
-
- // KM: defect 53008.
- // Yes we are showing the subsystem, so widget is the subsystem item
- if (widget != c && widget instanceof Item) {
-
- if (debug) logDebugMsg("...Found ss " + ss);
-
- item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE);
- }
- // No, we are not showing the subsystem, so widget is the control
- else if (widget == c) {
-
- if (debug) logDebugMsg("...Din not find ss " + ss);
-
- item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE);
- }
-
- if (item == null)
- logDebugMsg("......didn't find renamed/updated filter's reference!");
- else {
- // STEP 3: UPDATE THAT FILTER...
- if (type == EVENT_RENAME_FILTER_REFERENCE) {
- String[] rproperties = { IBasicPropertyConstants.P_TEXT };
- update(item.getData(), rproperties); // for refreshing non-structural properties in viewer when model changes
- } else if (type == EVENT_CHANGE_FILTER_REFERENCE) {
- //if (((TreeItem)item).getExpanded())
- //refresh(item.getData());
- smartRefresh(new TreeItem[] { (TreeItem) item });
- /*
- Object data = item.getData();
- boolean wasExpanded = getExpanded((Item)item);
- setExpandedState(data, false); // collapse node
- refresh(data); // clear all cached widgets
- if (wasExpanded)
- setExpandedState(data, true); // by doing this all subnodes that were expanded are now collapsed
- */
- }
- updatePropertySheet();
- }
- }
- }
-
- protected void findAndUpdateFilterString(ISystemResourceChangeEvent event, int type) {
- ISystemFilterString filterString = (ISystemFilterString) event.getSource();
- // STEP 1. ARE WE EVEN SHOWING THE GIVEN SUBSYSTEM?
- ISubSystem ss = (ISubSystem) event.getGrandParent();
- Widget item = findItem(ss);
- if (item != null && item != getControl()) {
- Item ssItem = (Item) item;
- if (debug) logDebugMsg("...Found ss " + ss);
- // STEP 2: ARE WE SHOWING A REFERENCE TO THE UPDATED FILTER STRING?
- item = internalFindReferencedItem(ssItem, filterString, SEARCH_INFINITE);
- if (item == null)
- logDebugMsg("......didn't find updated filter string's reference!");
- else {
- // STEP 3: UPDATE THAT FILTER STRING...
- if (type == EVENT_CHANGE_FILTERSTRING_REFERENCE) // HAD BETTER!
- {
- //if (((TreeItem)item).getExpanded())
- //refresh(item.getData());
- // boolean wasExpanded = getExpanded((Item)item);
- Object data = item.getData();
- setExpandedState(data, false); // collapse node
- refresh(data); // clear all cached widgets
- //if (wasExpanded)
- //setExpandedState(data, true); // hmm, should we?
- String properties[] = { IBasicPropertyConstants.P_TEXT };
- update(item.getData(), properties); // for refreshing non-structural properties in viewer when model changes
- updatePropertySheet();
- }
- }
- }
- }
-
- /**
- * We don't show actual filters, only filter references that are unique generated
- * for each subtree of each subsystem. Yet, each event is relative to the filter,
- * not our special filter references. Hence, all this code!!
- * <p>
- * Special case handling for updates to filters which affect the parent of the
- * filter, such that the parent's children must be re-generated:
- * 1. New filter created (ADD)
- * 2. Existing filter deleted (DELETE)
- * 3. Existing filters reordered (MOVE)
- * <p>
- * Assumption:
- * 1. event.getGrandParent() == subsystem (one event fired per affected subsystem)
- * 2. event.getSource() == filter (not the reference, the real filter)
- * 3. event.getParent() == parent of filter. One of:
- * a. filterPool reference or filter reference (nested)
- * b. filterPool for non-nested filters when showing filter pools
- * c. subsystem for non-nested filters when not showing filter pools
- * d. filter for nested filters
- * <p>
- * Our job here:
- * 1. Determine if we are even showing the given subsystem
- * 2. Find the parent to the given filter: filterPool or subsystem
- * 3. Ask that parent to refresh its children (causes re-gen of filter references)
- * 4. Select something: QUESTION: is this subsystem the origin of this action??
- * a. For ADD, select the newly created filter reference for the new filter
- * ANSWER: IF PARENT OF NEW FILTER IS WITHIN THIS SUBSYSTEM, AND WAS SELECTED PREVIOUSLY
- * b. For DELETE, select the parent of the filter?
- * ANSWER: IF DELETED FILTER IS WITHING THIS SUBSYSTEM AND WAS SELECTED PREVIOUSLY
- * c. For MOVE, select the moved filters
- * ANSWER: IF MOVED FILTERS ARE WITHIN THIS SUBSYSTEM, AND WERE SELECTED PREVIOUSLY
- */
- protected void findAndUpdateFilterParent(ISystemResourceChangeEvent event, int type) {
- ISubSystem ss = (ISubSystem) event.getGrandParent();
-
-
- boolean add = false, move = false, delete = false;
- boolean afilterstring = false;
- //if (debug)
- //{
- String eventType = null;
- switch (type) {
- case EVENT_ADD_FILTER_REFERENCE:
- add = true;
- if (debug) eventType = "EVENT_ADD_FILTER_REFERENCE";
- break;
- case EVENT_DELETE_FILTER_REFERENCE:
- delete = true;
- if (debug) eventType = "EVENT_DELETE_FILTER_REFERENCE";
- break;
- case EVENT_MOVE_FILTER_REFERENCES:
- move = true;
- if (debug) eventType = "EVENT_MOVE_FILTER_REFERENCES";
- break;
- case EVENT_ADD_FILTERSTRING_REFERENCE:
- add = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_ADD_FILTERSTRING_REFERENCE";
- break;
- case EVENT_DELETE_FILTERSTRING_REFERENCE:
- delete = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_DELETE_FILTERSTRING_REFERENCE";
- break;
- case EVENT_MOVE_FILTERSTRING_REFERENCES:
- move = true;
- afilterstring = true;
- if (debug) eventType = "EVENT_MOVE_FILTERSTRING_REFERENCES";
- break;
-
- }
- if (debug) logDebugMsg("SV event: " + eventType);
- //}
- //clearSelection();
-
- ISystemFilter filter = null;
- ISystemFilterString filterstring = null;
- if (!afilterstring)
- filter = (ISystemFilter) event.getSource(); // for multi-source move, gets first filter
- else
- filterstring = (ISystemFilterString) event.getSource();
-
- boolean multiSource = move;
- // STEP 1: ARE WE SHOWING THE SUBSYSTEM GRANDPARENT OF CURRENT REFRESH?
- Widget item = findItem(ss);
-
- if (item == null) {
- refresh();
-
- if (debug) logDebugMsg("...Did not find ss " + ss.getName());
- return;
- }
- Item ssItem = (Item) item;
- boolean wasSelected = false;
- IStructuredSelection oldSelections = (IStructuredSelection) getSelection();
-
- Object parent = event.getParent();
- if (debug) logDebugMsg("...Found ss " + ss);
-
- // STEP 2: ARE WE SHOWING A REFERENCE TO THE FILTER's PARENT POOL?
- Item parentRefItem = null;
- ISystemFilterContainer refdParent = null;
- // 3a (reference to filter pool or filter)
- if (parent instanceof ISystemFilterContainerReference) // given a reference to parent?
- {
- refdParent = ((ISystemFilterContainerReference) parent).getReferencedSystemFilterContainer();
- parentRefItem = (Item) internalFindReferencedItem(ssItem, refdParent, SEARCH_INFINITE);
- }
- // 3b and 3d. (filter pool or filter)
- else if (parent instanceof ISystemFilterContainer) {
- refdParent = (ISystemFilterContainer) parent;
- parentRefItem = (Item) internalFindReferencedItem(ssItem, refdParent, SEARCH_INFINITE);
- }
- // 3c (subsystem)
- else {
- parentRefItem = ssItem;
- }
- if (parentRefItem != null) {
- if (debug) logDebugMsg("......We are showing reference to parent");
- // STEP 3... YES, SO REFRESH PARENT... IT WILL RE-GEN THE FILTER REFERENCES FOR EACH CHILD FILTER
- // ... actually, call off the whole show if that parent is currently not expanded!!
- // HMMM... WE NEED TO REFRESH EVEN IF NOT EXPANDED IF ADDING FIRST CHILD
- if (!add) // move or delete
- {
- if (!(((TreeItem) parentRefItem).getExpanded())) {
- refresh(parentRefItem.getData()); // flush cached widgets so next expand is fresh
- return;
- }
- // move or delete and parent is expanded...
- Item oldItem = (Item) internalFindReferencedItem(parentRefItem, afilterstring ? (Object) filterstring : (Object) filter, 1);
- //if (debug)
- //logDebugMsg("oldItem null? " + (oldItem==null));
- if (oldItem != null) // found moved or deleted filter in our subtree
- {
- wasSelected = isSelected(oldItem.getData(), oldSelections); // was it selected before?
- //if (debug)
- //logDebugMsg("was selected? " + wasSelected);
- } else {
- // else interesting case ... we are showing the parent, but can't find the child!
- }
- if (move) {
- Object[] srcObjects = null;
- if (multiSource)
- srcObjects = event.getMultiSource();
- else {
- srcObjects = new Object[1];
- srcObjects[0] = event.getSource();
- }
- moveReferencedTreeItems(parentRefItem, srcObjects, event.getPosition());
- //refresh(parentRefItem.getData());
- } else // remove
- {
- remove(oldItem.getData());
- }
- } else // add operation
- {
- if (!(((TreeItem) parentRefItem).getExpanded())) {
- refresh(parentRefItem.getData()); // delete cached GUIs
- //setExpandedState(parentRefItem,true); // not our job to expand here.
- } else if (afilterstring) {
- ISystemFilterReference fr = (ISystemFilterReference) parentRefItem.getData();
- ISystemFilterStringReference fsr = fr.getSystemFilterStringReference(filterstring);
- createTreeItem(parentRefItem, fsr, event.getPosition());
- //setSelection(new StructuredSelection(fsr),true);
- } else {
- Object data = parentRefItem.getData();
- if (data instanceof ISystemFilterContainerReference) {
- ISystemFilterContainerReference sfcr = (ISystemFilterContainerReference) data;
- ISystemFilterReference sfr = sfcr.getSystemFilterReference(ss, filter);
- createTreeItem(parentRefItem, sfr, event.getPosition());
- } else // hmm, could be parent is a subsystem, child is a filter in no-show-filter-pools mode
- {
- if (data instanceof ISystemFilterPoolReferenceManagerProvider) // that's a subsystem!
- {
- ISystemFilterPoolReferenceManagerProvider sfprmp = (ISystemFilterPoolReferenceManagerProvider) data;
- ISystemFilterPoolReferenceManager sfprm = sfprmp.getSystemFilterPoolReferenceManager();
- ISystemFilterReference sfr = sfprm.getSystemFilterReference(ss, filter);
- createTreeItem(parentRefItem, sfr, sfprm.getSystemFilterReferencePosition(sfr));
- }
- }
- }
- //refresh(parentRefItem.getData());
- }
-
- // STEP 4: DECIDE WHAT TO SELECT:
-
- // 4a. ADD ... only select if parent of new filter was previously selected...
- if (add && isSelected(parentRefItem.getData(), oldSelections)) {
- if (debug) logDebugMsg(".........that parent was previously selected");
- // .... YES, SO SELECT NEW FILTER'S REFERENCE
- Item filterItem = (Item) internalFindReferencedItem(parentRefItem, afilterstring ? (Object) filterstring : (Object) filter, 1); // start at filter's parent, search for filter
- if (filterItem == null) {
- if (debug) logDebugMsg("Hmm, didn't find new filter's reference!");
- } else {
- if (debug) logDebugMsg(".........Trying to set selection to " + filterItem.getData());
- setSelection(new StructuredSelection(filterItem.getData()), true);
- }
- }
- // 4b. DELETE ... select parent if deleted filter was previously selected
- else if (delete && wasSelected) {
- setSelection(new StructuredSelection(parentRefItem.getData())); // select parent
- }
- // 4c. MOVE ... only select if any of moved references were previously selected...
- else if (move && wasSelected && !afilterstring) {
- ISystemFilter[] filters = (ISystemFilter[]) event.getMultiSource();
- if (filters != null) {
- ISystemFilterReference[] newRefs = new ISystemFilterReference[filters.length];
- for (int idx = 0; idx < newRefs.length; idx++) {
- Widget w = internalFindReferencedItem(parentRefItem, filters[idx], 1);
- newRefs[idx] = (ISystemFilterReference) ((Item) w).getData();
- }
- setSelection(new StructuredSelection(newRefs), true);
- }
- } else if (move && wasSelected && afilterstring) {
- ISystemFilterString[] filterStrings = (ISystemFilterString[]) event.getMultiSource();
- if (filterStrings != null) {
- ISystemFilterStringReference[] newRefs = new ISystemFilterStringReference[filterStrings.length];
- for (int idx = 0; idx < newRefs.length; idx++) {
- Widget w = internalFindReferencedItem(parentRefItem, filterStrings[idx], 1);
- newRefs[idx] = (ISystemFilterStringReference) ((Item) w).getData();
- }
- setSelection(new StructuredSelection(newRefs), true);
- }
- }
-
- } else if (debug) logDebugMsg("Did not find parent ref " + parent);
- }
-
- /**
- * Move existing items a given number of positions within the same node.
- * If the delta is negative, they are all moved up by the given amount. If
- * positive, they are all moved down by the given amount.<p>
- */
- protected void moveReferencedTreeItems(Widget parentItem, Object[] masterSrc, int delta) {
- int[] oldPositions = new int[masterSrc.length];
- Item[] oldItems = new Item[masterSrc.length];
- Object[] src = new Object[masterSrc.length];
-
- for (int idx = 0; idx < src.length; idx++) {
- oldItems[idx] = (Item) internalFindReferencedItem(parentItem, masterSrc[idx], 1);
- src[idx] = oldItems[idx].getData();
- }
- for (int idx = 0; idx < src.length; idx++) {
- oldPositions[idx] = getTreeItemPosition(parentItem, oldItems[idx]) + 1;
- //logDebugMsg("::: Old position : " + oldPositions[idx]);
- }
-
- if (delta > 0) // moving down, process backwards
- {
- for (int idx = src.length - 1; idx >= 0; idx--) {
- //logDebugMsg("DN: Old position : " + oldPositions[idx] + ", new position : " + (oldPositions[idx]+delta));
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta);
- }
- } else // moving up, process forewards
- {
- for (int idx = 0; idx < src.length; idx++) {
- //logDebugMsg("UP: Old position : " + oldPositions[idx] + ", new position : " + (oldPositions[idx]+delta-1));
- moveTreeItem(parentItem, oldItems[idx], src[idx], oldPositions[idx] + delta - 1);
- }
- }
- }
-
- /**
- * Recursively tries to find a reference to the given referenced item
- *
- * @param parent the parent item at which to start the search.
- * @param element the master element to which we want to find a tree item which references it
- * @param searchLimit how deep to search
- */
- protected Widget internalFindReferencedItem(Widget parent, Object element, int searchLimit) {
- previousItem = null;
- searchDepth = 0;
- return recursiveInternalFindReferencedItem(parent, element, searchLimit);
- }
-
- /**
- * Recursively tries to find a reference the given filtercontainer
- * Limits search depth to when we find an item that is not a connection,
- * subsystem, filter pool, filter or filter string.
- * @param parent the parent item at which to start the search.
- * @param element the master element to which we want to find a tree item which references it
- * @param searchLimit how deep to search
- */
- protected Widget recursiveInternalFindReferencedItem(Widget parent, Object element, int searchLimit) {
- // compare with node
- Object data = parent.getData();
- if ((data != null) && (data instanceof IRSEBaseReferencingObject)) {
- IRSEBaseReferencingObject refingData = (IRSEBaseReferencingObject) data;
- Object refedData = refingData.getReferencedObject();
- //logDebugMsg("data is a refing obj to " + refingData);
- if (refedData == element)
- //if (refedData.equals(element))
- return parent;
- else
- previousItem = parent;
- }
- // recurse over children if we are listing a subsystem or connection or
- // filter framework reference object, and nesting limit not reached.
- if (((data instanceof ISubSystem) || (data instanceof IHost) || (data instanceof ISystemFilterContainer) || (data instanceof ISystemFilterContainerReference) || (data instanceof ISystemFilterStringReference))
- && (searchDepth < searchLimit)) {
- ++searchDepth;
- int oldDepth = searchDepth;
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- Widget o = recursiveInternalFindReferencedItem(items[i], element, searchLimit);
- if (o != null) return o;
- searchDepth = oldDepth;
- }
- }
- return null;
- }
-
- /**
- * Recursively tries to find an item starting at the given item.
- * (base viewer classes do not offer a relative search!)
- *
- * @param parent the parent item at which to start the search.
- * @param element the element to match on. Matches on "==" versus equals()
- */
- protected Widget internalFindRelativeItem(Widget parent, Object element, int searchLimit) {
- searchDepth = 0;
- return recursiveInternalFindRelativeItem(parent, element, searchLimit);
- }
-
- /**
- * Recursively tries to find an item starting at the given item.
- * (base viewer classes do not offer a relative search!)
- *
- * @param parent the parent item at which to start the search.
- * @param element the element to match on. Matches on "==" versus equals()
- */
- protected Widget recursiveInternalFindRelativeItem(Widget parent, Object element, int searchLimit) {
- // compare with node
- Object data = parent.getData();
- if ((data != null) && (data == element)) return parent;
- // recurse over children
- if (searchDepth < searchLimit) {
- ++searchDepth;
- int oldDepth = searchDepth;
- Item[] items = getChildren(parent);
- for (int i = 0; i < items.length; i++) {
- Widget o = recursiveInternalFindRelativeItem(items[i], element, searchLimit);
- if (o != null) return o;
- searchDepth = oldDepth;
- }
- }
- return null;
- }
-
- protected ISystemRemoteElementAdapter getRemoteData(Item item, Object rawData) {
- if (rawData != null)
- return getRemoteAdapter(rawData);
- else
- return null;
- }
-
- /**
- * Find the first binary-match or name-match of remote object, given its absolute name.
- * @param remoteObjectName The absolute name of the remote object to find.
- * @param subsystem The subsystem of the remote object to find. Optional.
- * @param parentItem The parent item at which to start the search. Optional.
- * @return TreeItem hit if found
- */
- public Item findFirstRemoteItemReference(String remoteObjectName, ISubSystem subsystem, Item parentItem) {
- //Vector matches = new Vector();
- Item match = null;
- if (parentItem == null)
- //findAllRemoteItemReferences(remoteObjectName, null, subsystem, matches);
- match = internalFindFirstRemoteItemReference(remoteObjectName, null, subsystem);
- else {
- //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, null, subsystem, matches);
- match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, null, subsystem);
- if (debugRemote) System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2,3)");
- }
- //if (matches.size() > 0)
- // return (Item)matches.elementAt(0);
- //else
- // return null;
- return match;
- }
-
- /**
- * Find the first binary-match or name-match of a remote object, given its binary object.
- * @param remoteObject - The remote object to find.
- * @param parentItem - Optionally, the parent item to start the search at
- * @return TreeItem hit if found
- */
- public Item findFirstRemoteItemReference(Object remoteObject, Item parentItem) {
- //Vector matches = new Vector();
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(remoteObject);
- if (adapter == null) return null;
- Item match = null;
- ISubSystem subsystem = adapter.getSubSystem(remoteObject);
- String remoteObjectName = adapter.getAbsoluteName(remoteObject);
- if (parentItem == null)
- //findAllRemoteItemReferences(remoteObjectName, remoteObject, subsystem, matches);
- match = internalFindFirstRemoteItemReference(remoteObjectName, remoteObject, subsystem);
- else {
- //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, remoteObject, subsystem, matches);
- match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, remoteObject, subsystem);
- if (debugRemote) System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2)");
- }
-
- //if (matches.size() > 0)
- // return (Item)matches.elementAt(0);
- //else
- // return null;
- return match;
- }
-
- /**
- * Recursively tries to find a given remote object. Since the object memory object
- * for a remote object is not dependable we call getAbsoluteName() on the adapter to
- * do the comparisons. Note this does not take into account the parent connection or
- * subsystem or filter, hence you must know where to start the search, else you risk
- * finding the wrong one.
- *
- * @param element the remote object to which we want to find a tree item which references it. Can be a string or an object
- * @param elementObject the actual remote element to find, for binary matching, optionally for cases when element is a string
- * @param matches the vector to populate with hits
- */
- protected Vector findAllRemoteItemReferences(Object element, Object elementObject, Vector matches) {
- String searchString = null;
- ISubSystem subsystem = null;
- if (element instanceof String)
- searchString = (String) element;
- else {
- if (elementObject == null) elementObject = element;
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(element);
- if (adapter == null) return matches;
- subsystem = adapter.getSubSystem(element);
- searchString = adapter.getAbsoluteName(element);
- }
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++) {
- matches = recursiveFindAllRemoteItemReferences(roots[idx], searchString, elementObject, subsystem, matches);
- }
- return matches;
- }
-
- /**
- * Recursively tries to find all occurrences of a given remote object, starting at the tree root.
- * Since the object memory object for a remote object is not dependable we call getAbsoluteName()
- * on the adapter to do the comparisons.
- * <p>
- * This overload takes a string and a subsystem.
- *
- * @param searchString the absolute name of the remote object to which we want to find a tree item which references it.
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param matches the vector to populate with hits
- */
- protected Vector findAllRemoteItemReferences(String searchString, Object elementObject, ISubSystem subsystem, Vector matches) {
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++)
- matches = recursiveFindAllRemoteItemReferences(roots[idx], searchString, elementObject, subsystem, matches);
- return matches;
- }
-
- /**
- * Recursively tries to find the first occurrence of a given remote object, starting at the tree root.
- * Optionally scoped to a specific subsystem.
- * Since the object memory object for a remote object is not dependable we call getAbsoluteName()
- * on the adapter to do the comparisons.
- * <p>
- * This overload takes a string and a subsystem.
- *
- * @param searchString the absolute name of the remote object to which we want to find a tree item which references it.
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param matches the vector to populate with hits
- * @return TreeItem hit if found
- */
- protected Item internalFindFirstRemoteItemReference(String searchString, Object elementObject, ISubSystem subsystem) {
- Item[] roots = getTree().getItems();
- if ((roots == null) || (roots.length == 0)) return null;
- Item match = null;
- if (debugRemote) {
- System.out.println("Inside internalFindFirstRemoteItemReference for searchString: " + searchString + ", subsystem null? " + (subsystem == null) + ", nbr roots = " + roots.length);
- }
- for (int idx = 0; (match == null) && (idx < roots.length); idx++) {
- match = recursiveFindFirstRemoteItemReference(roots[idx], searchString, elementObject, subsystem);
- if (debugRemote) System.out.println("...Inside internalFindFirstRemoteItemReference. Result of searching root " + idx + ": " + roots[idx].getText() + ": " + match);
- }
- if (debugRemote) {
- System.out.println("...Inside internalFindFirstRemoteItemReference. Returning " + match);
- if (match != null) System.out.println("......set bp here");
- }
- return match;
- }
-
- /**
- * Recursively tries to find all references to a remote object.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element to find
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @param occurrences the vector to populate with hits
- */
- protected Vector recursiveFindAllRemoteItemReferences(Item parent, String elementName, Object elementObject, ISubSystem subsystem, Vector occurrences) {
- Object rawData = parent.getData();
- ISystemRemoteElementAdapter remoteAdapter = null;
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
- if (rawData != null) remoteAdapter = getRemoteAdapter(rawData);
- // -----------------------------------------------------------------------
- // if this is a remote object, test if it is the one we are looking for...
- // -----------------------------------------------------------------------
- if (remoteAdapter != null) {
- // first test for binary match
- if (elementObject == rawData) {
- occurrences.addElement(parent); // found a match!
- if (debugRemote) System.out.println("Find All: Remote item binary match found");
- return occurrences; // no point in checking the kids
- }
- // now test for absolute name match
- String fqn = remoteAdapter.getAbsoluteName(rawData);
- if (debugRemote) System.out.println("TESTING FINDALL: '" + fqn + "' vs '" + elementName + "'");
- if ((fqn != null) && fqn.equals(elementName)) {
- occurrences.addElement(parent); // found a match!
- if (debugRemote) System.out.println("...and remote item name match found");
- return occurrences; // no point in checking the kids
- }
- }
- // -------------------------------------------------------------------------
- // if we have been given a subsystem to restrict to, that is a hint to us...
- // -------------------------------------------------------------------------
- else if ((rawData != null) && (subsystem != null)) // test for hints we are in the wrong place
- {
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- if ((rawData instanceof ISubSystem) && (((ISubSystem) rawData).getSubSystemConfiguration() != subsystem.getSubSystemConfiguration())) {
- return occurrences; // they don't match, so don't bother checking the kids
- }
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- else if ((rawData instanceof IHost) && (!((IHost) rawData).getHostName().equals(subsystem.getHost().getHostName()))) {
- return occurrences; // they don't match, so don't bother checking the kids
- }
- }
- // recurse over children
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- if (!items[i].isDisposed()) occurrences = recursiveFindAllRemoteItemReferences(items[i], elementName, elementObject, subsystem, occurrences);
- }
- return occurrences;
- }
-
- /**
- * Recursively tries to find the first references to a remote object.
- * This search is restricted to the given subsystem, if given.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element to find
- * @param elementObject the actual remote element to find, for binary matching
- * @param subsystem optional subsystem to search within
- * @return TreeItem match if found, null if not found.
- */
- protected Item recursiveFindFirstRemoteItemReference(Item parent, String elementName, Object elementObject, ISubSystem subsystem) {
- Object rawData = parent.getData();
- ISystemRemoteElementAdapter remoteAdapter = null;
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
- if (rawData != null) remoteAdapter = getRemoteAdapter(rawData);
- // -----------------------------------------------------------------------
- // if this is a remote object, test if it is the one we are looking for...
- // -----------------------------------------------------------------------
- if (remoteAdapter != null) {
- // first test for binary match
- if (elementObject == rawData) {
- if (debugRemote) System.out.println("Remote item binary match found");
- return parent; // return the match
- }
- // now test for absolute name match
- String fqn = remoteAdapter.getAbsoluteName(rawData);
- if (debugRemote) System.out.println("TESTING FINDFIRST: '" + fqn + "' vs '" + elementName + "'");
- if ((fqn != null) && fqn.equals(elementName)) {
- if ((subsystem != null) && (subsystem == remoteAdapter.getSubSystem(rawData))) {
- if (debugRemote) System.out.println("Remote item name match found and subsystems matched");
- return parent; // return the match
- } else if (subsystem == null) {
- if (debugRemote) System.out.println("Remote item name match found and subsystem null");
- return parent;
- } else if (debugRemote) System.out.println("Remote item name match found but subsystem mismatch");
- }
- }
- // -------------------------------------------------------------------------
- // if we have been given a subsystem to restrict to, that is a hint to us...
- // -------------------------------------------------------------------------
- else if ((rawData != null) && (subsystem != null)) // test for hints we are in the wrong place
- {
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- if ((rawData instanceof ISubSystem) && (rawData != subsystem)) {
- return null; // they don't match, so don't bother checking the kids
- }
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- else if ((rawData instanceof IHost) && !((IHost) rawData).getHostName().equals(subsystem.getHost().getHostName())) {
- return null; // they don't match, so don't bother checking the kids
- }
- }
- // recurse over children
- Item[] items = getChildren(parent);
- Item match = null;
- for (int i = 0; (match == null) && (i < items.length); i++) {
- if (!items[i].isDisposed()) match = recursiveFindFirstRemoteItemReference(items[i], elementName, elementObject, subsystem);
- }
- return match;
- }
-
- /**
- * Recursively tries to find all filters affected by a given remote object.
- *
- * @param elementName the absolute name of the remote object to which we want to find a filters which result in it.
- * @param subsystem The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.
- * @param matches the vector to populate with hits. Can be null, in which case a new vector is created.
- *
- * @return Vector of FilterMatch objects for each affected filter
- */
- protected Vector findAllRemoteItemFilterReferences(String elementName, ISubSystem subsystem, Vector matches) {
- Tree tree = getTree();
- Item[] roots = tree.getItems();
- if (roots == null) return matches;
- if (matches == null) matches = new Vector();
- for (int idx = 0; idx < roots.length; idx++)
- matches = recursiveFindAllRemoteItemFilterReferences(roots[idx], elementName, subsystem, matches);
- return matches;
-
- }
-
- /**
- * Recursively tries to find all filters which are affected by a given remote object, such that we can subsequently refresh that filter
- * after a remote resource change.
- * @param parent the parent item at which to start the search.
- * @param elementName the absolute name of the remote element that has been created, changed, deleted or renamed.
- * @param subsystem The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.
- * @param occurrences the vector to populate with hits
- *
- * @return Vector of FilterMatch objects for each affected filter
- */
- protected Vector recursiveFindAllRemoteItemFilterReferences(Item parent, String elementName, ISubSystem subsystem, Vector occurrences) {
- Object rawData = parent.getData();
-
- // ----------------------------
- // what are we looking at here?
- // ----------------------------
-
- // ---------------------------------------------------------------------
- // if this is a filter object, test for two things:
- // #1. does this filter list this remote object if expanded/refreshed?
- // #2. does this filter list the contents of this remote object?
- // ---------------------------------------------------------------------
- if (rawData instanceof ISystemFilterReference) {
- ISystemFilterReference filterRef = (ISystemFilterReference) rawData;
- if (filterRef.getReferencedFilter().isPromptable()) return occurrences;
- if (debugRemote) System.out.println("Testing filter: " + filterRef.getReferencedFilter().getName());
- ISubSystem fss = (ISubSystem) filterRef.getProvider();
- if (fss != null) // should never happen!!
- {
- // #1
- if (fss.doesFilterMatch(filterRef.getReferencedFilter(), elementName)) {
- occurrences.addElement(new FilterMatch((TreeItem) parent, true)); // found a match!
- if (debugRemote) System.out.println("...Filter match found for " + elementName + ": " + filterRef.getReferencedFilter().getName());
- return occurrences; // no point in checking the kids
- }
- // #2
- else if (fss.doesFilterListContentsOf(filterRef.getReferencedFilter(), elementName)) {
- occurrences.addElement(new FilterMatch((TreeItem) parent, false)); // found a match!
- if (debugRemote) System.out.println("...Filter content match found for " + elementName + ": " + filterRef.getReferencedFilter().getName());
- return occurrences; // no point in checking the kids
- } else if (debugRemote) System.out.println("... no match on the filter for element name " + elementName);
- }
- }
- // ----------------------------------------------------------------------
- // if this is not a filter, then before recursing on its kids, check for
- // hints that such recursion is a waste of time, for performance reasons
- // ----------------------------------------------------------------------
- else if (rawData != null) {
- // ---------------------------------------------------------------------------------
- // if we are currently visiting a subsystem, and that subsystem is not from the same
- // factory, then we can assume the remote object occurrences we are looking for are
- // not to be found within this branch...
- // ---------------------------------------------------------------------------------
- if ((rawData instanceof ISubSystem) && (subsystem != null)) {
- ISubSystem currSS = (ISubSystem) rawData;
- if (currSS.getSubSystemConfiguration() != subsystem.getSubSystemConfiguration()) return occurrences; // they don't match, so don't bother checking the kids
- }
- // -----------------------------------------------------------------------------------------
- // if we are currently visiting a connection, and that connection's hostname is not the same
- // as that of our given subsystem, then we can assume the remote object occurrences we are
- // looking for are not to be found within this branch...
- // -----------------------------------------------------------------------------------------
- else if (rawData instanceof IHost) {
- IHost currConn = (IHost) rawData;
- if (!currConn.getHostName().equals(subsystem.getHost().getHostName())) return occurrences; // they don't match, so don't bother checking the kids
- }
- // skip the new connection prompts...
- else if (rawData instanceof ISystemPromptableObject)
- return occurrences;
- // ------------------------------------------------------------------------
- // if this is a remote object, we are too deep into this branch of the tree
- // for filters, so stop here
- // ------------------------------------------------------------------------
- else if (getRemoteAdapter(rawData) != null) return occurrences;
- }
- // recurse over children
- Item[] items = getChildren(parent);
- for (int i = 0; (i < items.length); i++) {
- occurrences = recursiveFindAllRemoteItemFilterReferences(items[i], elementName, subsystem, occurrences);
- }
- return occurrences;
- }
-
- /**
- * Inner class to ensapsulate what is put in the vector for the recursiveFindAllRemoteItemFilterReferences() method.
- */
- protected class FilterMatch {
- protected boolean filterListsElement;
- protected boolean filterListsElementContents;
- protected TreeItem match;
-
- FilterMatch(TreeItem match, boolean filterListsElement) {
- this.match = match;
- this.filterListsElement = filterListsElement;
- this.filterListsElementContents = !filterListsElement;
- }
-
- boolean listsElement() {
- return filterListsElement;
- }
-
- boolean listsElementContents() {
- return filterListsElementContents;
- }
-
- TreeItem getTreeItem() {
- return match;
- }
- }
-
- /**
- * --------------------------------------------------------------------------------
- * For many actions we have to walk the selection list and examine each selected
- * object to decide if a given common action is supported or not.
- * <p>
- * Walking this list multiple times while building the popup menu is a performance
- * hit, so we have this common method that does it only once, setting instance
- * variables for all of the decisions we are in interested in.
- * --------------------------------------------------------------------------------
- */
- protected void scanSelections(String whereFrom) {
- //System.out.println("inside scanSelections. Called from " + whereFrom);
- // here are the instance variables we set...
- // protected boolean selectionShowRefreshAction;
- // protected boolean selectionShowOpenViewActions;
- // protected boolean selectionShowDeleteAction;
- // protected boolean selectionShowRenameAction;
- // protected boolean selectionIsRemoteObject;
- // protected boolean selectionEnableDeleteAction;
- // protected boolean selectionEnableRenameAction;
-
- // initial these variables to true. Then if set to false even once, leave as false always...
- selectionShowRefreshAction = true;
- selectionShowOpenViewActions = true;
- selectionShowGenericShowInTableAction = true;
- selectionShowDeleteAction = true;
- selectionShowRenameAction = true;
- selectionEnableDeleteAction = true;
- selectionEnableRenameAction = true;
- selectionIsRemoteObject = true;
- selectionHasAncestorRelation = hasAncestorRelationSelection();
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (elements.hasNext()) {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter == null) continue;
-
- if (selectionShowRefreshAction) selectionShowRefreshAction = adapter.showRefresh(element);
-
- if (selectionShowOpenViewActions) selectionShowOpenViewActions = adapter.showOpenViewActions(element);
-
- if (selectionShowGenericShowInTableAction) selectionShowGenericShowInTableAction = adapter.showGenericShowInTableAction(element);
-
- if (selectionShowDeleteAction) selectionShowDeleteAction = adapter.showDelete(element);
-
- if (selectionShowRenameAction) selectionShowRenameAction = adapter.showRename(element);
-
- if (selectionEnableDeleteAction) selectionEnableDeleteAction = selectionShowDeleteAction && adapter.canDelete(element) && !selectionHasAncestorRelation;
- //System.out.println("ENABLE DELETE SET TO " + selectionEnableDeleteAction);
-
- if (selectionEnableRenameAction) selectionEnableRenameAction = selectionShowRenameAction && adapter.canRename(element);
-
- if (selectionIsRemoteObject) selectionIsRemoteObject = (getRemoteAdapter(element) != null);
-
- if (selectionIsRemoteObject && !selectionFlagsUpdated) {
- ISubSystem srcSubSystem = adapter.getSubSystem(element);
- if (srcSubSystem.isConnected() || element instanceof ISystemFilterReference || element instanceof ISubSystem) {
- SystemRemoteElementResourceSet set = getSetFor(srcSubSystem, adapter);
- set.addResource(element);
- }
- }
- }
- selectionFlagsUpdated = true;
- //System.out.println("Inside scan selections: selectionShowOpenViewActions = " + selectionShowOpenViewActions);
- }
-
- /**
- * Decides whether to even show the refresh menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showRefresh() {
- return selectionShowRefreshAction;
- /*
- boolean ok = true;
- IStructuredSelection selection= (IStructuredSelection)getSelection();
- Iterator elements= selection.iterator();
- int count = 0;
- while (ok && elements.hasNext())
- {
- Object element= elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (!adapter.showRefresh(element))
- ok = false;
- }
- return ok;
- */
- }
-
- /**
- * Decides whether to even show the "open in new perspective" menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showOpenViewActions() {
- return selectionShowOpenViewActions;
- }
-
- /**
- * Decides whether to even show the generic "show in table" menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showGenericShowInTableAction() {
- return selectionShowGenericShowInTableAction;
- }
-
- /**
- * Decides whether all the selected objects are remote objects or not
- * Assumes scanSelections() has already been called
- */
- protected boolean areSelectionsRemote() {
- return selectionIsRemoteObject;
- }
-
- // ---------------------------
- // ISYSTEMDELETETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemDeleteTarget.
- * Decides whether to even show the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showDelete() {
- if (!selectionFlagsUpdated) {
- //System.out.println("Inside showDelete. selectFlagsUpdated = false");
- scanSelections("showDelete");
- }
- return selectionShowDeleteAction;
- }
-
- /**
- * Required method from ISystemDeleteTarget
- * Decides whether to enable the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canDelete() {
- if (!selectionFlagsUpdated) {
- //System.out.println("Inside canDelete. selectFlagsUpdated = false");
- scanSelections("canDelete");
- }
- return selectionEnableDeleteAction;
- }
-
- /**
- * Required method from ISystemDeleteTarget
- */
- public boolean doDelete(IProgressMonitor monitor) {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- //Object multiSource[] = new Object[selectedCount];
- //int idx = 0;
- Object element = null;
- //Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- boolean ok = true;
- boolean anyOk = false;
- Vector deletedVector = new Vector();
- try {
- while (ok && elements.hasNext()) {
- element = elements.next();
- //multiSource[idx++] = element;
- adapter = getAdapter(element);
- if (getRemoteAdapter(element) != null) continue;
- ok = adapter.doDelete(getShell(), element, monitor);
- if (ok) {
- anyOk = true;
- deletedVector.addElement(element);
- }
- }
- // now we have things divided into sets
- // delete 1 set at a time
- for (int s = 0; s < _setList.size() && ok; s++) {
- SystemRemoteElementResourceSet set = (SystemRemoteElementResourceSet) _setList.get(s);
- ISubSystem srcSubSystem = set.getSubSystem();
- ISystemViewElementAdapter srcAdapter = set.getAdapter();
-
- if (srcSubSystem != null) {
- ok = srcAdapter.doDeleteBatch(getShell(), set.getResourceSet(), monitor);
- if (ok) {
- anyOk = true;
- deletedVector.addAll(set.getResourceSet());
- }
- }
- }
- } catch (SystemMessageException exc) {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- } catch (Exception exc) {
- exc.printStackTrace();
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException)) msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(element, msg));
- ok = false;
- }
- //System.out.println("in doDelete. Any ok? " + anyOk + ", selectionIsRemoteObject? " + selectionIsRemoteObject);
- if (anyOk) {
- if (selectionIsRemoteObject)
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, deletedVector, null, null, null, this);
- else {
- Object[] deleted = new Object[deletedVector.size()];
- for (int idx = 0; idx < deleted.length; idx++)
- deleted[idx] = deletedVector.elementAt(idx);
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(deleted, ISystemResourceChangeEvents.EVENT_DELETE_MANY, getSelectedParent()));
- }
- }
- return ok;
- }
-
- // ---------------------------
- // ISYSTEMRENAMETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemRenameTarget.
- * Decides whether to even show the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showRename() {
- return selectionShowRenameAction;
- }
-
- /**
- * Required method from ISystemRenameTarget
- * Decides whether to enable the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canRename() {
- if (!selectionFlagsUpdated) scanSelections("canRename");
- return selectionEnableRenameAction;
- }
-
- /**
- * Required method from ISystemRenameTarget
- */
- public boolean doRename(String[] newNames) {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- Object element = null;
- Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- ISystemRemoteElementAdapter remoteAdapter = null;
- String oldFullName = null;
- boolean ok = true;
- try {
- int nameIdx = 0;
- while (ok && elements.hasNext()) {
- element = elements.next();
- adapter = getAdapter(element);
- remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter != null) oldFullName = remoteAdapter.getAbsoluteName(element); // pre-rename
- ok = adapter.doRename(getShell(), element, newNames[nameIdx++]);
- if (ok) {
- if (remoteAdapter != null)
- {
- ISubSystem ss = adapter.getSubSystem(element);
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, ss, oldFullName, this);
- }
-
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement));
- }
- }
- } catch (SystemMessageException exc) {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- } catch (Exception exc) {
- //String msg = exc.getMessage();
- //if ((msg == null) || (exc instanceof ClassCastException))
- // msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(element, exc), //msg),
- exc);
- ok = false;
- }
- return ok;
- }
-
- protected void logDebugMsg(String msg) {
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),msg);
- msg = this.getClass().getName() + ": " + msg;
- SystemBasePlugin.logInfo(msg);
- System.out.println(msg);
- }
-
- // -----------------------------------------------------------------
- // ISystemSelectAllTarget methods to facilitate the global action...
- // -----------------------------------------------------------------
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection) {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length != 1)) // only allow for single selections
- return false;
-
- TreeItem ti = items[0];
- int count = getItemCount(ti);
- if (count == 1) // is it a dummy?
- {
- if ((getItems(ti)[0]).getData() == null) count = 0; // assume a dummy
- }
- return (count > 0);
- }
-
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection) {
- Tree tree = getTree();
- TreeItem[] currSel = tree.getSelection();
- TreeItem[] childItems = currSel[0].getItems();
- if (childItems.length == 0) return;
- tree.setSelection(childItems);
- Object[] childObjects = new Object[childItems.length];
- for (int idx = 0; idx < childObjects.length; idx++)
- childObjects[idx] = childItems[idx].getData();
- fireSelectionChanged(new SelectionChangedEvent(this, new StructuredSelection(childObjects)));
- }
-
- // --------------------------------------------
- // ISystemTree methods to facilitate our GUI...
- // --------------------------------------------
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent() {
- boolean same = true;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) return true;
- TreeItem prevParent = null;
- TreeItem currParent = null;
- for (int idx = 0; same && (idx < items.length); idx++) {
- currParent = items[idx].getParentItem();
- if ((idx > 0) && (currParent != prevParent))
- same = false;
- else {
- prevParent = currParent;
- }
- }
- return same;
- }
-
- protected boolean selectionHasAncestryRelationship() {
- if (selectionFlagsUpdated) return selectionHasAncestorRelation;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
-
- for (int idx = 0; idx < items.length; idx++) {
- TreeItem item = items[idx];
- for (int c = 0; c < items.length; c++) {
- if (item != items[c]) {
- if (isAncestorOf(item, items[c])) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- protected boolean isAncestorOf(TreeItem container, TreeItem item) {
- TreeItem[] children = container.getItems();
- for (int i = 0; i < children.length; i++) {
- TreeItem child = children[i];
- if (child == item) {
- return true;
- } else if (child.getItemCount() > 0) {
- if (isAncestorOf(child, item)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * This is called to accurately get the parent object for the current selection
- * for this viewer.
- * <p>
- * The getParent() method in the adapter is very unreliable... adapters can't be sure
- * of the context which can change via filtering and view options.
- */
- public Object getSelectedParent() {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) {
- return tree.getData();
- } else {
- TreeItem parentItem = items[0].getParentItem();
- if (parentItem != null)
- return parentItem.getData();
- else
- return tree.getData();
- }
- }
-
- /**
- * Return the TreeItem of the parent of the selected node. Or null if a root is selected.
- */
- public TreeItem getSelectedParentItem() {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items == null) || (items.length == 0)) {
- return null;
- } else {
- return items[0].getParentItem();
- }
- }
-
- /**
- * This returns the element immediately before the first selected element in this tree level.
- * Often needed for enablement decisions for move up actions.
- */
- public Object getPreviousElement() {
- Object prevElement = null;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items != null) && (items.length > 0)) {
- TreeItem item1 = items[0];
- TreeItem[] parentItems = null;
- TreeItem parentItem = item1.getParentItem();
- if (parentItem != null)
- parentItems = parentItem.getItems();
- else
- parentItems = item1.getParent().getItems();
- if (parentItems != null) {
- TreeItem prevItem = null;
- for (int idx = 0; (prevItem == null) && (idx < parentItems.length); idx++)
- if ((parentItems[idx] == item1) && (idx > 0)) prevItem = parentItems[idx - 1];
- if (prevItem != null) prevElement = prevItem.getData();
- }
- }
- return prevElement;
- }
-
- /**
- * This returns the element immediately after the last selected element in this tree level
- * Often needed for enablement decisions for move down actions.
- */
- public Object getNextElement() {
- Object nextElement = null;
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items != null) && (items.length > 0)) {
- TreeItem itemN = items[items.length - 1];
- TreeItem[] parentItems = null;
- TreeItem parentItem = itemN.getParentItem();
- if (parentItem != null)
- parentItems = parentItem.getItems();
- else
- parentItems = itemN.getParent().getItems();
- if (parentItems != null) {
- TreeItem nextItem = null;
- for (int idx = 0; (nextItem == null) && (idx < parentItems.length); idx++)
- if ((parentItems[idx] == itemN) && (idx < (parentItems.length - 1))) nextItem = parentItems[idx + 1];
- if (nextItem != null) nextElement = nextItem.getData();
- }
- }
- return nextElement;
- }
-
- /**
- * This is called to walk the tree back up to the roots and return the visible root
- * node for the first selected object.
- */
- public Object getRootParent() {
- Tree tree = getTree();
- TreeItem[] selectedItems = tree.getSelection();
- Object rootElement = null;
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- TreeItem item = selectedItems[0];
- TreeItem parentItem = item.getParentItem();
- if (parentItem == null) // item is a root element
- rootElement = item.getData();
- else
- while (rootElement == null) {
- item = parentItem;
- parentItem = item.getParentItem();
- if (parentItem == null) // item is a root element
- rootElement = item.getData();
- }
- }
- //logDebugMsg("getRootParent returned: "+rootElement);
- return rootElement;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- */
- public Object[] getElementNodes(Object element) {
- Widget w = findItem(element);
- if ((w != null) && (w instanceof TreeItem)) return getElementNodes((TreeItem) w);
- return null;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * This flavour is optimized for the case when you have the tree item directly.
- */
- public Object[] getElementNodes(TreeItem item) {
- Vector v = new Vector();
- v.addElement(item.getData());
- while (item != null) {
- item = item.getParentItem();
- if (item != null) v.addElement(item.getData());
- }
- Object[] nodes = new Object[v.size()];
- for (int idx = 0; idx < nodes.length; idx++)
- nodes[idx] = v.elementAt(idx);
- return nodes;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * This flavour returns a vector of TreeItem objects versus element objects.
- */
- public TreeItem[] getItemNodes(TreeItem item) {
- Vector v = new Vector();
- v.addElement(item);
- while (item != null) {
- item = item.getParentItem();
- if (item != null) v.addElement(item);
- }
- TreeItem[] nodes = new TreeItem[v.size()];
- for (int idx = 0; idx < nodes.length; idx++)
- nodes[idx] = (TreeItem) v.elementAt(idx);
- return nodes;
- }
-
- /**
- * Helper method to determine if a given object is currently selected.
- * Does consider if a child node of the given object is currently selected.
- */
- public boolean isSelectedOrChildSelected(Object parentElement) {
- boolean isSelected = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- Widget w = findItem(parentElement);
- if (!(w instanceof TreeItem)) return true; // assume we have been given the root, which means any selection is a child
- TreeItem item = (TreeItem) w;
- // for every selected tree item, scan upwards to the root to see if
- // it or any of its parents are the given element.
- for (int idx = 0; !isSelected && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (selectedItems[idx] == item)
- isSelected = true;
- else
- isSelected = searchToRoot((TreeItem) selectedItems[idx], item);
- }
- }
- }
- return isSelected;
- //return isSelected(element, (IStructuredSelection)getSelection());
- }
-
- /**
- * Override that takes a widget.
- */
- public boolean isTreeItemSelectedOrChildSelected(Widget w) {
- boolean isSelected = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- if (!(w instanceof TreeItem)) return true; // assume we have been given the root, which means any selection is a child
- TreeItem item = (TreeItem) w;
- // for every selected tree item, scan upwards to the root to see if
- // it or any of its parents are the given element.
- for (int idx = 0; !isSelected && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (selectedItems[idx] == item)
- isSelected = true;
- else
- isSelected = searchToRoot((TreeItem) selectedItems[idx], item);
- }
- }
- }
- return isSelected;
- //return isSelected(element, (IStructuredSelection)getSelection());
- }
-
- /**
- * Return the number of immediate children in the tree, for the given tree node
- */
- public int getChildCount(Object element) {
- if (getTree().isDisposed()) return 0;
- Widget w = findItem(element);
- if (w == null)
- return 0;
- else {
- if (w instanceof TreeItem) {
- TreeItem ti = (TreeItem) w;
- int count = getItemCount((Item) w);
- if (count == 1) // is it a dummy?
- {
- Item[] items = getItems(ti);
- if (items[0].getData() == null) count = 0; // assume a dummy
- }
- return count;
- } else
- return getItemCount((Control) w);
- }
- }
-
- /**
- * Return the tree item of the first selected object
- */
- protected TreeItem getFirstSelectedTreeItem() {
- // find the selected tree item...
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems == null) || (selectedItems.length == 0) || !(selectedItems[0] instanceof TreeItem)) return null;
- return (TreeItem) selectedItems[0];
- }
-
- /**
- * Refresh the given tree item node
- */
- protected void refreshTreeItem(TreeItem item) {
- // if we are already expanded, collapse and refresh to clear memory
- if (getExpanded(item)) {
- collapseNode(item.getData(), true);
- //setExpanded(selectedItem, false);
- //refreshItem(selectedItem, selectedItem.getData());
- }
- // ok, now time to force an expand...
- createChildren(item); // re-expand. this calls the content provider, which calls the getChildren() method in the adapter. That will call us back.
- item.setExpanded(true);
- }
-
- /**
- * Called when a property is updated and we need to inform the Property Sheet viewer.
- * There is no formal mechanism for this so we simulate a selection changed event as
- * this is the only event the property sheet listens for.
- */
- public void updatePropertySheet() {
- ISelection selection = getSelection();
- if (selection == null) return;
- // create an event
- SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection());
- // fire the event
- fireSelectionChanged(event);
- }
-
- /**
- * Called to select an object within the tree, and optionally expand it
- */
- public void select(Object element, boolean expand) {
- setSelection(new StructuredSelection(element), true); // true => reveal
- if (expand) setExpandedState(element, true);
- }
-
- /**
- * Returns the tree item of the first selected object. Used for setViewerItem in a resource
- * change event.
- */
- public Item getViewerItem() {
- TreeItem[] selectedItems = getTree().getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0))
- return selectedItems[0];
- else
- return null;
- }
-
- /**
- * Returns true if any of the selected items are currently expanded
- */
- public boolean areAnySelectedItemsExpanded() {
- boolean expanded = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- // for every selected tree item, see if it is currently expanded...
- for (int idx = 0; !expanded && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if (((TreeItem) selectedItems[idx]).getExpanded()) expanded = true;
- }
- }
- }
- return expanded;
- }
-
- /**
- * Returns true if any of the selected items are expandable but not yet expanded
- */
- public boolean areAnySelectedItemsExpandable() {
- boolean expandable = false;
- Item[] selectedItems = ((Tree) getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length > 0)) {
- // for every selected tree item, see if needs expanding...
- for (int idx = 0; !expandable && (idx < selectedItems.length); idx++) {
- if (selectedItems[idx] instanceof TreeItem) {
- if ((((TreeItem) selectedItems[idx]).getItemCount() > 0) && !((TreeItem) selectedItems[idx]).getExpanded()) expandable = true;
- }
- }
- }
- return expandable;
- }
-
- /**
- * Initialize drag and drop support for this view.
- *
- */
- protected void initDragAndDrop() {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] { PluginTransfer.getInstance(),
- /*ResourceTransfer.getInstance(),*/
- FileTransfer.getInstance(), EditorInputTransfer.getInstance() };
- addDragSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDragAdapter(this));
- addDropSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDropAdapter(this));
- }
-
- // ----------------------------------
- // Support for EXPAND TO-> ACTIONS...
- // ----------------------------------
- /**
- * Called when user selects an Expand To action to expand the selected remote object with a quick filter
- */
- public void expandTo(String filterString) {
- SystemViewPart svp = getSystemViewPart();
- if (svp == null) return;
- // find the selected tree item...
- TreeItem selectedItem = getFirstSelectedTreeItem();
- if (selectedItem == null) return;
- Object element = selectedItem.getData();
- ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter == null) return;
- // update our hashtables, keyed by object address and tree path...
- if (expandToFiltersByObject == null) expandToFiltersByObject = new Hashtable();
- if (expandToFiltersByTreePath == null) expandToFiltersByTreePath = new Hashtable();
- if (filterString != null)
- expandToFiltersByObject.put(selectedItem.getData(), filterString);
- else
- expandToFiltersByObject.remove(selectedItem.getData());
- if (filterString != null)
- expandToFiltersByTreePath.put(getItemPath(selectedItem), filterString);
- else
- expandToFiltersByTreePath.remove(getItemPath(selectedItem));
-
- // now refresh this tree item node...
- refreshTreeItem(selectedItem);
- }
-
- /**
- * Return the fully-qualified path up to the given item, expressible as a string
- */
- protected String getItemPath(TreeItem item) {
- StringBuffer idBuffer = new StringBuffer(getItemNodeID(item));
- TreeItem[] elementNodes = getItemNodes(item);
- if (elementNodes != null) {
- for (int idx = elementNodes.length - 1; idx >= 0; idx--) {
- item = elementNodes[idx];
- idBuffer.append(SystemViewPart.MEMENTO_DELIM + getItemNodeID(item));
- }
- }
- //System.out.println("MEMENTO HANDLE: " + idBuffer.toString());
- return idBuffer.toString();
- }
-
- /**
- * Return the string identifying this node in the tree
- */
- protected String getItemNodeID(TreeItem item) {
- //ISystemViewElementAdapter adapter = getAdapter(item.getData());
- //return adapter.getMementoHandle(item.getData());
- return item.getText();
- }
-
- /**
- * Callback from the input provider to test if the given node has expand-to filtering criteria
- */
- public String getExpandToFilter(Object element) {
- String filter = null;
- // for performance reasons, we first test for a binary match...
- if (expandToFiltersByObject != null) {
- filter = (String) expandToFiltersByObject.get(element);
- }
- // if binary match fails, look for tree path match...
- if ((filter == null) && (expandToFiltersByTreePath != null)) {
- Widget item = findItem(element);
- if ((item != null) && (item instanceof TreeItem)) {
- filter = (String) expandToFiltersByTreePath.get(getItemPath((TreeItem) item));
- if (filter != null) {
- if (expandToFiltersByObject == null) expandToFiltersByObject = new Hashtable();
- expandToFiltersByObject.put(element, filter); // so next time it will be faster
- }
- }
- }
- return filter;
- }
-
- /**
- * To support restoring state we need to write out to disk out current table that maps
- * tree items to their current expand-to filter. That means we need access to the table.
- */
- public Hashtable getExpandToFilterTable() {
- return expandToFiltersByTreePath;
- }
-
- /**
- * To support restoring state we need to write out to disk out current table that maps
- * tree items to their current expand-to filter. That means we need to be able to set the table.
- */
- public void setExpandToFilterTable(Hashtable ht) {
- expandToFiltersByTreePath = ht;
- }
-
- protected SystemRemoteElementResourceSet getSetFor(ISubSystem subSystem, ISystemViewElementAdapter adapter) {
- for (int i = 0; i < _setList.size(); i++) {
- SystemRemoteElementResourceSet set = (SystemRemoteElementResourceSet) _setList.get(i);
- if (set.getAdapter() == adapter && set.getSubSystem() == subSystem) {
- return set;
- }
- }
-
- // no existing set - create one
- SystemRemoteElementResourceSet newSet = new SystemRemoteElementResourceSet(subSystem, adapter);
- _setList.add(newSet);
- return newSet;
- }
-
- protected boolean usingElementMap() {
- return false;
- }
-
- public void add(Object parentElementOrTreePath, Object[] childElements) {
- Assert.isNotNull(parentElementOrTreePath);
- assertElementsNotNull(childElements);
-
- Vector matches = new Vector();
- matches = findAllRemoteItemReferences(parentElementOrTreePath, parentElementOrTreePath, matches);
-
-
-
- //Widget[] widgets = internalFindItems(parentElementOrTreePath);
- // If parent hasn't been realized yet, just ignore the add.
- if (matches.size() == 0) {
- super.add(parentElementOrTreePath, childElements);
- }
- else
- {
- for (int i = 0; i < matches.size(); i++) {
- Widget match = (Widget) matches.get(i);
- internalAdd(match, parentElementOrTreePath, childElements);
- }
- }
-
- TreeItem item = getFirstSelectedTreeItem();
- if (item != null)
- {
- if (item.getData() == parentElementOrTreePath)
- {
- updatePropertySheet();
- }
- }
-
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForConnections.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForConnections.java
deleted file mode 100644
index ed1055ee2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForConnections.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.model.IHost;
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are the children of a particular connection.
- * Used when user right clicks on a connection and selects Open In New Perspective.
- */
-public class SystemViewAPIProviderForConnections
- extends SystemAbstractAPIProvider
-{
-
-
- protected IHost connection = null;
-
- /**
- * Constructor
- * @param connection The connection object we are drilling down on.
- */
- public SystemViewAPIProviderForConnections(IHost connection)
- {
- super();
- this.connection = connection;
- }
-
- /**
- * Get the input connection object.
- */
- public IHost getConnection()
- {
- return connection;
- }
- /**
- * Reset the input connection object.
- */
- public void setConnection(IHost connection)
- {
- this.connection = connection;
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * We return all subsystems for this connection
- */
- public Object[] getSystemViewRoots()
- {
- //return sr.getSubSystems(connection);
- return getAdapter(connection).getChildren(connection); // pc42690
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return true, assuming there is at least one subsystem object
- */
- public boolean hasSystemViewRoots()
- {
- return true;
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>Not applicable for us.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- //return sr.getSubSystems(selectedConnection);
- return getAdapter(selectedConnection).getChildren(selectedConnection); // pc42690
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>Not applicable for us.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return true;
- }
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterPools.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterPools.java
deleted file mode 100644
index fa3c38cfe..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterPools.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are the children of a particular subsystem.
- * Used when user right clicks on a filter pool and selects Open In New Perspective.
- */
-public class SystemViewAPIProviderForFilterPools
- extends SystemAbstractAPIProvider
-{
-
-
- protected ISubSystem subsystem = null;
- protected ISystemFilterPool filterPool = null;
- protected ISystemFilterPoolReference filterPoolReference = null;
-
- /**
- * Constructor
- * @param filterPoolReference The filterpool reference object we are drilling down on.
- */
- public SystemViewAPIProviderForFilterPools(ISystemFilterPoolReference filterPoolReference)
- {
- super();
- setFilterPoolReference(filterPoolReference);
- }
-
- /**
- * Get the parent subsystem object.
- */
- public ISubSystem getSubSystem()
- {
- return subsystem;
- }
- /**
- * Get the input filter pool reference object.
- */
- public ISystemFilterPoolReference getSystemFilterPoolReference()
- {
- return filterPoolReference;
- }
- /**
- * Get the filter pool referenced by the input filter pool reference object.
- */
- public ISystemFilterPool getSystemFilterPool()
- {
- return filterPool;
- }
-
- /**
- * Reset the input filter pool reference object.
- */
- public void setFilterPoolReference(ISystemFilterPoolReference filterPoolReference)
- {
- this.filterPoolReference = filterPoolReference;
- this.filterPool = filterPoolReference.getReferencedFilterPool();
- this.subsystem = (ISubSystem)filterPoolReference.getProvider();
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * We return all filters for this filter pool
- */
- public Object[] getSystemViewRoots()
- {
- return filterPoolReference.getSystemFilterReferences(getSubSystem());
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return true if the referenced filter pool has any filters
- */
- public boolean hasSystemViewRoots()
- {
- return (filterPool.getSystemFilterCount() > 0);
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>Not applicable for us.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null;
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>Not applicable for us.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java
deleted file mode 100644
index 8c4924dbf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are the children of a particular subsystem.
- * Used when user right clicks on a filter string and selects Open In New Perspective.
- */
-public class SystemViewAPIProviderForFilterStrings
- extends SystemAbstractAPIProvider
-{
-
-
- protected ISubSystem subsystem = null;
- protected ISystemFilterPool filterPool = null;
- protected ISystemFilterPoolReference filterPoolReference = null;
- protected ISystemFilterReference filterReference = null;
- protected ISystemFilter filter = null;
- protected ISystemFilterString filterString = null;
- protected ISystemFilterStringReference filterStringReference = null;
-
- /**
- * Constructor
- * @param filterStringReference The filter string reference object we are drilling down on.
- */
- public SystemViewAPIProviderForFilterStrings(ISystemFilterStringReference filterStringReference)
- {
- super();
- setFilterStringReference(filterStringReference);
- }
-
- /**
- * Get the parent subsystem object.
- */
- public ISubSystem getSubSystem()
- {
- return subsystem;
- }
- /**
- * Get the parent filter pool reference object.
- */
- public ISystemFilterPoolReference getSystemFilterPoolReference()
- {
- return filterPoolReference;
- }
- /**
- * Get the parent filter pool.
- */
- public ISystemFilterPool getSystemFilterPool()
- {
- return filterPool;
- }
- /**
- * Get the parent filter reference object.
- */
- public ISystemFilterReference getSystemFilterReference()
- {
- return filterReference;
- }
- /**
- * Get the parent filter
- */
- public ISystemFilter getSystemFilter()
- {
- return filter;
- }
- /**
- * Get the input filter string reference object.
- */
- public ISystemFilterStringReference getSystemFilterStringReference()
- {
- return filterStringReference;
- }
- /**
- * Get the filter referenced by the input filter string reference object.
- */
- public ISystemFilterString getSystemFilterString()
- {
- return filterString;
- }
-
-
- /**
- * Reset the input filter string reference object.
- */
- public void setFilterStringReference(ISystemFilterStringReference filterStringReference)
- {
- this.filterStringReference = filterStringReference;
- this.filterString = filterStringReference.getReferencedFilterString();
- this.filterReference = filterStringReference.getParent();
- this.filter = filterReference.getReferencedFilter();
- this.filterPoolReference = filterReference.getParentSystemFilterReferencePool();
- this.filterPool = filterPoolReference.getReferencedFilterPool();
- this.subsystem = (ISubSystem)filterPoolReference.getProvider();
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * What we return depends on setting of Show Filter Strings.
- */
- public Object[] getSystemViewRoots()
- {
- ISubSystem ss = subsystem;
- Object element = filterStringReference;
- Object[] children = null;
- try
- {
- children = ss.resolveFilterString(filterStringReference.getString());
- if ((children == null) || (children.length==0))
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),
- ISystemMessageObject.MSGTYPE_EMPTY, element);
- }
- }
- catch (InterruptedException exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED),
- ISystemMessageObject.MSGTYPE_CANCEL, element);
- System.out.println("Canceled.");
- }
- catch (Exception exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),
- ISystemMessageObject.MSGTYPE_ERROR, element);
- System.out.println("Exception resolving filter strings: " + exc.getClass().getName() + ", " + exc.getMessage());
- exc.printStackTrace();
- } // message already issued
- return children;
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return true
- */
- public boolean hasSystemViewRoots()
- {
- return true;
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>Not applicable for us.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null;
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>Not applicable for us.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java
deleted file mode 100644
index 60148f6d1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are the children of a particular subsystem.
- * Used when user right clicks on a filter and selects Open In New Perspective.
- */
-public class SystemViewAPIProviderForFilters
- extends SystemAbstractAPIProvider
-{
-
-
- protected ISubSystem subsystem = null;
- protected ISystemFilterPool filterPool = null;
- protected ISystemFilterPoolReference filterPoolReference = null;
- protected ISystemFilterReference filterReference = null;
- protected ISystemFilter filter = null;
-
- /**
- * Constructor
- * @param filterReference The filter reference object we are drilling down on.
- */
- public SystemViewAPIProviderForFilters(ISystemFilterReference filterReference)
- {
- super();
- setFilterReference(filterReference);
- }
-
- /**
- * Get the parent subsystem object.
- */
- public ISubSystem getSubSystem()
- {
- return subsystem;
- }
- /**
- * Get the parent filter pool reference object.
- */
- public ISystemFilterPoolReference getSystemFilterPoolReference()
- {
- return filterPoolReference;
- }
- /**
- * Get the parent filter pool.
- */
- public ISystemFilterPool getSystemFilterPool()
- {
- return filterPool;
- }
- /**
- * Get the input filter reference object.
- */
- public ISystemFilterReference getSystemFilterReference()
- {
- return filterReference;
- }
- /**
- * Get the filter referenced by the input filter reference object.
- */
- public ISystemFilter getSystemFilter()
- {
- return filter;
- }
-
- /**
- * Reset the input filter reference object.
- */
- public void setFilterReference(ISystemFilterReference filterReference)
- {
- this.filterReference = filterReference;
- this.filter = filterReference.getReferencedFilter();
- this.filterPoolReference = filterReference.getParentSystemFilterReferencePool();
- this.filterPool = filterPoolReference.getReferencedFilterPool();
- this.subsystem = (ISubSystem)filterPoolReference.getProvider();
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * What we return depends on setting of Show Filter Strings.
- */
- public Object[] getSystemViewRoots()
- {
- // see getChildren() OF SystemViewFilterReferenceAdapter. TODO: RE-USE VS COPY!
- Object[] children = null;
- ISystemFilterReference fRef = filterReference;
- Object element = fRef;
- //Object[] children = fRef.getChildren(getShell());
- ISystemFilter referencedFilter = fRef.getReferencedFilter();
-
- ISubSystemConfiguration ssf = SubSystemHelpers.getParentSubSystemConfiguration(referencedFilter);
- boolean promptable = referencedFilter.isPromptable();
- //System.out.println("Promptable? " + promptable);
- if (promptable)
- {
- children = new SystemMessageObject[1];
- try {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssf.getAdapter(ISubSystemConfigurationAdapter.class);
- ISystemFilter newFilter = adapter.createFilterByPrompting(ssf, fRef, getShell());
- if (newFilter == null)
- {
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED),
- ISystemMessageObject.MSGTYPE_CANCEL,element);
- }
- else // filter successfully created!
- {
- // return "filter created successfully" message object for this node
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FILTERCREATED),
- ISystemMessageObject.MSGTYPE_OBJECTCREATED,element);
- // select the new filter reference...
- ISubSystem ss = fRef.getSubSystem();
- ISystemFilterReference sfr = fRef.getParentSystemFilterReferencePool().getExistingSystemFilterReference(ss, newFilter);
- ISystemViewInputProvider inputProvider = this;
- if ((sfr != null) && (inputProvider != null) && (inputProvider.getViewer()!=null))
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(sfr, ISystemResourceChangeEvents.EVENT_SELECT_EXPAND, null);
- Viewer v = inputProvider.getViewer();
- if (v instanceof ISystemResourceChangeListener)
- {
- //sr.fireEvent((ISystemResourceChangeListener)v, event); // only expand in the current viewer, not all viewers!
- sr.postEvent((ISystemResourceChangeListener)v, event); // only expand in the current viewer, not all viewers!
- }
- }
- }
- } catch (Exception exc) {
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),
- ISystemMessageObject.MSGTYPE_ERROR, element);
- SystemBasePlugin.logError("Exception prompting for filter ",exc);
- }
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"returning children");
- return children;
- }
- ISubSystem ss = fRef.getSubSystem();
- Object[] nestedFilterReferences = fRef.getSystemFilterReferences(ss);
- int nbrFilterStrings = referencedFilter.getFilterStringCount();
- if (nbrFilterStrings == 0)
- return nestedFilterReferences;
- else
- {
-
- {
- String[] filterStrings = referencedFilter.getFilterStrings();
- try
- {
- Object[] allChildren = ss.resolveFilterStrings(filterStrings);
- int nbrNestedFilters = (nestedFilterReferences==null) ? 0: nestedFilterReferences.length;
- children = new Object[nbrNestedFilters + allChildren.length];
- int idx = 0;
- for (idx=0; idx<nbrNestedFilters; idx++)
- children[idx] = nestedFilterReferences[idx];
- for (int jdx=0; jdx<allChildren.length; jdx++)
- children[idx++] = allChildren[jdx];
- }
- catch (InterruptedException exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED),
- ISystemMessageObject.MSGTYPE_CANCEL,element);
- SystemBasePlugin.logDebugMessage(this.getClass().getName(),"Filter resolving canceled by user.");
- }
- catch (Exception exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),
- ISystemMessageObject.MSGTYPE_ERROR, element);
- SystemBasePlugin.logError("Exception resolving filters' strings ",exc);
- } // message already issued
-
- if ((children == null) || (children.length==0))
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),
- ISystemMessageObject.MSGTYPE_EMPTY, element);
- }
- return children;
- }
- }
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return true if the referenced filter has nested filters or has filter strings.
- */
- public boolean hasSystemViewRoots()
- {
- int nbrNestedFilters = filter.getSystemFilterCount();
- int nbrFilterStrings = filter.getFilterStringCount();
- return (nbrNestedFilters > 0) || (nbrFilterStrings > 0);
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>Not applicable for us.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null;
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>Not applicable for us.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForSubSystems.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForSubSystems.java
deleted file mode 100644
index a3c7dcb41..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForSubSystems.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-
-
-/**
- * This class is a provider of root nodes to the remote systems tree viewer part.
- * It is used when the contents are the children of a particular subsystem.
- * Used when user right clicks on a subsystem and selects Open In New Perspective.
- */
-public class SystemViewAPIProviderForSubSystems
- extends SystemAbstractAPIProvider
-{
-
-
- protected ISubSystem subsystem = null;
-
- /**
- * Constructor
- * @param subsystem The subsystem object we are drilling down on.
- */
- public SystemViewAPIProviderForSubSystems(ISubSystem subsystem)
- {
- super();
- setSubSystem(subsystem);
- }
-
- /**
- * Get the input subsystem object.
- */
- public ISubSystem getSubSystem()
- {
- return subsystem;
- }
- /**
- * Reset the input subsystem object.
- */
- public void setSubSystem(ISubSystem subsystem)
- {
- this.subsystem = subsystem;
- }
-
- // ----------------------------------
- // SYSTEMVIEWINPUTPROVIDER METHODS...
- // ----------------------------------
- /**
- * Return the children objects to consistute the root elements in the system view tree.
- * We return all filter pools for this subsystem
- */
- public Object[] getSystemViewRoots()
- {
- return subsystem.getChildren();
- }
- /**
- * Return true if {@link #getSystemViewRoots()} will return a non-empty list
- * We return subsystem.hasChildren()
- */
- public boolean hasSystemViewRoots()
- {
- return subsystem.hasChildren();
- }
- /**
- * This method is called by the connection adapter when the user expands
- * a connection. This method must return the child objects to show for that
- * connection.
- * <p>Not applicable for us.
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null;
- }
- /**
- * This method is called by the connection adapter when deciding to show a plus-sign
- * or not beside a connection. Return true if this connection has children to be shown.
- * <p>Not applicable for us.
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-
- /**
- * Return true to show right-click popup actions on objects in the tree.
- * We return true.
- */
- public boolean showActions()
- {
- return true;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAdapterFactory.java
deleted file mode 100644
index 55d2cff6c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAdapterFactory.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.internal.model.SystemNewConnectionPromptObject;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.ui.view.team.SystemTeamViewCategoryAdapter;
-import org.eclipse.rse.ui.view.team.SystemTeamViewCategoryNode;
-import org.eclipse.rse.ui.view.team.SystemTeamViewProfileAdapter;
-import org.eclipse.rse.ui.view.team.SystemTeamViewSubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.view.team.SystemTeamViewSubSystemConfigurationNode;
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * This factory maps requests for an adapter object from a given
- * element object.
- */
-public class SystemViewAdapterFactory implements IAdapterFactory {
-
- private SystemViewRootInputAdapter rootAdapter = new SystemViewRootInputAdapter();
- private SystemViewConnectionAdapter connectionAdapter = new SystemViewConnectionAdapter();
- private SystemViewSubSystemAdapter subsystemAdapter = new SystemViewSubSystemAdapter();
- private SystemViewFilterPoolAdapter filterPoolAdapter = new SystemViewFilterPoolAdapter();
- private SystemViewFilterAdapter filterAdapter = new SystemViewFilterAdapter();
- private SystemViewFilterPoolReferenceAdapter filterPoolReferenceAdapter = new SystemViewFilterPoolReferenceAdapter();
- private SystemViewFilterReferenceAdapter filterReferenceAdapter = new SystemViewFilterReferenceAdapter();
- private SystemViewMessageAdapter msgAdapter = new SystemViewMessageAdapter();
- private SystemViewPromptableAdapter promptAdapter = new SystemViewPromptableAdapter();
- private SystemViewNewConnectionPromptAdapter newConnPromptAdapter = new SystemViewNewConnectionPromptAdapter();
- private SystemTeamViewProfileAdapter profileAdapter = new SystemTeamViewProfileAdapter();
- private SystemTeamViewCategoryAdapter categoryAdapter;
- private SystemTeamViewSubSystemConfigurationAdapter subsysFactoryAdapter;
-
- private SystemViewFilterStringAdapter filterStringAdapter = new SystemViewFilterStringAdapter();
-
- /**
- * @see IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] { ISystemViewElementAdapter.class, ISystemDragDropAdapter.class, IPropertySource.class, IWorkbenchAdapter.class, IActionFilter.class, IDeferredWorkbenchAdapter.class };
- }
-
- /**
- * Called by our plugin's startup method to register our adaptable object types
- * with the platform. We prefer to do it here to isolate/encapsulate all factory
- * logic in this one place.
- * @param manager the adapter manager controlling this factory
- */
- public void registerWithManager(IAdapterManager manager) {
- manager.registerAdapters(this, ISystemViewInputProvider.class);
- manager.registerAdapters(this, ISystemProfile.class);
- manager.registerAdapters(this, IHost.class);
- manager.registerAdapters(this, ISubSystem.class);
- manager.registerAdapters(this, ISystemFilter.class);
- manager.registerAdapters(this, ISystemFilterPool.class);
- manager.registerAdapters(this, ISystemFilterPoolReference.class);
- manager.registerAdapters(this, ISystemFilterReference.class);
- manager.registerAdapters(this, ISystemFilterString.class);
- manager.registerAdapters(this, ISystemMessageObject.class);
- manager.registerAdapters(this, ISystemPromptableObject.class);
- manager.registerAdapters(this, SystemTeamViewCategoryNode.class);
- manager.registerAdapters(this, SystemTeamViewSubSystemConfigurationNode.class);
-
- // FIXME - UDAs no longer in core
- //manager.registerAdapters(this, SystemTeamViewCompileTypeNode.class);
- //manager.registerAdapters(this, SystemTeamViewCompileCommandNode.class);
- //manager.registerAdapters(this, SystemUDActionElement.class);
- }
-
- /**
- * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- Object adapter = null;
- if (adaptableObject instanceof ISystemViewElementAdapter)
- adapter = adaptableObject;
- else if (adaptableObject instanceof ISystemDragDropAdapter)
- adapter = adaptableObject;
- else if (adaptableObject instanceof ISystemViewInputProvider)
- adapter = rootAdapter;
- else if (adaptableObject instanceof ISystemProfile)
- adapter = profileAdapter;
- else if (adaptableObject instanceof IHost)
- adapter = connectionAdapter;
- else if (adaptableObject instanceof ISubSystem)
- adapter = subsystemAdapter;
- else if (adaptableObject instanceof ISystemFilterPoolReference)
- adapter = filterPoolReferenceAdapter;
- else if (adaptableObject instanceof ISystemFilterPool)
- adapter = filterPoolAdapter;
- else if (adaptableObject instanceof ISystemFilterReference)
- adapter = filterReferenceAdapter;
- else if (adaptableObject instanceof ISystemFilterString)
- adapter = filterStringAdapter;
- else if (adaptableObject instanceof ISystemFilter)
- adapter = filterAdapter;
- else if (adaptableObject instanceof ISystemMessageObject)
- adapter = msgAdapter;
- else if (adaptableObject instanceof ISystemPromptableObject) {
-
- if (adaptableObject instanceof SystemNewConnectionPromptObject) {
- adapter = newConnPromptAdapter;
- } else {
- adapter = promptAdapter;
- }
- } else if (adaptableObject instanceof SystemTeamViewCategoryNode)
- adapter = getCategoryAdapter();
- else if (adaptableObject instanceof SystemTeamViewSubSystemConfigurationNode) adapter = getSubSystemConfigurationAdapter();
-
- /** FIXME - UDAs no longer in core
- else if (adaptableObject instanceof SystemTeamViewCompileTypeNode)
- adapter = getCompileTypeAdapter();
- else if (adaptableObject instanceof SystemTeamViewCompileCommandNode)
- adapter = getCompileCommandAdapter();
- else if (adaptableObject instanceof SystemUDActionElement)
- adapter = getUserActionAdapter();
- */
-
- if ((adapter != null) && (adapterType == IPropertySource.class)) {
- ((ISystemViewElementAdapter) adapter).setPropertySourceInput(adaptableObject);
- } else if (adapter == null) {
- SystemBasePlugin.logWarning("No adapter found for object of type: " + adaptableObject.getClass().getName());
- }
- return adapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for root inputs to the RSE
- * @return SystemViewRootInputAdapter
- */
- public SystemViewRootInputAdapter getRootInputAdapter() {
- return rootAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for connection objects
- * @return SystemViewConnectionAdapter
- */
- public SystemViewConnectionAdapter getConnectionAdapter() {
- return connectionAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for profile objects
- * @return SystemViewProfileAdapter
- */
- public SystemTeamViewProfileAdapter getProfileAdapter() {
- return profileAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for filters
- * @return SystemViewFilterAdapter
- */
- public SystemViewFilterAdapter getFilterAdapter() {
- return filterAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for filter pools
- * @return SystemViewFilterPoolAdapter
- */
- public SystemViewFilterPoolAdapter getFilterPoolAdapter() {
- return filterPoolAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for filter pool references, which
- * are what we actually see in the RSE.
- * @return SystemViewFilterPoolReferenceAdapter
- */
- public SystemViewFilterPoolReferenceAdapter getFilterPoolReferenceAdapter() {
- return filterPoolReferenceAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for filter references, which are
- * what we actually see in the RSE
- * @return SystemViewFilterReferenceAdapter
- */
- public SystemViewFilterReferenceAdapter getFilterReferenceAdapter() {
- return filterReferenceAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for messages shown in the RSE as child objects
- * @return SystemViewMessageAdapter
- */
- public SystemViewMessageAdapter getMsgAdapter() {
- return msgAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for promptable objects the run an action when expanded
- * @return SystemViewPromptableAdapter
- */
- public SystemViewPromptableAdapter getPromptAdapter() {
- return promptAdapter;
- }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for subsystems
- * @return SystemViewSubSystemAdapter
- */
- public SystemViewSubSystemAdapter getSubSystemAdapter() {
- return subsystemAdapter;
- }
-
- /**
- * @return adapter for category nodes in team view
- */
- public SystemTeamViewCategoryAdapter getCategoryAdapter() {
- if (categoryAdapter == null) categoryAdapter = new SystemTeamViewCategoryAdapter();
- return categoryAdapter;
- }
-
- /**
- * @return adapter for subsystem factory nodes in team view
- */
- public SystemTeamViewSubSystemConfigurationAdapter getSubSystemConfigurationAdapter() {
- if (subsysFactoryAdapter == null) subsysFactoryAdapter = new SystemTeamViewSubSystemConfigurationAdapter();
- return subsysFactoryAdapter;
- }
-
- // FIXME user actions and compile commands no longer coupled with core
- // /**
- // * Return adapter for user actions nodes in team view
- // */
- // public SystemTeamViewUserActionAdapter getUserActionAdapter()
- // {
- // if (userActionAdapter == null)
- // userActionAdapter = new SystemTeamViewUserActionAdapter();
- // return userActionAdapter;
- // }
- //
- // /**
- // * Return adapter for compile type nodes in team view
- // */
- // public SystemTeamViewCompileTypeAdapter getCompileTypeAdapter()
- // {
- // if (compileTypeAdapter == null)
- // compileTypeAdapter = new SystemTeamViewCompileTypeAdapter();
- // return compileTypeAdapter;
- // }
- // /**
- // * Return adapter for compile command nodes in team view
- // */
- // public SystemTeamViewCompileCommandAdapter getCompileCommandAdapter()
- // {
- // if (compileCmdAdapter == null)
- // compileCmdAdapter = new SystemTeamViewCompileCommandAdapter();
- // return compileCmdAdapter;
- // }
-
- /**
- * Because we use singletons for our adapters, it is possible to speed up
- * access to them by simply returning them from here.
- * <p>
- * This method returns the RSE adapter for filter strings
- * @return SystemViewFilterStringAdapter
- */
- public SystemViewFilterStringAdapter getFilterStringAdapter() {
- return filterStringAdapter;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewCompositeActionGroup.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewCompositeActionGroup.java
deleted file mode 100644
index 2ae276ac0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewCompositeActionGroup.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-
-public class SystemViewCompositeActionGroup extends ActionGroup {
-
-
-
- private ActionGroup[] fGroups;
-
- public SystemViewCompositeActionGroup() {
- }
-
- public SystemViewCompositeActionGroup(ActionGroup[] groups) {
- setGroups(groups);
- }
-
- protected void setGroups(ActionGroup[] groups) {
- Assert.isTrue(fGroups == null);
- Assert.isNotNull(groups);
- fGroups= groups;
- }
-
- public ActionGroup get(int index) {
- if (fGroups == null)
- return null;
- return fGroups[index];
- }
-
- public void addGroup(ActionGroup group) {
- if (fGroups == null) {
- fGroups= new ActionGroup[] { group };
- } else {
- ActionGroup[] newGroups= new ActionGroup[fGroups.length + 1];
- System.arraycopy(fGroups, 0, newGroups, 0, fGroups.length);
- newGroups[fGroups.length]= group;
- fGroups= newGroups;
- }
- }
-
- public void dispose() {
- super.dispose();
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].dispose();
- }
- }
-
- public void fillActionBars(IActionBars actionBars) {
- super.fillActionBars(actionBars);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].fillActionBars(actionBars);
- }
- }
-
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].fillContextMenu(menu);
- }
- }
-
- public void setContext(ActionContext context) {
- super.setContext(context);
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].setContext(context);
- }
- }
-
- public void updateActionBars() {
- super.updateActionBars();
- if (fGroups == null)
- return;
- for (int i= 0; i < fGroups.length; i++) {
- fGroups[i].updateActionBars();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionAdapter.java
deleted file mode 100644
index 28746bd3d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionAdapter.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.ISystemUserIdConstants;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRegistryUI;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSESystemTypeAdapter;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemClearAllPasswordsAction;
-import org.eclipse.rse.ui.actions.SystemConnectAllSubSystemsAction;
-import org.eclipse.rse.ui.actions.SystemCopyConnectionAction;
-import org.eclipse.rse.ui.actions.SystemDisconnectAllSubSystemsAction;
-import org.eclipse.rse.ui.actions.SystemMoveConnectionAction;
-import org.eclipse.rse.ui.actions.SystemMoveDownConnectionAction;
-import org.eclipse.rse.ui.actions.SystemMoveUpConnectionAction;
-import org.eclipse.rse.ui.actions.SystemNewConnectionFromExistingConnectionAction;
-import org.eclipse.rse.ui.actions.SystemWorkOfflineAction;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorSpecialChar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-
-/**
- * Adapter for displaying SystemConnection objects in tree views.
- */
-public class SystemViewConnectionAdapter
- extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter, ISystemUserIdConstants
-{
- private SystemNewConnectionFromExistingConnectionAction anotherConnectionAction = null;
- //private SystemUpdateConnectionAction updateAction = null;
- private SystemMoveUpConnectionAction upAction = null;
- private SystemMoveDownConnectionAction downAction = null;
- private SystemDisconnectAllSubSystemsAction disconnectAction = null;
- private SystemConnectAllSubSystemsAction connectAction = null;
- private SystemClearAllPasswordsAction clearPasswordAction = null;
- private SystemCopyConnectionAction copyAction = null;
- private SystemMoveConnectionAction moveAction = null;
-
- // yantzi: artemis 6.0, add work offline support
- private SystemWorkOfflineAction offlineAction = null;
-
- private SystemInheritablePropertyData userIdData = new SystemInheritablePropertyData();
- private String translatedType = null;
- private String translatedHostname = null;
- private String translatedDescription = null;
- // for reset property support
- private String original_hostName, original_description;
- private SystemInheritablePropertyData original_userIdData = new SystemInheritablePropertyData();
- private boolean changed_hostName, changed_description, changed_userId;
- private boolean actionsCreated = false;
-
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (!actionsCreated)
- createActions();
- //updateAction.setValue(null); // reset
- menu.add(menuGroup, anotherConnectionAction);
- menu.add(menuGroup, copyAction);
- menu.add(menuGroup, moveAction);
- menu.add(menuGroup, upAction);
- menu.add(menuGroup, downAction);
-
- // MJB: RE defect 40854
- addConnectOrDisconnectAction(menu, menuGroup, selection);
-
- menu.add(menuGroup, clearPasswordAction);
-
- IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType((((IHost)selection.getFirstElement()).getSystemType()));
- RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
-
- // yantzi: artemis 6.0, offline support, only add work offline action for system types that support offline mode
- if (sysTypeAdapter.isEnableOffline(sysType))
- {
- menu.add(menuGroup, offlineAction);
- }
- }
-
- private void addConnectOrDisconnectAction(SystemMenuManager menu, String menuGroup, IStructuredSelection selection)
- {
- IHost sysCon = (IHost) selection.getFirstElement();
- ISystemRegistry sysReg = RSEUIPlugin.getTheSystemRegistry();
- boolean anySupportsConnect = sysReg.isAnySubSystemSupportsConnect(sysCon);
-
- if (anySupportsConnect) {
- boolean anyConnected = sysReg.isAnySubSystemConnected(sysCon);
- boolean allConnected = sysReg.areAllSubSystemsConnected(sysCon);
- if (!allConnected) menu.add(menuGroup, connectAction);
- if (anyConnected) menu.add(menuGroup, disconnectAction);
- }
- }
-
- private void createActions()
- {
- anotherConnectionAction = new SystemNewConnectionFromExistingConnectionAction(null);
- //updateAction = new SystemUpdateConnectionAction(null);
- upAction = new SystemMoveUpConnectionAction(null);
- downAction = new SystemMoveDownConnectionAction(null);
- disconnectAction = new SystemDisconnectAllSubSystemsAction(null);
- copyAction = new SystemCopyConnectionAction(null);
- moveAction = new SystemMoveConnectionAction(null);
- offlineAction = new SystemWorkOfflineAction(null);
- connectAction = new SystemConnectAllSubSystemsAction(null);
- clearPasswordAction = new SystemClearAllPasswordsAction(null);
-
- actionsCreated = true;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element) {
- IHost connection = (IHost)element;
- String systemTypeName = connection.getSystemType();
- boolean anyConnected = RSEUIPlugin.getTheSystemRegistry().isAnySubSystemConnected(connection);
- ImageDescriptor descriptor = null;
- IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeName);
- if (systemType != null) {
- RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
- if (anyConnected) {
- descriptor = sysTypeAdapter.getLiveImageDescriptor(systemType);
- } else {
- descriptor = sysTypeAdapter.getImageDescriptor(systemType);
- }
- } else {
- descriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- return descriptor;
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- IHost conn = (IHost)element;
- boolean qualifyNames = RSEUIPlugin.getTheSystemRegistry().getQualifiedHostNames();
- if (!qualifyNames)
- return conn.getAliasName();
- else
- return conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$
- }
-
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- IHost conn = (IHost)element;
- return conn.getAliasName();
- }
-
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- IHost conn = (IHost)element;
- return conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$
- }
-
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- if (translatedType == null)
- translatedType = SystemViewResources.RESID_PROPERTY_CONNECTION_TYPE_VALUE;
- return translatedType;
- }
-
- /**
- * Return the string to display in the status line when the given object is selected.
- * We return:
- * Connection: name - Host name: hostName - Description: description
- */
- public String getStatusLineText(Object element)
- {
- IHost conn = (IHost)element;
- if (translatedHostname == null)
- translatedHostname = SystemViewResources.RESID_PROPERTY_HOSTNAME_LABEL;
- if (translatedDescription == null)
- translatedDescription = SystemViewResources.RESID_PROPERTY_CONNDESCRIPTION_LABEL;
- String statusText =
- getType(element) + ": " + conn.getAliasName() + " - " +
- translatedHostname + ": " + conn.getHostName();
- String text = conn.getDescription();
- if ((text==null) || (text.length()==0))
- return statusText;
- else
- return statusText + " - " + translatedDescription + ": " + text;
- }
-
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element)
- {
- return RSEUIPlugin.getTheSystemRegistry();
- }
-
- /**
- * Return the children of this object
- */
- public Object[] getChildren(Object element)
- {
- IHost conn = (IHost)element;
- ISystemViewInputProvider input = getInput();
- if (input != null)
- {
- Object[] children = input.getConnectionChildren(conn);
- if (children != null)
- {
- Vector v = new Vector();
- boolean someSkipped = false;
- for (int idx=0; idx<children.length; idx++)
- {
- if ((children[idx] instanceof ISubSystem) &&
- ((ISubSystem)children[idx]).isHidden() )
- someSkipped = true;
- else
- v.addElement(children[idx]);
- }
- if (someSkipped)
- {
- children = new Object[v.size()];
- for (int idx=0; idx<children.length; idx++)
- children[idx] = v.elementAt(idx);
- }
- }
- return children;
- }
- else
- {
- System.out.println("SystemViewConnection.getChildren(): adapter has no input!");
- return null;
- }
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element)
- {
- IHost conn = (IHost)element;
- return getInput().hasConnectionChildren(conn);
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
-
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[6];
- int idx = -1;
-
- // add our unique property descriptors...
- //idx = defaultProperties.length;
- //RSEUIPlugin plugin = RSEUIPlugin.getDefault();
-
- // profile
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_PROFILE, SystemViewResources.RESID_PROPERTY_PROFILE_LABEL, SystemViewResources.RESID_PROPERTY_PROFILE_TOOLTIP);
-
- // system type
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_SYSTEMTYPE,SystemViewResources.RESID_PROPERTY_SYSTEMTYPE_LABEL, SystemViewResources.RESID_PROPERTY_SYSTEMTYPE_TOOLTIP);
-
- // status
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_IS_CONNECTED,SystemViewResources.RESID_PROPERTY_CONNECTIONSTATUS_LABEL, SystemViewResources.RESID_PROPERTY_CONNECTIONSTATUS_TOOLTIP);
-
- // hostname
- if (translatedHostname == null)
- translatedHostname = SystemViewResources.RESID_PROPERTY_HOSTNAME_LABEL;
- propertyDescriptorArray[++idx] = new TextPropertyDescriptor(ISystemPropertyConstants.P_HOSTNAME, translatedHostname);
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_HOSTNAME_TOOLTIP);
-
- // default user id
- //propertyDescriptorArray[++idx] = new TextPropertyDescriptor(ISystemPropertyConstants.P_DEFAULTUSERID,
- // SystemViewResources.RESID_PROPERTY_DEFAULTUSERID_LABEL));
- SystemInheritableTextPropertyDescriptor userIdDescriptor =
- new SystemInheritableTextPropertyDescriptor(ISystemPropertyConstants.P_DEFAULTUSERID,
- SystemViewResources.RESID_PROPERTY_DEFAULTUSERID_LABEL);
- //RSEUIPlugin sp = RSEUIPlugin.getDefault();
- userIdDescriptor.setToggleButtonToolTipText(SystemResources.RESID_CONNECTION_DEFAULTUSERID_INHERITBUTTON_TIP);
- userIdDescriptor.setEntryFieldToolTipText(SystemResources.RESID_CONNECTION_DEFAULTUSERID_TIP);
- ICellEditorValidator userIdValidator =
- new ValidatorSpecialChar("=;",false, //$NON-NLS-1$
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_NOTVALID),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY)); // false => allow empty? No.
- userIdDescriptor.setValidator(userIdValidator);
- propertyDescriptorArray[++idx] = userIdDescriptor;
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_DEFAULTUSERID_TOOLTIP);
-
- // description
- if (translatedDescription == null)
- translatedDescription = SystemViewResources.RESID_PROPERTY_CONNDESCRIPTION_LABEL;
- propertyDescriptorArray[++idx] = new TextPropertyDescriptor(ISystemPropertyConstants.P_DESCRIPTION, translatedDescription);
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_CONNDESCRIPTION_TOOLTIP);
-
- }
- return propertyDescriptorArray;
- }
-
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param key the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- IHost conn = (IHost)propertySourceInput;
-
- if (name.equals(P_SYSTEMTYPE))
- return conn.getSystemType();
- else if (name.equals(P_HOSTNAME))
- return conn.getHostName();
- else if (name.equals(P_DEFAULTUSERID))
- {
- setDefaultUserIdPropertyData(userIdData, conn);
- //System.out.println("Testing getPropertyValue: " + userIdData);
- return userIdData;
- }
- else if (name.equals(P_DESCRIPTION))
- return conn.getDescription();
- else if (name.equals(P_PROFILE))
- return conn.getSystemProfile().getName();
- else if (name.equals(P_IS_CONNECTED))
- {
- if (conn.isOffline())
- {
- return SystemResources.RESID_OFFLINE_LABEL;
- }
- else
- {
- boolean anyConnected = RSEUIPlugin.getTheSystemRegistry().isAnySubSystemConnected(conn);
- if (anyConnected)
- return SystemViewResources.RESID_PROPERTY_CONNECTIONSTATUS_CONNECTED_VALUE;
- else
- return SystemViewResources.RESID_PROPERTY_CONNECTIONSTATUS_DISCONNECTED_VALUE;
- }
- }
- else
- return null;
- }
-
- /**
- * Set the values in the userIdPropertyData object that drives the userId property sheet widget
- */
- private SystemInheritablePropertyData setDefaultUserIdPropertyData(SystemInheritablePropertyData data, IHost conn)
- {
- String localUserId = conn.getLocalDefaultUserId();
- data.setLocalValue(localUserId);
- String parentUserId = SystemPreferencesManager.getPreferencesManager().getDefaultUserId(conn.getSystemType());
- data.setInheritedValue(parentUserId);
- data.setIsLocal((localUserId!=null)&&(localUserId.length()>0));
- //data.printDetails();
- return data;
- }
-
- // because this node has some editable properties, these overrides of our
- // parent class are needed as callbacks from the PropertySheet window.
- /**
- * Set input object for property source queries. This is called by the
- * SystemViewAdaptorFactory before returning this adapter object.
- */
- public void setPropertySourceInput(Object propertySourceInput)
- {
- if (this.propertySourceInput == propertySourceInput) // no change?
- return; // don't mistakenly update history values else reset from property sheet doesn't work correctly.
- super.setPropertySourceInput(propertySourceInput);
- IHost conn = (IHost)propertySourceInput;
- original_userIdData = setDefaultUserIdPropertyData(original_userIdData,conn);
- original_hostName = conn.getHostName();
- original_description = conn.getDescription();
- changed_userId = changed_hostName = changed_description = false;
- //System.out.println("Inside setPropertySourceInput in adapter");
- }
- /**
- * Returns whether the property value has changed from the default.
- * Only applicable for editable properties.
- * Called by PropertySheet viewer when user presses reset.
- * @return <code>true</code> if the value of the specified property has changed
- * from its original default value; <code>false</code> otherwise.
- */
- public boolean isPropertySet(Object propertyObject)
- {
- String property = (String)propertyObject;
- boolean changed = false;
- if (property.equals(P_DEFAULTUSERID))
- changed = changed_userId;
- else if (property.equals(P_HOSTNAME))
- changed = changed_hostName;
- else if (property.equals(P_DESCRIPTION))
- changed = changed_description;
- return changed;
- }
-
- /**
- * Called when user selects the reset button in property sheet.
- */
- public void resetPropertyValue(Object propertyObject)
- {
- //System.out.println("Inside resetPropertyValue in adapter");
- String property = (String)propertyObject;
- IHost conn = (IHost)propertySourceInput;
- ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
-
- if (property.equals(P_DEFAULTUSERID))
- {
- //sr.updateConnection(null, conn, conn.getSystemType(), conn.getAliasName(),
- // conn.getHostName(), conn.getDescription(), original_userId, USERID_LOCATION_CONNECTION);
- updateDefaultUserId(conn, original_userIdData);
- }
- else if (property.equals(P_HOSTNAME))
- {
- sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
- original_hostName, conn.getDescription(), conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
- }
- else if (property.equals(P_DESCRIPTION))
- {
- sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
- conn.getHostName(), original_description, conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
- }
- }
- /**
- * Change the default user Id value
- */
- private void updateDefaultUserId(IHost conn, SystemInheritablePropertyData data)
- {
- int whereToUpdate = USERID_LOCATION_CONNECTION;
- //if (!data.getIsLocal())
- //whereToUpdate = USERID_LOCATION_DEFAULT_SYSTEMTYPE;
- String userId = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override
- ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
- conn.getHostName(), conn.getDescription(), userId, whereToUpdate);
- }
-
- /**
- * Called when user changes property via property sheet.
- */
- public void setPropertyValue(Object property, Object value)
- {
- String name = (String)property;
- IHost conn = (IHost)propertySourceInput;
- ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
-
- if (name.equals(P_DEFAULTUSERID))
- {
- //System.out.println("Testing setPropertyValue: " + value);
- //sr.updateConnection(null, conn, conn.getSystemType(), conn.getAliasName(),
- // conn.getHostName(), conn.getDescription(), (String)value, USERID_LOCATION_CONNECTION);
- updateDefaultUserId(conn, (SystemInheritablePropertyData)value);
- changed_userId = true;
- }
- else if (name.equals(P_HOSTNAME))
- {
- // DKM - don't update unless it really changed
- // defect 57739
- if (!((String)value).equalsIgnoreCase(conn.getHostName()))
- {
- sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
- (String)value, conn.getDescription(), conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
- changed_hostName = true;
- }
- }
- else if (name.equals(P_DESCRIPTION))
- {
- // DKM - don't update unless it really changed
- // defect 57739
- if (!((String)value).equalsIgnoreCase(conn.getDescription()))
- {
- sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
- conn.getHostName(), (String)value, conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
- changed_description = true;
- }
- }
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- if (element instanceof IHost)
- {
- IHost sysCon = (IHost) element;
- if (sysCon.getSystemType().equals(IRSESystemType.SYSTEMTYPE_LOCAL)) return existsMoreThanOneLocalConnection();
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- return !sr.isAnySubSystemConnected((IHost)element);
- }
- return true;
- }
-
- protected boolean existsMoreThanOneLocalConnection()
- {
- IHost[] localCons = RSEUIPlugin.getDefault().getSystemRegistry().getHostsBySystemType(IRSESystemType.SYSTEMTYPE_LOCAL);
- return localCons.length > 1;
- }
-
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor)
- {
- boolean ok = true;
- IHost conn = (IHost)element;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.deleteHost(conn);
- return ok;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- return true; // all connections are renamable
- }
- /**
- * Perform the rename action.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- boolean ok = true;
- IHost conn = (IHost)element;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.renameHost(conn,name); // renames and saves to disk
- return ok;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- IHost conn = (IHost)element;
- //return org.eclipse.rse.core.ui.SystemConnectionForm.getConnectionNameValidator(conn); defect 42117
- return org.eclipse.rse.ui.SystemConnectionForm.getConnectionNameValidator(conn.getSystemProfile());
- }
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns profile.connectionName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- IHost conn = (IHost)element;
- return (conn.getSystemProfileName() + "." + newName).toUpperCase(); //$NON-NLS-1$
- }
-
-
- // FOR COMMON DRAG AND DROP ACTIONS
- /**
- * Indicates whether the connection can be dragged.
- * Can't be used for physical copies but rather
- * for views (like the Scratchpad)
- */
- public boolean canDrag(Object element)
- {
- return true;
- }
-
- /**
- * Returns the connection (no phyiscal operation required to drag and subsystem (because it's local)
- */
- public Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor)
- {
- return element;
- }
-
-
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- IHost conn = (IHost)element;
- return conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return ISystemMementoConstants.MEMENTO_KEY_CONNECTION;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionSelectionInputProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionSelectionInputProvider.java
deleted file mode 100644
index d43aa1063..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewConnectionSelectionInputProvider.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.internal.model.SystemNewConnectionPromptObject;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This input provider for the System View is used when we want to merely present a
- * list of existing connections for the user to select from, and optionally include
- * the New Connection prompting connection. <br>
- * Used in the {@link org.eclipse.rse.ui.widgets.SystemSelectConnectionForm} class.
- */
-public class SystemViewConnectionSelectionInputProvider extends SystemAbstractAPIProvider
-{
- private boolean showNew = true;
- private SystemNewConnectionPromptObject newConnPrompt;
- private Object[] newConnPromptArray;
- private String[] systemTypes;
-
- /**
- * Constructor
- */
- public SystemViewConnectionSelectionInputProvider()
- {
- super();
- }
-
- /**
- * Specify if the New Connection prompt is to be shown.
- * Default is true.
- */
- public void setShowNewConnectionPrompt(boolean show)
- {
- this.showNew = show;
- }
- /**
- * Query whether the New Connection prompt is to be shown or not.
- */
- public boolean getShowNewConnectionPrompt()
- {
- return showNew;
- }
- /**
- * Set the system types to restrict by
- */
- public void setSystemTypes(String[] systemTypes)
- {
- this.systemTypes = systemTypes;
- }
- /**
- * Return the system types we are restricted by
- */
- public String[] getSystemTypes()
- {
- return systemTypes;
- }
-
- // REQUIRED METHODS...
-
- /**
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getSystemViewRoots()
- */
- public Object[] getSystemViewRoots()
- {
- //System.out.println("Inside getSystemViewRoots. showNew = "+showNew);
- IHost[] conns = null;
- if (systemTypes == null)
- conns = RSEUIPlugin.getTheSystemRegistry().getHosts();
- else
- conns = RSEUIPlugin.getTheSystemRegistry().getHostsBySystemTypes(systemTypes);
- if (showNew)
- {
- if ((conns == null) || (conns.length == 0))
- {
- return getNewConnectionPromptObjectAsArray();
- }
- else
- {
- Object[] allChildren = new Object[conns.length+1];
- allChildren[0] = getNewConnectionPromptObject();
- for (int idx=0; idx<conns.length; idx++)
- allChildren[idx+1] = conns[idx];
- return allChildren;
- }
- }
- else
- return conns;
- }
- private SystemNewConnectionPromptObject getNewConnectionPromptObject()
- {
- if (newConnPrompt == null)
- newConnPrompt = new SystemNewConnectionPromptObject();
- if (systemTypes != null)
- newConnPrompt.setSystemTypes(systemTypes);
- return newConnPrompt;
- }
-
- private Object[] getNewConnectionPromptObjectAsArray()
- {
- if (newConnPromptArray == null)
- newConnPromptArray = new Object[1];
- newConnPromptArray[0] = getNewConnectionPromptObject();
- return newConnPromptArray;
- }
-
- /**
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#hasSystemViewRoots()
- */
- public boolean hasSystemViewRoots()
- {
- return true;
- }
- /**
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#showingConnections()
- */
- public boolean showingConnections()
- {
- return true;
- }
- /**
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getConnectionChildren(org.eclipse.rse.core.model.IHost)
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- return null;
- }
- /**
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#hasConnectionChildren(org.eclipse.rse.core.model.IHost)
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- return false;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDragAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDragAdapter.java
deleted file mode 100644
index 3d6e5856c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDragAdapter.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceAdapter;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.part.PluginTransferData;
-
-
-/**
- * Drag adapter for dragging objects in the Systems views
- *
- */
-public class SystemViewDataDragAdapter extends DragSourceAdapter
-{
-
-
- ISelectionProvider _selectionProvider;
- public static final char CONNECTION_DELIMITER = ':';
- public static final char RESOURCE_SEPARATOR = '|';
-
- /**
- * Constructor for drag adapter
- *
- */
- public SystemViewDataDragAdapter(ISelectionProvider provider)
- {
- _selectionProvider = provider;
- }
-
- public void dragFinished(DragSourceEvent event)
- {
- if (event.doit == false)
- {
- return;
- }
- }
-
-
- private void serializeObject(Object dragObject, ISystemDragDropAdapter adapter, StringBuffer dataStream)
- {
- // get the subsystem id
- ISubSystem subSystem = null;
- if (dragObject instanceof ISubSystem)
- {
- subSystem = (ISubSystem)dragObject;
- String subSystemId = RSEUIPlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem);
- dataStream.append(subSystemId);
- }
- else if (dragObject instanceof IHost)
- {
- IHost connection = (IHost)dragObject;
- String connectionId = RSEUIPlugin.getTheSystemRegistry().getAbsoluteNameForConnection(connection);
- dataStream.append(connectionId);
- }
- else
- {
- subSystem = adapter.getSubSystem(dragObject);
-
- if (subSystem != null)
- {
- String subSystemId = RSEUIPlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem);
- dataStream.append(subSystemId);
-
- }
-
- String objectId = adapter.getAbsoluteName(dragObject);
- dataStream.append(":"); //$NON-NLS-1$
- dataStream.append(objectId);
- }
- }
-
- public void dragStart(DragSourceEvent event)
- {
- ISelection selection = _selectionProvider.getSelection();
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
-
- if (dragObject instanceof IAdaptable)
- {
- ISystemDragDropAdapter adapter = (ISystemDragDropAdapter) ((IAdaptable) dragObject).getAdapter(ISystemDragDropAdapter.class);
- if (adapter == null || !adapter.canDrag(dragObject))
- {
- event.doit = false;
- event.detail = DND.DROP_NONE;
- }
- else
- {
- if (EditorInputTransfer.getInstance().isSupportedType(event.dataType))
- {
- if (adapter instanceof ISystemRemoteElementAdapter)
- {
- if (((ISystemRemoteElementAdapter)adapter).canEdit(dragObject))
- {
- event.doit = true;
- }
- else
- {
- event.doit = false;
- event.detail = DND.DROP_NONE;
- return;
- }
- }
- }
- else
- {
- event.doit = true;
- }
- }
- }
- else
- {
- event.doit = false;
- event.detail = DND.DROP_NONE;
- return;
- }
- }
- }
-
- //event.doit = true;
- }
-
-
- /**
- * Method for determining the source (drag) object(s) and
- * encoding those objects in a byte[]. We encode the profile,
- * connection and subsystem, and then we use ISystemDragDropAdapter.getAbsoluteName()
- * to determine the ID for the object within it's subsystem.
- */
- public void dragSetData(DragSourceEvent event)
- {
- ISelection selection = _selectionProvider.getSelection();
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection ss = (IStructuredSelection) selection;
-
- if (PluginTransfer.getInstance().isSupportedType(event.dataType))
- {
- StringBuffer dataStream = new StringBuffer(""); //$NON-NLS-1$
- Iterator iterator = ss.iterator();
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
-
- if (dragObject instanceof IAdaptable)
- {
- ISystemDragDropAdapter adapter = (ISystemDragDropAdapter) ((IAdaptable) dragObject).getAdapter(ISystemDragDropAdapter.class);
- if (adapter != null)
- {
- if (adapter.canDrag(dragObject))
- {
- serializeObject(dragObject, adapter, dataStream);
-
- if (iterator.hasNext())
- {
- dataStream.append(RESOURCE_SEPARATOR);
- }
- }
- }
- }
- }
-
- PluginTransferData data = new PluginTransferData("org.eclipse.rse.ui.view.DropActions", dataStream.toString().getBytes()); //$NON-NLS-1$
- event.data = data;
- if (dataStream.length() > 0)
- {
- event.doit = true;
- event.detail = DND.DROP_COPY;
- }
- else
- {
- event.doit = false;
- event.detail = DND.ERROR_CANNOT_INIT_DRAG;
- }
- }
- else if (FileTransfer.getInstance().isSupportedType(event.dataType))
- {
- // external drag and drop
- String[] fileNames = new String[ss.size()];
- Iterator iterator = ss.iterator();
- int i = 0;
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
- /** FIXME - IREmoteFile is systems.core independent now
- if (dragObject instanceof IRemoteFile)
- {
- IRemoteFile file = (IRemoteFile) dragObject;
-
- String connectionType = file.getParentRemoteFileSubSystem().getHost().getSystemType();
- if (connectionType.equals("Local"))
- {
- fileNames[i] = file.getAbsolutePath();
- i++;
- }
- }
- */
- }
- if (i > 0)
- {
- event.data = fileNames;
- }
- }
- else if (TextTransfer.getInstance().isSupportedType(event.dataType))
- {
- String[] texts = new String[ss.size()];
- Iterator iterator = ss.iterator();
- int i = 0;
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
- if (dragObject instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) dragObject).getAdapter(ISystemViewElementAdapter.class);
- if (adapter != null)
- {
- texts[i] = adapter.getText(dragObject);
- i++;
- }
- }
- }
- if (i > 0)
- {
- event.data = texts;
- }
- }
- else if (EditorInputTransfer.getInstance().isSupportedType(event.dataType))
- {
- EditorInputTransfer.EditorInputData[] inputData = new EditorInputTransfer.EditorInputData[ss.size()];
- Iterator iterator = ss.iterator();
- int i = 0;
-
- IEditorRegistry editRegistry = RSEUIPlugin.getDefault().getWorkbench().getEditorRegistry();
-
- while (iterator.hasNext())
- {
- Object dragObject = iterator.next();
-
- Object adapterObj = ((IAdaptable)dragObject).getAdapter(ISystemRemoteElementAdapter.class);
- if (adapterObj != null)
- {
- ISystemRemoteElementAdapter adapter = (ISystemRemoteElementAdapter)adapterObj;
- if (adapter.canEdit(dragObject))
- {
- ISystemEditableRemoteObject editable = adapter.getEditableRemoteObject(dragObject);
- if (editable != null)
- {
- try
- {
-
- Shell shell = event.display.getActiveShell();
- if (editable.download(shell))
- {
- editable.addAsListener();
- editable.setLocalResourceProperties();
-
- IFile theFile = editable.getLocalResource();
-
- IEditorDescriptor preferredEditor = editRegistry.getDefaultEditor(theFile.getName()); // may be null
- if (preferredEditor == null)
- {
- preferredEditor = getDefaultTextEditor();
-
- }
-
- FileEditorInput fileInput = new FileEditorInput(theFile);
- inputData[i] = EditorInputTransfer.createEditorInputData(preferredEditor.getId(), fileInput);
- i++;
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- }
- }
- if (i > 0)
- {
- event.data = inputData;
- }
- else
- {
- event.detail = DND.DROP_NONE;
- }
- }
- }
- }
-
- protected IEditorRegistry getEditorRegistry()
- {
- return RSEUIPlugin.getDefault().getWorkbench().getEditorRegistry();
- }
-
- protected IEditorDescriptor getDefaultTextEditor()
- {
- IEditorRegistry registry = getEditorRegistry();
- return registry.findEditor("org.eclipse.ui.DefaultTextEditor"); //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDropAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDropAdapter.java
deleted file mode 100644
index 659df1d5d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDataDropAdapter.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.internal.model.SystemScratchpad;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.part.PluginTransferData;
-
-
-/**
- * Drop adapter for dropping objects in the Systems views.
- *
- */
-public class SystemViewDataDropAdapter extends ViewerDropAdapter
-{
- protected Shell shell;
- protected long hoverStart = 0;
-
- protected static final long hoverThreshold = 1500;
- public static final char CONNECTION_DELIMITER = ':';
- public static final String RESOURCE_SEPARATOR = "|"; //$NON-NLS-1$
-
- protected int _sourceType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
- /**
- * Constructor for the drop adapter
- *
- */
- public SystemViewDataDropAdapter(StructuredViewer viewer)
- {
- super(viewer);
- setFeedbackEnabled(true);
- }
-
- /**
- * Method for determining whether the drop target is a valid target.
- * We could do extra validation on the source (drag) object(s), although
- * that could get expensive. The SWT drag and drop framework calls this
- * method.
- *
- */
- public boolean validateDrop(Object target, int operation, TransferData transferType)
- {
- if (target == null)
- {
- target = this.getViewer().getInput();
- }
- if (target instanceof IAdaptable)
- {
- ISystemDragDropAdapter adapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
- if (adapter != null)
- {
- return adapter.canDrop(target);
- }
- }
-
- return false;
- }
-
- private ArrayList getRSESourceObjects(PluginTransferData transferData)
- {
- byte[] result = transferData.getData();
-
- // get the sources
- //StringTokenizer tokenizer = new StringTokenizer(new String(result), RESOURCE_SEPARATOR);
- String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
-
-
- ArrayList srcObjects = new ArrayList();
- for (int i = 0;i < tokens.length; i++)
- {
- String srcStr = tokens[i];
-
- Object srcObject = getObjectFor(srcStr);
- srcObjects.add(srcObject);
- }
- return srcObjects;
- }
-
- private ArrayList getSourceObjects(Object data)
- {
- ArrayList srcObjects = new ArrayList();
-
- if (srcObjects.isEmpty())
- {
- if (data instanceof PluginTransferData)
- {
- PluginTransferData transferData = (PluginTransferData) data;
- srcObjects = getRSESourceObjects(transferData);
- _sourceType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
- }
- // different kind of data
- else if (data instanceof IResource[])
- {
- IResource[] resources = (IResource[]) data;
- for (int i = 0; i < resources.length; i++)
- {
- srcObjects.add(resources[i]);
- }
- _sourceType = SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE;
- }
- else if (data instanceof String[])
- {
- String[] resources = (String[]) data;
- for (int i = 0; i < resources.length; i++)
- {
- String resource = resources[i];
- srcObjects.add(resource);
- }
- _sourceType = SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE;
- }
- }
-
- return srcObjects;
- }
-
- /**
- * Called by SWT after the drop have been validated to perform the
- * drop transfer.
- *
- */
- public boolean performDrop(Object data)
- {
- boolean ok = true;
-
- ArrayList srcObjects = getSourceObjects(data);
-
- if (srcObjects.size() > 0)
- {
- Object target = getCurrentTarget();
- if (target == null)
- {
- target = getViewer().getInput();
- }
-
- List rulesList = new ArrayList();
- int j = 0;
- for (int i = 0; i < srcObjects.size(); i++)
- {
- if (srcObjects.get(i) instanceof ISchedulingRule)
- {
- rulesList.add(srcObjects.get(i));
- j++;
- }
- /** FIXME - can't be coupled with IRemoteFile
- else if (srcObjects.get(i) instanceof IRemoteFile)
- {
- rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)srcObjects.get(i)));
- j++;
- }
- */
- }
- /*
- if (target instanceof ISchedulingRule)
- {
- rulesList.add(target);
- j++;
- }
- */
- /** FIXME - can't be coupled with IRemoteFile
- else if (target instanceof IRemoteFile)
- {
- rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)target));
- }
-
- else if (target instanceof IAdaptable)
- {
- ISystemDragDropAdapter targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
-
- if (targetAdapter != null)
- {
- ISubSystem targetSubSystem = targetAdapter.getSubSystem(target);
- rulesList.add(targetSubSystem);
- j++;
- }
- }
- */
- MultiRule rule = null;
- ISchedulingRule[] rules = (ISchedulingRule[])rulesList.toArray(new ISchedulingRule[rulesList.size()]);
-
- if (j > 0) rule = new MultiRule(rules);
-
- SystemDNDTransferRunnable runnable = new SystemDNDTransferRunnable(target, srcObjects, getViewer(), _sourceType);
- // DKM - rules are causing problems at the moment
- runnable.setRule(rule);
-
- if (target instanceof SystemScratchpad)
- {
- runnable.run(new NullProgressMonitor());
- }
- else
- {
- runnable.schedule();
- }
- //ok = runnable.dropOkay();
- ok = true;
- }
- return ok;
- }
-
-
- /**
- * Method for decoding an source object ID to the actual source object.
- * We determine the profile, connection and subsystem, and then
- * we use the SubSystem.getObjectWithKey() method to get at the
- * object.
- *
- */
- private Object getObjectFor(String str)
- {
- ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- // first extract subsystem id
- int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
- if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
- {
- int profileDelim = str.indexOf("."); //$NON-NLS-1$
- if (profileDelim != -1)
- {
- String profileId = str.substring(0, profileDelim);
- String connectionId = str.substring(profileDelim + 1, str.length());
- ISystemProfile profile = registry.getSystemProfile(profileId);
- return registry.getHost(profile, connectionId);
- }
- }
-
-
- int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
- if (subsystemDelim == -1) // not remote object, therefore likely to be a subsystem
- {
- return registry.getSubSystem(str);
- }
- else
- {
- String subSystemId = str.substring(0, subsystemDelim);
- String srcKey = str.substring(subsystemDelim + 1, str.length());
-
-
- ISubSystem subSystem = registry.getSubSystem(subSystemId);
- if (subSystem != null)
- {
- Object result = null;
- try
- {
- result = subSystem.getObjectWithAbsoluteName(srcKey);
- }
- catch (SystemMessageException e)
- {
- return e.getSystemMessage();
- }
- catch (Exception e)
- {
- }
- if (result != null)
- {
- return result;
- }
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_FILE_NOTFOUND);
- msg.makeSubstitution(srcKey, subSystem.getHostAliasName());
- return msg;
- }
- }
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_CONNECTION_NOTFOUND);
- msg.makeSubstitution(subSystemId);
- return msg;
- }
- }
- }
-
- protected IRunnableContext getRunnableContext(Shell shell)
- {
- IRunnableContext irc = RSEUIPlugin.getTheSystemRegistry().getRunnableContext();
- if (irc != null)
- {
- return irc;
- }
- else
- {
- /*
- // for other cases, use statusbar
- IWorkbenchWindow win = RSEUIPlugin.getActiveWorkbenchWindow();
- if (win != null)
- {
- Shell winShell = RSEUIPlugin.getActiveWorkbenchShell();
- if (winShell != null && !winShell.isDisposed() && winShell.isVisible())
- {
- RSEUIPlugin.logInfo("Using active workbench window as runnable context");
- shell = winShell;
- return win;
- }
- else
- {
- win = null;
- }
- }
- */
-
- irc = new ProgressMonitorDialog(shell);
- RSEUIPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
- return irc;
- }
- }
-
- public void dragOver(DropTargetEvent event)
- {
- super.dragOver(event);
- event.feedback &= ~DND.FEEDBACK_EXPAND;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDummyObject.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDummyObject.java
deleted file mode 100644
index 897d0f59c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewDummyObject.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-/**
- * Sometimes we need to supply a dummy object in our events just to prevent a crash.
- * In these cases, use this.
- */
-public class SystemViewDummyObject
-{
-
-
- private static SystemViewDummyObject singleton;
-
- /**
- * Constructor for SystemViewDummyObject.
- */
- public SystemViewDummyObject()
- {
- super();
- }
-
- /**
- * Return the singleton of this
- */
- public static SystemViewDummyObject getSingleton()
- {
- if (singleton == null)
- singleton = new SystemViewDummyObject();
- return singleton;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java
deleted file mode 100644
index c87cae99b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java
+++ /dev/null
@@ -1,560 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.SystemChildrenContentsType;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.filters.SystemFilterSimple;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterName;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Default Adapter for displaying filter objects in tree views.
- * For some subsystems, these are children of SubSystem objects.
- * This class offers default behaviour but can be subclassed to refine the
- * behaviour. If this is done, you must register your subclass with the
- * platform's adapter manager in your plugin class's startup method.
- */
-public class SystemViewFilterAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- //private static String translatedFilterString = null;
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
- private SystemComboBoxPropertyDescriptor filterStringsDescriptor;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given filter object.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- //if (selection.size() != 1)
- // return; // does not make sense adding unique actions per multi-selection
- ISystemFilter filter = (ISystemFilter)selection.getFirstElement();
- if (filter.isTransient())
- return;
- ISubSystemConfiguration ssFactory = SubSystemHelpers.getParentSubSystemConfiguration(filter);
- ssFactory.setConnection(null);
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
- IAction[] actions = adapter.getFilterActions(ssFactory, filter, shell);
- if (actions != null)
- {
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- }
-
- private ISystemFilter getFilter(Object element)
- {
- return (ISystemFilter)element;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- //return RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_FILTER_ID);
- ImageDescriptor filterImage = null;
- ISystemFilter filter = getFilter(element);
- if (filter.getProvider() != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)filter.getProvider().getAdapter(ISubSystemConfigurationAdapter.class);
- filterImage = adapter.getSystemFilterImage(filter);
- }
- if (filterImage == null)
- filterImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID);
- return filterImage;
- }
-
- /**
- * Return the label for this object. Calls getName on the filter
- */
- public String getText(Object element)
- {
- return getFilter(element).getName();
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return getFilter(element).getName();
- }
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- ISystemFilter filter = getFilter(element);
- return filter.getSystemFilterPoolManager().getName() + "." + filter.getParentFilterPool().getName() + "." + filter.getName();
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- ISystemFilter filter = getFilter(element);
- if (filter.isTransient())
- return SystemResources.RESID_PP_FILTER_TYPE_VALUE;
- ISubSystemConfiguration ssParentFactory = SubSystemHelpers.getParentSubSystemConfiguration(filter);
- return ssParentFactory.getTranslatedFilterTypeProperty(filter);
- }
-
- /**
- * Return the parent of this object.
- * This will be either a SubSystem object, or a filter object.
- */
- public Object getParent(Object element)
- {
- ISystemFilter filter = getFilter(element);
- if (filter.isTransient())
- return ((SystemFilterSimple)filter).getParent();
- return filter.getParentFilterContainer();
- }
-
- /**
- * Return the children of this filter.
- * This is a combination of nested filters and resolved filter objects.
- */
- public Object[] getChildren(Object element)
- {
- ISystemFilter filter = getFilter(element);
- // transient filters...
- if (filter.isTransient())
- {
- if (filter.isPromptable())
- return checkForNull(processPromptingFilter(filter), true);
-
- Object[] children = null;
- SystemFilterSimple simpleFilter = (SystemFilterSimple)filter;
- String[] filterStrings = simpleFilter.getFilterStrings();
- // 50167pc: The following was a problem, as the parent in a SimpleFilterSimpleImpl is not
- // to be trusted, since we tend to use the same instance for each connection in the list.
- ISubSystem ss = (ISubSystem)simpleFilter.getParent();
- String preSelectName = null;
- try
- {
- Shell shell = getShell();
- // hack to propogate type filters down from connection in select dialogs...
- ISystemViewInputProvider inputProvider = getInput();
- if ( (inputProvider != null) && (inputProvider instanceof SystemSelectRemoteObjectAPIProviderImpl) &&
- (filterStrings != null) && (filterStrings.length>0) )
- {
- SystemSelectRemoteObjectAPIProviderImpl ip = (SystemSelectRemoteObjectAPIProviderImpl)inputProvider;
- if (ip.filtersNeedDecoration(element))
- {
- String[] adorned = new String[filterStrings.length];
- for (int idx = 0; idx < filterStrings.length; idx++)
- adorned[idx] = ip.decorateFilterString(element, filterStrings[idx]);
- filterStrings = adorned;
- }
- preSelectName = ip.getPreSelectFilterChild();
- }
-
- // get children from cache if the children have been cached
- if (ss.getSubSystemConfiguration().supportsFilterCaching() && !simpleFilter.isStale() &&
- simpleFilter.hasContents(SystemChildrenContentsType.getInstance())) {
- children = simpleFilter.getContents(SystemChildrenContentsType.getInstance());
- }
- // otherwise, get children and then cache
- else {
- children = checkForNull(ss.resolveFilterStrings(filterStrings), true);
-
- if (ss.getSubSystemConfiguration().supportsFilterCaching()) {
- simpleFilter.setContents(SystemChildrenContentsType.getInstance(), children);
- }
- }
-
- if ((children !=null) && (preSelectName != null))
- {
- Object match = null;
- for (int idx=0; (match==null) && (idx<children.length); idx++)
- {
- Object child = children[idx];
- String objName = getAdapter(child).getName(child);
- if ((objName != null) && (objName.equals(preSelectName)))
- match = child;
- }
- //if (match != null) always reset even if it is null
- ((SystemSelectRemoteObjectAPIProviderImpl)inputProvider).setPreSelectFilterChildObject(match);
- }
- }
- catch (InterruptedException exc)
- {
- children = getCancelledMessageObject();
- }
- catch (Exception exc)
- {
- children = getFailedMessageObject();
- SystemBasePlugin.logError("Exception resolving filters' strings ",exc);
- } // message already issued
-
- return children;
- }
-
- if (filter.isPromptable())
- return checkForNull(null, false);
-
- // normal filters...
- //Vector strings = filter.getFilterStringsVector();
- Vector strings = filter.getFilterStringObjectsVector();
- Vector filters = filter.getSystemFiltersVector();
- Vector vChildren = new Vector();
-
- // start with nested filters...
- for (int idx=0; idx < filters.size(); idx++)
- vChildren.addElement(filters.elementAt(idx));
- // continue with resolved filter string objects...
- for (int idx=0; idx < strings.size(); idx++)
- {
- //String filterString = (String)strings.elementAt(idx);
- ISystemFilterString filterString = (ISystemFilterString)strings.elementAt(idx);
- vChildren.addElement(filterString);
- }
-
- // convert whole thing to an array...
- Object[] children = new Object[vChildren.size()];
- for (int idx=0; idx<vChildren.size(); idx++)
- children[idx] = vChildren.elementAt(idx);
-
- return children;
- }
-
- /**
- * Processing a prompting filter...
- */
- private Object[] processPromptingFilter(ISystemFilter filter)
- {
- Object[] children = new SystemMessageObject[1];
- ISystemViewInputProvider inputProvider = getInput();
- if ( (inputProvider != null) && (inputProvider instanceof SystemSelectRemoteObjectAPIProviderImpl) )
- {
- try
- {
- SystemSelectRemoteObjectAPIProviderImpl ip = (SystemSelectRemoteObjectAPIProviderImpl)inputProvider;
- ISystemFilter newFilter = ip.createFilterByPrompting(filter, getShell());
- if (newFilter == null)
- {
- children = getCancelledMessageObject();
- }
- else // filter string successfully created!
- {
- //SystemFilterSimpleImpl simpleFilter = (SystemFilterSimpleImpl)filter;
- //SubSystem ss = (SubSystem)simpleFilter.getParent();
-
- // return "filter created successfully" message object for this node
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FILTERCREATED),
- ISystemMessageObject.MSGTYPE_OBJECTCREATED,filter);
-
- // select the new filter and expand it
- Viewer v = inputProvider.getViewer();
- if ((v!=null) && (v instanceof ISystemResourceChangeListener))
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(newFilter, ISystemResourceChangeEvents.EVENT_SELECT_EXPAND, null);
- sr.postEvent((ISystemResourceChangeListener)v, event); // only expand in the current viewer, not all viewers!
- }
- }
- } catch (Exception exc)
- {
- children = getFailedMessageObject();
- SystemBasePlugin.logError("Exception prompting for filter ",exc);
- }
- }
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"returning children");
- return children;
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element)
- {
- ISystemFilter filter = getFilter(element);
- if (filter.getFilterStringCount() > 0)
- return true;
- else if (filter.getSystemFilterCount() > 0)
- return true;
- else
- return false;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
-
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[3];
- int idx = 0;
-
- // parent filter pool
- propertyDescriptorArray[idx] = createSimplePropertyDescriptor(P_PARENT_FILTERPOOL,SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_TOOLTIP);
- // parent filter
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_PARENT_FILTER,SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_TOOLTIP);
- // number filter strings
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_FILTERSTRINGS_COUNT,SystemViewResources.RESID_PROPERTY_FILTERSTRINGS_COUNT_LABEL, SystemViewResources.RESID_PROPERTY_FILTERSTRINGS_COUNT_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
- /**
- * Return our unique property values
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param property the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- ISystemFilter filter = getFilter(propertySourceInput);
- // following not working yet...
- if (name.equals(ISystemPropertyConstants.P_FILTERSTRINGS))
- {
- String[] filterStrings = filter.getFilterStrings();
- filterStringsDescriptor.setValues(filterStrings);
- if ((filterStrings != null) && (filterStrings.length>0))
- return filterStrings[0];
- else
- return "null";
- }
- else if (name.equals(ISystemPropertyConstants.P_FILTERSTRINGS_COUNT))
- {
- int nbrFilterStrings = filter.getFilterStringCount();
- return Integer.toString(nbrFilterStrings);
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTER))
- {
- if (filter.isTransient())
- return getTranslatedNotApplicable();
- ISystemFilter parent = filter.getParentFilter();
- if (parent != null)
- return parent.getName();
- else
- return getTranslatedNotApplicable();
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTERPOOL))
- {
- if (filter.isTransient())
- return getTranslatedNotApplicable();
- ISystemFilterPool parent = filter.getParentFilterPool();
- if (parent != null)
- return parent.getName();
- else
- return null;
- }
- else
- return null;
- }
-
- // FOR COMMON DELETE ACTIONS
- public boolean showDelete(Object element)
- {
- return !getFilter(element).isTransient();
- }
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- return true;
- }
-
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- ISystemFilter filter = getFilter(element);
- ISystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- fpMgr.deleteSystemFilter(filter);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- public boolean showRename(Object element)
- {
- return !getFilter(element).isTransient();
- }
-
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- return true;
- }
- /**
- * Perform the rename action.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- ISystemFilter filter = getFilter(element);
- ISystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- fpMgr.renameSystemFilter(filter,name);
- return true;
- }
- /**
- * Return a validator for verifying the new name is correct.
- * @param either a filter for a rename action, or a filter pool for a "new" action.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- ISystemFilter filter = null;
- ISystemFilterPool pool = null;
- Vector filterNames = null;
- if (element instanceof ISystemFilter)
- {
- filter = (ISystemFilter)element;
- pool = filter.getParentFilterPool();
- if (pool != null)
- filterNames = pool.getSystemFilterNames();
- else
- {
- ISystemFilter parentFilter = filter.getParentFilter();
- filterNames = parentFilter.getSystemFilterNames();
- }
- }
- else
- {
- pool = (ISystemFilterPool)element;
- filterNames = pool.getSystemFilterNames();
- }
- /*
- if (filter != null)
- filterNames.removeElement(filter.getName()); // remove current filter's name
- */
- ISystemValidator nameValidator = new ValidatorFilterName(filterNames);
- return nameValidator;
- }
-
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns mgrName.poolName.filterName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- ISystemFilter filter = (ISystemFilter)element;
- if (!filter.isTransient())
- {
- String mgrName = filter.getSystemFilterPoolManager().getName();
- return (mgrName + "." + filter.getParentFilterPool().getName() + "." + newName).toUpperCase();
- }
- else
- return newName.toUpperCase();
- }
-
- // FOR COMMON REFRESH ACTIONS
- public boolean showRefresh(Object element)
- {
- return !getFilter(element).isTransient();
- }
-
- /**
- * Return true if we should show the refresh action in the popup for the given element.
- */
- public boolean showOpenViewActions(Object element)
- {
- return !getFilter(element).isTransient();
- }
-
- /**
- * <i>Overide of parent method.</i><br>
- * From <samp>IActionFilter</samp> so the popupMenus extension point can use &lt;filter&gt;, &lt;enablement&gt;
- * or &lt;visibility&gt;. We add support is for the following:
- * <ol>
- * <li>name="filterType". The value is tested against the non-translated filter type. Note all subsystems
- * support different types of filters.
- * <li>name="showChangeFilterStringsPropertyPage". The value is tested against the call to the subsystem factory method showChangeFilterStringsPropertyPage(SystemFilter).
- * Compares against "true" (default) or "false".
- * </ol>
- */
- public boolean testAttribute(Object target, String name, String value)
- {
- if (name.equalsIgnoreCase("filterType"))
- {
- ISystemFilter filter = getFilter(target);
- String type = filter.getType();
- if ((type == null) || (type.length() == 0))
- return false;
- else
- return value.equals(type);
- }
- else if (name.equalsIgnoreCase("showChangeFilterStringPropertyPage"))
- {
- ISystemFilter filter = getFilter(target);
- ISubSystemConfiguration ssf = SubSystemHelpers.getParentSubSystemConfiguration(filter);
- if (value.equals("true"))
- return ssf.showChangeFilterStringsPropertyPage(filter);
- else
- return !ssf.showChangeFilterStringsPropertyPage(filter);
- }
- else
- return super.testAttribute(target, name, value);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolAdapter.java
deleted file mode 100644
index 81ede4c3e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolAdapter.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterPoolName;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying SystemFilterPool objects in tree views.
- * These are the masters, and only shown in work-with for the master.
- * These are children of SubSystemConfiguration objects
- */
-public class SystemViewFilterPoolAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- protected String translatedType;
- //protected Object parent;
-
- // for reset property support
- //private String original_userId, original_port;
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given subsystem object.
- * Calls the method getActions on the subsystem's factory, and places
- * all action objects returned from the call, into the menu.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- //if (selection.size() != 1)
- // return; // does not make sense adding unique actions per multi-selection
- ISystemFilterPool pool = ((ISystemFilterPool)selection.getFirstElement());
- ISubSystemConfiguration ssFactory = SubSystemHelpers.getParentSubSystemConfiguration(pool);
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
- IAction[] actions = adapter.getFilterPoolActions(ssFactory, pool, shell);
- if (actions != null)
- {
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- //return RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_FILTERPOOL_ID);
- ImageDescriptor poolImage = null;
- ISystemFilterPool pool = (ISystemFilterPool)element;
- if (pool.getProvider() != null)
- {
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)pool.getProvider().getAdapter(ISubSystemConfigurationAdapter.class);
- poolImage = adapter.getSystemFilterPoolImage(pool);
- }
- if (poolImage == null)
- poolImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID);
- return poolImage;
- }
-
- /**
- * Return the label for this object. Uses getName() on the filter pool object.
- */
- public String getText(Object element)
- {
- return ((ISystemFilterPool)element).getName();
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return ((ISystemFilterPool)element).getName();
- }
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- ISystemFilterPool filterPool = (ISystemFilterPool)element;
- return filterPool.getSystemFilterPoolManager().getName() + "." + filterPool.getName();
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- if (translatedType == null)
- translatedType = SystemViewResources.RESID_PROPERTY_FILTERPOOL_TYPE_VALUE;
- return translatedType;
- }
-
- /**
- * Return the parent of this object. The parent of a filter pool is a subsystem factory,
- * in real life. But to a user, it is a subsystem.
- */
- public Object getParent(Object element)
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- // hmm, this will only work if a given factory only has one subsystem object...
- ISubSystemConfiguration ssParentFactory = SubSystemHelpers.getParentSubSystemConfiguration(fp);
- return ssParentFactory.getSubSystems(false)[0];
- }
-
- /**
- * Return the children of this object.
- * For filter pools, this is a list of filters.
- */
- public Object[] getChildren(Object element)
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- return fp.getSystemFilters();
- }
-
- /**
- * Return true if this object has children. That is, has filters.
- */
- public boolean hasChildren(Object element)
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- return fp.getSystemFilterCount() > 0;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[3];
- int idx = 0;
-
- // parent filter pool
- propertyDescriptorArray[idx] = createSimplePropertyDescriptor(P_PARENT_FILTERPOOL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_TOOLTIP);
-
- // parent filter pool's profile
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_PROFILE, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_TOOLTIP);
-
- // Related connection
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_RELATED_CONNECTION, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_TOOLTIP);
-
- }
- return propertyDescriptorArray;
- }
- /**
- * Return our unique property values
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- ISystemFilterPool pool = (ISystemFilterPool)propertySourceInput;
- if (name.equals(ISystemPropertyConstants.P_PARENT_FILTERPOOL))
- return pool.getName();
- else if (name.equals(ISystemPropertyConstants.P_PROFILE))
- return pool.getSystemFilterPoolManager().getName();
- else if (name.equals(ISystemPropertyConstants.P_RELATED_CONNECTION))
- return (pool.getOwningParentName()==null) ? getTranslatedNotApplicable() : pool.getOwningParentName();
- else
- return null;
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- return fp.isDeletable();
- }
-
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- ISystemFilterPoolManager fpMgr = fp.getSystemFilterPoolManager();
- fpMgr.deleteSystemFilterPool(fp);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- if (!canDelete(element))
- return false;
- ISystemFilterPool fp = (ISystemFilterPool)element;
- return !fp.isNonRenamable();
- }
-
- /**
- * Perform the rename action. Assumes uniqueness checking was done already.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- ISystemFilterPoolManager fpMgr = fp.getSystemFilterPoolManager();
- fpMgr.renameSystemFilterPool(fp,name);
- return true;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- ISystemFilterPool fp = (ISystemFilterPool)element;
- ISystemFilterPoolManager mgr = fp.getSystemFilterPoolManager();
- Vector v = mgr.getSystemFilterPoolNamesVector();
- /*
- if (fp != null) // might be called by the New wizard vs rename action
- v.removeElement(fp.getName());
- */
- ISystemValidator nameValidator = new ValidatorFilterPoolName(v);
- //System.out.println("Inside getNameValidator for SystemViewFilterPoolAdapter");
- return nameValidator;
- }
-
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns mgrName.poolName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- String mgrName = ((ISystemFilterPool)element).getSystemFilterPoolManager().getName();
- return (mgrName + "." + newName).toUpperCase();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolReferenceAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolReferenceAdapter.java
deleted file mode 100644
index c6e3f16d8..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterPoolReferenceAdapter.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterPoolName;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying SystemFilterPool reference objects in tree views.
- * These are children of SubSystem objects
- */
-public class SystemViewFilterPoolReferenceAdapter
- extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- protected String translatedType;
- //protected Object parent;
-
- // for reset property support
- //private String original_userId, original_port;
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given subsystem object.
- * Calls the method getActions on the subsystem's factory, and places
- * all action objects returned from the call, into the menu.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- //if (selection.size() != 1)
- // return; // does not make sense adding unique actions per multi-selection
- Object element = selection.getFirstElement();
- ISystemFilterPool pool = getFilterPool(element);
- ISubSystemConfiguration ssFactory = getSubSystemConfiguration(pool);
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
-
- IAction[] actions = adapter.getFilterPoolActions(ssFactory, pool, shell);
- if (actions != null)
- {
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- actions = adapter.getFilterPoolReferenceActions(ssFactory, getFilterPoolReference(element), shell);
- if (actions != null)
- {
- //menu.addSeparator();
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- }
-
- private ISubSystemConfiguration getSubSystemConfiguration(ISystemFilterPool pool)
- {
- return SubSystemHelpers.getParentSubSystemConfiguration(pool);
- }
-
- /**
- * <i>Overridden from parent.</i><br>
- * Returns the subsystem that contains this object.
- */
- public ISubSystem getSubSystem(Object element)
- {
- return ((ISubSystem)getFilterPoolReference(element).getProvider());
- }
-
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- ImageDescriptor poolImage = null;
- ISystemFilterPool pool = getFilterPool(element);
- if (pool.getProvider() != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)pool.getProvider().getAdapter(ISubSystemConfigurationAdapter.class);
- poolImage = adapter.getSystemFilterPoolImage(pool);
- }
- if (poolImage == null)
- poolImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID);
- return poolImage;
- }
-
- private ISystemFilterPoolReference getFilterPoolReference(Object element)
- {
- return (ISystemFilterPoolReference)element; // get referenced object
- }
-
- private ISystemFilterPool getFilterPool(Object element)
- {
- return getFilterPoolReference(element).getReferencedFilterPool(); // get master object
- }
-
-
- /**
- * @param element the filter pool reference masquerading as an object
- * @return the label for this filter pool reference.
- */
- public String getText(Object element) {
- String result = "unknown"; // $NON-NLS-1$
- ISystemFilterPool pool = getFilterPool(element);
- if (pool != null) {
- result = pool.getName();
-// the following looks like it was copied from the host adapter and not really needed here.
-// boolean qualifyNames = RSEUIPlugin.getTheSystemRegistry().getQualifiedHostNames();
-// if (qualifyNames) {
-// String prefix = SubSystemHelpers.getParentSystemProfile(pool).getName();
-// result = prefix + "." + result;
-// }
- }
- return result;
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return getFilterPool(element).getName();
- }
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- ISystemFilterPoolReference filterPoolRef = (ISystemFilterPoolReference)element;
- return filterPoolRef.getReferencedFilterPool().getSystemFilterPoolManager().getName() + "." + filterPoolRef.getName();
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- if (translatedType == null)
- translatedType = SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_TYPE_VALUE;
- return translatedType;
- }
-
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element)
- {
- ISystemFilterPoolReference fpr = getFilterPoolReference(element);
- return SubSystemHelpers.getParentSubSystem(fpr);
- }
-
- /**
- * Return the children of this object.
- * For filter pools, this is a list of filters.
- */
- public Object[] getChildren(Object element)
- {
- ISystemFilterPoolReference fpRef = getFilterPoolReference(element);
- ISubSystem ss = getSubSystem(element);
- return fpRef.getSystemFilterReferences(ss);
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element) {
- int count = 0;
- ISystemFilterPoolReference fpRef = getFilterPoolReference(element);
- if (fpRef != null) {
- ISystemFilterPool filterPool = fpRef.getReferencedFilterPool();
- if (filterPool != null) {
- count = filterPool.getSystemFilterCount();
- }
- }
- return count > 0;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[3];
- int idx = 0;
-
- // parent filter pool
- propertyDescriptorArray[idx] = createSimplePropertyDescriptor(P_PARENT_FILTERPOOL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_TOOLTIP);
-
- // parent filter pool's profile
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_PROFILE, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_TOOLTIP);
-
- // Related connection
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_RELATED_CONNECTION, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
- /**
- * Return our unique property values
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- //SystemFilterPoolReference ref = getFilterPoolReference(propertySourceInput);
- ISystemFilterPool pool = getFilterPool(propertySourceInput);
- if (name.equals(ISystemPropertyConstants.P_PARENT_FILTERPOOL))
- return pool.getName();
- else if (name.equals(ISystemPropertyConstants.P_PROFILE))
- return pool.getSystemFilterPoolManager().getName();
- else if (name.equals(ISystemPropertyConstants.P_RELATED_CONNECTION))
- return (pool.getOwningParentName()==null) ? getTranslatedNotApplicable() : pool.getOwningParentName();
- else
- return null;
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- ISystemFilterPool fp = getFilterPool(element);
- return fp.isDeletable();
- }
-
- /**
- * Perform the delete action.
- * This physically deletes the filter pool and all references.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- ISystemFilterPoolReference fpr = getFilterPoolReference(element);
- ISystemFilterPool fp = getFilterPool(element);
- ISystemFilterPoolManager fpMgr = fp.getSystemFilterPoolManager();
- fpMgr.deleteSystemFilterPool(fp);
- //SubSystemConfiguration ssParentFactory = getSubSystemConfiguration(fp);
- //ssParentFactory.deleteFilterPool(fp);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- if (!canDelete(element))
- return false;
- ISystemFilterPool fp = getFilterPool(element);
- return !fp.isNonRenamable();
- }
-
- /**
- * Perform the rename action. Assumes uniqueness checking was done already.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- ISystemFilterPool fp = getFilterPool(element);
- ISystemFilterPoolManager fpMgr = fp.getSystemFilterPoolManager();
- fpMgr.renameSystemFilterPool(fp,name);
- //SubSystemConfiguration ssParentFactory = getSubSystemConfiguration(fp);
- //ssParentFactory.renameFilterPool(fp,name);
- return true;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- ISystemFilterPool fp = null;
- if (element instanceof ISystemFilterPoolReference)
- fp = getFilterPool(element);
- else
- fp = (ISystemFilterPool)element;
- ISystemFilterPoolManager mgr = fp.getSystemFilterPoolManager();
- Vector v = mgr.getSystemFilterPoolNamesVector();
- /*
- if (fp != null) // might be called by the New wizard vs rename action
- v.removeElement(fp.getName());
- */
- ISystemValidator nameValidator = new ValidatorFilterPoolName(v);
- return nameValidator;
- }
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns mgrName.poolName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- String mgrName = ((ISystemFilterPoolReference)element).getReferencedFilterPoolManagerName();
- return (mgrName + "." + newName).toUpperCase();
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference)element;
- return fpRef.getFullName();
- }
- /**
- * Return what to save to disk to identify this element when it is the input object to a secondary
- * Remote Systems Explorer perspective.
- */
- public String getInputMementoHandle(Object element)
- {
- Object parent = getParent(element);
- return getAdapter(parent).getInputMementoHandle(parent) + MEMENTO_DELIM + getMementoHandle(element);
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return ISystemMementoConstants.MEMENTO_KEY_FILTERPOOLREFERENCE;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java
deleted file mode 100644
index b5edfcd45..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java
+++ /dev/null
@@ -1,953 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterContainerReference;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.core.model.ISystemResourceSet;
-import org.eclipse.rse.core.model.SystemChildrenContentsType;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.SubSystemHelpers;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemRemoteResourceSet;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorFilterName;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying SystemFilterReference objects in tree views.
- * These are children of SystemFilterPoolReference and SystemFilterReference objects
- */
-public class SystemViewFilterReferenceAdapter
- extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter
-{
- //private static String translatedFilterString = null;
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
- //private SystemComboBoxPropertyDescriptor filterStringsDescriptor, filtersDescriptor;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given filter object.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- //if (selection.size() != 1)
- // return; // does not make sense adding unique actions per multi-selection
- ISystemFilter filter = getFilter(selection.getFirstElement());
- ISubSystemConfiguration ssFactory = getSubSystemConfiguration(filter);
- ISubSystem currentSubSystem = getFilterReference(selection.getFirstElement()).getSubSystem();
- IHost currentConnection = currentSubSystem.getHost();
- ssFactory.setConnection(currentConnection);
- ssFactory.setCurrentSelection(selection.toArray());
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
-
- IAction[] actions = adapter.getFilterActions(ssFactory, filter, shell);
- if (actions != null)
- {
- for (int idx = 0; idx < actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- actions = adapter.getFilterReferenceActions(ssFactory, getFilterReference(selection.getFirstElement()), shell);
- if (actions != null)
- {
- for (int idx = 0; idx < actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- }
-
- private ISubSystemConfiguration getSubSystemConfiguration(ISystemFilter filter)
- {
- return SubSystemHelpers.getParentSubSystemConfiguration(filter);
- }
- /**
- * <i>Overridden from parent.</i><br>
- * Returns the subsystem that contains this object.
- */
- public ISubSystem getSubSystem(Object element)
- {
- if (element instanceof ISystemFilterReference)
- return (ISubSystem) (((ISystemFilterReference) element).getProvider());
- else
- return null;
- }
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- //return RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_FILTER_ID);
- ImageDescriptor filterImage = null;
- ISystemFilter filter = getFilter(element);
- if (filter.getProvider() != null) // getProvider() returns the subsystem factory
- {
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)filter.getProvider().getAdapter(ISubSystemConfigurationAdapter.class);
- filterImage = adapter.getSystemFilterImage(filter);
- }
- if (filterImage == null)
- filterImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID);
- return filterImage;
- }
-
- private ISystemFilterReference getFilterReference(Object element)
- {
- return (ISystemFilterReference) element; // get referenced object
- }
- private ISystemFilter getFilter(Object element)
- {
- return getFilterReference(element).getReferencedFilter(); // get master object
- }
-
- /**
- * Return the label for this object. Uses getName() on the filter pool object.
- */
- public String getText(Object element)
- {
- return getFilter(element).getName();
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return getFilter(element).getName();
- }
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- ISystemFilter filter = getFilter(element);
- return filter.getSystemFilterPoolManager().getName() + "." + filter.getParentFilterPool().getName() + "." + filter.getName();
- }
-
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- ISystemFilter filter = getFilter(element);
- ISubSystemConfiguration ssParentFactory = getSubSystemConfiguration(filter);
- return ssParentFactory.getTranslatedFilterTypeProperty(filter);
- }
-
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element)
- {
- ISystemFilterReference fr = getFilterReference(element);
- ISystemFilterContainerReference parentContainer = fr.getParent();
- // if parent is a filter (eg, we are nested) that is always the parent...
- if (parentContainer instanceof ISystemFilterReference)
- return parentContainer;
- // else parent is a filter pool. The parent will be the pool only if
- // we are in "Show Filter Pools" mode, else it is the subsystem.
- boolean showFPs = SystemPreferencesManager.getPreferencesManager().getShowFilterPools();
- if (showFPs)
- return parentContainer;
- else
- return fr.getProvider();
- //return fr.getParent();
- }
-
- /**
- * Return the children of this object.
- * For filters, this is one or more of:
- * <ul>
- * <li>filters if nested filters supported
- * <li>filter strings if user has elected to show filter strings in his preferences
- * <li>resolved objects for each filter string if user has elected NOT to show filter strings in his preferences
- * </ul>
- */
- public Object[] getChildren(IProgressMonitor monitor, Object element)
- {
- return internalGetChildren(monitor, element);
- }
-
- /**
- * Return the children of this object.
- * For filters, this is one or more of:
- * <ul>
- * <li>filters if nested filters supported
- * <li>filter strings if user has elected to show filter strings in his preferences
- * <li>resolved objects for each filter string if user has elected NOT to show filter strings in his preferences
- * </ul>
- */
- public Object[] getChildren(Object element)
- {
- return internalGetChildren(null, element);
- }
-
- /*
- * Returns the children of the specified element. If a monitor is passed in then
- * the context is assumed to be modal and, as such, the modal version of ss.resolveFilterStrings
- * is called rather than the main thread version.
- */
- protected synchronized Object[] internalGetChildren(IProgressMonitor monitor, Object element)
- {
- Object[] children = null;
- ISystemFilterReference fRef = getFilterReference(element);
- ISystemFilter referencedFilter = fRef.getReferencedFilter();
- boolean promptable = referencedFilter.isPromptable();
-
- ISubSystem ss = fRef.getSubSystem();
- ISubSystemConfiguration ssf = SubSystemHelpers.getParentSubSystemConfiguration(referencedFilter);
-
- // PROMPTING FILTER?...
- if (promptable)
- {
- children = new SystemMessageObject[1];
- try
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssf.getAdapter(ISubSystemConfigurationAdapter.class);
-
- ISystemFilter newFilter = adapter.createFilterByPrompting(ssf, fRef, getShell());
- if (newFilter == null)
- {
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED), ISystemMessageObject.MSGTYPE_CANCEL, element);
- }
- else // filter successfully created!
- {
- // return "filter created successfully" message object for this node
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FILTERCREATED), ISystemMessageObject.MSGTYPE_OBJECTCREATED, element);
- // select the new filter reference...
- ISystemFilterReference sfr = fRef.getParentSystemFilterReferencePool().getExistingSystemFilterReference(ss, newFilter);
- ISystemViewInputProvider inputProvider = getInput();
- if ((sfr != null) && (inputProvider != null) && (inputProvider.getViewer() != null))
- {
- SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(sfr, ISystemResourceChangeEvents.EVENT_SELECT_EXPAND, null);
- Viewer v = inputProvider.getViewer();
- if (v instanceof ISystemResourceChangeListener)
- {
- //sr.fireEvent((ISystemResourceChangeListener)v, event); // only expand in the current viewer, not all viewers!
- sr.postEvent((ISystemResourceChangeListener) v, event); // only expand in the current viewer, not all viewers!
- }
- }
- }
- }
- catch (Exception exc)
- {
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED), ISystemMessageObject.MSGTYPE_ERROR, element);
- SystemBasePlugin.logError("Exception prompting for filter ", exc);
- }
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"returning children");
- return children;
- }
-
- // NON-PROMPTING FILTER?...
- Object[] nestedFilterReferences = fRef.getSystemFilterReferences(ss);
- int nbrFilterStrings = referencedFilter.getFilterStringCount();
- if (nbrFilterStrings == 0)
- return nestedFilterReferences;
- else
- {
- /*
- // show filter strings
- if (ssf.showFilterStrings())
- {
- SystemFilterStringReference[] refFilterStrings = fRef.getSystemFilterStringReferences();
- if ((nestedFilterReferences == null) || (nestedFilterReferences.length == 0))
- return refFilterStrings;
- if ((refFilterStrings == null) || (refFilterStrings.length == 0))
- return nestedFilterReferences;
- int nbrChildren = nestedFilterReferences.length + refFilterStrings.length;
- children = new Object[nbrChildren];
- int idx=0;
- for (idx=0; idx<nestedFilterReferences.length; idx++)
- children[idx] = nestedFilterReferences[idx];
- for (int jdx=0; jdx<refFilterStrings.length; jdx++)
- children[idx++] = refFilterStrings[jdx];
- return children;
- }
- // resolve filter strings
- else
- */ {
- String[] filterStrings = referencedFilter.getFilterStrings();
-
- try
- {
-
- // hack to propogate type filters down from connection in select dialogs...
- ISystemViewInputProvider inputProvider = getInput();
- if ((inputProvider != null) && (inputProvider instanceof SystemSelectRemoteObjectAPIProviderImpl) &&
- (filterStrings != null) && (filterStrings.length > 0))
- {
- SystemSelectRemoteObjectAPIProviderImpl ip = (SystemSelectRemoteObjectAPIProviderImpl) inputProvider;
- if (ip.filtersNeedDecoration(element))
- {
- String[] adorned = new String[filterStrings.length];
- for (int idx = 0; idx < filterStrings.length; idx++)
- adorned[idx] = ip.decorateFilterString(element, filterStrings[idx]);
- filterStrings = adorned;
- }
- }
-
-
- if (!referencedFilter.isTransient() &&
- ssf.supportsFilterCaching() &&
- !fRef.isStale() &&
- fRef.hasContents(SystemChildrenContentsType.getInstance()))
- {
- children = fRef.getContents(SystemChildrenContentsType.getInstance());
- }
- else
- {
- Object[] allChildren = null;
-
- if (monitor == null)
- {
- Shell shell = getShell();
- allChildren = ss.resolveFilterStrings(filterStrings);
- }
- else
- {
- allChildren = ss.resolveFilterStrings(monitor, filterStrings);
- }
-
- if (allChildren == null)
- {
- System.out.println("filter children == null!");
- }
- else
- {
- int nbrNestedFilters = (nestedFilterReferences == null) ? 0 : nestedFilterReferences.length;
- children = new Object[nbrNestedFilters + allChildren.length];
- int idx = 0;
- for (idx = 0; idx < nbrNestedFilters; idx++)
- children[idx] = nestedFilterReferences[idx];
- for (int jdx = 0; jdx < allChildren.length; jdx++)
- children[idx++] = allChildren[jdx];
-
-
- if (!referencedFilter.isTransient() && ssf.supportsFilterCaching())
- {
- fRef.setContents(SystemChildrenContentsType.getInstance(), children);
- }
- }
- }
-
- }
- catch (InterruptedException exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED), ISystemMessageObject.MSGTYPE_CANCEL, element);
- SystemBasePlugin.logDebugMessage(this.getClass().getName(), "Filter resolving canceled by user.");
- }
- catch (Exception exc)
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED), ISystemMessageObject.MSGTYPE_ERROR, element);
- SystemBasePlugin.logError("Exception resolving filters' strings ", exc);
- } // message already issued
-
- if ((children == null) || (children.length == 0))
- {
- children = new SystemMessageObject[1];
- children[0] = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY), ISystemMessageObject.MSGTYPE_EMPTY, element);
- }
- return children;
- }
- }
- }
-
- /**
- * Return true if this object has children.
- * That is, if the referenced filter has nested filters or filter strings.
- */
- public boolean hasChildren(Object element)
- {
- ISystemFilterReference fRef = getFilterReference(element);
- ISystemFilter referencedFilter = fRef.getReferencedFilter();
-
- ISubSystemConfiguration factory = getSubSystemConfiguration(referencedFilter);
- if (factory.supportsFilterChildren())
- {
- int nbrNestedFilters = referencedFilter.getSystemFilterCount();
- int nbrFilterStrings = referencedFilter.getFilterStringCount();
- return (nbrNestedFilters > 0) || (nbrFilterStrings > 0);
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Return true if this object is a "prompting" object that prompts the user when expanded.
- * For such objects, we do not try to save and restore their expansion state on F5 or between
- * sessions.
- * <p>
- * Default is false unless this is a prompting filter
- */
- public boolean isPromptable(Object element)
- {
- boolean promptable = false;
- ISystemFilter filter = getFilter(element);
- promptable = filter.isPromptable();
- //if (!promptable && !SystemPreferencesManager.getPreferencesManager().getShowFilterStrings())
- if (!promptable)
- {
- //if (isCommandFilter(filter) || isJobFilter(filter))
- if (isCommandFilter(filter))
- promptable = true;
- }
- return promptable;
- }
-
- /**
- * <i>Overide of parent method.</i><br>
- * From <samp>IActionFilter</samp> so the popupMenus extension point can use &lt;filter&gt;, &lt;enablement&gt;
- * or &lt;visibility&gt;. We add support is for the following:
- * <ol>
- * <li>name="filterType". The value is tested against the non-translated filter type. Note all subsystems
- * support different types of filters.
- * <li>name="showChangeFilterStringsPropertyPage". The value is tested against the call to the subsystem factory method showChangeFilterStringsPropertyPage(SystemFilter).
- * Compares against "true" (default) or "false".
- * </ol>
- */
- public boolean testAttribute(Object target, String name, String value)
- {
- if (name.equalsIgnoreCase("filterType"))
- {
- ISystemFilterReference ref = getFilterReference(target);
- String type = ref.getReferencedFilter().getType();
- if ((type == null) || (type.length() == 0))
- return false;
- else
- return value.equals(type);
- }
- else if (name.equalsIgnoreCase("showChangeFilterStringPropertyPage"))
- {
- ISystemFilterReference ref = getFilterReference(target);
- ISubSystemConfiguration ssf = SubSystemHelpers.getParentSubSystemConfiguration(ref.getReferencedFilter());
- if (value.equals("true"))
- return ssf.showChangeFilterStringsPropertyPage(ref.getReferencedFilter());
- else
- return !ssf.showChangeFilterStringsPropertyPage(ref.getReferencedFilter());
- }
- else
- return super.testAttribute(target, name, value);
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- int nbrOfProperties = 4;
- propertyDescriptorArray = new PropertyDescriptor[nbrOfProperties];
- int idx = 0;
- // parent filter pool
- propertyDescriptorArray[idx] = createSimplePropertyDescriptor(P_PARENT_FILTERPOOL, SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_TOOLTIP);
- // parent filter
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_PARENT_FILTER, SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_TOOLTIP);
- // number filter strings
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_FILTERSTRINGS_COUNT, SystemViewResources.RESID_PROPERTY_FILTERSTRINGS_COUNT_LABEL, SystemViewResources.RESID_PROPERTY_FILTERSTRINGS_COUNT_TOOLTIP);
- // Related connection
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_IS_CONNECTION_PRIVATE, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
- /**
- * Return our unique property values
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String) key;
- ISystemFilter filter = getFilter(propertySourceInput);
- if (name.equals(ISystemPropertyConstants.P_FILTERSTRINGS_COUNT))
- {
- int nbrFilterStrings = filter.getFilterStringCount();
- return Integer.toString(nbrFilterStrings);
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTER))
- {
- ISystemFilter parent = filter.getParentFilter();
- if (parent != null)
- return parent.getName();
- else
- return getTranslatedNotApplicable();
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTERPOOL))
- {
- ISystemFilterPool parent = filter.getParentFilterPool();
- if (parent != null)
- return parent.getName();
- else
- return getTranslatedNotApplicable();
- }
- else if (name.equals(ISystemPropertyConstants.P_IS_CONNECTION_PRIVATE))
- {
- ISystemFilterPool parent = filter.getParentFilterPool();
- return (parent.getOwningParentName()==null) ? getTranslatedNo() : getTranslatedYes();
- }
- else
- return null;
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- ISystemFilter filter = getFilter(element);
- return !filter.isNonDeletable(); // defect 43190
- //return true;
- }
-
- /**
- * Perform the delete action.
- * This physically deletes the filter pool and all references.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- ISystemFilter filter = getFilter(element);
- ISystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- fpMgr.deleteSystemFilter(filter);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- ISystemFilter filter = getFilter(element);
- return !filter.isNonRenamable(); // defect 43190
- //return true;
- }
-
- /**
- * Perform the rename action. Assumes uniqueness checking was done already.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- ISystemFilter filter = getFilter(element);
- ISystemFilterPoolManager fpMgr = filter.getSystemFilterPoolManager();
- fpMgr.renameSystemFilter(filter, name);
- return true;
- }
-
- /**
- * Return a validator for verifying the new name is correct.
- * @param either a filter for a rename action, or a filter pool for a "new" action.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- ISystemFilter filter = null;
- ISystemFilterPool pool = null;
- Vector filterNames = null;
- if (element instanceof ISystemFilterReference)
- {
- filter = getFilter(element);
- pool = filter.getParentFilterPool();
- if (pool != null)
- filterNames = pool.getSystemFilterNames();
- else
- {
- ISystemFilter parentFilter = filter.getParentFilter();
- filterNames = parentFilter.getSystemFilterNames();
- }
- }
- else if (element instanceof ISystemFilter)
- {
- filter = (ISystemFilter) element;
- pool = filter.getParentFilterPool();
- if (pool != null)
- filterNames = pool.getSystemFilterNames();
- else
- {
- ISystemFilter parentFilter = filter.getParentFilter();
- filterNames = parentFilter.getSystemFilterNames();
- }
- }
- else
- {
- pool = (ISystemFilterPool) element;
- filterNames = pool.getSystemFilterNames();
- }
- /*
- if (filter != null)
- {
- filterNames.removeElement(filter.getName()); // remove current filter's name
- System.out.println("Existing names for " + filter.getName());
- for (int idx=0; idx<filterNames.size(); idx++)
- System.out.println("...: " + filterNames.elementAt(idx));
- }
- */
- ISystemValidator nameValidator = new ValidatorFilterName(filterNames);
- return nameValidator;
- }
-
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns mgrName.poolName.filterName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- ISystemFilterReference fRef = (ISystemFilterReference) element;
- ISystemFilter filter = fRef.getReferencedFilter();
- String mgrName = filter.getSystemFilterPoolManager().getName();
- return (mgrName + "." + filter.getParentFilterPool().getName() + "." + newName).toUpperCase();
- }
-
- /**
- * Don't show "Open in new perspective" if this is promptable
- */
- public boolean showOpenViewActions(Object element)
- {
- ISystemFilter filter = getFilter(element);
- return !filter.isPromptable();
- }
-
-
- /**
- * Don't show generic "Show in Table" if the factory asks not to
- */
- public boolean showGenericShowInTableAction(Object element)
- {
- ISystemFilter filter = getFilter(element);
- ISubSystemConfiguration ssParentFactory = getSubSystemConfiguration(filter);
- return ssParentFactory.showGenericShowInTableOnFilter();
- }
-
- /**
- * Return true if we should show the refresh action in the popup for the element.
- */
- public boolean showRefresh(Object element)
- {
- ISystemFilter filter = getFilter(element);
- ISubSystemConfiguration ssParentFactory = getSubSystemConfiguration(filter);
- return ssParentFactory.showRefreshOnFilter();
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- ISystemFilterReference fRef = getFilterReference(element);
- ISystemFilter referencedFilter = fRef.getReferencedFilter();
- ISystemFilterPool pool = referencedFilter.getParentFilterPool();
- String handle = pool.getReferenceName() + "=";
- ISystemFilter parentFilter = referencedFilter.getParentFilter();
- while (parentFilter != null)
- {
- handle += parentFilter.getName() + ";";
- parentFilter = parentFilter.getParentFilter();
- }
- handle += referencedFilter.getName();
- return handle;
- }
- /**
- * Return what to save to disk to identify this element when it is the input object to a secondary
- * Remote Systems Explorer perspective.
- */
- public String getInputMementoHandle(Object element)
- {
- Object parent = ((ISystemFilterReference) element).getParent(); //getParent(element); // will be filter (nested) or filter pool
- ISystemViewElementAdapter parentAdapter = getAdapter(parent);
- boolean showFPs = SystemPreferencesManager.getPreferencesManager().getShowFilterPools();
- if (parent instanceof ISystemFilterPoolReference) // not a nested filter
- {
- if (!showFPs) // not showing the real parent in GUI?
- {
- parent = parentAdapter.getParent(parent); // get the subsystem parent of the filter pool reference
- parentAdapter = getAdapter(parent); // get the adapter for the subsystem parent
- }
- }
- return parentAdapter.getInputMementoHandle(parent) + MEMENTO_DELIM + getMementoHandle(element);
- }
-
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return ISystemMementoConstants.MEMENTO_KEY_FILTERREFERENCE;
- }
-
- /**
- * Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted
- * messages. In these cases return false from this method. The default is true.
- * <p>
- * WE RETURN FALSE IF THIS IS A PROMPTABLE FILTER, COMMAND FILTER OR JOB FILTER.
- */
- public boolean saveExpansionState(Object element)
- {
- boolean savable = true;
- ISystemFilterReference fRef = getFilterReference(element);
- ISystemFilter referencedFilter = fRef.getReferencedFilter();
- boolean promptable = referencedFilter.isPromptable();
- if (promptable)
- savable = false;
- else
- {
- // I thought the types would be set for these filters, but it isn't! Phil.
- /*
- String type = referencedFilter.getType();
- if ((type!=null) && (type.equals("Command") || type.equals("Job")))
- savable = false;
- */
- if (isCommandFilter(referencedFilter))
- savable = false;
- }
- return savable;
- }
-
- /**
- * Return true if the given filter is from a command subsystem
- */
- public static boolean isCommandFilter(ISystemFilter filter)
- {
- ISubSystemConfiguration ssf = (ISubSystemConfiguration) filter.getProvider();
- return ssf.supportsCommands();
- }
-
- // ------------------------------------------
- // METHODS TO SUPPORT COMMON DRAG AND DROP FUNCTION...
- // ------------------------------------------
- /**
- * drag support is handled directly for filter references, rather than delegated here.
- */
- public boolean canDrag(Object element)
- {
- ISystemFilterReference fRef = getFilterReference(element);
- if (fRef != null)
- {
- if (getSubSystemConfiguration(fRef.getReferencedFilter()).supportsFilterStringExport())
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Can this object be added as part of the filter?
- */
- public boolean canDrop(Object element)
- {
- ISystemFilterReference fRef = getFilterReference(element);
- if (fRef != null)
- {
- ISubSystemConfiguration factory = getSubSystemConfiguration(fRef.getReferencedFilter());
- if (factory.supportsDropInFilters())
- {
- // if the drop is handled by the subsystem rather than this adapter, this will be true.
- if (factory.providesCustomDropInFilters())
- {
- return true;
- }
-
- if (!fRef.getReferencedFilter().isNonChangable())
- {
- if (factory.supportsMultiStringFilters())
- {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public ISystemResourceSet doDrag(SystemRemoteResourceSet set, IProgressMonitor monitor)
- {
- return set;
- }
-
- /**
- * drag support is handled directory for filter references, rather than delegated here.
- */
- public Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor)
- {
- return element;
- }
-
- /**
- * Add the absolute name of the from object to the list of filter strings for this filter
- */
- public Object doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor)
- {
- if (sameSystemType)
- {
- ISystemFilterReference fRef = getFilterReference(to);
- ISystemFilter filter = fRef.getReferencedFilter();
-
- if (from instanceof ISystemFilterReference)
- {
- ISystemFilter srcFilter = ((ISystemFilterReference) from).getReferencedFilter();
- String[] filterStrings = srcFilter.getFilterStrings();
- for (int i = 0; i < filterStrings.length; i++)
- {
- filter.addFilterString(filterStrings[i]);
- }
- return fRef;
- }
- else if (from instanceof IAdaptable)
- {
- ISystemRemoteElementAdapter radapter = (ISystemRemoteElementAdapter) ((IAdaptable) from).getAdapter(ISystemRemoteElementAdapter.class);
-
- {
-
- String newFilterStr = radapter.getFilterStringFor(from);
- if (newFilterStr != null)
- {
- filter.addFilterString(newFilterStr);
- return fRef;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Validate that the source and target for the drag and drop operation are
- * compatable.
- */
- public boolean validateDrop(Object src, Object target, boolean sameSystem)
- {
- if (!sameSystem)
- {
- if (src instanceof IResource)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- if (target instanceof ISystemFilterReference)
- {
- ISystemFilterReference filterRef = (ISystemFilterReference) target;
- if (getSubSystemConfiguration(filterRef.getReferencedFilter()).supportsMultiStringFilters())
- {
- if (src instanceof ISystemFilterReference)
- {
- // yantzi: wswb2.1.2 (defect 50994) add check for filter types
- String srcType = ((ISystemFilterReference)src).getReferencedFilter().getType();
- String targetType = filterRef.getReferencedFilter().getType();
- if (targetType != null && srcType != null)
- {
- if (targetType.equals(srcType))
- {
- return true;
- }
- }
- else
- {
- return true;
- }
- }
- // check if src has a filter string
- else if (src instanceof IAdaptable)
- {
- ISystemRemoteElementAdapter adapter = (ISystemRemoteElementAdapter) ((IAdaptable) src).getAdapter(ISystemRemoteElementAdapter.class);
- if (adapter != null)
- {
- if (adapter.getFilterStringFor(src) != null)
- {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
-
- /*
- * Return whether deferred queries are supported.
- */
- public boolean supportsDeferredQueries()
- {
- return true;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterStringAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterStringAdapter.java
deleted file mode 100644
index 0f1065b3a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterStringAdapter.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.filters.ISystemFilterString;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Default Adapter for displaying filter string objects in tree views.
- */
-public class SystemViewFilterStringAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- //private static String translatedFilterString = null;
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given filter object.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- //if (selection.size() != 1)
- // return; // does not make sense adding unique actions per multi-selection
- ISystemFilterString filterString = getFilterString(selection.getFirstElement());
- if (filterString.getParentSystemFilter().isTransient())
- return;
- /*
- SubSystemConfiguration ssFactory = SubSystemHelpers.getParentSubSystemConfiguration(filterString);
- ssFactory.setConnection(null);
- IAction[] actions = ssFactory.getFilterActions(filter, shell);
- if (actions != null)
- {
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- } */
- }
-
- private ISystemFilterString getFilterString(Object element)
- {
- return (ISystemFilterString)element;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- ImageDescriptor filterImage = null;
- ISystemFilterString filterString = getFilterString(element);
- if (filterString.getProvider() != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)filterString.getProvider().getAdapter(ISubSystemConfigurationAdapter.class);
- filterImage = adapter.getSystemFilterStringImage(filterString);
- }
- if (filterImage == null)
- filterImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERSTRING_ID);
- return filterImage;
- }
-
- /**
- * Return the label for this object. Calls getName on the filter
- */
- public String getText(Object element)
- {
- return getFilterString(element).getString();
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return getFilterString(element).getString();
- }
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- ISystemFilterString filterString = getFilterString(element);
- ISystemFilter filter = filterString.getParentSystemFilter();
- return filter.getSystemFilterPoolManager().getName() + "." + filter.getParentFilterPool().getName() + "." + filter.getName() + "." + filterString.getString();
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- //SystemFilterString filterString = getFilterString(element);
- //if (filterString.getParentSystemFilter().isTransient())
- return SystemResources.RESID_PP_FILTERSTRING_TYPE_VALUE;
- //SubSystemConfiguration ssParentFactory = SubSystemHelpers.getParentSubSystemConfiguration(filterString.getParentSystemFilter());
- //return ssParentFactory.getTranslatedFilterStringTypeProperty(filterString);
- }
-
- /**
- * Return the parent of this object.
- * This will be either a SubSystem object, or a filter object.
- */
- public Object getParent(Object element)
- {
- ISystemFilterString filterString = getFilterString(element);
- return filterString.getParentSystemFilter();
- }
-
- /**
- * Return the children of this filter.
- * This returns an empty list.
- */
- public Object[] getChildren(Object element)
- {
- return null;
- }
-
-
- /**
- * Return true if this object has children. We return false;
- */
- public boolean hasChildren(Object element)
- {
- return false;
- }
-
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[3];
- // parent filter pool
- propertyDescriptorArray[0] = createSimplePropertyDescriptor(P_PARENT_FILTERPOOL,SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTPOOL_TOOLTIP);
- // parent filter
- propertyDescriptorArray[1] = createSimplePropertyDescriptor(P_PARENT_FILTER,SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_LABEL, SystemViewResources.RESID_PROPERTY_FILTERPARENTFILTER_TOOLTIP);
- // filter string
- propertyDescriptorArray[2] = createSimplePropertyDescriptor(P_FILTERSTRING,SystemViewResources.RESID_PROPERTY_FILTERSTRING_LABEL, SystemViewResources.RESID_PROPERTY_FILTERSTRING_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param key the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- protected Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- ISystemFilterString filterString = getFilterString(propertySourceInput);
-
- if (name.equals(ISystemPropertyConstants.P_FILTERSTRING))
- {
- return filterString.getString();
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTER))
- {
- return filterString.getParentSystemFilter().getName();
- }
- else if (name.equals(ISystemPropertyConstants.P_PARENT_FILTERPOOL))
- {
- if (filterString.getParentSystemFilter().isTransient())
- return getTranslatedNotApplicable();
- ISystemFilterPool parent = filterString.getParentSystemFilter().getParentFilterPool();
- if (parent != null)
- return parent.getName();
- else
- return null;
- }
- else
- return null;
- }
-
- // FOR COMMON DELETE ACTIONS
- public boolean showDelete(Object element)
- {
- return !getFilterString(element).getParentSystemFilter().isTransient();
- }
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- return true;
- }
-
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- ISystemFilterString filterString = getFilterString(element);
- ISystemFilter filter = filterString.getParentSystemFilter();
- ISystemFilterPoolManager fpMgr = filterString.getSystemFilterPoolManager();
- Vector strings = filter.getSystemFiltersVector();
- String[] filterStrings = new String[strings.size()-1];
- for (int idx=0; idx<filterStrings.length; idx++)
- filterStrings[idx] = ((ISystemFilterString)strings.elementAt(idx)).toString();
- strings.remove(filterString);
- fpMgr.updateSystemFilter(filter, filter.getName(), filterStrings);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- public boolean showRename(Object element)
- {
- //return !getFilterString(element).getParentSystemFilter().isTransient();
- return false;
- }
-
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- return false; //true;
- }
- /**
- * Perform the rename action.
- */
- public boolean doRename(Shell shell, Object element, String name) throws Exception
- {
- return true;
- }
-
- // FOR COMMON REFRESH ACTIONS
- public boolean showRefresh(Object element)
- {
- return false;
- }
-
- /**
- * Return true if we should show the refresh action in the popup for the given element.
- */
- public boolean showOpenViewActions(Object element)
- {
- return false;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewForm.java
deleted file mode 100644
index ba8d6ec38..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewForm.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import java.util.Vector;
-
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemCascadingPulldownMenuAction;
-import org.eclipse.rse.ui.actions.SystemNewConnectionAction;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.Tree;
-
-
-/**
- * This re-usable widget is for a single widget that displays a
- * toolbar underneath which is a systems view tree.
- */
-public class SystemViewForm extends Composite implements ISystemTree
-{
- private ToolBar toolbar = null;
- private ToolBarManager toolbarMgr = null;
- private Button refreshButton, getListButton;
- private SystemView tree = null;
- private ISystemMessageLine msgLine = null;
- private boolean showActions = true;
- private boolean deferLoading = false;
- private boolean requestInProgress = false;
- private ISystemViewInputProvider inputProvider = null;
- private ISystemViewInputProvider emptyProvider = new SystemEmptyListAPIProviderImpl();
- private Vector requestListeners = null;
- public static final int DEFAULT_WIDTH = 300;
- public static final int DEFAULT_HEIGHT = 300;
-
- // the following allows us to identify dialog/wizard hosting this widget so we can
- // disable it's close capability while a remote request is in place.
- protected Object caller;
- protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog;
-
- // viewer filters
- protected ViewerFilter[] initViewerFilters = null;
-
- /**
- * Constructor
- * @param shell The owning window
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically SWT.NULL
- * @param inputProvider Who is supplying the roots for the system viewer?
- * @param singleSelectionMode Are users allowed to select multiple things at once?
- * @param msgLine where to show messages and tooltip text
- */
- public SystemViewForm(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider,
- boolean singleSelectionMode, ISystemMessageLine msgLine)
- {
- this(shell, parent, style, inputProvider, singleSelectionMode, msgLine, 1, 1);
- }
- /**
- * Constructor when you want to span more than one column or row
- * @param shell The owning window
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically SWT.NULL
- * @param inputProvider Who is supplying the roots for the system viewer?
- * @param singleSelectionMode Are users allowed to select multiple things at once?
- * @param msgLine where to show messages and tooltip text
- * @param horizontalSpan how many columns in parent composite to span
- * @param verticalSpan how many rows in parent composite to span
- */
- public SystemViewForm(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider,
- boolean singleSelectionMode, ISystemMessageLine msgLine,
- int horizontalSpan, int verticalSpan)
- {
- this(shell, parent, style, inputProvider, singleSelectionMode, msgLine, horizontalSpan, verticalSpan, null);
- }
-
- /**
- * Constructor when you want to span more than one column or row
- * @param shell The owning window
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically SWT.NULL
- * @param inputProvider Who is supplying the roots for the system viewer?
- * @param singleSelectionMode Are users allowed to select multiple things at once?
- * @param msgLine where to show messages and tooltip text
- * @param horizontalSpan how many columns in parent composite to span
- * @param verticalSpan how many rows in parent composite to span
- * @param initViewerFilters the initial viewer filters to apply.
- */
- public SystemViewForm(Shell shell, Composite parent, int style, ISystemViewInputProvider inputProvider,
- boolean singleSelectionMode, ISystemMessageLine msgLine,
- int horizontalSpan, int verticalSpan, ViewerFilter[] initViewerFilters)
- {
- super(parent, style);
- this.inputProvider = inputProvider;
- this.msgLine = msgLine;
- callerInstanceOfWizardPage = (caller instanceof WizardPage);
- callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
- prepareComposite(1, horizontalSpan, verticalSpan);
- if (inputProvider.showActionBar())
- createToolBar(shell);
- if (inputProvider.showButtonBar())
- {
- createButtonBar(this, 2);
- enableButtonBarButtons(false);
- deferLoading = true;
- }
-
- // set viewer filters
- this.initViewerFilters = initViewerFilters;
-
- createSystemView(shell, inputProvider, singleSelectionMode);
-
- if (inputProvider.showActionBar())
- populateToolBar(shell);
-
- addOurSelectionListener();
- }
-
- /**
- * Return the toolbar widget manager
- */
- public ToolBarManager getToolBarManager()
- {
- return toolbarMgr;
- }
- /**
- * Return the system view tree viewer
- */
- public SystemView getSystemView()
- {
- return tree;
- }
- /**
- * Return the system view tree viewer tree widget
- */
- public Tree getTreeControl()
- {
- return tree.getTree();
- }
-
- /**
- * Set the tree's tooltip text
- */
- public void setToolTipText(String tip)
- {
- tree.getTree().setToolTipText(tip);
- }
-
- /**
- * Refresh contents
- */
- public void refresh()
- {
- tree.refreshAll();
- }
-
- /**
- * Reset contents
- */
- public void reset(ISystemViewInputProvider inputProvider)
- {
- this.inputProvider = inputProvider;
- if (deferLoading)
- {
- tree.setSelection(null);
- tree.setInputProvider(emptyProvider);
- enableButtonBarButtons(false);
- }
- else
- {
- tree.setSelection(null);
- tree.setInputProvider(inputProvider);
- }
- }
-
- /*
- * Turn off right-click actions
- *
- NOW SET VIA INPUT PROVIDER METHODS
- public void setShowActions(boolean show)
- {
- this.showActions = show;
- if (tree != null)
- tree.setShowActions(show);
- }*/
-
- /**
- * Disable/Enable all the child controls.
- */
- public void setEnabled(boolean enabled)
- {
- if (toolbar != null)
- toolbar.setEnabled(enabled);
- tree.setEnabled(enabled);
- //if ((tree != null) && (tree.getTree() != null))
- // tree.getTree().setEnabled(enabled);
- //super.setEnabled(enabled);
- }
- /**
- * Register a listener interested in an item is selected in the system view
- * @see #removeSelectionChangedListener(ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- tree.addSelectionChangedListener(listener);
- }
- /**
- * Remove a previously set system view selection listener.
- * @see #addSelectionChangedListener(ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- tree.removeSelectionChangedListener(listener);
- }
- /**
- * Add a listener that is informed when a remote list request starts and stops.
- * This allows for the listener to do things like disable the Close button
- */
- public void addListRequestListener(ISystemLongRunningRequestListener listener)
- {
- if (requestListeners == null)
- requestListeners = new Vector();
- requestListeners.addElement(listener);
- }
- /**
- * Add a listener that is informed when a remote list request starts and stops.
- * This allows for the listener to do things like disable the Close button
- */
- public void removeListRequestListener(ISystemLongRunningRequestListener listener)
- {
- if (requestListeners != null)
- requestListeners.removeElement(listener);
- }
-
- /**
- * Return the selection of the tree viewer
- */
- public ISelection getSelection()
- {
- return tree.getSelection();
- }
-
-
- // --------------------------------------------
- // ISystemTree methods to facilitate our GUI...
- // ... all these are delegated to the SystemView tree
- // --------------------------------------------
- /**
- * Returns true if any of the selected items are currently expanded
- */
- public boolean areAnySelectedItemsExpanded()
- {
- return tree.areAnySelectedItemsExpanded();
- }
- /**
- * Returns true if any of the selected items are expandable but not yet expanded
- */
- public boolean areAnySelectedItemsExpandable()
- {
- return tree.areAnySelectedItemsExpandable();
- }
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent()
- {
- return tree.sameParent();
- }
- /**
- * This is called to accurately get the parent object for the current selection
- * for this viewer.
- * <p>
- * The getParent() method in the adapter is very unreliable... adapters can't be sure
- * of the context which can change via filtering and view options.
- */
- public Object getSelectedParent()
- {
- return tree.getSelectedParent();
- }
- /**
- * This returns the element immediately before the first selected element in this tree level.
- * Often needed for enablement decisions for move up actions.
- */
- public Object getPreviousElement()
- {
- return tree.getPreviousElement();
- }
- /**
- * This returns the element immediately after the last selected element in this tree level
- * Often needed for enablement decisions for move down actions.
- */
- public Object getNextElement()
- {
- return tree.getNextElement();
- }
-
- /**
- * This is called to walk the tree back up to the roots and return the visible root
- * node for the first selected object.
- */
- public Object getRootParent()
- {
- return tree.getRootParent();
- }
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- */
- public Object[] getElementNodes(Object element)
- {
- return tree.getElementNodes(element);
- }
- /**
- * Helper method to determine if a given object is currently selected.
- * Does consider if a child node of the given object is currently selected.
- */
- public boolean isSelectedOrChildSelected(Object parentElement)
- {
- return tree.isSelectedOrChildSelected(parentElement);
- }
-
- /**
- * Return the number of immediate children in the tree, for the given tree node
- */
- public int getChildCount(Object element)
- {
- return tree.getChildCount(element);
- }
-
- /**
- * Called when a property is updated and we need to inform the Property Sheet viewer.
- * There is no formal mechanism for this so we simulate a selection changed event as
- * this is the only event the property sheet listens for.
- */
- public void updatePropertySheet()
- {
- tree.updatePropertySheet();
- }
-
- /**
- * Called to select an object within the tree, and optionally expand it
- */
- public void select(Object element, boolean expand)
- {
- tree.select(element, expand);
- }
-
- /**
- * Returns the tree item of the first selected object. Used for setViewerItem in a resource
- * change event.
- */
- public Item getViewerItem()
- {
- return tree.getViewerItem();
- }
-
- /**
- * Returns true if it is ok to close the dialog or wizard page. Returns false if there
- * is a remote request currently in progress.
- */
- public boolean okToClose()
- {
- return !requestInProgress; //d43433
- }
-
- // -----------------------
- // INTERNAL-USE METHODS...
- // -----------------------
- /**
- * Prepares this composite control and sets the default layout data.
- * @param Number of columns the new group will contain.
- */
- protected Composite prepareComposite(int numColumns,
- int horizontalSpan, int verticalSpan)
- {
- Composite composite = this;
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.widthHint = DEFAULT_WIDTH;
- data.heightHint = DEFAULT_HEIGHT;
- data.horizontalSpan = horizontalSpan;
- data.verticalSpan = verticalSpan;
- composite.setLayoutData(data);
- return composite;
- }
-
- protected void createSystemView(Shell shell, ISystemViewInputProvider inputProvider, boolean singleSelectionMode)
- {
- // TREE
- int style = (singleSelectionMode ? SWT.SINGLE : SWT.MULTI) | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
- tree = new SystemView(shell, this, style, deferLoading ? emptyProvider : inputProvider, msgLine, initViewerFilters);
- GridData treeData = new GridData();
- treeData.horizontalAlignment = GridData.FILL;
- treeData.verticalAlignment = GridData.FILL;
- treeData.grabExcessHorizontalSpace = true;
- treeData.grabExcessVerticalSpace = true;
- treeData.widthHint = 300;
- treeData.heightHint= 200;
- tree.getTree().setLayoutData(treeData);
- tree.setShowActions(showActions);
- }
-
- protected void createToolBar(Shell shell)
- {
- toolbar = new ToolBar(this, SWT.FLAT | SWT.WRAP);
- toolbarMgr = new ToolBarManager(toolbar);
- }
-
- protected void populateToolBar(Shell shell)
- {
- SystemNewConnectionAction newConnAction = new SystemNewConnectionAction(shell, false, tree); // false implies not from popup menu
- toolbarMgr.add(newConnAction);
- SystemCascadingPulldownMenuAction submenuAction = new SystemCascadingPulldownMenuAction(shell, tree);
- toolbarMgr.add(submenuAction);
- toolbarMgr.update(false);
- }
-
- protected void createButtonBar(Composite parentComposite, int nbrButtons)
- {
- // Button composite
- Composite composite_buttons = SystemWidgetHelpers.createTightComposite(parentComposite, nbrButtons);
- getListButton = SystemWidgetHelpers.createPushButton(composite_buttons, null, SystemResources.ACTION_VIEWFORM_GETLIST_LABEL, SystemResources.ACTION_VIEWFORM_GETLIST_TOOLTIP);
- refreshButton = SystemWidgetHelpers.createPushButton(composite_buttons, null, SystemResources.ACTION_VIEWFORM_REFRESH_LABEL, SystemResources.ACTION_VIEWFORM_REFRESH_TOOLTIP);
- }
-
-
- protected void addOurSelectionListener()
- {
- // Add the button listener
- SelectionListener selectionListener = new SelectionListener()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- };
- public void widgetSelected(SelectionEvent event)
- {
- Object src = event.getSource();
- if (src==getListButton)
- processGetListButton();
- else if (src==refreshButton)
- processRefreshButton();
- };
- };
- if (getListButton != null)
- getListButton.addSelectionListener(selectionListener);
- if (refreshButton != null)
- refreshButton.addSelectionListener(selectionListener);
-
- }
- protected void addOurMouseListener()
- {
- MouseListener mouseListener = new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- //requestActivation();
- }
- };
- toolbar.addMouseListener(mouseListener);
- }
-
- /**
- * Process the refresh button.
- */
- protected void processRefreshButton()
- {
- refreshButton.setEnabled(false);
- getListButton.setEnabled(false);
- requestInProgress = true;
- fireRequestStartEvent();
-
- refresh();
-
- fireRequestStopEvent();
- requestInProgress = false;
- enableButtonBarButtons(true);
- }
-
- /**
- * Process the getList button.
- */
- protected void processGetListButton()
- {
- refreshButton.setEnabled(false);
- getListButton.setEnabled(false);
- requestInProgress = true;
- fireRequestStartEvent();
-
- tree.setInputProvider(inputProvider);
-
- fireRequestStopEvent();
- requestInProgress = false;
- enableButtonBarButtons(true);
- }
-
- /**
- * Enable/Disable refresh and getList buttons.
- * Note that these are mutually exclusive
- */
- protected void enableButtonBarButtons(boolean enableRefresh)
- {
- if (refreshButton != null)
- refreshButton.setEnabled(enableRefresh);
- if (getListButton != null)
- getListButton.setEnabled(!enableRefresh);
- }
-
- /**
- * Fire long running request listener event
- */
- protected void fireRequestStartEvent()
- {
- if (requestListeners != null)
- {
- SystemLongRunningRequestEvent event = new SystemLongRunningRequestEvent();
- for (int idx=0; idx<requestListeners.size(); idx++)
- ((ISystemLongRunningRequestListener)requestListeners.elementAt(idx)).startingLongRunningRequest(event);
- }
- }
-
- /**
- * Fire long running request listener event
- */
- protected void fireRequestStopEvent()
- {
- if (requestListeners != null)
- {
- SystemLongRunningRequestEvent event = new SystemLongRunningRequestEvent();
- for (int idx=0; idx<requestListeners.size(); idx++)
- ((ISystemLongRunningRequestListener)requestListeners.elementAt(idx)).endingLongRunningRequest(event);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java
deleted file mode 100644
index b373fced2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewLabelAndContentProvider.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.SystemMessageObject;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.progress.DeferredTreeContentManager;
-import org.eclipse.ui.progress.PendingUpdateAdapter;
-
-
-/**
- * Provides tree contents for objects that have the ISystemViewElement
- * adapter registered. Also provides label contents, so can be used for
- * both a content and label provider for TreeViewers.
- * <p>
- * This has a general flavour, which is used in most cases, and also has
- * a specialized flavour for universal file systems, which allows restricting
- * the list to files only or folders only. It also allows further subsetting by
- * setting an input filter or filterstring.
- */
-public class SystemViewLabelAndContentProvider extends LabelProvider
- implements ITreeContentProvider, ILabelProvider, ITableLabelProvider
- // ,IResourceChangeListener
-{
- private static final Object[] NO_OBJECTS = new Object[0];
-
- protected Viewer viewer;
- private boolean filesOnly, foldersOnly;
- private String filterString = null;
- private Hashtable resolvedChildrenPerFolder = null; // local cache to improve performance
-
- private DeferredTreeContentManager manager;
- /**
- * The cache of images that have been dispensed by this provider.
- * Maps ImageDescriptor->Image.
- */
- private Map imageTable = new Hashtable(40);
-
- /**
- * Constructor
- */
- public SystemViewLabelAndContentProvider()
- {
- // System.out.println("inside ctor for LCProvider " + this);
- }
- /**
- * Constructor to restrict to remote folders or files
- */
- public SystemViewLabelAndContentProvider(boolean foldersOnly, boolean filesOnly)
- {
- this();
- this.foldersOnly = foldersOnly;
- this.filesOnly = filesOnly;
- }
- /**
- * Set a filter string to subset the list by. For example, "A*.java" or "java,class,"
- * Only valid if filesOnly or foldersOnly mode. If the latter, its recorded and used
- * the next time files are requested from any folder.
- */
- public void setFilterString(String filterString)
- {
- this.filterString = filterString;
-
- flushCache();
- }
- /**
- * Get the current filter string being used to subset the list by.
- * Will be null unless setFilterString has previously been called.
- */
- public String getFilterString()
- {
- return filterString;
- }
-
-
-
- /**
- * Flush the in-memory cache which remembers the result of the last
- * getChildren request when we are in files-only or folders-only
- * mode. Only applies when the two-boolean constructor is used.
- */
- public void flushCache()
- {
- resolvedChildrenPerFolder = null;
- }
-
- /**
- * Return the current viewer we are associated with
- */
- public Viewer getViewer()
- {
- return viewer;
- }
-
- /**
- * The visual part that is using this content provider is about
- * to be disposed. Deallocate all allocated SWT resources.
- */
- public void dispose()
- {
- // AS LONG AS WE DON'T SUPPORT IWORKSPACE OBJECT THIS IS NOT NEEDED.
- // WE LEAVE IT IN BECAUSE IT IS HARMLESS AND MIGHT BE OF VALUE SOMEDAY.
- if (viewer != null)
- {
- Object obj = viewer.getInput();
- if (obj != null)
- {
- if (obj instanceof IWorkspace)
- {
- //IWorkspace workspace = (IWorkspace) obj;
- //workspace.removeResourceChangeListener(this);
- }
- else if (obj instanceof IContainer)
- {
- //IWorkspace workspace = ((IContainer) obj).getWorkspace();
- //workspace.removeResourceChangeListener(this);
- }
- }
- }
- // The following we got from WorkbenchLabelProvider
- if (imageTable != null)
- {
- Collection imageValues = imageTable.values();
- if (imageValues!=null)
- {
- Iterator images = imageValues.iterator();
- if (images!=null)
- while (images.hasNext())
- ((Image)images.next()).dispose();
- imageTable = null;
- }
- }
- }
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getAdapter(Object o)
- {
- ISystemViewElementAdapter adapter = null;
- if (o == null)
- {
- SystemBasePlugin.logWarning("ERROR: null passed to getAdapter in SystemViewLabelAndContentProvider");
- }
- else
- {
- if (o instanceof IAdaptable)
- {
- adapter = (ISystemViewElementAdapter)((IAdaptable)o).getAdapter(ISystemViewElementAdapter.class);
- }
- else
- {
- adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
- }
- if (adapter == null)
- {
- if (!(o instanceof PendingUpdateAdapter))
- {
- SystemBasePlugin.logWarning("ADAPTER IS NULL FOR ELEMENT OF TYPE: " + o.getClass().getName());
- }
- }
- }
- if ((adapter!=null) && (viewer != null))
- {
- Shell shell = null;
- if (viewer instanceof ISystemResourceChangeListener)
- shell = ((ISystemResourceChangeListener)viewer).getShell();
- else
- shell = viewer.getControl().getShell();
- adapter.setShell(shell);
- //System.out.println("Inside getAdapter for LCProvider "+this+", setting viewer of adapter to "+viewer);
- adapter.setViewer(viewer);
- if (viewer.getInput() instanceof ISystemViewInputProvider)
- {
- ISystemViewInputProvider inputProvider = (ISystemViewInputProvider)viewer.getInput();
- //inputProvider.setShell(shell); this is now done in the getInput() method of viewer.
- adapter.setInput(inputProvider);
- }
- }
- else if (viewer == null)
- SystemBasePlugin.logWarning("VIEWER IS NULL FOR SYSTEMVIEWLABELANDCONTENTPROVIDER");
- return adapter;
- }
-
- /**
- * Cancel any jobs that are fetching content from the given location.
- * @param location
- */
- public void cancelJobs(Object location)
- {
- if (manager != null) {
- manager.cancel(location);
- }
- }
-
- protected boolean supportsDeferredQueries()
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(ISystemPreferencesConstants.USE_DEFERRED_QUERIES);
- }
-
-
- /**
- * @see ITreeContentProvider
- */
- public Object[] getChildren(Object element)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (supportsDeferredQueries())
- {
- if (manager != null && adapter.supportsDeferredQueries())
- {
- ISubSystem ss = adapter.getSubSystem(element);
- if (ss != null)
- {
- // if (ss.isConnected())
- {
-
- Object[] children = manager.getChildren(element);
- if (children != null)
- {
- // This will be a placeholder to indicate
- // that the real children are being fetched
- return children;
- }
- }
- }
- }
- }
-
-
- //System.out.println("inside getChildren for landcProvider");
- //System.out.println("...element = " + element);
- //System.out.println("...adapter = " + adapter);
- if (adapter != null)
- {
- // we first test to see if this is an expand-to filter in effect for this
- // object, and if so use it...
- if ((viewer instanceof SystemView) && (((SystemView)viewer).getSystemViewPart() != null) &&
- (adapter instanceof ISystemRemoteElementAdapter))
- {
- String expandToFilter = ((SystemView)viewer).getExpandToFilter(element);
- if (expandToFilter != null)
- return adapter.getChildrenUsingExpandToFilter(element, expandToFilter);
- }
- Object[] children = null;
- // The re-usable Eclipse GUI widgets are not very efficient.
- // The are always re-asking for children, which for remote requests
- // causes a lot of flashing and unnecessary trips to the host.
- // To overcome this, once we successfully resolve a request,
- // we remember the result so on the subsequent request for the
- // same files or folders, we can return that remembered cache.
- // The tricky part is what to key each request by. We use the element
- // as the key ... this is the parent folder which children are being
- // asked for. However, for the same folder we will be asked for
- // folders and files in separate requests. It turns out this is not
- // not a problem though, because a separate instance of us is used
- // for files versus folders so each maintains its own cache.
-
- if ((filesOnly || foldersOnly) && (resolvedChildrenPerFolder != null))
- {
- children = (Object[])resolvedChildrenPerFolder.get(element);
- if (children != null) // found cached list?
- return children; // return it to caller
- }
-
- children = adapter.getChildren(element);
-
- if ((filesOnly || foldersOnly) &&
- // an array of one SystemMessageObject item implies some kind of error, so don't cache...
- ((children.length != 1) || !(children[0] instanceof SystemMessageObject)) )
- {
- if (resolvedChildrenPerFolder == null)
- resolvedChildrenPerFolder = new Hashtable();
- resolvedChildrenPerFolder.put(element, children);
- }
-
- return children;
- }
- return NO_OBJECTS;
- }
- /**
- * @see ITreeContentProvider
- */
- public Object[] getElements(Object element)
- {
- return getChildren(element);
- }
- /**
- * @see ITreeContentProvider
- */
- public Object getParent(Object element)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter != null)
- return adapter.getParent(element);
- return null;
- }
- /**
- * hasChildren method comment.
- * This method has been optimized over its original code so
- * that we don't actually retrieve all the children (horrors!)
- * just to decide if it has children. For performance reasons we
- * just assume if it can have children it does. That means we always
- * get a plus but that is way better than a very slow remote
- * system query just to decide if we want a plus or not!
- */
- public boolean hasChildren(Object element)
- {
- //return getChildren(element).hasNext();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter != null)
- {
- return adapter.hasChildren(element);
- }
- if (manager != null) {
- if (manager.isDeferredAdapter(element))
- return manager.mayHaveChildren(element);
- }
- return false;
- }
- /**
- * inputChanged method comment.
- * AS LONG AS WE DON'T SUPPORT IWORKSPACE OBJECT THIS IS NOT NEEDED.
- * WE LEAVE IT IN BECAUSE IT IS HARMLESS AND MIGHT BE OF VALUE SOMEDAY.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- //System.out.println("Inside LCProvider "+this+". viewer = " + viewer);
- this.viewer = viewer;
- if (newInput instanceof IWorkspace)
- {
- //IWorkspace workspace = (IWorkspace)newInput;
- //workspace.addResourceChangeListener(this);
- }
- else if (newInput instanceof IContainer)
- {
- //IWorkspace workspace = ((IContainer)newInput).getWorkspace();
- //workspace.addResourceChangeListener(this);
- }
- if (viewer instanceof AbstractTreeViewer)
- {
- manager = new DeferredTreeContentManager(this, (AbstractTreeViewer) viewer);
- }
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return getImage(element);
- }
- public String getColumnText(Object element, int columnIndex)
- {
- return getText(element);
- }
- public Image getImage(Object element)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- //System.out.println("Inside getImage. element = " + element + ", adapter = " + adapter);
- if (adapter == null)
- return null;
- /*
- boolean isOpen = false;
- if (viewer instanceof AbstractTreeViewer)
- {
- AbstractTreeViewer atv = (AbstractTreeViewer)viewer;
- isOpen = true; //atv.getExpandedState(element);
- //System.out.println("In getImage for " + adapter.getName(element) + ": isOpen = " + isOpen);
- }
- ImageDescriptor descriptor = adapter.getImageDescriptor(element, isOpen);
- */
- ImageDescriptor descriptor = adapter.getImageDescriptor(element);
- //System.out.println("...descriptor = " + descriptor);
-
- if (descriptor == null)
- return null;
- //add any annotations to the image descriptor
- descriptor = decorateImage(descriptor, element);
- //obtain the cached image corresponding to the descriptor
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- //System.out.println("...image = " + image);
- return image;
- }
- /**
- * Returns the label text for the given object.
- */
- public String getText(Object element)
- {
- ISystemViewElementAdapter adapter = getAdapter(element);
- //System.out.println("INSIDE GETTEXT FOR SVLandCprovider: " + element + ", adapter = " + adapter);
- if (adapter == null)
- {
- IWorkbenchAdapter wadapter = (IWorkbenchAdapter)((IAdaptable) element).getAdapter(IWorkbenchAdapter.class);
-
- if (wadapter == null)
- {
- return super.getText(element);
- }
- return wadapter.getLabel(element);
- }
- //return the decorated label (FROM WorkbenchLabelProvider)
- return decorateText(adapter.getText(element), element);
- }
-
- /**
- * Returns an image descriptor that is based on the given descriptor,
- * but decorated with additional information relating to the state
- * of the provided object.
- *
- * Subclasses may reimplement this method to decorate an object's
- * image.
- * @see org.eclipse.jface.resource.ImageDescriptor
- */
- protected ImageDescriptor decorateImage(ImageDescriptor input, Object element)
- {
- return input;
- }
- /**
- * Returns a label that is based on the given label,
- * but decorated with additional information relating to the state
- * of the provided object.
- *
- * Subclasses may implement this method to decorate an object's
- * label.
- */
- protected String decorateText(String input, Object element)
- {
- return input;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMenuListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMenuListener.java
deleted file mode 100644
index 371466cd5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMenuListener.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.events.ArmEvent;
-import org.eclipse.swt.events.ArmListener;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * A class that listens for menu show events for the purpose of applying mnemonics
- * to the menu items.
- */
-public class SystemViewMenuListener implements IMenuListener, MenuListener, ArmListener
-{
-
-
- protected boolean menuListenerAdded = false;
- protected boolean menuMnemonicsAdded = false;
- protected boolean doOnce = false;
- protected boolean armListeners = false;
- protected Mnemonics m = new Mnemonics();
- protected ISystemMessageLine msgLine;
-
- /**
- * Default constructor
- */
- public SystemViewMenuListener()
- {
- }
- /**
- * Constructor for a persistent menu (vs a popup that's fresh each time)
- */
- public SystemViewMenuListener(boolean doOnce)
- {
- this.doOnce = doOnce;
- }
- /**
- * Enable tooltip text for the menu items too?
- * Requires a message line to display the text on.
- */
- public void setShowToolTipText(boolean set, ISystemMessageLine msgLine)
- {
- this.armListeners = set;
- this.msgLine = msgLine;
- }
-
- // ---------------------
- // IMenuListener methods
- // ---------------------
- /**
- * Called when the context menu is about to open.
- */
- public void menuAboutToShow(IMenuManager menu)
- {
- if (!menuListenerAdded)
- {
- if (menu instanceof MenuManager)
- {
- Menu m = ((MenuManager)menu).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- m.addMenuListener(this);
- }
- }
- }
- }
-
- // --------------------
- // MenuListener methods
- // --------------------
- /**
- * Menu hidden
- */
- public void menuHidden(MenuEvent event)
- {
-
- }
- /**
- * Menu shown
- */
- public void menuShown(MenuEvent event)
- {
- if (!menuMnemonicsAdded || !doOnce)
- {
- m.clear();
- if (!armListeners)
- m.setMnemonics((Menu)event.getSource());
- else
- m.setMnemonicsAndArmListener((Menu)event.getSource(), this);
- menuMnemonicsAdded = true;
- if (doOnce)
- ((Menu)event.getSource()).removeMenuListener(this);
- }
- }
- // --------------------
- // ArmListener methods
- // --------------------
- /**
- * Menu item is currently selected by user. Try to show tooltip text.
- */
- public void widgetArmed(ArmEvent event)
- {
- if (msgLine == null)
- return;
- msgLine.clearMessage();
- Widget w = event.widget;
- //System.out.println("inside widgetArmed. w = "+w.getClass().getName());
- if (w instanceof MenuItem)
- {
- MenuItem mi = (MenuItem)w;
- Object data = mi.getData();
- //System.out.println("... data = "+data+", msgLine null? "+(msgLine==null));
- if (data != null)
- {
- String tip = null; //data.getClass().getName();
- if (data instanceof ActionContributionItem)
- tip = ((ActionContributionItem)data).getAction().getToolTipText();
- else if (data instanceof SystemSubMenuManager)
- tip = ((SystemSubMenuManager)data).getToolTipText();
- if (tip != null)
- msgLine.setMessage(tip);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMessageAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMessageAdapter.java
deleted file mode 100644
index 1aa0340a5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewMessageAdapter.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemMessageObject;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-
-/**
- * Adapter for displaying temporary message objects when an expand fails or is cancelled.
- * <p>
- */
-public class SystemViewMessageAdapter
- extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
-
- /**
- * Add actions to context menu.
- * We don't add any for message objects, at this point.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- ISystemMessageObject msg = (ISystemMessageObject)element;
- int type = msg.getType();
- if (type==ISystemMessageObject.MSGTYPE_ERROR)
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_ERROR_ID);
- else if (type==ISystemMessageObject.MSGTYPE_CANCEL)
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_INFO_TREE_ID);
- // DY: icon vetoed by UCD
- // return RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_CANCEL_ID);
- else if (type==ISystemMessageObject.MSGTYPE_EMPTY)
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_EMPTY_ID);
- else if (type==ISystemMessageObject.MSGTYPE_OBJECTCREATED)
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_OK_ID);
- else
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_INFO_TREE_ID);
- }
-
- /**
- * Return the label for this object. Uses getMessage() on the given ISystemMessageObject object.
- */
- public String getText(Object element)
- {
- ISystemMessageObject msg = (ISystemMessageObject)element;
- return msg.getMessage();
- }
- /**
- * Return the absolute name, versus just display name, of this object.
- * Just uses getText(element);
- */
- public String getAbsoluteName(Object element)
- {
- return getText(element);
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return SystemViewResources.RESID_PROPERTY_MESSAGE_TYPE_VALUE;
- }
-
- /**
- * Return the parent of this object.
- */
- public Object getParent(Object element)
- {
- ISystemMessageObject msg = (ISystemMessageObject)element;
- return msg.getParent();
- }
-
- /**
- * Return the children of this object. Not applicable for us.
- */
- public Object[] getChildren(Object element)
- {
- return null;
- }
-
- /**
- * Return true if this object has children. Always false for us.
- */
- public boolean hasChildren(Object element)
- {
- return false;
- }
- /**
- * Return our unique property descriptors
- */
- protected IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
-
- return null;
- }
- /**
- * Return our unique property values
- */
- public Object internalGetPropertyValue(Object key)
- {
- return null;
- }
- /**
- * Don't show delete
- */
- public boolean showDelete(Object element)
- {
- return false;
- }
-
- /**
- * Don't show rename
- */
- public boolean showRename(Object element)
- {
- return false;
- }
-
- /**
- * Don't show refresh
- */
- public boolean showRefresh(Object element)
- {
- return false;
- }
-
- /**
- * Don't show "Open in new perspective"
- */
- public boolean showOpenViewActions(Object element)
- {
- return false;
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- return getName(element);
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return "Msg"; //$NON-NLS-1$
- }
-
- /**
- * Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted
- * messages. In these cases return false from this method. The default is true.
- * <p>
- * WE RETURN FALSE.
- */
- public boolean saveExpansionState(Object element)
- {
- return false;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewNewConnectionPromptAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewNewConnectionPromptAdapter.java
deleted file mode 100644
index e4fa0b699..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewNewConnectionPromptAdapter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemRunAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Adapter class for new connection prompt objects.
- */
-public class SystemViewNewConnectionPromptAdapter extends SystemViewPromptableAdapter {
-
- /**
- * @see org.eclipse.rse.ui.view.SystemViewPromptableAdapter#getRunAction(org.eclipse.swt.widgets.Shell)
- */
- protected SystemRunAction getRunAction(Shell shell) {
- return (new SystemRunAction(SystemResources.ACTION_NEWCONN_LABEL, SystemResources.ACTION_NEWCONN_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID), shell));
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java
deleted file mode 100644
index 6ebe4c802..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java
+++ /dev/null
@@ -1,1909 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemElapsedTimer;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.filters.ISystemFilterStringReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvent;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
-import org.eclipse.rse.core.model.ISystemPreferenceChangeListener;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemCascadingPreferencesAction;
-import org.eclipse.rse.ui.actions.SystemCollapseAllAction;
-import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction;
-import org.eclipse.rse.ui.actions.SystemNewConnectionAction;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.actions.SystemPreferenceQualifyConnectionNamesAction;
-import org.eclipse.rse.ui.actions.SystemPreferenceRestoreStateAction;
-import org.eclipse.rse.ui.actions.SystemPreferenceShowFilterPoolsAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAllAction;
-import org.eclipse.rse.ui.actions.SystemStartCommunicationsDaemonAction;
-import org.eclipse.rse.ui.actions.SystemWorkWithProfilesAction;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.views.framelist.FrameList;
-
-/**
- * This is the desktop view wrapper of the System View viewer.
- */
-public class SystemViewPart
- extends ViewPart
- implements ISetSelectionTarget, ISystemShellProvider, ISystemMessageLine, IElementFactory, IPersistableElement, IAdapterFactory, ISystemPreferenceChangeListener, ISelectionChangedListener, IRSEViewPart
-{
-
- public class ToggleLinkingAction extends Action
- {
- public ToggleLinkingAction(SystemViewPart viewPart, String label)
- {
- super(label);
- setChecked(isLinkingEnabled);
- }
-
- public void run()
- {
- toggleLinkingEnabled();
- setChecked(isLinkingEnabled);
- }
- }
-
- protected SystemView systemView;
- protected ISystemViewInputProvider input = null;
- protected String message, errorMessage;
- protected SystemMessage sysErrorMessage;
- protected IStatusLineManager statusLine = null;
- protected boolean inputIsRoot = true;
- protected boolean doTimings = false;
- protected boolean isLinkingEnabled = false;
-
- protected SystemElapsedTimer timer;
- protected FrameList frameList;
- protected SystemViewPartGotoActionGroup gotoActionGroup;
- protected ToggleLinkingAction toggleLinkingAction;
-
- // remember-state variables...
-
- protected IMemento fMemento;
- protected IAdapterManager platformManager;
- // preference toggle actions that need to be updated when preferences change
- protected SystemPreferenceQualifyConnectionNamesAction qualifyConnectionNamesAction;
- protected SystemPreferenceShowFilterPoolsAction showFilterPoolsAction;
- protected SystemPreferenceRestoreStateAction restoreStateAction;
- //protected SystemPreferenceShowFilterStringsAction showFilterStringsAction;
- protected static SystemWorkWithProfilesAction wwProfilesAction;
- // copy and paste actions
- protected SystemCopyToClipboardAction _copyAction;
- protected SystemPasteFromClipboardAction _pasteAction;
-
- // Persistence tags.
- static final String TAG_RELEASE = "release";
- static final String TAG_SELECTION = "selection";
- static final String TAG_EXPANDED_TO = "expandedTo";
- static final String TAG_EXPANDED = "expanded";
- static final String TAG_ELEMENT = "element";
- static final String TAG_PATH = "path";
- static final String TAG_FILTER = "filter";
- static final String TAG_INPUT = "svInput";
- static final String TAG_VERTICAL_POSITION = "verticalPosition";
- static final String TAG_HORIZONTAL_POSITION = "horizontalPosition";
- static final String TAG_SHOWFILTERPOOLS = "showFilterPools";
- static final String TAG_SHOWFILTERSTRINGS = "showFilterStrings";
- static final String TAG_LINKWITHEDITOR = "linkWithEditor";
-
- public static final String MEMENTO_DELIM = "///";
-
- // constants
- public static final String ID = "org.eclipse.rse.ui.view.systemView"; // matches id in plugin.xml, view tag
-
- /**
- * SystemViewPart constructor.
- */
- public SystemViewPart()
- {
- super();
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),"INSIDE CTOR FOR SYSTEMVIEWPART.");
- }
- /**
- * Easy access to the TreeViewer object
- */
- public SystemView getSystemView()
- {
- return systemView;
- }
-
- public Viewer getRSEViewer()
- {
- return systemView;
- }
-
- /**
- * When an element is added/deleted/changed/etc and we have focus, this
- * method is called. See SystemStaticHelpers.selectReveal method.
- */
- public void selectReveal(ISelection selection)
- {
- systemView.setSelection(selection, true);
- }
-
- /**
- * Returns the name for the given element.
- * Used as the name for the current frame.
- */
- protected String getFrameName(Object element)
- {
- return ((ILabelProvider) getSystemView().getLabelProvider()).getText(element);
- }
-
- /**
- * Returns the tool tip text for the given element.
- * Used as the tool tip text for the current frame, and for the view title tooltip.
- */
- protected String getFrameToolTipText(Object element)
- {
- return ((ILabelProvider) getSystemView().getLabelProvider()).getText(element);
- }
-
- public void toggleLinkingEnabled()
- {
- isLinkingEnabled = !isLinkingEnabled;
- if (isLinkingEnabled)
- {
- IWorkbenchWindow activeWindow = SystemBasePlugin.getActiveWorkbenchWindow();
- IWorkbenchPage activePage = activeWindow.getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if (editor != null)
- {
- editorActivated(editor);
- }
- }
- }
-
- /**
- * An editor has been activated. Sets the selection in this navigator
- * to be the editor's input, if linking is enabled.
- *
- * @param editor the active editor
- * @since 2.0
- */
- protected void editorActivated(IEditorPart editor)
- {
- if (!isLinkingEnabled)
- return;
-
- IEditorInput input = editor.getEditorInput();
- if (input instanceof IFileEditorInput)
- {
- IFileEditorInput fileInput = (IFileEditorInput) input;
- fileInput.getFile();
- /* FIXME - can't couple this view to files ui
- IFile file = fileInput.getFile();
- SystemIFileProperties properties = new SystemIFileProperties(file);
- Object rmtEditable = properties.getRemoteFileObject();
- Object remoteObj = null;
- if (rmtEditable != null && rmtEditable instanceof ISystemEditableRemoteObject)
- {
- ISystemEditableRemoteObject editable = (ISystemEditableRemoteObject) rmtEditable;
- remoteObj = editable.getRemoteObject();
-
- }
- else
- {
- String subsystemId = properties.getRemoteFileSubSystem();
- String path = properties.getRemoteFilePath();
- if (subsystemId != null && path != null)
- {
- ISubSystem subSystem = RSEUIPlugin.getTheSystemRegistry().getSubSystem(subsystemId);
- if (subSystem != null)
- {
- if (subSystem.isConnected())
- {
- try
- {
- remoteObj = subSystem.getObjectWithAbsoluteName(path);
- }
- catch (Exception e)
- {
- return;
- }
- }
- }
- }
- }
-
-
- if (remoteObj != null)
- {
- // DKM - causes editor to loose focus
- //systemView.refreshRemoteObject(path, remoteObj, true);
-
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(remoteObj, ISystemResourceChangeEvents.EVENT_SELECT_REMOTE, null);
- systemView.systemResourceChanged(event);
- }
- */
- }
- }
- /**
- * Updates the title text and title tool tip.
- * Called whenever the input of the viewer changes.
- */
- protected void updateTitle()
- {
- //IAdaptable inputObj = getSite().getPage().getInput();
- Object inputObj = getSystemView().getInput();
- SystemBasePlugin.logInfo("Inside updateTitle. inputObject class type: " + inputObj.getClass().getName());
- if (inputObj != null)
- {
- setTitleToolTip(getFrameToolTipText(input));
- String viewName = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
- if (inputObj instanceof IHost)
- {
- IHost conn = (IHost) inputObj;
- setPartName(viewName + " : " + conn.getAliasName());
- }
- else if (inputObj instanceof ISubSystem)
- {
- ISubSystem ss = (ISubSystem) inputObj;
- setPartName(viewName + " : " + ss.getName());
- }
- else if (inputObj instanceof ISystemFilterPoolReference)
- {
- ISystemFilterPoolReference sfpr = (ISystemFilterPoolReference) inputObj;
- setPartName(viewName + " : " + sfpr.getName());
- }
- else if (inputObj instanceof ISystemFilterReference)
- {
- ISystemFilterReference sfr = (ISystemFilterReference) inputObj;
- setPartName(viewName + " : " + sfr.getName());
- }
- else if (inputObj instanceof ISystemFilterStringReference)
- {
- ISystemFilterStringReference sfsr = (ISystemFilterStringReference) inputObj;
- setPartName(viewName + " : " + sfsr.getString());
- }
- else
- {
- setPartName(viewName);
- setTitleToolTip(""); //$NON-NLS-1$
- }
- }
- }
-
- /*
- * Set our input provider that will be used to populate the tree view
- *
- public void setInputProvider(ISystemViewInputProvider input)
- {
- RSEUIPlugin.logDebugMessage(this.getClass().getName(),"INSIDE SETINPUTPROVIDER FOR SYSTEMVIEWPART.");
- this.input = input;
- }*/
- /**
- * Creates the SWT controls for a part.
- * Called by Eclipse framework.
- */
- public void createPartControl(Composite parent)
- {
- //RSEUIPlugin.logInfo("INSIDE CREATEPARTCONTROL FOR SYSTEMVIEWPART.");
- if (input == null)
- //input = RSEUIPlugin.getTheSystemRegistry();
- input = getInputProvider();
- systemView = new SystemView(getShell(), parent, input, this);
- frameList = createFrameList();
-
- gotoActionGroup = new SystemViewPartGotoActionGroup(this);
- IActionBars actionBars = getActionBars();
- if (actionBars != null)
- {
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), systemView.getDeleteAction());
- //SystemCommonSelectAllAction selAllAction = new SystemCommonSelectAllAction(getShell(), systemView, systemView);
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), systemView.getSelectAllAction());
- // added by Phil in 3.0 ...
- //actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PROPERTIES, systemView.getPropertyDialogAction(); hmm, different one for local vs remote objects
- actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), systemView.getRefreshAction());
-
- statusLine = actionBars.getStatusLineManager();
- }
-
- // register global edit actions
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
-
- Clipboard clipboard = registry.getSystemClipboard();
-
- CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
-
- _copyAction = new SystemCopyToClipboardAction(systemView.getShell(), clipboard);
- _pasteAction = new SystemPasteFromClipboardAction(systemView.getShell(), clipboard);
-
- editorActionHandler.setCopyAction(_copyAction);
- editorActionHandler.setPasteAction(_pasteAction);
- editorActionHandler.setDeleteAction(systemView.getDeleteAction());
- editorActionHandler.setSelectAllAction(systemView.getSelectAllAction());
-
- systemView.addSelectionChangedListener(this);
- //hook the part focus to the viewer's control focus.
- //hookFocus(systemView.getControl());
-
- //prime the selection
- //selectionChanged(null, getSite().getDesktopWindow().getSelectionService().getSelection());
-
- boolean showConnectionActions = true;
- fillLocalToolBar(showConnectionActions);
-
- // -----------------------------
- // Enable right-click popup menu
- // -----------------------------
- getSite().registerContextMenu(systemView.getContextMenuManager(), systemView);
-
- // ----------------------------------------------------------------------
- // Enable property sheet updates when tree items are selected.
- // Note for this to work each item in the tree must either implement
- // IPropertySource, or support IPropertySource.class as an adapter type
- // in its AdapterFactory.
- // ----------------------------------------------------------------------
- getSite().setSelectionProvider(systemView);
- // listen to editor events for linking
- getSite().getPage().addPartListener(partListener);
-
- SystemWidgetHelpers.setHelp(parent, RSEUIPlugin.HELPPREFIX + "sysv0000");
-
- // ----------------------
- // Restore previous state
- // ----------------------
- if ((fMemento != null) && (input instanceof ISystemRegistry))
- restoreState(fMemento);
- //fMemento = null;
-
- // Register for preference change events
- registry.addSystemPreferenceChangeListener(this);
-
- // if this is the primary RSE view, and there are no user-defined
- // connections, auto-expand the New Connection prompt...
- if ((input == RSEUIPlugin.getTheSystemRegistry()) && (RSEUIPlugin.getTheSystemRegistry().getHosts().length == 1))
- {
- // assume this is the primary RSE view
-
- // WE GET ALL THE WAY HERE, BUT THESE LINES OF CODE ARE INEFFECTIVE FOR SOME REASON!!
-
- if (systemView.getTree().getItemCount() > 0) {
- TreeItem firstItem = systemView.getTree().getItems()[0];
- systemView.setSelection(new StructuredSelection(firstItem.getData()));
- systemView.setExpandedState(firstItem.getData(), true);
- }
- }
- }
-
- /**
- * Creates the frame source and frame list, and connects them.
- *
- * @since 2.0
- */
- protected FrameList createFrameList()
- {
- SystemViewPartFrameSource frameSource = new SystemViewPartFrameSource(this);
- FrameList frameList = new FrameList(frameSource);
- frameSource.connectTo(frameList);
- return frameList;
- }
- /**
- * Return the FrameList object for this view part
- * @since 2.0
- */
- public FrameList getFrameList()
- {
- return frameList;
- }
-
- /**
- * Return the Goto action group
- */
- public SystemViewPartGotoActionGroup getGotoActionGroup()
- {
- return gotoActionGroup;
- }
-
- /**
- * Return the shell for this view part
- */
- public Shell getShell()
- {
- if (systemView != null)
- return systemView.getTree().getShell();
- else
- return getSite().getShell();
- }
- /**
- * Return the action bars for this view part
- */
- public IActionBars getActionBars()
- {
- return getViewSite().getActionBars();
- }
-
- /**
- * @see IWorkbenchPart#setFocus()
- */
- public void setFocus()
- {
- //System.out.println("INSIDE SETFOCUS FOR SYSTEMVIEWPART. SYSTEMVIEW NULL? " + (systemView==null));
- IWorkbench wb = PlatformUI.getWorkbench();
- wb.getActiveWorkbenchWindow().getShell().setFocus();
- systemView.getControl().setFocus();
- /* the following was an attempt to fix problem with scrollbar needing two clicks to activate. didn't help.
- if (!SystemPreferencesGlobal.getGlobalSystemPreferences().getRememberState())
- {
- TreeItem[] roots = systemView.getTree().getItems();
- if ((roots != null) && (roots.length>0))
- systemView.setSelection(new StructuredSelection(roots[0].getData()));
- }
- */
-
- }
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- IStructuredSelection sel = (IStructuredSelection) e.getSelection();
- _copyAction.setEnabled(_copyAction.updateSelection(sel));
- _pasteAction.setEnabled(_pasteAction.updateSelection(sel));
- //systemView.getPropertyDialogAction();
- if (isLinkingEnabled)
- {
- linkToEditor(sel);
- }
- }
-
-
- // link back to editor
- protected void linkToEditor(IStructuredSelection selection)
- {
- Object obj = selection.getFirstElement();
- if (obj instanceof IAdaptable)
- {
- try
- {
- ISystemRemoteElementAdapter adapter = (ISystemRemoteElementAdapter)((IAdaptable)obj).getAdapter(ISystemRemoteElementAdapter.class);
- if (adapter != null)
- {
-
- if (adapter.canEdit(obj))
- {
- IWorkbenchPage page = getSite().getPage();
- IEditorReference[] editorRefs = page.getEditorReferences();
- for (int i = 0; i < editorRefs.length; i++)
- {
- IEditorReference editorRef = editorRefs[i];
-
- IEditorPart editor = editorRef.getEditor(false);
- if (editor != null)
- {
- IEditorInput input = editor.getEditorInput();
- if (input instanceof FileEditorInput)
- {
- ((FileEditorInput)input).getFile();
- /** FIXME - can't couple this view to files ui
- IFile file = ((FileEditorInput)input).getFile();
- if (file.getProject().getName().equals(SystemRemoteEditManager.REMOTE_EDIT_PROJECT_NAME))
- {
- SystemIFileProperties properties = new SystemIFileProperties(file);
- String path = properties.getRemoteFilePath();
- if (path != null && path.equals(adapter.getAbsoluteName(obj)))
- {
- page.bringToTop(editor);
- return;
- }
- }
- */
- }
- }
- }
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-
-
- /**
- * Fills the local tool bar with actions.
- */
- protected void fillLocalToolBar(boolean showConnectionActions)
- {
- IActionBars actionBars = getViewSite().getActionBars();
- SystemRefreshAction refreshAction = new SystemRefreshAction(getShell());
- refreshAction.setSelectionProvider(systemView);
- actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
-
- IToolBarManager toolBarMgr = actionBars.getToolBarManager();
- if (showConnectionActions)
- {
- SystemNewConnectionAction newConnAction = new SystemNewConnectionAction(getShell(), false, systemView); // false implies not from popup menu
- toolBarMgr.add(newConnAction);
- }
-
- refreshAction.setSelectionProvider(systemView);
- toolBarMgr.add(refreshAction);
-
- toolBarMgr.add(new Separator("Navigate"));
- SystemViewPartGotoActionGroup gotoActions = new SystemViewPartGotoActionGroup(this);
- gotoActions.fillActionBars(actionBars);
-
- // defect 41203
- toolBarMgr.add(new Separator());
-
- // DKM - changing hover image to the elcl16 one since the navigator no long has clcl16 icons
- SystemCollapseAllAction collapseAllAction = new SystemCollapseAllAction(getShell());
- collapseAllAction.setSelectionProvider(systemView);
- // PSC ... better to encapsulate this in the SystemCollapseAllAction class
- //collapseAllAction.setImageDescriptor(getNavigatorImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
- //collapseAllAction.setHoverImageDescriptor(getNavigatorImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
-
- toolBarMgr.add(collapseAllAction);
-
- toggleLinkingAction = new ToggleLinkingAction(this, SystemViewResources.RESID_PROPERTY_LINKINGACTION_TEXT);
- toggleLinkingAction.setToolTipText(SystemViewResources.RESID_PROPERTY_LINKINGACTION_TOOLTIP);
- toggleLinkingAction.setImageDescriptor(getNavigatorImageDescriptor(ISystemIconConstants.ICON_IDE_LINKTOEDITOR_ID));
- toggleLinkingAction.setHoverImageDescriptor(getNavigatorImageDescriptor(ISystemIconConstants.ICON_IDE_LINKTOEDITOR_ID));
- toolBarMgr.add(toggleLinkingAction);
-
-
-
- IMenuManager menuMgr = actionBars.getMenuManager();
- populateSystemViewPulldownMenu(menuMgr, getShell(), showConnectionActions, this, systemView);
- }
- /**
- * Pulldown the local toolbar menu with actions
- */
- public static void populateSystemViewPulldownMenu(IMenuManager menuMgr, Shell shell, boolean showConnectionActions, IWorkbenchPart viewPart, ISelectionProvider sp)
- {
- SystemRefreshAllAction refreshAllAction = new SystemRefreshAllAction(shell);
- //SystemCascadingUserIdPerSystemTypeAction userIdPerSystemTypeAction = new SystemCascadingUserIdPerSystemTypeAction(shell); d51541
- SystemPreferenceShowFilterPoolsAction showFilterPoolsAction = new SystemPreferenceShowFilterPoolsAction(shell);
- SystemPreferenceQualifyConnectionNamesAction qualifyConnectionNamesAction = null;
- SystemPreferenceRestoreStateAction restoreStateAction = new SystemPreferenceRestoreStateAction(shell);
-
- if (viewPart instanceof SystemViewPart)
- {
- ((SystemViewPart) viewPart).showFilterPoolsAction = showFilterPoolsAction; // set non-static field
- ((SystemViewPart) viewPart).restoreStateAction = restoreStateAction; // set non-static field
- }
-
- if (showConnectionActions)
- {
- boolean fromPopup = false;
- boolean wantIcon = false;
- SystemNewConnectionAction newConnectionAction = new SystemNewConnectionAction(shell, fromPopup, wantIcon, sp);
- SystemWorkWithProfilesAction wwProfilesAction = new SystemWorkWithProfilesAction(shell);
- menuMgr.add(newConnectionAction);
- menuMgr.add(new Separator());
- menuMgr.add(wwProfilesAction);
- menuMgr.add(new Separator());
- // moved Qualify Connection Names from here for d51541
- //menuMgr.add(new Separator()); d51541
- }
- menuMgr.add(refreshAllAction);
- menuMgr.add(new Separator());
- if (showConnectionActions)
- {
- qualifyConnectionNamesAction = new SystemPreferenceQualifyConnectionNamesAction(shell);
- if (viewPart instanceof SystemViewPart)
- ((SystemViewPart) viewPart).qualifyConnectionNamesAction = qualifyConnectionNamesAction;
- menuMgr.add(qualifyConnectionNamesAction); // moved here for d51541
- }
- //menuMgr.add(userIdPerSystemTypeAction.getSubMenu()); d51541
- menuMgr.add(showFilterPoolsAction);
- menuMgr.add(restoreStateAction); // d51541
-
- // Now query our remoteSystemsViewPreferencesActions for extenders who wish to appear in the
- // preferences cascading menu...
- SystemCascadingPreferencesAction preferencesAction = new SystemCascadingPreferencesAction(shell);
- menuMgr.add(preferencesAction.getSubMenu());
-
- menuMgr.add(new Separator());
- menuMgr.add(new SystemStartCommunicationsDaemonAction(shell));
-
- if (viewPart != null)
- {
- /*
- SystemCascadingTeamAction teamAction = new SystemCascadingTeamAction(shell, viewPart);
- menuMgr.add(new Separator());
- menuMgr.add(teamAction.getSubMenu());
- */
- }
- SystemViewMenuListener menuListener = new SystemViewMenuListener(true); // true says this is a persistent menu
- if (viewPart instanceof ISystemMessageLine)
- menuListener.setShowToolTipText(true, (ISystemMessageLine) viewPart);
- menuMgr.addMenuListener(menuListener);
-
- }
-
- /**
- *
- */
- public void dispose()
- {
- super.dispose();
- if (platformManager != null)
- unregisterWithManager(platformManager);
- RSEUIPlugin.getTheSystemRegistry().removeSystemPreferenceChangeListener(this);
- getSite().getPage().removePartListener(partListener);
- //System.out.println("INSIDE DISPOSE FOR SYSTEMVIEWPART.");
- }
-
- /**
- * Returns the initial input provider for the viewer.
- * Tries to deduce the appropriate input provider based on current input.
- */
- protected ISystemViewInputProvider getInputProvider()
- {
- IAdaptable inputObj = getSite().getPage().getInput();
- inputIsRoot = false;
- ISystemViewInputProvider inputProvider = RSEUIPlugin.getTheSystemRegistry();
- if (inputObj != null)
- {
- platformManager = Platform.getAdapterManager();
- if (inputObj instanceof IHost)
- {
- IHost conn = (IHost) inputObj;
- inputProvider = new SystemViewAPIProviderForConnections(conn);
- setPartName(getTitle() + " : " + conn.getAliasName());
- }
- else if (inputObj instanceof ISubSystem)
- {
- ISubSystem ss = (ISubSystem) inputObj;
- inputProvider = new SystemViewAPIProviderForSubSystems(ss);
- setPartName(getTitle() + " : " + ss.getName());
- }
- else if (inputObj instanceof ISystemFilterPoolReference)
- {
- ISystemFilterPoolReference sfpr = (ISystemFilterPoolReference) inputObj;
- inputProvider = new SystemViewAPIProviderForFilterPools(sfpr);
- setPartName(getTitle() + " : " + sfpr.getName());
- }
- else if (inputObj instanceof ISystemFilterReference)
- {
- ISystemFilterReference sfr = (ISystemFilterReference) inputObj;
- inputProvider = new SystemViewAPIProviderForFilters(sfr);
- setPartName(getTitle() + " : " + sfr.getName());
- }
- else if (inputObj instanceof ISystemFilterStringReference)
- {
- ISystemFilterStringReference sfsr = (ISystemFilterStringReference) inputObj;
- inputProvider = new SystemViewAPIProviderForFilterStrings(sfsr);
- setPartName(getTitle() + " : " + sfsr.getString());
- }
- else
- {
- platformManager = null;
- inputIsRoot = true;
- }
-
- if (platformManager != null)
- registerWithManager(platformManager, inputObj);
- //msg = "INSIDE GETINPUTPROVIDER FOR SYSTEMVIEWPART: inputObj="+inputObj+", input class="+inputObj.getClass().getName()+", inputProvider="+inputProvider;
- }
- else
- {
- //msg = "INSIDE GETINPUTPROVIDER FOR SYSTEMVIEWPART: inputObj is null, inputProvider="+inputProvider;
- }
- //RSEUIPlugin.logDebugMessage(this.getClass().getName(),msg);
- //System.out.println("INSIDE getInputProvider. inputProvider = "+inputProvider);
- return inputProvider;
- }
-
- // --------------------------------------------
- // ISystemPreferenceChangeListener interface...
- // --------------------------------------------
- public void systemPreferenceChanged(ISystemPreferenceChangeEvent event)
- {
- if ((event.getType() == ISystemPreferenceChangeEvents.EVENT_QUALIFYCONNECTIONNAMES) && (qualifyConnectionNamesAction != null))
- qualifyConnectionNamesAction.setChecked(SystemPreferencesManager.getPreferencesManager().getQualifyConnectionNames());
- else if ((event.getType() == ISystemPreferenceChangeEvents.EVENT_SHOWFILTERPOOLS) && (showFilterPoolsAction != null))
- showFilterPoolsAction.setChecked(SystemPreferencesManager.getPreferencesManager().getShowFilterPools());
- else if ((event.getType() == ISystemPreferenceChangeEvents.EVENT_RESTORESTATE) && (restoreStateAction != null))
- restoreStateAction.setChecked(SystemPreferencesManager.getPreferencesManager().getRememberState());
-
- //else if ((event.getType() == ISystemPreferenceChangeEvents.EVENT_SHOWFILTERSTRINGS) &&
- // (showFilterStringsAction != null))
- // showFilterStringsAction.setChecked(SystemPreferencesManager.getPreferencesManager().getShowFilterStrings());
-
- }
-
- // -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- errorMessage = null;
- sysErrorMessage = null;
- if (statusLine != null)
- statusLine.setErrorMessage(errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- message = null;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this.errorMessage = message;
- if (statusLine != null)
- statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this.message = message;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-
- // -------------------------------------------
- // MEMENTO SUPPORT (SAVING/RESTORING STATE)...
- // -------------------------------------------
- /**
- * Initializes this view with the given view site. A memento is passed to
- * the view which contains a snapshot of the views state from a previous
- * session. Where possible, the view should try to recreate that state
- * within the part controls.
- * <p>
- * The parent's default implementation will ignore the memento and initialize
- * the view in a fresh state. Subclasses may override the implementation to
- * perform any state restoration as needed.
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException
- {
- init(site);
- fMemento = memento;
- //System.out.println("INSIDE INIT");
- }
-
- /**
- * Returns the image descriptor with the given relative path.
- */
- protected ImageDescriptor getNavigatorImageDescriptor(String relativePath)
- {
- return RSEUIPlugin.getDefault().getImageDescriptorFromIDE(relativePath); // more reusable
- /*
- String iconPath = "icons/full/"; //$NON-NLS-1$
- try
- {
- AbstractUIPlugin plugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID);
- URL installURL = plugin.getDescriptor().getInstallURL();
-
- URL url = new URL(installURL, iconPath + relativePath);
- ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
- return descriptor;
- }
- catch (MalformedURLException e)
- {
- // should not happen
- return ImageDescriptor.getMissingImageDescriptor();
- }*/
- }
-
- /**
- * Method declared on IViewPart.
- */
- public void saveState(IMemento memento)
- {
- //System.out.println("INSIDE SAVESTATE");
- if (!SystemPreferencesManager.getPreferencesManager().getRememberState())
- return;
- if (systemView == null)
- {
- // part has not been created
- if (fMemento != null) //Keep the old state;
- memento.putMemento(fMemento);
- return;
- }
-
- if (isLinkingEnabled)
- {
- memento.putString(TAG_LINKWITHEDITOR, "t");
- }
- else
- {
- memento.putString(TAG_LINKWITHEDITOR, "f");
- }
-
- // We record the current release for future in case anything significant changes from release to release
- memento.putString(TAG_RELEASE, SystemResources.CURRENT_RELEASE_NAME);
-
- // We record the current preferences for show filter string and show filter pools.
- // We do this to ensure the states match on restore. If they don't we will be in trouble
- // restoring expansion state and hence will abandon it.
-
- memento.putString(TAG_SHOWFILTERPOOLS, SystemPreferencesManager.getPreferencesManager().getShowFilterPools() ? "t" : "f");
- //memento.putString(TAG_SHOWFILTERSTRINGS, SystemPreferencesManager.getPreferencesManager().getShowFilterStrings() ? "t" : "f");
-
- String inputMemento = memento.getString("factoryID"); // see IWorkbenchWindow ... this is only clue I can figure out!
- if (inputMemento != null)
- {
- saveInputState(memento);
- return;
- }
-
- Tree tree = systemView.getTree();
-
- // SAVE EXPAND-TO HASHTABLE
- Hashtable expandToFilters = systemView.getExpandToFilterTable();
- if ((expandToFilters != null) && (expandToFilters.size() > 0))
- {
- IMemento expandedMem = memento.createChild(TAG_EXPANDED_TO);
- Enumeration keys = expandToFilters.keys();
- while (keys.hasMoreElements())
- {
- Object key = keys.nextElement();
- Object value = expandToFilters.get(key);
- if (value != null)
- {
- IMemento elementMem = expandedMem.createChild(TAG_ELEMENT);
- elementMem.putString(TAG_PATH, (String) key);
- elementMem.putString(TAG_FILTER, (String) value);
- }
- }
- }
-
- // SAVE EXPANSION STATE
- //Object expandedElements[]= systemView.getExpandedElements();
- Object expandedElements[] = systemView.getVisibleExpandedElements();
- if ((expandedElements != null) && (expandedElements.length > 0))
- {
- IMemento expandedMem = memento.createChild(TAG_EXPANDED);
- for (int i = 0; i < expandedElements.length; i++)
- {
- Object o = expandedElements[i];
- ISystemViewElementAdapter adapter = systemView.getAdapter(o);
- //ISystemRemoteElementAdapter radapter = systemView.getRemoteAdapter(o);
- //if (adapter.saveExpansionState(o) && (radapter==null))
- if (adapter.saveExpansionState(o))
- {
- IMemento elementMem = expandedMem.createChild(TAG_ELEMENT);
- elementMem.putString(TAG_PATH, getMementoHandle(o, adapter));
- //System.out.println("Added to saved expansion list: " + getMementoHandle(o, adapter));
- }
- }
- }
-
- // SAVE SELECTION STATE
- Object elements[] = ((IStructuredSelection) systemView.getSelection()).toArray();
- if ((elements != null) && (elements.length > 0))
- {
- IMemento selectionMem = memento.createChild(TAG_SELECTION);
- for (int i = 0; i < elements.length; i++)
- {
- Object o = elements[i];
- ISystemViewElementAdapter adapter = systemView.getAdapter(o);
- //ISystemRemoteElementAdapter radapter = systemView.getRemoteAdapter(o);
- //if (adapter.saveExpansionState(o) && (radapter==null))
- if (adapter.saveExpansionState(o))
- {
- IMemento elementMem = selectionMem.createChild(TAG_ELEMENT);
- elementMem.putString(TAG_PATH, getMementoHandle(o, adapter));
- }
- }
- }
-
- //save vertical position
- ScrollBar bar = tree.getVerticalBar();
- int position = bar != null ? bar.getSelection() : 0;
- memento.putString(TAG_VERTICAL_POSITION, String.valueOf(position));
- //save horizontal position
- bar = tree.getHorizontalBar();
- position = bar != null ? bar.getSelection() : 0;
- memento.putString(TAG_HORIZONTAL_POSITION, String.valueOf(position));
-
- }
-
- /**
- * Defer to the adapter to get the memento handle key plus the memento handle for
- * each part leading up to the current object.
- */
- protected String getMementoHandle(Object o, ISystemViewElementAdapter adapter)
- {
- StringBuffer idBuffer = new StringBuffer(adapter.getMementoHandleKey(o));
- Object[] elementNodes = systemView.getElementNodes(o);
- if (elementNodes != null)
- {
- for (int idx = elementNodes.length - 1; idx >= 0; idx--)
- {
- o = elementNodes[idx];
- adapter = systemView.getAdapter(o);
- idBuffer.append(MEMENTO_DELIM + adapter.getMementoHandle(o));
- }
- }
- //System.out.println("MEMENTO HANDLE: " + idBuffer.toString());
- return idBuffer.toString();
- }
-
- /**
- * Our own method for restoring state
- */
- protected void restoreState(IMemento memento)
- {
- RestoreStateRunnable restoreAction = new RestoreStateRunnable(memento);
- restoreAction.setRule(RSEUIPlugin.getTheSystemRegistry());
- restoreAction.schedule();
-
- /* DKM - Moved to RestoreStateRunnable
- * - resolves invalid shell problem at startup
- * *
- //System.out.println("SYSTEMVIEWPART: restoreState");
- if (!SystemPreferencesManager.getPreferencesManager().getRememberState())
- return;
-
- if (doTimings)
- timer = new SystemElapsedTimer();
-
- // restore the show filter pools and show filter strings settings as they were when this was saved
- boolean showFilterPools = false;
- boolean showFilterStrings = false;
- String savedValue = memento.getString(TAG_SHOWFILTERPOOLS);
- if (savedValue != null)
- showFilterPools = savedValue.equals("t");
- else
- showFilterPools = SystemPreferencesManager.getPreferencesManager().getShowFilterPools();
-
- savedValue = memento.getString(TAG_SHOWFILTERSTRINGS); // historical
- if (savedValue != null)
- showFilterStrings = savedValue.equals("t");
- //else
- //showFilterStrings = SystemPreferencesManager.getPreferencesManager().getShowFilterStrings();
-
- IMemento childMem = null;
-
- // restore expand-to hashtable state
- childMem= memento.getChild(TAG_EXPANDED_TO);
- if (childMem != null)
- {
- IMemento[] elementMem= childMem.getChildren(TAG_ELEMENT);
- Hashtable ht = new Hashtable();
- for (int i= 0; i < elementMem.length; i++)
- {
- String key = elementMem[i].getString(TAG_PATH);
- String value = elementMem[i].getString(TAG_FILTER);
- if ((key != null) && (value != null))
- ht.put(key, value);
- }
- if (ht.size() > 0)
- systemView.setExpandToFilterTable(ht);
- }
-
- // restore expansion state
- childMem= memento.getChild(TAG_EXPANDED);
- if (childMem != null)
- {
- ArrayList elements= new ArrayList();
- Vector remoteElements = new Vector();
- IMemento[] elementMem= childMem.getChildren(TAG_ELEMENT);
- // walk through list of expanded nodes, breaking into 2 lists: non-remote and remote
- for (int i= 0; i < elementMem.length; i++)
- {
- Object element= getObjectFromMemento(showFilterPools, showFilterStrings, elementMem[i].getString(TAG_PATH));
- if (element != null)
- if (element instanceof RemoteObject) // this is a remote object
- {
- remoteElements.add(element);
- //System.out.println("Added to remote expansion list: " + element);
- }
- else
- {
- elements.add(element);
- //System.out.println("Added to non-remote expansion list: " + element);
- }
- }
- // expand non-remote...
- systemView.setExpandedElements(elements.toArray());
- // expand remote...
- if (remoteElements.size() > 0)
- {
- SystemResourceChangeEvent event = null;
- for (int idx=0; idx<remoteElements.size(); idx++)
- {
- RemoteObject ro = (RemoteObject)remoteElements.elementAt(idx);
- if (doTimings)
- timer.setStartTime();
- //event = new SystemResourceChangeEvent(ro.name,ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE,
- // SystemViewDummyObject.getSingleton()); // This tells SystemView to expand this remote object, but don't select a child
- //systemView.systemResourceChanged(event);
- systemView.refreshRemoteObject(ro.name, SystemViewDummyObject.getSingleton(), true);
- if (doTimings)
- {
- timer.setEndTime();
- System.out.println("Time to restore "+ro.name+": " + timer);
- }
- }
- }
- }
-
- // restoreSelection
- childMem= memento.getChild(TAG_SELECTION);
- if (childMem != null)
- {
- ArrayList list= new ArrayList();
- Vector remoteElements = new Vector();
- IMemento[] elementMem= childMem.getChildren(TAG_ELEMENT);
- for (int i= 0; i < elementMem.length; i++)
- {
- Object element= getObjectFromMemento(showFilterPools, showFilterStrings, elementMem[i].getString(TAG_PATH));
- if (element != null)
- if (element instanceof RemoteObject) // this is a remote object
- remoteElements.add(element);
- else
- list.add(element);
- //System.out.println("Added to selection list: " + element);
- }
- systemView.setSelection(new StructuredSelection(list));
- if (remoteElements.size() > 0)
- {
- Vector v = new Vector();
- for (int idx=0; idx<remoteElements.size(); idx++)
- {
- RemoteObject ro = (RemoteObject)remoteElements.elementAt(idx);
- v.addElement(ro.name);
- }
- if (doTimings)
- timer.setStartTime();
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(v,ISystemResourceChangeEvents.EVENT_SELECT_REMOTE,null);
- systemView.systemResourceChanged(event);
- if (doTimings)
- {
- timer.setEndTime();
- System.out.println("Time to select "+v.size()+" elements: " + timer);
- }
- }
- }
- Tree tree= systemView.getTree();
- //restore vertical position
- ScrollBar bar= tree.getVerticalBar();
- if (bar != null)
- {
- try
- {
- String posStr= memento.getString(TAG_VERTICAL_POSITION);
- if (posStr != null)
- {
- int position;
- position= new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- } catch (NumberFormatException e)
- {
- }
- }
- //restore vertical position
- bar= tree.getHorizontalBar();
- if (bar != null)
- {
- try
- {
- String posStr= memento.getString(TAG_HORIZONTAL_POSITION);
- if (posStr != null)
- {
- int position;
- position= new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- } catch (NumberFormatException e)
- {
- }
- }
- */
- }
-
- /**
- * protected method to deconstruct an expanded/selected memento into an actual object
- */
- protected Object getObjectFromMemento(boolean showFilterPools, boolean showFilterStrings, String memento)
- {
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
-
- ISystemProfile profile = null;
- IHost conn = null;
- String ssfId = null;
- ISubSystemConfiguration ssf = null;
- ISubSystem subsystem = null;
- ISystemFilterPoolReference fpRef = null;
- ISystemFilterReference fRef = null;
- ISystemFilterStringReference fsRef = null;
- RemoteObject remoteObject = null;
-
- //System.out.println("PARSING MEMENTO: " + memento);
-
- if (memento == null)
- return null;
-
- Vector v = tokenize(memento, MEMENTO_DELIM);
-
- String elementType = "";
- String ssName = null;
- //String connName = null;
- //String subsystemName = null;
- // 0. element type
- // 1. connections
- // 2. subsystems
- // 3. filter pools (optional)
- // 4. filters
- // 5. filter strings (optional)
- // 6. remote objects
- // 1. connections
- // 2. subsystems
- // 3. filters
- // 4. filter strings (optional)
- // 5. remote objects
- // 1. connections
- // 2. subsystems
- // 3. filter pools (optional)
- // 4. filters
- // 5. remote objects
- // 1. connections
- // 2. subsystems
- // 3. filters
- // 4. remote objects
-
- int index = 0;
- for (int idx = 0; idx < v.size(); idx++)
- {
- String token = (String) v.elementAt(idx);
- switch (idx)
- {
- // type of element
- case 0 :
- elementType = token;
- break;
- // connection
- case 1 :
- index = token.indexOf('.');
- if (index > 0)
- {
- profile = sr.getSystemProfile(token.substring(0, index));
- if (profile != null)
- conn = sr.getHost(profile, token.substring(index + 1));
- }
- break;
- // subsystem
- case 2 :
- index = token.indexOf('=');
- ssfId = token.substring(0, index);
- ssName = token.substring(index + 1);
- if (ssfId != null)
- ssf = sr.getSubSystemConfiguration(ssfId);
- if ((ssf != null) && (conn != null))
- {
- ISubSystem[] subsystems = ssf.getSubSystems(conn, true); // force to life
- if (subsystems != null)
- for (int ssidx = 0;(subsystem == null) && (ssidx < subsystems.length); ssidx++)
- if (subsystems[ssidx].getName().equals(ssName))
- subsystem = subsystems[ssidx];
- }
- break;
- // filter pool or filter (depends on showFilterPools)
- case 3 :
- if (showFilterPools)
- {
- if (subsystem != null)
- {
- String poolName = token;
- ISystemFilterPoolReference[] refs = subsystem.getFilterPoolReferenceManager().getSystemFilterPoolReferences();
- if (refs != null)
- for (int refidx = 0;(fpRef == null) && (refidx < refs.length); refidx++)
- {
- if (refs[refidx].getFullName().equals(poolName))
- fpRef = refs[refidx];
- }
- }
- }
- else
- {
- index = token.indexOf('=');
- if (index != -1)
- {
- String filterName = token.substring(index + 1);
- String poolName = token.substring(0, index);
- if (subsystem != null)
- {
- ISystemFilterPoolReference[] refs = subsystem.getFilterPoolReferenceManager().getSystemFilterPoolReferences();
- if (refs != null)
- for (int refidx = 0;(fpRef == null) && (refidx < refs.length); refidx++)
- if (refs[refidx].getFullName().equals(poolName))
- fpRef = refs[refidx];
- }
-
- // TODO: handle nested filters. in this case they are separated by ';'. See SystemFilterReferenceAdapter's getMementoHandle()
- if (fpRef != null)
- {
- ISystemFilterReference[] refs = fpRef.getSystemFilterReferences(subsystem);
- if (refs != null)
- for (int refidx = 0;(fRef == null) && (refidx < refs.length); refidx++)
- if (refs[refidx].getName().equals(filterName))
- fRef = refs[refidx];
- }
- }
- }
- break;
- // filter or filter string (depends on showFilterPools) or remote object (depends on showFilterStrings)
- case 4 :
- if (showFilterPools) // definitely a filter
- {
- index = token.indexOf('=');
- String filterName = token.substring(index + 1);
-// String poolName = token.substring(0, index);
- // TODO: handle nested filters. in this case they are separated by ';'. See SystemFilterReferenceAdapter's getMementoHandle()
- if (fpRef != null) // should have already been parsed in case 3
- {
- ISystemFilterReference[] refs = fpRef.getSystemFilterReferences(subsystem);
- if (refs != null)
- for (int refidx = 0;(fRef == null) && (refidx < refs.length); refidx++)
- if (refs[refidx].getName().equals(filterName))
- fRef = refs[refidx];
- }
- }
- else if (showFilterStrings) // children of filters are filter strings or resolved remote objects
- {
- // at this point we know the parent filter reference as that was parsed in case 3
- if (fRef != null)
- {
- ISystemFilterStringReference[] refs = fRef.getSystemFilterStringReferences();
- if (refs != null)
- for (int refidx = 0;(fsRef == null) && (refidx < refs.length); refidx++)
- if (refs[refidx].getString().equals(token))
- fsRef = refs[refidx];
- }
- }
- else // if both pools and strings are turned off, then at level four we are definitely dealing with remote objects
- {
- if ((subsystem != null) && (fRef != null))
- remoteObject = new RemoteObject(token, subsystem, fRef, fsRef);
- }
-
- break;
- // filter string (depends on showFilterStrings) or remote object
- case 5 :
- if (showFilterPools && showFilterStrings) // definitely a filter string
- {
- // at this point we know the parent filter reference as that was parsed in case 4
- if (fRef != null)
- {
- ISystemFilterStringReference[] refs = fRef.getSystemFilterStringReferences();
- if (refs != null)
- for (int refidx = 0;(fsRef == null) && (refidx < refs.length); refidx++)
- if (refs[refidx].getString().equals(token))
- fsRef = refs[refidx];
- }
- }
- else // definitely remote
- {
- if ((subsystem != null) && (fRef != null))
- remoteObject = new RemoteObject(token, subsystem, fRef, fsRef);
- }
-
- break;
- default : // definitely a remote object
- if ((subsystem != null) && (fRef != null))
- remoteObject = new RemoteObject(token, subsystem, fRef, fsRef);
- }
- }
-
- if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_CONNECTION))
- return conn;
- else if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_SUBSYSTEM))
- return subsystem;
- else if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_FILTERPOOLREFERENCE))
- return fpRef;
- else if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_FILTERREFERENCE))
- return fRef;
- else if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_FILTERSTRINGREFERENCE))
- return fsRef;
- else
- return remoteObject;
-
- //return null;
- }
-
- /**
- * Parse a string into tokens. Unlike StringTokenizer, this supports delimiter strings versus
- * only delimiter characters
- */
- public static Vector tokenize(String inputString, String delimiter)
- {
- Vector v = new Vector();
- StringBuffer token = new StringBuffer();
- String lastToken = null;
- int inpLen = inputString.length();
- int delimLen = delimiter.length();
- char delimChar1 = delimiter.charAt(0);
- for (int idx = 0; idx < inpLen; idx++)
- {
- int remLen = inpLen - idx;
- char currChar = inputString.charAt(idx);
- if ((currChar == delimChar1) && (remLen >= delimLen) && inputString.substring(idx, idx + delimLen).equals(delimiter))
- {
- lastToken = token.toString();
- v.addElement(lastToken);
- //System.out.println("...token: " + token);
- token.setLength(0);
- idx += delimLen - 1;
- }
- else
- token.append(currChar);
- }
- if (token.length() > 0)
- {
- lastToken = token.toString();
- v.addElement(lastToken);
- //System.out.println("...token: " + token);
- }
- return v;
- }
-
- protected class RemoteObject
- {
- public String name;
- public ISubSystem subsystem;
- public ISystemFilterReference fRef;
- public ISystemFilterStringReference fsRef;
-
- public RemoteObject(String name, ISubSystem ss, ISystemFilterReference fRef, ISystemFilterStringReference fsRef)
- {
- this.name = name;
- this.subsystem = ss;
- this.fRef = fRef;
- this.fsRef = fsRef;
- }
-
- public String toString()
- {
- return "Remote object: " + name;
- }
- }
-
- protected IPartListener partListener = new IPartListener()
- {
- public void partActivated(IWorkbenchPart part)
- {
- if (part instanceof IEditorPart)
- editorActivated((IEditorPart) part);
- }
- public void partBroughtToTop(IWorkbenchPart part)
- {
- }
- public void partClosed(IWorkbenchPart part)
- {
- }
- public void partDeactivated(IWorkbenchPart part)
- {
- }
- public void partOpened(IWorkbenchPart part)
- {
- }
- };
-
- public class RestoreStateRunnable extends UIJob
- {
- protected IMemento _memento;
- public RestoreStateRunnable(IMemento memento)
- {
- super("Restore RSE Tree");
- _memento = memento;
-
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- IMemento memento = _memento;
- //System.out.println("SYSTEMVIEWPART: restoreState");
- if (!SystemPreferencesManager.getPreferencesManager().getRememberState())
- return Status.CANCEL_STATUS;
-
- if (doTimings)
- timer = new SystemElapsedTimer();
-
- // restore the show filter pools and show filter strings settings as they were when this was saved
- boolean showFilterPools = false;
- boolean showFilterStrings = false;
- String linkWithEditor = memento.getString(TAG_LINKWITHEDITOR);
- if (linkWithEditor != null)
- {
- if (linkWithEditor.equals("t"))
- {
- isLinkingEnabled = true;
- toggleLinkingAction.setChecked(true);
- }
- else
- isLinkingEnabled = false;
- }
- else
- {
- isLinkingEnabled = false;
- }
-
- String savedValue = memento.getString(TAG_SHOWFILTERPOOLS);
- if (savedValue != null)
- showFilterPools = savedValue.equals("t");
- else
- showFilterPools = SystemPreferencesManager.getPreferencesManager().getShowFilterPools();
- savedValue = memento.getString(TAG_SHOWFILTERSTRINGS); // historical
- if (savedValue != null)
- showFilterStrings = savedValue.equals("t");
- //else
- //showFilterStrings = SystemPreferencesManager.getPreferencesManager().getShowFilterStrings();
-
- IMemento childMem = null;
-
- // restore expand-to hashtable state
- childMem = memento.getChild(TAG_EXPANDED_TO);
- if (childMem != null)
- {
- IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
- Hashtable ht = new Hashtable();
- for (int i = 0; i < elementMem.length; i++)
- {
- String key = elementMem[i].getString(TAG_PATH);
- String value = elementMem[i].getString(TAG_FILTER);
- if ((key != null) && (value != null))
- ht.put(key, value);
- }
- if (ht.size() > 0)
- systemView.setExpandToFilterTable(ht);
- }
- // restore expansion state
- childMem = memento.getChild(TAG_EXPANDED);
- if (childMem != null)
- {
- ArrayList elements = new ArrayList();
- Vector remoteElements = new Vector();
- IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
-
- // yantzi: artemis6.0, keep track subsystems which have their memento flag set in order
- // to restore system view from cache (if the subsystem supports this)
- List cacheSubSystemList = new ArrayList();
- ISubSystem cacheSubSystem;
- boolean restoreFromCache = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemPreferencesConstants.RESTORE_STATE_FROM_CACHE);
-
- // walk through list of expanded nodes, breaking into 2 lists: non-remote and remote
- for (int i = 0; i < elementMem.length; i++)
- {
- Object element = getObjectFromMemento(showFilterPools, showFilterStrings, elementMem[i].getString(TAG_PATH));
- if (element != null)
- if (element instanceof RemoteObject) // this is a remote object
- {
- remoteElements.add(element);
- //System.out.println("Added to remote expansion list: " + element);
- }
- else if (element instanceof ISystemFilterReference)
- {
- elements.add(element);
-
- if (restoreFromCache)
- {
- // yantzi: artemis 6.0, see comment above
- cacheSubSystem = ((ISystemFilterReference)element).getSubSystem();
- if (cacheSubSystem.supportsCaching() && cacheSubSystem.getCacheManager() != null)
- {
- cacheSubSystem.getCacheManager().setRestoreFromMemento(true);
- cacheSubSystemList.add(cacheSubSystem);
- }
- }
- }
- else
- {
- elements.add(element);
- //System.out.println("Added to non-remote expansion list: " + element);
- }
- }
- // expand non-remote...
- systemView.setExpandedElements(elements.toArray());
- // expand remote...
- if (remoteElements.size() > 0)
- {
- for (int idx = 0; idx < remoteElements.size(); idx++)
- {
- RemoteObject ro = (RemoteObject) remoteElements.elementAt(idx);
- if (doTimings)
- timer.setStartTime();
- //event = new SystemResourceChangeEvent(ro.name,ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE,
- // SystemViewDummyObject.getSingleton()); // This tells SystemView to expand this remote object, but don't select a child
- //systemView.systemResourceChanged(event);
-
- // yantzi: artemis 6.0: notify subsystems that this is a restore from memento so they
- // can optionally use the cache if desired
- if (ro.subsystem != null && ro.subsystem.supportsCaching())
- {
- ro.subsystem.getCacheManager().setRestoreFromMemento(true);
- }
-
- systemView.refreshRemoteObject(ro.name, SystemViewDummyObject.getSingleton(), true);
-
- // yantzi: artemis 6.0: reset restore from memento flag
- if (ro.subsystem != null && ro.subsystem.supportsCaching())
- {
- ro.subsystem.getCacheManager().setRestoreFromMemento(false);
- }
-
- if (doTimings)
- {
- timer.setEndTime();
- System.out.println("Time to restore " + ro.name + ": " + timer);
- }
- }
- }
-
- // yantzi: artemis 6.0, restore memento flag for affected subsystems
- if (restoreFromCache)
- {
- for (int i = 0; i < cacheSubSystemList.size(); i++)
- {
- ((ISubSystem) cacheSubSystemList.get(i)).getCacheManager().setRestoreFromMemento(false);
- }
- }
- }
-
- // restoreSelection
- childMem = memento.getChild(TAG_SELECTION);
- if (childMem != null)
- {
- ArrayList list = new ArrayList();
- Vector remoteElements = new Vector();
- IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
- for (int i = 0; i < elementMem.length; i++)
- {
- Object element = getObjectFromMemento(showFilterPools, showFilterStrings, elementMem[i].getString(TAG_PATH));
- if (element != null)
- if (element instanceof RemoteObject) // this is a remote object
- remoteElements.add(element);
- else
- list.add(element);
- //System.out.println("Added to selection list: " + element);
- }
- systemView.setSelection(new StructuredSelection(list));
- if (remoteElements.size() > 0)
- {
- Vector v = new Vector();
- for (int idx = 0; idx < remoteElements.size(); idx++)
- {
- RemoteObject ro = (RemoteObject) remoteElements.elementAt(idx);
- v.addElement(ro.name);
- }
- if (doTimings)
- timer.setStartTime();
- SystemResourceChangeEvent event = new SystemResourceChangeEvent(v, ISystemResourceChangeEvents.EVENT_SELECT_REMOTE, null);
- systemView.systemResourceChanged(event);
- if (doTimings)
- {
- timer.setEndTime();
- System.out.println("Time to select " + v.size() + " elements: " + timer);
- }
- }
- }
- Tree tree = systemView.getTree();
- //restore vertical position
- ScrollBar bar = tree.getVerticalBar();
- if (bar != null)
- {
- try
- {
- String posStr = memento.getString(TAG_VERTICAL_POSITION);
- if (posStr != null)
- {
- int position;
- position = new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- //restore vertical position
- bar = tree.getHorizontalBar();
- if (bar != null)
- {
- try
- {
- String posStr = memento.getString(TAG_HORIZONTAL_POSITION);
- if (posStr != null)
- {
- int position;
- position = new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- return Status.OK_STATUS;
- }
-
- }
-
- // THE FOLLOWING ARE TO ENABLE PERSISTENCE OF NON-PRIMARY REMOTE SYSTEM EXPLORER VIEWS OPENED UP BY THE
- // USER RIGHT CLICKING AND SELECTING "OPEN IN NEW PERSPECTIVE".
-
- // --------------------------
- // IElementFactory methods...
- // --------------------------
- /**
- * Given the memento created by saveState, for the input to the perspective, recreate the input object
- * at startup time.
- * See the extension point for "org.eclipse.ui.elementFactories" in plugin.xml
- */
- public IAdaptable createElement(IMemento memento)
- {
- //System.out.println("INSIDE CREATEELEMENT IN SYSTEMVIEWPART. TAG_INPUT STRING = "+memento.getString(TAG_INPUT));
- IAdaptable element = null;
- Object object = null;
-
- // restore the show filter pools and show filter strings settings as they were when this was saved
- boolean showFilterPools = false;
- boolean showFilterStrings = false;
- String savedValue = memento.getString(TAG_SHOWFILTERPOOLS);
- if (savedValue != null)
- showFilterPools = savedValue.equals("t");
- else
- showFilterPools = SystemPreferencesManager.getPreferencesManager().getShowFilterPools();
-
- savedValue = memento.getString(TAG_SHOWFILTERSTRINGS);
- if (savedValue != null)
- showFilterStrings = savedValue.equals("t");
- //else
- // showFilterStrings = SystemPreferencesManager.getPreferencesManager().getShowFilterStrings();
-
- object = getObjectFromMemento(showFilterPools, showFilterStrings, memento.getString(TAG_INPUT));
-
- // For now we don't allow secondary perspectives to be opened on remote objects, so we are lucky!
- if (object instanceof RemoteObject)
- {
- }
- else if (object instanceof IAdaptable)
- element = (IAdaptable) object;
- //System.out.println("... RETURNING "+element);
- return element;
- }
-
- // ------------------------------
- // IPersistableElement methods...
- // ------------------------------
- /**
- * Return the element factory ID as declared in the extension point for "org.eclipse.ui.elementFactories" in plugin.xml
- */
- public String getFactoryId()
- {
- //System.out.println("INSIDE GETFACTORYID IN SYSTEMVIEWPART");
- return "org.eclipse.rse.systemview.elementfactory";
- }
-
- /*
- * The workbench is closing, and we are being asked to save the state of the input object in one of the secondary perspectives
- *
- public void saveState(IMemento memento)
- {
-
- }*/
-
- /**
- * The workbench is closing, and we are being asked to save the state of the input object in one of the secondary perspectives.
- * This method is called by our saveState when it detects this is a save for the input vs a page save.
- */
- protected void saveInputState(IMemento memento)
- {
- //System.out.println("INSIDE SAVEINPUTSTATE IN SYSTEMVIEWPART");
- IAdaptable inputObj = getSite().getPage().getInput();
- ISystemViewElementAdapter adapter = systemView.getAdapter(inputObj);
- if ((adapter != null) && (adapter.saveExpansionState(inputObj)))
- {
- String handle = getInputMementoHandle(inputObj, adapter);
- if (handle != null)
- {
- //System.out.println("... saving memento string: "+handle);
- memento.putString(TAG_INPUT, handle);
- }
- }
- }
- protected String getInputMementoHandle(Object o, ISystemViewElementAdapter adapter)
- {
- StringBuffer idBuffer = new StringBuffer(adapter.getMementoHandleKey(o));
- idBuffer.append(MEMENTO_DELIM + adapter.getInputMementoHandle(o));
- return idBuffer.toString();
- }
-
- // --------------------------------
- // IAdapterFactory methods...
- // --------------------------------
- /**
- * @see IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList()
- {
- return new Class[] { IPersistableElement.class };
- }
-
- /**
- * Called by our plugin's startup method to register our adaptable object types
- * with the platform. We prefer to do it here to isolate/encapsulate all factory
- * logic in this one place.
- */
- public void registerWithManager(IAdapterManager manager, Object input)
- {
- //System.out.println("INSIDE REGISTERWITHMANAGER IN SYSTEMVIEWPART");
- // these are all the object types we allow the user to select "Open in New Perspective" on...
- manager.registerAdapters(this, input.getClass());
- }
- /**
- * Called by our plugin's startup method to register our adaptable object types
- * with the platform. We prefer to do it here to isolate/encapsulate all factory
- * logic in this one place.
- */
- public void unregisterWithManager(IAdapterManager manager)
- {
- //System.out.println("INSIDE UNREGISTERWITHMANAGER IN SYSTEMVIEWPART");
- // these are all the object types we allow the user to select "Open in New Perspective" on...
- manager.unregisterAdapters(this);
- }
-
- /**
- * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType)
- {
- //System.out.println("INSIDE GETADAPTER IN SYSTEMVIEWPART. adaptableObject = "+adaptableObject+", adapterType = "+adapterType.getName());
- // we don't try to restore these secondary perspectives unless user has elected to do so...
- if (!SystemPreferencesManager.getPreferencesManager().getRememberState())
- return null;
- else
- return this;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartFrameSource.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartFrameSource.java
deleted file mode 100644
index 99695de65..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartFrameSource.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.ui.views.framelist.TreeFrame;
-import org.eclipse.ui.views.framelist.TreeViewerFrameSource;
-
-/**
- * Enables frameset for the Remote Systems Explorer view part
- */
-class SystemViewPartFrameSource extends TreeViewerFrameSource
-{
-
- // has same interface as org.eclipse.ui.views.navigator.NavigatorFrameSource
-
- private SystemViewPart fSystemViewPart;
-
- SystemViewPartFrameSource(SystemViewPart viewPart)
- {
- super(viewPart.getSystemView());
- fSystemViewPart = viewPart;
- }
-
- protected TreeFrame createFrame(Object input)
- {
- TreeFrame frame = super.createFrame(input);
- frame.setName(fSystemViewPart.getFrameName(input));
- frame.setToolTipText(fSystemViewPart.getFrameToolTipText(input));
- return frame;
- }
-
- /**
- * Also updates the title of the Remote Systems view part
- */
- protected void frameChanged(TreeFrame frame)
- {
- super.frameChanged(frame);
- fSystemViewPart.updateTitle();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartGotoActionGroup.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartGotoActionGroup.java
deleted file mode 100644
index cff400699..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPartGotoActionGroup.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.rse.ui.GenericMessages;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.views.framelist.BackAction;
-import org.eclipse.ui.views.framelist.ForwardAction;
-import org.eclipse.ui.views.framelist.FrameList;
-import org.eclipse.ui.views.framelist.UpAction;
-
-
-
-/**
- * Enables typical frameset actions for Remote Systems Explorer view part
- */
-public class SystemViewPartGotoActionGroup extends ActionGroup
-{
-
- protected SystemViewPart fSystemViewPart;
- protected BackAction backAction;
- protected ForwardAction forwardAction;
- //private GoIntoAction goIntoAction;
- protected UpAction upAction;
-
-
- /**
- * Constructor
- */
- public SystemViewPartGotoActionGroup(SystemViewPart viewPart)
- {
- fSystemViewPart = viewPart;
- makeActions();
- }
-
- /**
- * Returns the RSE view part associated with this action group
- */
- public SystemViewPart getSystemViewPart()
- {
- return fSystemViewPart;
- }
-
- protected void makeActions()
- {
- FrameList frameList = fSystemViewPart.getFrameList();
- //goIntoAction = new GoIntoAction(frameList);
- backAction = new BackAction(frameList);
- forwardAction = new ForwardAction(frameList);
- upAction = new UpAction(frameList);
- }
-
- public void fillContextMenu(IMenuManager menu)
- {
- // we actually don't call this! See instead SystemCascadingGoToAction
- //menu.add(goIntoAction); // done in SystemView
- MenuManager gotoMenu =
- new MenuManager(GenericMessages.ResourceNavigator_goto);
- menu.add(gotoMenu);
- gotoMenu.add(backAction);
- gotoMenu.add(forwardAction);
- gotoMenu.add(upAction);
- }
-
- public void fillActionBars(IActionBars actionBars)
- {
- //actionBars.setGlobalActionHandler(
- // ActionFactory.GO_INTO,
- // goIntoAction);
- actionBars.setGlobalActionHandler(
- ActionFactory.BACK.getId(),
- backAction);
- actionBars.setGlobalActionHandler(
- ActionFactory.FORWARD.getId(),
- forwardAction);
- actionBars.setGlobalActionHandler(ActionFactory.UP.getId(),upAction);
-
- IToolBarManager toolBar = actionBars.getToolBarManager();
- toolBar.add(backAction);
- toolBar.add(forwardAction);
- toolBar.add(upAction);
- }
-
- public void updateActionBars()
- {
- getContext().getSelection();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPromptableAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPromptableAdapter.java
deleted file mode 100644
index d0d62860b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPromptableAdapter.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.model.ISystemPromptableObject;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.actions.SystemRunAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Adapter for displaying special-case prompt objects in the system views.
- * These are objects that, when expanded, launch a wizard to create something.
- */
-public class SystemViewPromptableAdapter
- extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- protected SystemRunAction runAction;
-
- /**
- * Return the actions to show in the popup menu for the current selection
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- ISystemPromptableObject object = (ISystemPromptableObject)selection.getFirstElement();
- if ((object != null) && !object.hasChildren())
- {
- if (runAction == null)
- runAction = getRunAction(shell);
- menu.add(menuGroup, runAction);
- }
- }
-
- /**
- * Only called if the selected object has no children.
- * @param shell the shell.
- * @return the run action.
- */
- protected SystemRunAction getRunAction(Shell shell) {
- return (new SystemRunAction(shell));
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- return ((ISystemPromptableObject)element).getImageDescriptor();
- }
-
- /**
- * Return the label for this object.
- */
- public String getText(Object element)
- {
- return ((ISystemPromptableObject)element).getText();
- }
- /**
- * Return the absolute name, versus just display name, of this object.
- * Just uses getText(element);
- */
- public String getAbsoluteName(Object element)
- {
- return getText(element);
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return ((ISystemPromptableObject)element).getType();
- }
-
- /**
- * Return the parent of this object.
- */
- public Object getParent(Object element)
- {
- return ((ISystemPromptableObject)element).getParent();
- }
-
- /**
- * Return the children of this object. Not applicable for us.
- */
- public Object[] getChildren(Object element)
- {
- ISystemPromptableObject promptable = (ISystemPromptableObject)element;
- if (!promptable.hasChildren())
- return promptable.run(getShell());
- else
- return promptable.getChildren();
- }
-
- /**
- * Return true if this object has children.
- * We return true, as either we'll expand and prompt, or expand and show child prompts
- */
- public boolean hasChildren(Object element)
- {
- return true;
- }
- /**
- * Return our unique property descriptors
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- return null;
- }
- /**
- * Return our unique property values
- */
- public Object internalGetPropertyValue(Object key)
- {
- return null;
- }
- /**
- * Don't show delete
- */
- public boolean showDelete(Object element)
- {
- return false;
- }
-
- /**
- * Don't show rename
- */
- public boolean showRename(Object element)
- {
- return false;
- }
-
- /**
- * Do show refresh, expand and collapse, but only if there are children
- */
- public boolean showRefresh(Object element)
- {
- ISystemPromptableObject promptable = (ISystemPromptableObject)element;
- return promptable.hasChildren();
- }
-
- /**
- * Don't show "Open in new perspective"
- */
- public boolean showOpenViewActions(Object element)
- {
- return false;
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- return getName(element);
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return "Prompt";
- }
-
- /**
- * Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted
- * messages. In these cases return false from this method. The default is true.
- * <p>
- * WE RETURN FALSE.
- */
- public boolean saveExpansionState(Object element)
- {
- return false;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.java
deleted file mode 100644
index 41e7b5ee6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.osgi.util.NLS;
-
-
-/**
- * Constants used throughout the SystemView plugin
- */
-public class SystemViewResources extends NLS {
- private static String BUNDLE_NAME = "org.eclipse.rse.ui.view.SystemViewResources"; //$NON-NLS-1$
-
- // -------------------------
- // Property names...
- // -------------------------
- // Property sheet values: Common
- public static String RESID_PROPERTY_NBRCHILDREN_LABEL;
- public static String RESID_PROPERTY_NBRCHILDREN_TOOLTIP;
-
- public static String RESID_PROPERTY_NBRCHILDRENRETRIEVED_LABEL;
- public static String RESID_PROPERTY_NBRCHILDRENRETRIEVED_TOOLTIP;
-
- // Property sheet values: Connections
- public static String RESID_PROPERTY_PROFILE_TYPE_VALUE;
-
- public static String RESID_PROPERTY_PROFILESTATUS_LABEL;
- public static String RESID_PROPERTY_PROFILESTATUS_TOOLTIP;
-
- public static String RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL;
-
- public static String RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL;
-
- public static String RESID_PROPERTY_CONNECTION_TYPE_VALUE;
-
- public static String RESID_PROPERTY_SYSTEMTYPE_LABEL;
- public static String RESID_PROPERTY_SYSTEMTYPE_TOOLTIP;
-
- public static String RESID_PROPERTY_CONNECTIONSTATUS_LABEL;
- public static String RESID_PROPERTY_CONNECTIONSTATUS_TOOLTIP;
- public static String RESID_PROPERTY_CONNECTIONSTATUS_CONNECTED_VALUE;
-
- public static String RESID_PROPERTY_CONNECTIONSTATUS_DISCONNECTED_VALUE;
-
-
- public static String RESID_PROPERTY_ALIASNAME_LABEL;
- public static String RESID_PROPERTY_ALIASNAME_TOOLTIP;
-
- public static String RESID_PROPERTY_HOSTNAME_LABEL;
- public static String RESID_PROPERTY_HOSTNAME_TOOLTIP;
-
- public static String RESID_PROPERTY_DEFAULTUSERID_LABEL;
- public static String RESID_PROPERTY_DEFAULTUSERID_TOOLTIP;
-
- public static String RESID_PROPERTY_CONNDESCRIPTION_LABEL;
- public static String RESID_PROPERTY_CONNDESCRIPTION_TOOLTIP;
-
- public static String RESID_PROPERTY_PROFILE_LABEL;
- public static String RESID_PROPERTY_PROFILE_TOOLTIP;
-
-
- // Property sheet values: SubSystems
- public static String RESID_PROPERTY_SUBSYSTEM_TYPE_VALUE;
-
- public static String RESID_PROPERTY_USERID_LABEL;
- public static String RESID_PROPERTY_USERID_TOOLTIP;
-
- public static String RESID_PROPERTY_PORT_LABEL;
- public static String RESID_PROPERTY_PORT_TOOLTIP;
-
- public static String RESID_PROPERTY_CONNECTED_TOOLTIP;
- public static String RESID_PROPERTY_CONNECTED_LABEL;
-
- public static String RESID_PROPERTY_VRM_LABEL;
- public static String RESID_PROPERTY_VRM_TOOLTIP;
-
- // Property sheet values: Filter Pools
- public static String RESID_PROPERTY_FILTERPOOL_TYPE_VALUE;
-
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_TYPE_VALUE;
-
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_LABEL;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_TOOLTIP;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_LABEL;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_TOOLTIP;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_LABEL;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_TOOLTIP;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_LABEL;
- public static String RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_TOOLTIP;
-
- // Property sheet values: Filters
- public static String RESID_PROPERTY_FILTERTYPE_LABEL;
- public static String RESID_PROPERTY_FILTERTYPE_VALUE;
- public static String RESID_PROPERTY_FILTERTYPE_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERSTRING_LABEL;
- public static String RESID_PROPERTY_FILTERSTRING_VALUE;
- public static String RESID_PROPERTY_FILTERSTRING_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERSTRINGS_LABEL;
- public static String RESID_PROPERTY_FILTERSTRINGS_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERSTRINGS_COUNT_LABEL;
- public static String RESID_PROPERTY_FILTERSTRINGS_COUNT_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERPARENTFILTER_LABEL;
- public static String RESID_PROPERTY_FILTERPARENTFILTER_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERPARENTPOOL_LABEL;
- public static String RESID_PROPERTY_FILTERPARENTPOOL_TOOLTIP;
-
- public static String RESID_PROPERTY_FILTERS_LABEL;
- public static String RESID_PROPERTY_FILTERS_DESCRIPTION;
-
- // Property sheet values: Files
- public static String RESID_PROPERTY_FILE_TYPE_FILE_VALUE;
- public static String RESID_PROPERTY_FILE_TYPE_FOLDER_VALUE;
- public static String RESID_PROPERTY_FILE_TYPE_ROOT_VALUE;
-
- public static String RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_LABEL;
-
- public static String RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_VALUE;
- public static String RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_DESCRIPTION;
-
- public static String RESID_PROPERTY_ARCHIVE_COMMENT_LABEL;
- public static String RESID_PROPERTY_ARCHIVE_COMMENT_DESCRIPTION;
-
-
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_LABEL;
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_VALUE;
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_DESCRIPTION;
-
- public static String RESID_PROPERTY_VIRTUALFILE_COMMENT_LABEL;
- public static String RESID_PROPERTY_VIRTUALFILE_COMMENT_DESCRIPTION;
-
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_LABEL;
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_DESCRIPTION;
-
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_LABEL;
- public static String RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_DESCRIPTION;
-
- public static String RESID_PROPERTY_FILE_SIZE_VALUE;
-
- public static String RESID_PROPERTY_FILE_PATH_LABEL;
- public static String RESID_PROPERTY_FILE_PATH_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_LASTMODIFIED_LABEL;
- public static String RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_SIZE_LABEL;
- public static String RESID_PROPERTY_FILE_SIZE_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL;
- public static String RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_CLASSIFICATION_LABEL;
- public static String RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_READONLY_LABEL;
- public static String RESID_PROPERTY_FILE_READONLY_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_READABLE_LABEL;
- public static String RESID_PROPERTY_FILE_READABLE_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_WRITABLE_LABEL;
- public static String RESID_PROPERTY_FILE_WRITABLE_TOOLTIP;
-
- public static String RESID_PROPERTY_FILE_HIDDEN_LABEL;
- public static String RESID_PROPERTY_FILE_HIDDEN_TOOLTIP;
-
- // search result properties
- public static String RESID_PROPERTY_SEARCH_LINE_LABEL;
- public static String RESID_PROPERTY_SEARCH_LINE_TOOLTIP;
- //public static String RESID_PROPERTY_SEARCH_CHAR_END_LABEL;
- //public static String RESID_PROPERTY_SEARCH_CHAR_END_TOOLTIP;
-
-
-
- // shell status properties
- public static String RESID_PROPERTY_SHELL_STATUS_LABEL;
- public static String RESID_PROPERTY_SHELL_STATUS_TOOLTIP;
- public static String RESID_PROPERTY_SHELL_CONTEXT_LABEL;
- public static String RESID_PROPERTY_SHELL_CONTEXT_TOOLTIP;
-
- public static String RESID_PROPERTY_SHELL_STATUS_ACTIVE_VALUE;
- public static String RESID_PROPERTY_SHELL_STATUS_INACTIVE_VALUE;
-
- // error properties
- public static String RESID_PROPERTY_ERROR_FILENAME_LABEL;
- public static String RESID_PROPERTY_ERROR_FILENAME_TOOLTIP;
-
- public static String RESID_PROPERTY_ERROR_LINENO_LABEL;
- public static String RESID_PROPERTY_ERROR_LINENO_TOOLTIP;
-
- // Property sheet values: Messages
- public static String RESID_PROPERTY_MESSAGE_TYPE_VALUE;
-
- // Property sheet values: Categories in Team view
- public static String RESID_PROPERTY_TEAM_CATEGORY_TYPE_VALUE;
- public static String RESID_PROPERTY_TEAM_SSFACTORY_TYPE_VALUE;
- public static String RESID_PROPERTY_TEAM_USERACTION_TYPE_VALUE;
- public static String RESID_PROPERTY_TEAM_COMPILETYPE_TYPE_VALUE;
- public static String RESID_PROPERTY_TEAM_COMPILECMD_TYPE_VALUE;
-
- // Property sheet values: Compile types
- public static String RESID_PROPERTY_COMPILETYPE_TYPES_LABEL;
- public static String RESID_PROPERTY_COMPILETYPE_TYPES_DESCRIPTION;
-
- // Miscellaneous / common
- public static String RESID_PROPERTY_ORIGIN_LABEL;
- public static String RESID_PROPERTY_ORIGIN_TOOLTIP;
- public static String RESID_PROPERTY_COMMAND_LABEL;
- public static String RESID_PROPERTY_COMMAND_TOOLTIP;
- public static String RESID_PROPERTY_COMMENT_LABEL;
- public static String RESID_PROPERTY_COMMENT_TOOLTIP;
-
- public static String RESID_PROPERTY_LINKINGACTION_TEXT;
- public static String RESID_PROPERTY_LINKINGACTION_TOOLTIP;
-
- public static String RESID_SCRATCHPAD;
- public static String RESID_REMOTE_SCRATCHPAD;
-
- public static String RESID_FETCHING;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SystemViewResources.class);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.properties
deleted file mode 100644
index f24bdc638..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewResources.properties
+++ /dev/null
@@ -1,206 +0,0 @@
-################################################################################
-# Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Initial Contributors:
-# The following IBM employees contributed to the Remote System Explorer
-# component that contains this file: David McKnight, Kushal Munir,
-# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
-# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
-#
-# Contributors:
-# {Name} (company) - description of contribution.
-################################################################################
-
-# NLS_MESSAGEFORMAT_NONE
-
-#COMMON PROPERTIES
-RESID_PROPERTY_NBRCHILDREN_LABEL=Number of children
-RESID_PROPERTY_NBRCHILDREN_TOOLTIP=Number of children currently under this parent
-RESID_PROPERTY_NBRCHILDRENRETRIEVED_LABEL=Last retrieved
-RESID_PROPERTY_NBRCHILDRENRETRIEVED_TOOLTIP=Number of children last retrieved
-
-
-#CONNECTION PROPERTIES
-RESID_PROPERTY_SYSTEMTYPE_LABEL=Remote system type
-RESID_PROPERTY_SYSTEMTYPE_TOOLTIP=System type of remote host
-RESID_PROPERTY_PROFILE_TYPE_VALUE=Profile
-RESID_PROPERTY_PROFILESTATUS_LABEL=Status
-RESID_PROPERTY_PROFILESTATUS_TOOLTIP=Active status of this profile. Connections and filters are shown for active profiles only
-RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL=Active
-RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL=Not active
-RESID_PROPERTY_CONNECTION_TYPE_VALUE=Connection
-RESID_PROPERTY_CONNECTIONSTATUS_LABEL=Connection status
-RESID_PROPERTY_CONNECTIONSTATUS_TOOLTIP=Connection status of subsystems
-RESID_PROPERTY_CONNECTIONSTATUS_CONNECTED_VALUE=Some subsystems connected
-RESID_PROPERTY_CONNECTIONSTATUS_DISCONNECTED_VALUE=No subsystems connected
-
-RESID_PROPERTY_ALIASNAME_LABEL=Connection name
-RESID_PROPERTY_ALIASNAME_TOOLTIP=Unique name for this connection
-
-RESID_PROPERTY_HOSTNAME_LABEL=Host name
-RESID_PROPERTY_HOSTNAME_TOOLTIP=Host name or IP address of remote system
-
-RESID_PROPERTY_DEFAULTUSERID_LABEL=Default User ID
-RESID_PROPERTY_DEFAULTUSERID_TOOLTIP=Default user ID when no user ID in subsystem
-
-RESID_PROPERTY_CONNDESCRIPTION_LABEL=Description
-RESID_PROPERTY_CONNDESCRIPTION_TOOLTIP=Description of this connection
-
-RESID_PROPERTY_PROFILE_LABEL=Parent profile
-RESID_PROPERTY_PROFILE_TOOLTIP=Profile that owns this connection
-
-
-#SUBSYSTEM PROPERTIES
-RESID_PROPERTY_SUBSYSTEM_TYPE_VALUE=Subsystem
-
-RESID_PROPERTY_USERID_LABEL=User ID
-RESID_PROPERTY_USERID_TOOLTIP=User ID for connecting to this service
-
-RESID_PROPERTY_PORT_LABEL=Port
-RESID_PROPERTY_PORT_TOOLTIP=Port to use when connecting to this remote subsystem
-
-RESID_PROPERTY_CONNECTED_TOOLTIP=Currently connected to this service?
-RESID_PROPERTY_CONNECTED_LABEL=Connected
-
-RESID_PROPERTY_VRM_LABEL=Version
-RESID_PROPERTY_VRM_TOOLTIP=Version, release and modification of remote system, if available
-
-
-#FILTER POOL PROPERTIES
-RESID_PROPERTY_FILTERPOOL_TYPE_VALUE=Filter pool
-RESID_PROPERTY_FILTERPOOLREFERENCE_TYPE_VALUE=Filter pool reference
-
-RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_LABEL=Referenced filter pool
-RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPOOL_TOOLTIP=Filter pool this references
-RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_LABEL=Parent profile
-RESID_PROPERTY_FILTERPOOLREFERENCE_PARENTPROFILE_TOOLTIP=Profile containing referenced filter pool
-RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_LABEL=Related connection
-RESID_PROPERTY_FILTERPOOLREFERENCE_RELATEDCONNECTION_TOOLTIP=If this is a connection-private filter pool, this is the name of that connection
-RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_LABEL=Connection-private
-RESID_PROPERTY_FILTERPOOLREFERENCE_IS_CONNECTIONPRIVATE_TOOLTIP=Is this is a connection-private filter pool, which only exists for this connection?
-
-
-#FILTER PROPERTIES
-RESID_PROPERTY_FILTERTYPE_LABEL=Filter
-RESID_PROPERTY_FILTERTYPE_VALUE=Remote system filter
-RESID_PROPERTY_FILTERTYPE_TOOLTIP=Remote system filter
-
-RESID_PROPERTY_FILTERSTRING_LABEL=Filter string
-RESID_PROPERTY_FILTERSTRING_VALUE=Remote system filter string
-RESID_PROPERTY_FILTERSTRING_TOOLTIP=Filter string used to get this resource
-
-RESID_PROPERTY_FILTERSTRINGS_LABEL=Filter strings
-RESID_PROPERTY_FILTERSTRINGS_TOOLTIP=Filter strings used to retrieve list of remote system objects
-
-RESID_PROPERTY_FILTERSTRINGS_COUNT_LABEL=Number of filter strings
-RESID_PROPERTY_FILTERSTRINGS_COUNT_TOOLTIP=How many filter strings contained in this filter
-
-RESID_PROPERTY_FILTERPARENTFILTER_LABEL=Parent filter
-RESID_PROPERTY_FILTERPARENTFILTER_TOOLTIP=Filter containing this nested filter
-
-RESID_PROPERTY_FILTERPARENTPOOL_LABEL=Parent filter pool
-RESID_PROPERTY_FILTERPARENTPOOL_TOOLTIP=Filter pool that directly or indirectly contains this filter
-
-RESID_PROPERTY_FILTERS_LABEL=Filter Strings
-RESID_PROPERTY_FILTERS_DESCRIPTION=List of file system filters for this named filter
-
-
-
-#FILE PROPERTIES
-RESID_PROPERTY_FILE_TYPE_FILE_VALUE=File
-RESID_PROPERTY_FILE_TYPE_FOLDER_VALUE=Folder
-RESID_PROPERTY_FILE_TYPE_ROOT_VALUE=Root
-RESID_PROPERTY_FILE_LASTMODIFIED_LABEL=Last modified
-RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP=When last changed
-RESID_PROPERTY_FILE_SIZE_LABEL=Size
-RESID_PROPERTY_FILE_SIZE_VALUE=&1 bytes
-RESID_PROPERTY_FILE_SIZE_TOOLTIP=Number of bytes in this file
-RESID_PROPERTY_FILE_PATH_LABEL=Location
-RESID_PROPERTY_FILE_PATH_TOOLTIP=Path containing this file or folder
-RESID_PROPERTY_FILE_READABLE_LABEL=Readable
-RESID_PROPERTY_FILE_READABLE_TOOLTIP=Is this file readable
-RESID_PROPERTY_FILE_WRITABLE_LABEL=Writable
-RESID_PROPERTY_FILE_WRITABLE_TOOLTIP=Is this file writable
-RESID_PROPERTY_FILE_READONLY_LABEL=Read-only
-RESID_PROPERTY_FILE_READONLY_TOOLTIP=Is this file read-only
-RESID_PROPERTY_FILE_HIDDEN_LABEL=Hidden
-RESID_PROPERTY_FILE_HIDDEN_TOOLTIP=Is this file hidden
-RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL=Canonical Path
-RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP=Canonical path of this file or folder
-RESID_PROPERTY_FILE_CLASSIFICATION_LABEL=Classification
-RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP=Classification path of this file
-
-
-
-#SEARCH RESULT PROPERTIES
-RESID_PROPERTY_SEARCH_LINE_LABEL=Line
-RESID_PROPERTY_SEARCH_LINE_TOOLTIP=Line in file of match
-
-#ARCHIVE PROPERTIES
-RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_LABEL=Expanded Size
-RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_VALUE=&1 bytes
-RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_DESCRIPTION=Number of bytes in this archive when it is decompressed/expanded
-RESID_PROPERTY_ARCHIVE_COMMENT_LABEL=Comment
-RESID_PROPERTY_ARCHIVE_COMMENT_DESCRIPTION=The user-defined comment for this archive
-
-
-
-#VIRTUAL FILE PROPERTIES
-RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_LABEL=Compressed Size
-RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_VALUE=&1 bytes
-RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_DESCRIPTION=Number of bytes in the file after compression
-RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_LABEL=Compression ratio
-RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_DESCRIPTION=Compressed size divided by expanded size expressed as a percentage
-RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_LABEL=Compression method
-RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_DESCRIPTION=The algorithm used to compress the file
-RESID_PROPERTY_VIRTUALFILE_COMMENT_LABEL=Comment
-RESID_PROPERTY_VIRTUALFILE_COMMENT_DESCRIPTION=The user-defined comment for this virtual file
-
-#SHELL PROPERTIES
-RESID_PROPERTY_SHELL_STATUS_LABEL=Status
-RESID_PROPERTY_SHELL_STATUS_TOOLTIP=Status of the shell
-RESID_PROPERTY_SHELL_CONTEXT_LABEL=Context
-RESID_PROPERTY_SHELL_CONTEXT_TOOLTIP=Current context within the shell
-RESID_PROPERTY_SHELL_STATUS_ACTIVE_VALUE=Running
-RESID_PROPERTY_SHELL_STATUS_INACTIVE_VALUE=Finished
-
-#MESSAGE PROPERTIES
-RESID_PROPERTY_MESSAGE_TYPE_VALUE=Message
-
-#ERROR PROPERTIES
-RESID_PROPERTY_ERROR_FILENAME_LABEL=File
-RESID_PROPERTY_ERROR_FILENAME_TOOLTIP=File Containing Error
-RESID_PROPERTY_ERROR_LINENO_LABEL=Line
-RESID_PROPERTY_ERROR_LINENO_TOOLTIP=Line number
-
-#TEAM VIEW PROPERTIES
-RESID_PROPERTY_TEAM_CATEGORY_TYPE_VALUE=Category
-RESID_PROPERTY_TEAM_SSFACTORY_TYPE_VALUE=SubSystem factory
-RESID_PROPERTY_TEAM_USERACTION_TYPE_VALUE=User action
-RESID_PROPERTY_TEAM_COMPILETYPE_TYPE_VALUE=Compilable source type
-RESID_PROPERTY_TEAM_COMPILECMD_TYPE_VALUE=Compile command
-
-
-#COMPILE TYPE PROPERTIES
-RESID_PROPERTY_COMPILETYPE_TYPES_LABEL=File type
-RESID_PROPERTY_COMPILETYPE_TYPES_DESCRIPTION=File type this refers to
-
-#MISCELLANEOUS PROPERTIES
-RESID_PROPERTY_ORIGIN_LABEL=Origin
-RESID_PROPERTY_ORIGIN_TOOLTIP=Where this originated from
-RESID_PROPERTY_COMMAND_LABEL=Command
-RESID_PROPERTY_COMMAND_TOOLTIP=The command that will be executed
-RESID_PROPERTY_COMMENT_LABEL=Comment
-RESID_PROPERTY_COMMENT_TOOLTIP=A description
-
-RESID_PROPERTY_LINKINGACTION_TEXT = &Link with Editor
-RESID_PROPERTY_LINKINGACTION_TOOLTIP = Link with Editor
-
-
-RESID_SCRATCHPAD=Scratchpad
-RESID_REMOTE_SCRATCHPAD=Remote Scratchpad
-
-RESID_FETCHING = Fetching Remote Resources \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewRootInputAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewRootInputAdapter.java
deleted file mode 100644
index ceb8eb7fb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewRootInputAdapter.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemNewConnectionPromptObject;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Adapter for the root-providing object of the SystemView tree viewer.
- */
-public class SystemViewRootInputAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter
-{
- private SystemPreferencesManager spg;
- private SystemNewConnectionPromptObject newConnPrompt;
- private Object[] newConnPromptArray;
-
- /**
- * Ctor
- */
- public SystemViewRootInputAdapter()
- {
-
- }
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
-
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- return null;
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- return SystemResources.RESID_SYSTEMREGISTRY_CONNECTIONS;
- }
- /**
- * Return the absolute name, versus just display name, of this object.
- * Just uses getText(element);
- */
- public String getAbsoluteName(Object element)
- {
- return getText(element);
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- //return "System Root Provider"; // should never be called
- // DKM - MRI hack to get "root"
- return SystemViewResources.RESID_PROPERTY_FILE_TYPE_ROOT_VALUE;
- }
-
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element)
- {
- return null;
- }
-
- /**
- * Return the children of this object
- */
- public Object[] getChildren(Object element)
- {
- ISystemViewInputProvider provider = (ISystemViewInputProvider)element;
-
- if ((provider instanceof ISystemRegistry) && showNewConnectionPrompt())
- {
- Object[] children = provider.getSystemViewRoots();
- if ((children == null) || (children.length == 0))
- {
- return getNewConnectionPromptObjectAsArray();
- }
- else
- {
- Object[] allChildren = new Object[children.length+1];
- allChildren[0] = getNewConnectionPromptObject();
- for (int idx=0; idx<children.length; idx++)
- allChildren[idx+1] = children[idx];
- return allChildren;
- }
- }
- return provider.getSystemViewRoots();
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element)
- {
- ISystemViewInputProvider provider = (ISystemViewInputProvider)element;
- if ((provider instanceof ISystemRegistry) && showNewConnectionPrompt())
- {
- return true;
- }
- return provider.hasSystemViewRoots();
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * We don't support delete at all.
- */
- public boolean showDelete(Object element)
- {
- return false;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * We don't support rename at all.
- */
- public boolean showRename(Object element)
- {
- return false;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- return null;
- }
-
- // PRIVATE METHODS...
-
- private boolean showNewConnectionPrompt()
- {
- if (spg == null)
- spg = SystemPreferencesManager.getPreferencesManager();
- return spg.getShowNewConnectionPrompt();
- }
-
- private SystemNewConnectionPromptObject getNewConnectionPromptObject()
- {
- if (newConnPrompt == null)
- newConnPrompt = new SystemNewConnectionPromptObject();
- return newConnPrompt;
- }
-
- private Object[] getNewConnectionPromptObjectAsArray()
- {
- if (newConnPromptArray == null)
- newConnPromptArray = new Object[1];
- newConnPromptArray[0] = getNewConnectionPromptObject();
- return newConnPromptArray;
- }
- /**
- * Return our unique property descriptors
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- return null;
- }
- /**
- * Return our unique property values
- */
- public Object internalGetPropertyValue(Object key)
- {
- return null;
- }
-
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * We return "Connections"
- */
- public String getMementoHandle(Object element)
- {
- return "Connections"; // this is what getName() returns, but if we xlate the name we want this to remain in english.
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- // this really should not be translated... but changing it now might cause a problem restoring
- // from a previous release. Phil.
- return getType(element);
- //return "root";
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewScratchpadAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewScratchpadAdapter.java
deleted file mode 100644
index d82c8ee75..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewScratchpadAdapter.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.internal.model.SystemScratchpad;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Adapter for the root-providing object of the SystemView tree viewer.
- */
-public class SystemViewScratchpadAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter,ISystemRemoteElementAdapter,ISystemDragDropAdapter
-{
-
- private SystemPasteFromClipboardAction _pasteToScratchpadAction = null;
-
- public SystemViewScratchpadAdapter()
- {
- }
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (_pasteToScratchpadAction == null)
- {
- _pasteToScratchpadAction = new SystemPasteFromClipboardAction(shell, RSEUIPlugin.getTheSystemRegistry().getSystemClipboard());
- }
- menu.add(menuGroup, _pasteToScratchpadAction);
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- return null;
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- //return SystemResources.RESID_SYSTEMREGISTRY_CONNECTIONS);
- return "Remote Scratchpad";
- }
- /**
- * Return the absolute name, versus just display name, of this object.
- * Just uses getText(element);
- */
- public String getAbsoluteName(Object element)
- {
- return getText(element);
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return SystemViewResources.RESID_SCRATCHPAD;
- }
-
- /**
- * Return the parent of this object
- */
- public Object getParent(Object element)
- {
- return null;
- }
-
- /**
- * Return the children of this object
- */
- public Object[] getChildren(Object element)
- {
- SystemScratchpad pad = (SystemScratchpad)element;
- return pad.getChildren();
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element)
- {
- SystemScratchpad pad = (SystemScratchpad)element;
- return pad.hasChildren();
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * We don't support delete at all.
- */
- public boolean showDelete(Object element)
- {
- return false;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * We don't support rename at all.
- */
- public boolean showRename(Object element)
- {
- return false;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- return null;
- }
-
-
- /**
- * Return our unique property descriptors
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- return null;
- }
- /**
- * Return our unique property values
- */
- public Object internalGetPropertyValue(Object key)
- {
- return null;
- }
-
-
- public boolean canDrop(Object element)
- {
- return true;
- }
-
- public Object doDrop(Object from, Object to, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor)
- {
- if (to instanceof SystemScratchpad)
- {
- if (from instanceof List)
- {
- List set = (List)from;
- for (int i = 0;i < set.size(); i++)
- {
- ((SystemScratchpad)to).addChild(set.get(i));
- }
- }
- else
- {
- ((SystemScratchpad)to).addChild(from);
- }
- return from;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getAbsoluteParentName(java.lang.Object)
- */
- public String getAbsoluteParentName(Object element)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemConfigurationId(java.lang.Object)
- */
- public String getSubSystemConfigurationId(Object element)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteTypeCategory(java.lang.Object)
- */
- public String getRemoteTypeCategory(Object element)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteType(java.lang.Object)
- */
- public String getRemoteType(Object element)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubType(java.lang.Object)
- */
- public String getRemoteSubType(Object element)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#refreshRemoteObject(java.lang.Object, java.lang.Object)
- */
- public boolean refreshRemoteObject(Object oldElement, Object newElement)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParent(org.eclipse.swt.widgets.Shell, java.lang.Object)
- */
- public Object getRemoteParent(Shell shell, Object element) throws Exception
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParentNamesInUse(org.eclipse.swt.widgets.Shell, java.lang.Object)
- */
- public String[] getRemoteParentNamesInUse(Shell shell, Object element) throws Exception
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean validateDrop(Object src, Object target, boolean sameSystem)
- {
- return true;
- }
-
- /**
- * Returns <code>false</code>.
- * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object)
- */
- public boolean supportsUserDefinedActions(Object object) {
- return false;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java
deleted file mode 100644
index 658061f43..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java
+++ /dev/null
@@ -1,734 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.ISystemUserIdConstants;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorPortInput;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-
-
-/**
- * Adapter for displaying SubSystem objects in tree views.
- * These are children of SystemConnection objects
- */
-public class SystemViewSubSystemAdapter extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter, ISystemPropertyConstants, ISystemUserIdConstants
-{
- protected String translatedType;
- // for reset property support
- private String original_portData;
- private SystemInheritablePropertyData original_userIdData = new SystemInheritablePropertyData();
- //private SystemInheritablePropertyData original_portData = new SystemInheritablePropertyData();
- private TextPropertyDescriptor propertyPortDescriptor;
- private boolean changed_userId, changed_port;
- private boolean port_editable = true;
- // -------------------
- // property descriptors
- // -------------------
- private PropertyDescriptor[] propertyDescriptorArray = null;
- //private SystemInheritablePropertyData portData = new SystemInheritablePropertyData();
- //private SystemInheritableTextPropertyDescriptor portDescriptor;
- private SystemInheritablePropertyData userIdData = new SystemInheritablePropertyData();
- private SystemInheritableTextPropertyDescriptor userIdDescriptor = null;
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given subsystem object.
- * Calls the method getActions on the subsystem's factory, and places
- * all action objects returned from the call, into the menu.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (selection.size() != 1)
- return; // does not make sense adding unique actions per multi-selection
- Object element = selection.getFirstElement();
- ISubSystem ss = (ISubSystem)element;
- ISubSystemConfiguration ssFactory = RSEUIPlugin.getDefault().getSystemRegistry().getSubSystemConfiguration(ss);
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
-
- IAction[] actions = adapter.getSubSystemActions(ssFactory, ss,shell);
- if (actions != null)
- {
- for (int idx=0; idx<actions.length; idx++)
- {
- IAction action = actions[idx];
- menu.add(menuGroup, action);
- }
- }
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- //System.out.println("INSIDE GETIMAGEDESCRIPTOR FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- ISubSystemConfiguration ssFactory = RSEUIPlugin.getDefault().getSystemRegistry().getSubSystemConfiguration(ss);
- if (ssFactory != null)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
- if (ss.isConnected())
- return adapter.getLiveImage(ssFactory);
- else
- return adapter.getImage(ssFactory);
- }
- else
- {
- SystemBasePlugin.logWarning("Unexpected error: ssFactory is null for ss " + ss.getName());
- return null;
- }
- }
-
- /**
- * Return the label for this object. Uses getName() on the subsystem object.
- */
- public String getText(Object element)
- {
- return ((ISubSystem)element).getName();
- }
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return ((ISubSystem)element).getName();
- }
- /**
- * Return the absolute name, versus just display name, of this object.
- * Returns profileName.connectionName.subsystemName;
- */
- public String getAbsoluteName(Object element)
- {
- ISubSystem ss = (ISubSystem)element;
- return ss.getSystemProfileName() + "." + ss.getHostAliasName() + "." + ss.getName();
- }
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- if (translatedType == null)
- translatedType = SystemViewResources.RESID_PROPERTY_SUBSYSTEM_TYPE_VALUE;
- return translatedType;
- }
-
-
- /**
- * Return the parent of this object. This is a connection object.
- */
- public Object getParent(Object element)
- {
- //System.out.println("INSIDE GETPARENT FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- return RSEUIPlugin.getDefault().getSystemRegistry().getHost(ss.getSystemProfile(),ss.getHostAliasName());
- }
-
- /**
- * Return the children of this object
- */
- public Object[] getChildren(Object element)
- {
- //System.out.println("INSIDE GETCHILDREN FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- Object[] children = ss.getChildren();
- return children;
- }
-
- /**
- * Return true if this object has children
- */
- public boolean hasChildren(Object element)
- {
- //System.out.println("INSIDE HASCHILDREN FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- return ss.hasChildren();
- }
-
- // ----------------------------------
- // Property sheet supplier methods...
- // ----------------------------------
-
- /**
- * Returns the current collection of property descriptors for connection objects.
- * @return an array containing all descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- PropertyDescriptor[] defaultProperties = (PropertyDescriptor[])getDefaultDescriptors();
- propertyDescriptorArray = new PropertyDescriptor[defaultProperties.length + 4];
- int idx = 0;
- for (idx = 0; idx < defaultProperties.length; idx++)
- propertyDescriptorArray[idx] = defaultProperties[idx];
-
- // add our unique property descriptors...
- //idx = defaultProperties.length; assertion
-
- // user id
- //propertyDescriptorArray[idx] = new TextPropertyDescriptor(ISystemPropertyConstants.P_USERID,
- // SystemViewResources.RESID_PROPERTY_USERID_LABEL));
- userIdDescriptor =
- new SystemInheritableTextPropertyDescriptor(ISystemPropertyConstants.P_USERID,
- SystemViewResources.RESID_PROPERTY_USERID_LABEL);
-
- userIdDescriptor.setToggleButtonToolTipText(SystemResources.RESID_SUBSYSTEM_USERID_INHERITBUTTON_TIP);
- userIdDescriptor.setEntryFieldToolTipText(SystemResources.RESID_SUBSYSTEM_USERID_TIP);
- propertyDescriptorArray[idx] = userIdDescriptor;
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_USERID_TOOLTIP);
-
- // port
- propertyPortDescriptor = new TextPropertyDescriptor(ISystemPropertyConstants.P_PORT,
- SystemViewResources.RESID_PROPERTY_PORT_LABEL);
- propertyPortDescriptor.setValidator(new ValidatorPortInput());
- propertyDescriptorArray[++idx] = propertyPortDescriptor;
- //propertyDescriptorArray[++idx] = getPortDescriptor();
-
- // connected
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_IS_CONNECTED, SystemViewResources.RESID_PROPERTY_CONNECTED_LABEL, SystemViewResources.RESID_PROPERTY_CONNECTED_TOOLTIP);
-
- // vrm
- propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(P_VRM, SystemViewResources.RESID_PROPERTY_VRM_LABEL, SystemViewResources.RESID_PROPERTY_VRM_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
- /**
- * Return our unique property descriptors
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- return null;
- }
-
- /**
- * Create (first time), configure and return the property descriptor for the port number
- *
- private SystemInheritableTextPropertyDescriptor getPortDescriptor()
- {
- if (portDescriptor == null)
- {
- SystemViewPlugin plugin = SystemViewPlugin.getDefault();
- RSEUIPlugin sp = RSEUIPlugin.getDefault();
- portDescriptor =
- new SystemInheritableTextPropertyDescriptor(ISystemPropertyConstants.P_PORT,
- SystemViewResources.RESID_PROPERTY_PORT_LABEL));
- portDescriptor.setToggleButtonToolTipText(SystemResources.RESID_SUBSYSTEM_PORT_INHERITBUTTON_TIP));
- portDescriptor.setEntryFieldToolTipText(SystemResources.RESID_SUBSYSTEM_PORT_TIP));
- portDescriptor.setDescription(SystemViewResources.RESID_PROPERTY_PORT_DESCRIPTION));
- }
- return portDescriptor;
- }*/
-
- /**
- * Set the values in the userIdPropertyData object that drives the userId property sheet widget
- */
- private SystemInheritablePropertyData setUserIdPropertyData(SystemInheritablePropertyData data, ISubSystem subsys)
- {
- String localUserId = subsys.getLocalUserId();
- data.setLocalValue(localUserId);
- String parentUserId = subsys.getHost().getDefaultUserId();
- data.setInheritedValue(parentUserId);
- data.setIsLocal((localUserId!=null)&&(localUserId.length()>0));
-
- // DY: Defect 42735, check if user has temporarilly overrode the userid
- // for this connection via the signon dialog
- if (subsys.isConnected())
- {
- String connectedId = subsys.getConnectorService().getUserId();
- //On Local subsystems, connectedId==null. Phil.
- if (data.getIsLocal() && connectedId!=null && !connectedId.equals(localUserId))
- {
- data.setLocalValue(connectedId);
- data.setIsLocal(true);
- }
- else if (connectedId!=null && !connectedId.equals(parentUserId))
- {
- data.setLocalValue(connectedId);
- data.setIsLocal(true);
- }
- }
-
- return data;
- }
-
- /**
- * Set the values in the portPropertyData object that drives the port property sheet widget
- *
- private SystemInheritablePropertyData setPortPropertyData(SystemInheritablePropertyData data, SubSystem subsys)
- {
- Integer localPort = subsys.getPort();
- int iPort = 0;
- if (localPort != null)
- iPort = localPort.intValue();
- if (iPort > 0)
- data.setLocalValue(localPort.toString());
- else
- data.setLocalValue(null); // clear history
- SubSystemConfiguration ssFactory = subsys.getParentSubSystemConfiguration();
- boolean notApplicable = (!ssFactory.isPortEditable() && (iPort <= 0));
- if (!notApplicable)
- {
- data.setInheritedValue("0");
- data.setInheritedDisplayString(SystemResources.RESID_PORT_DYNAMICSELECT));
- data.setIsLocal(iPort != 0);
- }
- data.setNotApplicable(notApplicable);
- getPortDescriptor().setEditable(!notApplicable);
- //data.printDetails();
- return data;
- }
- */
-
- private String getPortString(ISubSystem ss)
- {
- //return getPortPropertyData(portData, ss);
- int iPort = ss.getConnectorService().getPort();
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
- boolean notApplicable = (!ssFactory.isPortEditable() && (iPort <= 0));
- if (notApplicable)
- return getTranslatedNotApplicable();
- else
- {
- return Integer.toString(iPort);
- }
- }
-
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param property the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object getPropertyValue(Object property)
- {
- String name = (String)property;
- ISubSystem ss = (ISubSystem)propertySourceInput;
- if (name.equals(P_USERID))
- return setUserIdPropertyData(userIdData, ss);
- else if (name.equals(P_PORT))
- return getPortString(ss);
- else if (name.equals(P_VRM))
- {
- IConnectorService system = ss.getConnectorService();
- if (system != null)
- {
- String vrm = system.getVersionReleaseModification();
- if (vrm != null)
- return vrm;
- else
- return getTranslatedNotAvailable();
- }
- else
- return getTranslatedNotAvailable();
- }
- else if (name.equals(P_IS_CONNECTED))
- {
- // yantzi: artemis 6.0, offline support
- if (ss.getHost().isOffline())
- {
- // connection is offline
- return SystemResources.RESID_OFFLINE_LABEL;
- }
-
- IConnectorService system = ss.getConnectorService();
- boolean connected = false;
- if (system == null)
- {
- System.out.println("SystemViewSubSystemAdapter: Error! system is null for subsystem "+ss.getClass().getName());
- SystemBasePlugin.logError("SystemViewSubSystemAdapter: Error! system is null for subsystem "+ss.getClass().getName(), null);
- }
- else
- connected = system.isConnected();
- return connected ? getTranslatedYes() : getTranslatedNo();
- }
- else
- return super.getPropertyValue(name);
- }
-
- /**
- * Returns itself
- */
- public ISubSystem getSubSystem(Object element)
- {
- if (element instanceof ISubSystem)
- return (ISubSystem)element;
- else
- return null;
- }
-
- /**
- * Return our unique property values
- */
- public Object internalGetPropertyValue(Object key)
- {
- return null;
- }
-
- // because this node has some editable properties, these overrides of our
- // parent class are needed as callbacks from the PropertySheet window.
- /**
- * Set input object for property source queries. This is called by the
- * SystemViewAdaptorFactory before returning this adapter object.
- */
- public void setPropertySourceInput(Object propertySourceInput)
- {
- if (this.propertySourceInput == propertySourceInput)
- return;
- super.setPropertySourceInput(propertySourceInput);
- ISubSystem ss = (ISubSystem)propertySourceInput;
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
- original_userIdData = setUserIdPropertyData(original_userIdData,ss);
- //original_portData = setPortPropertyData(original_portData,ss);
- original_portData = getPortString(ss);
- changed_userId = changed_port = false;
-
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class);
- if (userIdDescriptor != null)
- {
-
- userIdDescriptor.setValidator(adapter.getUserIdValidator(ssFactory));
- }
-
- //getPortDescriptor().setValidator((ICellEditorValidator)ssFactory.getPortValidator());
- if (propertyPortDescriptor != null)
- {
- propertyPortDescriptor.setValidator(adapter.getPortValidator(ssFactory));
- }
- ss.getConnectorService().getPort();
- port_editable = ssFactory.isPortEditable();
- }
-
- /**
- * Returns whether the property value has changed from the default.
- * Only applicable for editable properties.
- * Called by PropertySheet viewer when user presses reset.
- * @return <code>true</code> if the value of the specified property has changed
- * from its original default value; <code>false</code> otherwise.
- */
- public boolean isPropertySet(Object propertyObject)
- {
- String property = (String)propertyObject;
- boolean changed = false;
- if (property.equals(P_USERID))
- changed = changed_userId;
- else if (property.equals(P_PORT))
- changed = changed_port && port_editable;
- return changed;
- }
-
- /**
- * Change the subsystem user Id value
- */
- private void updateUserId(ISubSystem subsys, SystemInheritablePropertyData data)
- {
- //int whereToUpdate = USERID_LOCATION_SUBSYSTEM;
- String userId = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override
- ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
- // unlike with connection objects, we don't ever allow the user to change the parent's
- // userId value, even if it is empty, when working with subsystems. There is too much
- // ambiquity as the parent could be the connnection or the user preferences setting for this
- // system type. Because of this decision, we don't need to tell updateSubSystem(...) where
- // to update, as it always the local subsystem.
- ssFactory.updateSubSystem(subsys, true, userId, false, subsys.getConnectorService().getPort());
- }
- /**
- * Change the subsystem port value
- *
- private void updatePort(SubSystem subsys, SystemInheritablePropertyData data)
- {
- String port = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override
- Integer portInteger = null;
- if (data.getIsLocal() && (port.length()>0))
- portInteger = new Integer(port);
- else
- portInteger = new Integer(0);
- SubSystemConfiguration ssFactory = subsys.getParentSubSystemConfiguration();
- ssFactory.updateSubSystem((Shell)null, subsys, false, subsys.getLocalUserId(), true, portInteger);
- }
- */
- /**
- * Change the subsystem port value
- */
- private void updatePort(ISubSystem subsys, String data)
- {
- if (!port_editable)
- return;
- String port = data;
- Integer portInteger = null;
- if (port.length()>0)
- {
- try
- {
- portInteger = new Integer(port);
- }
- catch (Exception exc)
- {
- return;
- }
- }
- else
- {
- portInteger = new Integer(0);
- }
- int portInt = portInteger.intValue();
- ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
- ssFactory.updateSubSystem(subsys, false, subsys.getLocalUserId(), true, portInt);
- subsys.commit();
- }
-
-
- /**
- * Called when user selects the reset button in property sheet.
- */
- public void resetPropertyValue(Object propertyObject)
- {
- String property = (String)propertyObject;
- ISubSystem ss = (ISubSystem)propertySourceInput;
- ss.getSubSystemConfiguration();
- if (property.equals(P_USERID))
- {
- updateUserId(ss, original_userIdData);
- changed_userId = false;
- }
- else if (property.equals(P_PORT))
- {
- //updatePort(ss, original_portData);
- updatePort(ss, original_portData);
- changed_port = false;
- }
- }
- /**
- * Called when user changes property via property sheet.
- */
- public void setPropertyValue(Object property, Object value)
- {
- String name = (String)property;
- ISubSystem ss = (ISubSystem)propertySourceInput;
- ss.getSubSystemConfiguration();
- //System.out.println("inside setPropVal: " + property + ", value: " + value);
- if (name.equals(P_USERID))
- {
- updateUserId(ss, (SystemInheritablePropertyData)value);
- changed_userId = true;
- }
- else if (name.equals(P_PORT))
- {
- //System.out.println("inside setPropVal: " + property + ", value: " + value);
- //updatePort(ss, (SystemInheritablePropertyData)value);
- updatePort(ss, (String)value);
- changed_port = true;
- }
- }
-
- /**
- * Override of {@link AbstractSystemViewAdapter#testAttribute(Object, String, String)}. We add
- * one more attribute for subsystems:
- * <ol>
- * <li>name="serverLaunchPP". Returns "true" if the given subsystem supports the Server Launch Settings
- * property page, which is determined by calling it's factory's {@link ISubSystemConfiguration#supportsServerLaunchProperties()} method.
- * </ol>
- *
- * This property is used to filter the existence of the Server Launch Settings property page.
- *
- * @see org.eclipse.ui.IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value)
- {
- if (target instanceof ISubSystem)
- {
- if (name.equalsIgnoreCase("serverLaunchPP"))
- {
- ISubSystem ss = (ISubSystem)target;
- boolean supports = ss.getSubSystemConfiguration().supportsServerLaunchProperties(ss.getHost());
- return supports ? value.equals("true") : value.equals("false");
- }
- else if (name.equalsIgnoreCase("envVarPP"))
- {
- /** FIXME can't access specific subsystems from core anymore
- boolean supports = false;
- if (ss instanceof IRemoteFileSubSystem)
- supports = ((IRemoteFileSubSystemConfiguration)ss.getParentSubSystemConfiguration()).supportsEnvironmentVariablesPropertyPage();
- else
- supports = ((IRemoteCmdSubSystemConfiguration)ss.getParentSubSystemConfiguration()).supportsEnvironmentVariablesPropertyPage();
- */
- boolean supports = false;
- return supports ? value.equals("true") : value.equals("false");
- }
- else if (name.equalsIgnoreCase("isConnectionError"))
- {
- ISubSystem ss = (ISubSystem) target;
- boolean error = ss.isConnectionError();
- return error ? value.equals("true") : value.equals("false");
- }
- }
- return super.testAttribute(target, name, value);
- }
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if we should show the delete action in the popup for the given element.
- * If true, then canDelete will be called to decide whether to enable delete or not.
- */
- public boolean showDelete(Object element)
- {
- return canDelete(element);
- }
-
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- //System.out.println("INSIDE ISDELETABLE FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
- return ssFactory.isSubSystemsDeletable();
- }
-
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor)
- {
- //System.out.println("INSIDE DODELETE FOR SUBSYSTEM VIEW ADAPTER: "+element);
- ISubSystem ss = (ISubSystem)element;
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- sr.deleteSubSystem(ss);
- return true;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if we should show the rename action in the popup for the given element.
- * If true, then canRename will be called to decide whether to enable delete or not.
- */
- public boolean showRename(Object element)
- {
- return canRename(element);
- }
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- return canDelete(element); // same rules for both delete and rename
- }
-
- /**
- * Perform the rename action. Assumes uniqueness checking was done already.
- */
- public boolean doRename(Shell shell, Object element, String name)
- {
- ISubSystem ss = (ISubSystem)element;
- ISubSystemConfiguration parentSSFactory = ss.getSubSystemConfiguration();
- parentSSFactory.renameSubSystem(ss,name); // renames, and saves to disk
- return true;
- }
-
- /**
- * Return a validator for verifying the new name is correct on a rename action.
- * The default implementation is not to support rename hence this method returns
- * null. Override if appropriate.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- return null;
- }
-
- // FOR COMMON DRAG AND DROP ACTIONS
- /**
- * Indicates whether the subsystem can be dragged.
- * Can't be used for physical copies but rather
- * for views (like the Scratchpad)
- */
- public boolean canDrag(Object element)
- {
- return true;
- }
-
- /**
- * Returns the subsystem (no phyiscal operation required to drag and subsystem (because it's local)
- */
- public Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor)
- {
- return element;
- }
-
-
-
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
-
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- * This just defaults to getName, but if that is not sufficient override it here.
- */
- public String getMementoHandle(Object element)
- {
- ISubSystem ss = (ISubSystem)element;
- ISubSystemConfiguration ssf = ss.getSubSystemConfiguration();
- return ssf.getId()+"="+ss.getName();
- }
- /**
- * Return what to save to disk to identify this element when it is the input object to a secondary
- * Remote Systems Explorer perspective.
- */
- public String getInputMementoHandle(Object element)
- {
- Object parent = getParent(element);
- return getAdapter(parent).getInputMementoHandle(parent) + MEMENTO_DELIM + getMementoHandle(element);
- }
- /**
- * Return a short string to uniquely identify the type of resource. Eg "conn" for connection.
- * This just defaults to getType, but if that is not sufficient override it here, since that is
- * a translated string.
- */
- public String getMementoHandleKey(Object element)
- {
- return ISystemMementoConstants.MEMENTO_KEY_SUBSYSTEM;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/BrowseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/BrowseAction.java
deleted file mode 100644
index c773e65d3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/BrowseAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-class BrowseAction extends Action
-{
- protected final SystemMonitorViewPart part;
-
- public BrowseAction(SystemMonitorViewPart part)
- {
- super();
- this.part = part;
- }
-
- public BrowseAction(SystemMonitorViewPart part, String label, ImageDescriptor des)
- {
- super(label, des);
- this.part = part;
-
- setToolTipText(label);
- }
-
- public void checkEnabledState()
- {
- if (this.part._folder != null && this.part._folder.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
-
- public void run()
- {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearAction.java
deleted file mode 100644
index c8c9f535d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-
-
-public class ClearAction extends BrowseAction
-{
-
- public ClearAction(SystemMonitorViewPart view)
- {
- super(view, SystemResources.ACTION_CLEAR_ALL_LABEL,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL_ID));
-
-
- // TODO DKM - get help for this!
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- public void checkEnabledState()
- {
- setEnabled(part.getViewer() != null);
- }
-
- public void run()
- {
- clear();
- }
-
- // clear contents of the current command viewer
- private void clear()
- {
- part.removeAllItemsToMonitor();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearSelectedAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearSelectedAction.java
deleted file mode 100644
index a63128ae5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/ClearSelectedAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-
-
-
-
-public class ClearSelectedAction extends BrowseAction
-{
- public ClearSelectedAction(SystemMonitorViewPart view)
- {
- super(view, SystemResources.ACTION_CLEAR_SELECTED_LABEL,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED_ID));
-
- // TODO DKM - get help for this!
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- public void checkEnabledState()
- {
- if (part.getViewer() != null)
- {
- setEnabled(true);
- return;
- }
-
- setEnabled(false);
- }
-
- public void run()
- {
- clear();
- }
-
- private void clear()
- {
- part.removeItemToMonitor((IAdaptable)part.getViewer().getInput());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewPage.java
deleted file mode 100644
index 17658f2a5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewPage.java
+++ /dev/null
@@ -1,596 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.model.ISystemRegistryUI;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.model.SystemRemoteChangeEvent;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemThemeConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableTreeView;
-import org.eclipse.rse.ui.view.SystemTableTreeViewProvider;
-import org.eclipse.rse.ui.widgets.ISystemCollapsableSectionListener;
-import org.eclipse.rse.ui.widgets.SystemCollapsableSection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Scale;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-
-
-
-/**
- * Class for a remote shell session on a connection
- */
-public class MonitorViewPage implements SelectionListener, ISystemThemeConstants, IPropertyChangeListener, ISelectionChangedListener, Listener,
-FocusListener
-{
- private static SystemMessage _queryMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_QUERY_PROGRESS);
-
- class PollingThread extends Thread
- {
- private boolean _querying = false;
- private ISystemViewElementAdapter _adapter;
- private Object _inputObject;
- private SystemTableTreeView _viewer;
-
- public PollingThread()
- {
- _viewer = getViewer();
- _inputObject = _viewer.getInput();
- _adapter = (ISystemViewElementAdapter)((IAdaptable)_inputObject).getAdapter(ISystemViewElementAdapter.class);
- }
-
- public void run()
- {
- while (isPollingEnabled())
- {
- int interval = getPollingInterval() * 1000;
- try
- {
- Thread.sleep(interval);
- doQuery();
- // while (_querying)
- // {
- // Thread.sleep(100);
- // }
- doRedraw();
- }
- catch (InterruptedException e)
- {
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-
- protected void doQuery()
- {
-
- Display display = Display.getDefault();
- if (display != null && !_querying)
- {
- _querying= true;
- if (_inputObject instanceof ISystemContainer)
- {
- ((ISystemContainer)_inputObject).markStale(true);
- }
- ISubSystem ss = _adapter.getSubSystem(_inputObject);
- if (!ss.isConnected())
- return;
-
- String name = _adapter.getName(_inputObject);
- _queryMessage.makeSubstitution(name);
- String txt = _queryMessage.getLevelOneText();
- Job job = new Job(txt)
- {
- public IStatus run(IProgressMonitor monitor)
- {
- Object[] children = _adapter.getChildren(monitor, _inputObject);
- if (children != null)
- {
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider)_viewer.getContentProvider();
- if (provider!=null) {
- //bug 150924: provider can be lost when disconnecting while this job runs
- provider.setCache(children);
- }
-
- }
-
- _querying = false;
- return Status.OK_STATUS;
- }
- };
-
- job.schedule();
-
- try
- {
- job.wait();
- }
- catch (Exception e)
- {
-
- }
- }
-
- }
-
- protected void doRedraw()
- {
- Display display = Display.getDefault();
- if (display != null)
- {
- display.asyncExec(
- new Runnable()
- {
- public void run()
- {
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- registry.fireEvent(new SystemResourceChangeEvent(_inputObject, ISystemResourceChangeEvents.EVENT_CHANGE_CHILDREN, _inputObject));
- //getViewer().refresh();
- }
- });
- }
- }
- }
-
- class SelectAllAction extends Action
- {
- public SelectAllAction()
- {
- super(SystemResources.ACTION_SELECT_ALL_LABEL, null);
- setToolTipText(SystemResources.ACTION_SELECT_ALL_TOOLTIP);
- }
-
- public void checkEnabledState()
- {
- setEnabled(true);
- }
-
- public void run()
- {
- SystemTableTreeView view = _viewer;
- view.getTree().selectAll();
- view.setSelection(view.getSelection());
- }
- }
-
-
- private SystemTableTreeView _viewer;
-
- private boolean _isPolling = false;
- private int _pollingInterval;
-
- private Group _tabFolderPage;
- private Button _pollCheckbox;
- private Scale _scale;
- private Text _scaleValue;
-
- private PollingThread _pollingThread;
-
- private SystemMonitorViewPart _viewPart;
-
- private String _title;
-
- private SystemCopyToClipboardAction _copyAction;
- private SystemPasteFromClipboardAction _pasteAction;
- private SelectAllAction _selectAllAction;
- private IActionBars _actionBars;
-
- public MonitorViewPage(SystemMonitorViewPart viewPart)
- {
- _viewPart = viewPart;
- _actionBars = _viewPart.getViewSite().getActionBars();
- }
-
-
-
- public Composite createTabFolderPage(CTabFolder tabFolder, CellEditorActionHandler editorActionHandler)
- {
- _tabFolderPage = new Group(tabFolder, SWT.NULL);
- GridLayout gridLayout = new GridLayout();
- _tabFolderPage.setLayout(gridLayout);
-
- createControl(_tabFolderPage);
-
-
-
- ISystemRegistryUI registry = RSEUIPlugin.getTheSystemRegistry();
-
- // global actions
- Clipboard clipboard = registry.getSystemClipboard();
- _copyAction = new SystemCopyToClipboardAction(_viewer.getShell(), clipboard);
- _copyAction.setEnabled(false);
-
- _pasteAction = new SystemPasteFromClipboardAction(_viewer.getShell(), clipboard);
- _pasteAction.setEnabled(false);
-
- editorActionHandler.setCopyAction(_copyAction);
- editorActionHandler.setPasteAction(_pasteAction);
-
- _selectAllAction = new SelectAllAction();
- _selectAllAction.setEnabled(false);
- editorActionHandler.setSelectAllAction(_selectAllAction);
-
-
- _viewer.addSelectionChangedListener(this);
- _viewer.getControl().addFocusListener(this);
-
- return _tabFolderPage;
- }
-
- public void setFocus()
- {
- _viewPart.getSite().setSelectionProvider(_viewer);
- }
-
- public IActionBars getActionBars()
- {
- return _actionBars;
- }
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- IStructuredSelection sel = (IStructuredSelection) e.getSelection();
- _copyAction.setEnabled(_copyAction.updateSelection(sel));
- _pasteAction.setEnabled(_pasteAction.updateSelection(sel));
- _selectAllAction.setEnabled(true);
-
- //setActionHandlers();
- }
-
- public int getPollingInterval()
- {
- return _pollingInterval;
- }
-
- public boolean isPollingEnabled()
- {
- if (_isPolling && !getViewer().getControl().isDisposed())
- {
- return true;
- }
- return false;
- }
-
- public void setPollingEnabled(boolean flag)
- {
- _isPolling = flag;
- }
-
- public void setEnabled(boolean flag)
- {
- if (!flag)
- {
- Tree tree = _viewer.getTree();
-
- Display display = _viewer.getShell().getDisplay();
- Color bgcolour = _tabFolderPage.getBackground();
-
- tree.setBackground(bgcolour);
- }
- }
-
- protected void createPollControls(Composite parent)
- {
-
- SystemCollapsableSection collapsable = new SystemCollapsableSection(parent);
- collapsable.setText(SystemResources.RESID_MONITOR_POLL_CONFIGURE_POLLING_LABEL);
- collapsable.setToolTips(SystemResources.RESID_MONITOR_POLL_CONFIGURE_POLLING_COLLAPSE_TOOLTIP,
- SystemResources.RESID_MONITOR_POLL_CONFIGURE_POLLING_EXPAND_TOOLTIP
- );
-
- Composite inputContainer = collapsable.getPageComposite();
-
-
- _pollCheckbox = SystemWidgetHelpers.createCheckBox(inputContainer, this, SystemResources.RESID_MONITOR_POLL_LABEL, SystemResources.RESID_MONITOR_POLL_TOOLTIP);
- GridData pg = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- _pollCheckbox.setLayoutData(pg);
-
- _pollingInterval = 100;
- Label label = SystemWidgetHelpers.createLabel(inputContainer, SystemResources.RESID_MONITOR_POLL_INTERVAL_LABEL);
-
- _scale = new Scale(inputContainer, SWT.NULL);
- _scale.setMaximum(200);
- _scale.setMinimum(5);
- _scale.setSelection(_pollingInterval);
-
- _scale.addSelectionListener(
- new SelectionListener()
- {
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- _pollingInterval = _scale.getSelection();
- _scaleValue.setText(_pollingInterval + "s");
-
- if (_pollingThread != null)
- _pollingThread.interrupt();
- }
-
- });
-
- _scale.setToolTipText(SystemResources.RESID_MONITOR_POLL_INTERVAL_TOOLTIP);
- GridData sd = new GridData(GridData.FILL_HORIZONTAL);
- _scale.setLayoutData(sd);
-
- _scaleValue = SystemWidgetHelpers.createReadonlyTextField(inputContainer);
- _scaleValue.setTextLimit(5);
- GridData scgd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _scaleValue.setLayoutData(scgd);
- _scaleValue.setText(_pollingInterval + "s");
-
-
-
- GridLayout ilayout = new GridLayout();
- ilayout.numColumns = 4;GridData gridData1 = new GridData(GridData.FILL_HORIZONTAL);
- inputContainer.setLayout(ilayout);
- inputContainer.setLayoutData(gridData1);
-
-
- // defaults
- _scale.setEnabled(_isPolling);
- _scaleValue.setEnabled(_isPolling);
-
- collapsable.addCollapseListener(new CollapsableListener(inputContainer));
- collapsable.setCollapsed(true);
- }
-
- class CollapsableListener implements ISystemCollapsableSectionListener
- {
- Composite _child;
- public CollapsableListener(Composite child)
- {
- _child = child;
- }
-
- public void sectionCollapsed(boolean collapsed)
- {
- //System.out.println("collapsed");
- }
- }
-
- public void createControl(Composite parent)
- {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- parent.setLayout(gridLayout);
-
- // create table portion
- //Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- //_viewer = new SystemTableView(table, _viewPart);
-
- Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- _viewer = new SystemTableTreeView(tree, _viewPart);
- _viewer.setWorkbenchPart(_viewPart);
-
- _viewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- handleDoubleClick(event);
- }
- });
-
-
- SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "ucmd0000");
-
- //TableLayout layout = new TableLayout();
- //tree.setLayout(layout);
- //tree.setLayout(new GridLayout())
- tree.setHeaderVisible(false);
- tree.setLinesVisible(false);
-
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- tree.setLayoutData(gridData);
-
- createPollControls(_tabFolderPage);
- }
-
- public void propertyChange(PropertyChangeEvent e)
- {
- }
-
-
- private void handleDoubleClick(DoubleClickEvent event)
- {
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
- if (element == null)
- return;
-
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) element).getAdapter(ISystemViewElementAdapter.class);
- boolean alreadyHandled = false;
- if (adapter != null)
- {
- alreadyHandled = adapter.handleDoubleClick(element);
- }
- }
-
- public void dispose()
- {
- _viewer.dispose();
- _tabFolderPage.dispose();
- _isPolling = false;
- }
-
-
-
-
- public Object getInput()
- {
- return _viewer.getInput();
- }
-
- public void setInput(IAdaptable object)
- {
- setInput(object, true);
- updateTitle(object);
- }
-
- public void updateTitle(IAdaptable object)
- {
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)object.getAdapter(ISystemViewElementAdapter.class);
-
- String title = adapter.getText(object);
- _tabFolderPage.setText(title);
- }
-
- public String getTitle()
- {
- return _title;
- }
-
- public void setInput(IAdaptable object, boolean updateHistory)
- {
- if (_viewer != null && object != null)
- {
- _viewer.setInput(object);
- }
- }
-
- public void clearInput()
- {
- if (_viewer != null)
- {
- _viewer.setInput(null);
- }
- }
-
- public SystemTableTreeView getViewer()
- {
- return _viewer;
- }
-
-
-
- public void updateActionStates()
- {
- Object input = _viewer.getInput();
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- }
-
-
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
- */
- public void focusGained(FocusEvent arg0)
- {
- IActionBars actionBars = getActionBars();
- if (actionBars != null)
- {
- if (arg0.widget == _viewer.getControl())
- {
- actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY, _copyAction);
- actionBars.setGlobalActionHandler(ITextEditorActionConstants.PASTE, _pasteAction);
- actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL, _selectAllAction);
- actionBars.updateActionBars();
-
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
- */
- public void focusLost(FocusEvent arg0)
- {
-
- }
-
- public void handleEvent(Event event)
- {
- Widget w = event.widget;
- if (w == _pollCheckbox)
- {
- boolean wasPolling = _isPolling;
- _isPolling = _pollCheckbox.getSelection();
- _scale.setEnabled(_isPolling);
- _scaleValue.setEnabled(_isPolling);
- if (wasPolling != _isPolling && _isPolling)
- {
- _pollingThread = new PollingThread();
- _pollingThread.start();
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewWorkbook.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewWorkbook.java
deleted file mode 100644
index 504d04d02..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/MonitorViewWorkbook.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableTreeView;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-
-
-/**
- * This is the desktop view wrapper of the System View viewer.
- */
-public class MonitorViewWorkbook extends Composite
-{
-
-
- private CTabFolder _folder;
- private SystemMonitorViewPart _viewPart;
-
- public MonitorViewWorkbook(Composite parent, SystemMonitorViewPart viewPart)
- {
- super(parent, SWT.NONE);
-
- _folder = new CTabFolder(this, SWT.NONE);
- _folder.setLayout(new TabFolderLayout());
- _folder.setLayoutData(new GridData(GridData.FILL_BOTH));
- setLayout(new FillLayout());
- _viewPart = viewPart;
- }
-
- public void dispose()
- {
-
- //if (!_folder.isDisposed())
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- if (!item.isDisposed())
- {
- MonitorViewPage page = (MonitorViewPage) item.getData();
- page.dispose();
- }
- }
- _folder.dispose();
- }
- super.dispose();
- }
-
- public CTabFolder getFolder()
- {
- return _folder;
- }
-
- public void remove(Object root)
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- if (!item.isDisposed())
- {
- MonitorViewPage page = (MonitorViewPage) item.getData();
-
- if (page != null && root == page.getInput())
- {
- item.dispose();
- page.dispose();
-
- page = null;
- item = null;
-
- _folder.redraw();
-
- return;
- }
- }
- }
- }
-
- public void removeDisconnected()
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- if (!item.isDisposed())
- {
- MonitorViewPage page = (MonitorViewPage) item.getData();
- if (page != null)
- {
- IAdaptable input = (IAdaptable)page.getInput();
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)input.getAdapter(ISystemViewElementAdapter.class);
- if (adapter != null)
- {
- ISubSystem subSystem = adapter.getSubSystem(input);
- if (subSystem != null)
- {
- if (!subSystem.isConnected())
- {
- item.dispose();
- page.dispose();
-
- page = null;
- item = null;
-
- _folder.redraw();
- }
- }
- }
- }
- }
- }
- }
-
-
-
- public CTabItem getSelectedTab()
- {
- if (_folder.getItemCount() > 0)
- {
- int index = _folder.getSelectionIndex();
- CTabItem item = _folder.getItem(index);
- return item;
- }
-
- return null;
- }
-
- public MonitorViewPage getCurrentTabItem()
- {
- if (_folder.getItemCount() > 0)
- {
- int index = _folder.getSelectionIndex();
- CTabItem item = _folder.getItem(index);
- return (MonitorViewPage) item.getData();
- }
- return null;
- }
-
- public void showCurrentPage()
- {
- _folder.setFocus();
- }
-
- public Object getInput()
- {
- MonitorViewPage page = getCurrentTabItem();
- if (page != null)
- {
- page.setFocus();
- return page.getInput();
- }
-
- return null;
- }
-
- public SystemTableTreeView getViewer()
- {
- if (getCurrentTabItem() != null)
- {
- return getCurrentTabItem().getViewer();
- }
- return null;
- }
-
- public void addItemToMonitor(IAdaptable root, boolean createTab)
- {
- if (!_folder.isDisposed())
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- MonitorViewPage page = (MonitorViewPage) item.getData();
- if (page != null && root == page.getInput())
- {
- page.getViewer().refresh();
-
- if (_folder.getSelectionIndex() != i)
- {
- _folder.setSelection(item);
- }
- updateActionStates();
- //page.setFocus();
- return;
- }
- }
-
- if (createTab)
- {
- // never shown this, so add it
- createTabItem(root);
- }
- }
- }
-
- private void createTabItem(IAdaptable root)
- {
- MonitorViewPage monitorViewPage = new MonitorViewPage(_viewPart);
-
- CTabItem titem = new CTabItem(_folder, SWT.NULL);
- setTabTitle(root, titem);
-
- titem.setData(monitorViewPage);
- titem.setControl(monitorViewPage.createTabFolderPage(_folder, _viewPart.getEditorActionHandler()));
- _folder.setSelection(titem );
-
- monitorViewPage.setInput(root);
-
- SystemTableTreeView viewer = monitorViewPage.getViewer();
- _viewPart.getSite().setSelectionProvider(viewer);
- _viewPart.getSite().registerContextMenu(viewer.getContextMenuManager(), viewer);
-
- monitorViewPage.setFocus();
- }
-
- private void setTabTitle(IAdaptable root, CTabItem titem)
- {
- ISystemViewElementAdapter va = (ISystemViewElementAdapter) root.getAdapter(ISystemViewElementAdapter.class);
- if (va != null)
- {
- titem.setText(va.getName(root));
- titem.setImage(va.getImageDescriptor(root).createImage());
- }
- }
-
- public void setInput(IAdaptable root)
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- MonitorViewPage page = (MonitorViewPage) item.getData();
- if (root == page.getInput())
- {
- _folder.setSelection(i);
- page.getViewer().refresh();
- return;
- }
- }
- }
-
- public void updateActionStates()
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- CTabItem item = _folder.getItem(i);
- if (!item.isDisposed())
- {
- MonitorViewPage page = (MonitorViewPage) item.getData();
- if (page != null)
- {
- page.updateActionStates();
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorUI.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorUI.java
deleted file mode 100644
index 6f174a60f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorUI.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-
-
-/**
- * A singleton class for dealing with remote commands
- */
-public class SystemMonitorUI
-{
-
-
- // singleton instance
- private static SystemMonitorUI instance;
- private static SystemMonitorViewPart _viewPart;
-
- public static final String MONITOR_VIEW_ID = "org.eclipse.rse.ui.view.monitorView";
-
- private SystemMonitorUI()
- {
- super();
- }
-
- /**
- * Get the singleton instance.
- * @return the singleton object of this type
- */
- public static SystemMonitorUI getInstance()
- {
- if (instance == null)
- {
- instance = new SystemMonitorUI();
- }
-
- return instance;
- }
-
-
- public SystemMonitorViewPart activateCommandsView()
- {
- try
- {
- IWorkbenchPage page = SystemBasePlugin.getActiveWorkbenchWindow().getActivePage();
- _viewPart = (SystemMonitorViewPart) page.showView(SystemMonitorUI.MONITOR_VIEW_ID);
- page.bringToTop(_viewPart);
- }
- catch (PartInitException e)
- {
- SystemBasePlugin.logError("Can not open commands view", e);
- }
-
- return _viewPart;
- }
-
-
- public static SystemMonitorViewPart getMonitorView()
- {
- return _viewPart;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorViewPart.java
deleted file mode 100644
index b7b6c3ca0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/SystemMonitorViewPart.java
+++ /dev/null
@@ -1,1039 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-
-import java.util.ArrayList;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.rse.core.model.ISystemContainer;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.IRSEViewPart;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableTreeView;
-import org.eclipse.rse.ui.view.SystemTableTreeViewProvider;
-import org.eclipse.rse.ui.view.SystemTableViewColumnManager;
-import org.eclipse.rse.ui.view.SystemTableViewProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-
-
-
-
-/**
- * This is the desktop view wrapper of the System View viewer.
- */
-public class SystemMonitorViewPart
- extends ViewPart
- implements
- ISelectionListener,
- SelectionListener,
- ISelectionChangedListener,
- ISystemResourceChangeListener,
- ISystemRemoteChangeListener,
- ISystemMessageLine,
- IRSEViewPart
-{
-
-
- class RestoreStateRunnable implements Runnable
- {
- public void run()
- {
- }
- }
- class PositionToAction extends BrowseAction
- {
- class PositionToDialog extends SystemPromptDialog
- {
- private String _name;
- private Combo _cbName;
-
-
- public PositionToDialog(Shell shell, String title)
- {
- super(shell, title);
- }
-
- public String getPositionName()
- {
- return _name;
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
- _name = _cbName.getText();
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _cbName;
- }
-
- public Control createInner(Composite parent)
- {
- Composite c = SystemWidgetHelpers.createComposite(parent, 2);
-
- Label aLabel = new Label(c, SWT.NONE);
- aLabel.setText(SystemPropertyResources.RESID_PROPERTY_NAME_LABEL);
-
- _cbName = SystemWidgetHelpers.createCombo(c, null);
- GridData textData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _cbName.setLayoutData(textData);
- _cbName.setText("*");
- _cbName.setToolTipText(SystemResources.RESID_TABLE_POSITIONTO_ENTRY_TOOLTIP);
-
- this.getShell().setText(SystemResources.RESID_TABLE_POSITIONTO_LABEL);
- setHelp();
- return c;
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gnpt0000");
- }
- }
-
- public PositionToAction()
- {
- super(SystemMonitorViewPart.this, SystemResources.ACTION_POSITIONTO_LABEL, null);
- setToolTipText(SystemResources.ACTION_POSITIONTO_TOOLTIP);
- }
-
- public void run()
- {
-
- PositionToDialog posDialog = new PositionToDialog(getViewer().getShell(), getTitle());
- if (posDialog.open() == Window.OK)
- {
- String name = posDialog.getPositionName();
-
- getViewer().positionTo(name);
- }
- }
- }
-
-class SubSetAction extends BrowseAction
- {
- class SubSetDialog extends SystemPromptDialog
- {
- private String[] _filters;
- private Text[] _controls;
- private IPropertyDescriptor[] _uniqueDescriptors;
-
-
- public SubSetDialog(Shell shell, IPropertyDescriptor[] uniqueDescriptors)
- {
- super(shell, SystemResources.RESID_TABLE_SUBSET_LABEL);
- _uniqueDescriptors = uniqueDescriptors;
- }
-
- public String[] getFilters()
- {
- return _filters;
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
-
- for (int i = 0; i < _controls.length; i++)
- {
- _filters[i] = _controls[i].getText();
- }
-
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _controls[0];
- }
-
- public Control createInner(Composite parent)
- {
- Composite c = SystemWidgetHelpers.createComposite(parent, 2);
-
- int numberOfFields = _uniqueDescriptors.length;
- _controls = new Text[numberOfFields + 1];
- _filters = new String[numberOfFields + 1];
-
- Label nLabel = new Label(c, SWT.NONE);
- nLabel.setText(SystemPropertyResources.RESID_PROPERTY_NAME_LABEL);
-
-
- _controls[0] = SystemWidgetHelpers.createTextField(c, null);
- GridData textData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _controls[0].setLayoutData(textData);
- _controls[0].setText("*");
- _controls[0].setToolTipText(SystemResources.RESID_TABLE_SUBSET_ENTRY_TOOLTIP);
-
-
-
- for (int i = 0; i < numberOfFields; i++)
- {
- IPropertyDescriptor des = _uniqueDescriptors[i];
-
- Label aLabel = new Label(c, SWT.NONE);
- aLabel.setText(des.getDisplayName());
-
- _controls[i + 1] = SystemWidgetHelpers.createTextField(c, null);
- GridData textData3 = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- _controls[i + 1].setLayoutData(textData3);
- _controls[i + 1].setText("*");
- }
-
- setHelp();
- return c;
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gnss0000");
- }
- }
-
- public SubSetAction()
- {
- super(SystemMonitorViewPart.this, SystemResources.ACTION_SUBSET_LABEL, null);
- setToolTipText(SystemResources.ACTION_SUBSET_TOOLTIP);
- }
-
- public void run()
- {
- SubSetDialog subsetDialog = new SubSetDialog(getViewer().getShell(), getViewer().getVisibleDescriptors(getViewer().getInput()));
- if (subsetDialog.open() == Window.OK)
- {
- String[] filters = subsetDialog.getFilters();
- getViewer().setViewFilters(filters);
-
- }
- }
- }
-
-
-
- class RefreshAction extends BrowseAction
- {
- public RefreshAction()
- {
- super(SystemMonitorViewPart.this, SystemResources.ACTION_REFRESH_LABEL,
- //RSEUIPlugin.getDefault().getImageDescriptor(ICON_SYSTEM_REFRESH_ID));
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID));
- setTitleToolTip(SystemResources.ACTION_REFRESH_TOOLTIP);
- }
-
- public void run()
- {
- Object inputObject = getViewer().getInput();
- if (inputObject instanceof ISystemContainer)
- {
- ((ISystemContainer)inputObject).markStale(true);
- }
- ((SystemTableTreeViewProvider) getViewer().getContentProvider()).flushCache();
- getViewer().refresh();
-
- // refresh layout too
- //_viewer.computeLayout(true);
-
- }
- }
- private class SelectColumnsAction extends BrowseAction
- {
-
- class SelectColumnsDialog extends SystemPromptDialog
- {
- private ISystemViewElementAdapter _adapter;
- private SystemTableViewColumnManager _columnManager;
- private IPropertyDescriptor[] _uniqueDescriptors;
- private ArrayList _currentDisplayedDescriptors;
- private ArrayList _availableDescriptors;
-
- private List _availableList;
- private List _displayedList;
-
- private Button _addButton;
- private Button _removeButton;
- private Button _upButton;
- private Button _downButton;
-
-
- public SelectColumnsDialog(Shell shell, ISystemViewElementAdapter viewAdapter, SystemTableViewColumnManager columnManager)
- {
- super(shell, SystemResources.RESID_TABLE_SELECT_COLUMNS_LABEL);
- _adapter = viewAdapter;
- _columnManager = columnManager;
- _uniqueDescriptors = viewAdapter.getUniquePropertyDescriptors();
- IPropertyDescriptor[] initialDisplayedDescriptors = _columnManager.getVisibleDescriptors(_adapter);
- _currentDisplayedDescriptors = new ArrayList(initialDisplayedDescriptors.length);
- for (int i = 0; i < initialDisplayedDescriptors.length;i++)
- {
- if (!_currentDisplayedDescriptors.contains(initialDisplayedDescriptors[i]))
- _currentDisplayedDescriptors.add(initialDisplayedDescriptors[i]);
- }
- _availableDescriptors = new ArrayList(_uniqueDescriptors.length);
- for (int i = 0; i < _uniqueDescriptors.length;i++)
- {
- if (!_currentDisplayedDescriptors.contains(_uniqueDescriptors[i]))
- {
- _availableDescriptors.add(_uniqueDescriptors[i]);
- }
- }
- }
-
-
- public void handleEvent(Event e)
- {
- Widget source = e.widget;
- if (source == _addButton)
- {
- int[] toAdd = _availableList.getSelectionIndices();
- addToDisplay(toAdd);
- }
- else if (source == _removeButton)
- {
- int[] toAdd = _displayedList.getSelectionIndices();
- removeFromDisplay(toAdd);
- }
- else if (source == _upButton)
- {
- int index = _displayedList.getSelectionIndex();
- moveUp(index);
- _displayedList.select(index - 1);
- }
- else if (source == _downButton)
- {
- int index = _displayedList.getSelectionIndex();
- moveDown(index);
- _displayedList.select(index + 1);
- }
-
- // update button enable states
- updateEnableStates();
- }
-
- public IPropertyDescriptor[] getDisplayedColumns()
- {
- IPropertyDescriptor[] displayedColumns = new IPropertyDescriptor[_currentDisplayedDescriptors.size()];
- for (int i = 0; i< _currentDisplayedDescriptors.size();i++)
- {
- displayedColumns[i]= (IPropertyDescriptor)_currentDisplayedDescriptors.get(i);
- }
- return displayedColumns;
- }
-
- private void updateEnableStates()
- {
- boolean enableAdd = false;
- boolean enableRemove = false;
- boolean enableUp = false;
- boolean enableDown = false;
-
- int[] availableSelected = _availableList.getSelectionIndices();
- for (int i = 0; i < availableSelected.length; i++)
- {
- int index = availableSelected[i];
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
- if (!_currentDisplayedDescriptors.contains(descriptor))
- {
- enableAdd = true;
- }
- }
-
- if (_displayedList.getSelectionCount()>0)
- {
- enableRemove = true;
-
- int index = _displayedList.getSelectionIndex();
- if (index > 0)
- {
- enableUp = true;
- }
- if (index < _displayedList.getItemCount()-1)
- {
- enableDown = true;
- }
- }
-
- _addButton.setEnabled(enableAdd);
- _removeButton.setEnabled(enableRemove);
- _upButton.setEnabled(enableUp);
- _downButton.setEnabled(enableDown);
-
- }
-
- private void moveUp(int index)
- {
- Object obj = _currentDisplayedDescriptors.remove(index);
- _currentDisplayedDescriptors.add(index - 1, obj);
- refreshDisplayedList();
- }
-
- private void moveDown(int index)
- {
- Object obj = _currentDisplayedDescriptors.remove(index);
- _currentDisplayedDescriptors.add(index + 1, obj);
-
- refreshDisplayedList();
- }
-
- private void addToDisplay(int[] toAdd)
- {
- ArrayList added = new ArrayList();
- for (int i = 0; i < toAdd.length; i++)
- {
- int index = toAdd[i];
-
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
-
- if (!_currentDisplayedDescriptors.contains(descriptor))
- {
- _currentDisplayedDescriptors.add(descriptor);
- added.add(descriptor);
- }
- }
-
- for (int i = 0; i < added.size(); i++)
- {
- _availableDescriptors.remove(added.get(i));
- }
-
-
- refreshAvailableList();
- refreshDisplayedList();
-
- }
-
- private void removeFromDisplay(int[] toRemove)
- {
- for (int i = 0; i < toRemove.length; i++)
- {
- int index = toRemove[i];
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_currentDisplayedDescriptors.get(index);
- _currentDisplayedDescriptors.remove(index);
- _availableDescriptors.add(descriptor);
- }
- refreshDisplayedList();
- refreshAvailableList();
- }
-
- protected void buttonPressed(int buttonId)
- {
- setReturnCode(buttonId);
-
- close();
- }
-
- protected Control getInitialFocusControl()
- {
- return _availableList;
- }
-
- public Control createInner(Composite parent)
- {
- Composite main = SystemWidgetHelpers.createComposite(parent, 1);
-
- Label label = SystemWidgetHelpers.createLabel(main, SystemResources.RESID_TABLE_SELECT_COLUMNS_DESCRIPTION_LABEL);
-
- Composite c = SystemWidgetHelpers.createComposite(main, 4);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- _availableList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL, this, true);
-
- Composite addRemoveComposite = SystemWidgetHelpers.createComposite(c, 1);
- addRemoveComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
- _addButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_LABEL,
- this);
- _addButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP);
-
- _removeButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL,
- this);
- _removeButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP);
-
- _displayedList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL, this, false);
-
- Composite upDownComposite = SystemWidgetHelpers.createComposite(c, 1);
- upDownComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
- _upButton = SystemWidgetHelpers.createPushButton(upDownComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_LABEL,
- this);
- _upButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP);
-
- _downButton = SystemWidgetHelpers.createPushButton(upDownComposite,
- SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL,
- this);
- _downButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP);
-
- initLists();
-
- setHelp();
- return c;
- }
-
- private void initLists()
- {
- refreshAvailableList();
- refreshDisplayedList();
- updateEnableStates();
- }
-
- private void refreshAvailableList()
- {
- _availableList.removeAll();
- // initialize available list
- for (int i = 0; i < _availableDescriptors.size(); i++)
- {
- IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(i);
- _availableList.add(descriptor.getDisplayName());
- }
- }
-
- private void refreshDisplayedList()
- {
- _displayedList.removeAll();
- // initialize display list
- for (int i = 0; i < _currentDisplayedDescriptors.size(); i++)
- {
-
- Object obj = _currentDisplayedDescriptors.get(i);
- if (obj != null && obj instanceof IPropertyDescriptor)
- {
- _displayedList.add(((IPropertyDescriptor)obj).getDisplayName());
- }
- }
- }
-
- private void setHelp()
- {
- setHelp(RSEUIPlugin.HELPPREFIX + "gntc0000");
- }
- }
-
- public SelectColumnsAction()
- {
- super(SystemMonitorViewPart.this, SystemResources.ACTION_SELECTCOLUMNS_LABEL, null);
- setToolTipText(SystemResources.ACTION_SELECTCOLUMNS_TOOLTIP);
- setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID));
- }
-
- public void checkEnabledState()
- {
-
- if (getViewer() != null && getViewer().getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
- public void run()
- {
- SystemTableTreeView viewer = getViewer();
- SystemTableViewColumnManager mgr = viewer.getColumnManager();
- ISystemViewElementAdapter adapter = viewer.getAdapterForContents();
- SelectColumnsDialog dlg = new SelectColumnsDialog(getShell(), adapter, mgr);
- if (dlg.open() == Window.OK)
- {
- mgr.setCustomDescriptors(adapter, dlg.getDisplayedColumns());
- viewer.computeLayout(true);
- viewer.refresh();
- }
- }
- }
-
- MonitorViewWorkbook _folder = null;
- private CellEditorActionHandler _editorActionHandler = null;
-
- // for ISystemMessageLine
- private String _message, _errorMessage;
- private SystemMessage sysErrorMessage;
- private IStatusLineManager _statusLine = null;
-
- private SelectColumnsAction _selectColumnsAction = null;
- private RefreshAction _refreshAction = null;
-
- private ClearAction _clearAllAction = null;
- private ClearSelectedAction _clearSelectedAction = null;
-
- private SubSetAction _subsetAction = null;
- private PositionToAction _positionToAction = null;
-
- // constants
- public static final String ID = "org.eclipse.rse.ui.view.monitorView";
- // matches id in plugin.xml, view tag
-
- public void setFocus()
- {
- _folder.showCurrentPage();
- }
-
- public Shell getShell()
- {
- return _folder.getShell();
- }
-
- public SystemTableTreeView getViewer()
- {
- return _folder.getViewer();
- }
-
- public Viewer getRSEViewer()
- {
- return _folder.getViewer();
- }
-
- public CellEditorActionHandler getEditorActionHandler()
- {
- if (_editorActionHandler == null)
- {
- _editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
- }
- return _editorActionHandler;
- }
-
- public void createPartControl(Composite parent)
- {
- _folder = new MonitorViewWorkbook(parent, this);
- _folder.getFolder().addSelectionListener(this);
-
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.addSelectionListener(this);
-
-
- SystemWidgetHelpers.setHelp(_folder, RSEUIPlugin.HELPPREFIX + "ucmd0000");
-
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- registry.addSystemResourceChangeListener(this);
- registry.addSystemRemoteChangeListener(this);
-
-
- RestoreStateRunnable restore = new RestoreStateRunnable();
- Display.getCurrent().asyncExec(restore);
-
- fillLocalToolBar();
-
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection sel)
- {
- }
-
- public void dispose()
- {
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.removeSelectionListener(this);
- _folder.dispose();
-
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- registry.removeSystemResourceChangeListener(this);
- registry.removeSystemRemoteChangeListener(this);
-
-
- super.dispose();
- }
-
- public void updateActionStates()
- {
-
- if (_folder != null && _folder.getInput() != null)
- {
- }
- if (_clearAllAction != null)
- {
- _clearAllAction.checkEnabledState();
- _clearSelectedAction.checkEnabledState();
- _selectColumnsAction.checkEnabledState();
- _refreshAction.checkEnabledState();
- _positionToAction.checkEnabledState();
- }
- }
-
- public void fillLocalToolBar()
- {
- if (_folder != null )
- {
-
-
- //updateActionStates();
-
- IActionBars actionBars = getViewSite().getActionBars();
-
- _refreshAction= new RefreshAction();
-
- _clearSelectedAction = new ClearSelectedAction(this);
- _clearAllAction = new ClearAction(this);
-
- _selectColumnsAction = new SelectColumnsAction();
-
- _subsetAction = new SubSetAction();
- _positionToAction = new PositionToAction();
-
- IToolBarManager toolBarManager = actionBars.getToolBarManager();
- addToolBarItems(toolBarManager);
- addToolBarMenuItems(actionBars.getMenuManager());
- }
- updateActionStates();
- }
-
- private void addToolBarItems(IToolBarManager toolBarManager)
- {
- toolBarManager.removeAll();
-
- toolBarManager.add(_refreshAction);
-
- toolBarManager.add(new Separator());
- toolBarManager.add(_clearSelectedAction);
- toolBarManager.add(_clearAllAction);
-
- toolBarManager.add(new Separator());
- toolBarManager.add(_selectColumnsAction);
-
- toolBarManager.update(true);
- }
-
-
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- }
-
-
-
- public void addItemToMonitor(IAdaptable root)
- {
- if (root != null)
- {
- _folder.addItemToMonitor(root, true);
- if (true)
- updateActionStates();
- }
- }
-
- public void removeItemToMonitor(IAdaptable root)
- {
- if (root != null)
- {
- _folder.remove(root);
- if (true)
- updateActionStates();
- }
- }
-
- public void removeAllItemsToMonitor()
- {
- while (_folder.getInput() != null)
- {
- removeItemToMonitor((IAdaptable)_folder.getInput());
- }
- }
-
- public void setInput(IAdaptable object)
- {
- _folder.setInput(object);
- }
-
-
- /**
- * Used to asynchronously update the view whenever properties change.
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
-
- Object child = event.getSource();
- SystemTableTreeView viewer = getViewer();
- if (viewer != null)
- {
- Object input = viewer.getInput();
- switch (event.getType())
- {
- case ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE:
- {
- _folder.removeDisconnected();
- updateActionStates();
- }
- break;
- case ISystemResourceChangeEvents.EVENT_RENAME:
- {
- if (child == input)
- {
- _folder.getCurrentTabItem().updateTitle((IAdaptable)child);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_DELETE:
- case ISystemResourceChangeEvents.EVENT_DELETE_MANY:
- {
- if (child == input)
- {
- removeItemToMonitor((IAdaptable)child);
- }
- }
- break;
- default:
- break;
- }
- }
- }
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
-
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
-
- Object child = event.getResource();
-
- SystemTableTreeView viewer = getViewer();
- if (viewer != null)
- {
- Object input = viewer.getInput();
- if (input == child || child instanceof Vector)
- {
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
- break;
-
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
- break;
-
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- if (child instanceof Vector)
- {
- Vector vec = (Vector)child;
- for (int v = 0; v < vec.size(); v++)
- {
- Object c = vec.get(v);
-
- }
- }
- else
- {
-
- return;
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- addItemToMonitor((IAdaptable)child);
- }
-
- break;
- }
- }
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- Widget source = e.widget;
-
- if (source == _folder.getFolder())
- {
- updateActionStates();
- }
- }
-
-
-// -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- _errorMessage = null;
- sysErrorMessage = null;
- if (_statusLine != null)
- _statusLine.setErrorMessage(_errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- _message = null;
- if (_statusLine != null)
- _statusLine.setMessage(_message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return _errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return _message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this._errorMessage = message;
- if (_statusLine != null)
- _statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this._message = message;
- if (_statusLine != null)
- _statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-
- private void addToolBarMenuItems(IMenuManager menuManager)
- {
- menuManager.removeAll();
- menuManager.add(_selectColumnsAction);
- menuManager.add(new Separator("Filter"));
- menuManager.add(_positionToAction);
- menuManager.add(_subsetAction);
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/TabFolderLayout.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/TabFolderLayout.java
deleted file mode 100644
index 7b3493d15..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/monitor/TabFolderLayout.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.monitor;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-public class TabFolderLayout extends Layout {
-
-
-
- protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
-
- Control [] children = composite.getChildren ();
- int count = children.length;
- int maxWidth = 0, maxHeight = 0;
- for (int i=0; i<count; i++) {
- Control child = children [i];
- Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
- maxWidth = Math.max (maxWidth, pt.x);
- maxHeight = Math.max (maxHeight, pt.y);
- }
-
- if (wHint != SWT.DEFAULT)
- maxWidth= wHint;
- if (hHint != SWT.DEFAULT)
- maxHeight= hHint;
-
- return new Point(maxWidth, maxHeight);
-
- }
-
- protected void layout (Composite composite, boolean flushCache) {
- Rectangle rect= composite.getClientArea();
-
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/BrowseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/BrowseAction.java
deleted file mode 100644
index 6dab5756b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/BrowseAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.scratchpad;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.internal.model.SystemScratchpad;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-
-class BrowseAction extends Action
-{
- protected SystemScratchpadView _view;
- protected SystemScratchpad _scratchPad;
- public BrowseAction(SystemScratchpadView view, String label, ImageDescriptor des)
- {
- super(label, des);
- _view = view;
- setImageDescriptor(des);
- setToolTipText(label);
- _scratchPad = RSEUIPlugin.getTheSystemRegistry().getSystemScratchPad();
- }
-
- public void checkEnabledState()
- {
- if (_view.getInput() != null)
- {
- setEnabled(true);
- }
- else
- {
- setEnabled(false);
- }
- }
-
- public void run()
- {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearAction.java
deleted file mode 100644
index 35f9e4420..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-
-package org.eclipse.rse.ui.view.scratchpad;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-
-
-public class ClearAction extends BrowseAction
-{
-
- public ClearAction(SystemScratchpadView view)
- {
- super(view, SystemResources.ACTION_CLEAR_ALL_LABEL,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL_ID));
-
-
- // TODO DKM - get help for this!
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- public void checkEnabledState()
- {
- setEnabled(_scratchPad.hasChildren());
- }
-
- public void run()
- {
- clear();
- }
-
- // clear contents of the current command viewer
- private void clear()
- {
- _scratchPad.clearChildren();
- RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
- //_view.updateActionStates();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearSelectedAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearSelectedAction.java
deleted file mode 100644
index 311cfc53b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/ClearSelectedAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-
-package org.eclipse.rse.ui.view.scratchpad;
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.SystemResourceChangeEvent;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-
-
-
-public class ClearSelectedAction extends BrowseAction
-{
- public ClearSelectedAction(SystemScratchpadView view)
- {
- super(view, SystemResources.ACTION_CLEAR_SELECTED_LABEL,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED_ID));
-
- // TODO DKM - get help for this!
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- public void checkEnabledState()
- {
- if (_scratchPad.hasChildren())
- {
- StructuredSelection selection = (StructuredSelection)_view.getSelection();
- if (selection != null)
- {
- Iterator iterator = selection.iterator();
- while (iterator.hasNext())
- {
- Object obj = iterator.next();
- if (!_scratchPad.contains(obj))
- {
- setEnabled(false);
- return;
- }
- }
- setEnabled(true);
- return;
- }
- }
-
- setEnabled(false);
- }
-
- public void run()
- {
- clear();
- }
-
- private void clear()
- {
- StructuredSelection selection = (StructuredSelection)_view.getSelection();
- if (selection != null)
- {
- Iterator iterator = selection.iterator();
- while (iterator.hasNext())
- {
- _scratchPad.removeChild(iterator.next());
- }
- RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
- //_view.updateActionStates();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadView.java
deleted file mode 100644
index d6dc5cca5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadView.java
+++ /dev/null
@@ -1,1448 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.scratchpad;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterReference;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemRemoteChangeListener;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
-import org.eclipse.rse.ui.actions.SystemShowInTableAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
-import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
-import org.eclipse.rse.ui.view.ISystemSelectAllTarget;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemView;
-import org.eclipse.rse.ui.view.SystemViewDataDragAdapter;
-import org.eclipse.rse.ui.view.SystemViewDataDropAdapter;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.EditorInputTransfer;
-import org.eclipse.ui.part.PluginTransfer;
-
-
-/**
- * This subclass of the standard JFace tabletree viewer is used to
- * show a generic tabletree view of the selected object
- * <p>
- */
-public class SystemScratchpadView
- // TODO change TreeViewer to ScratchpadViewer when Eclipse fixes SWT viewer
-// extends ScratchpadViewer
- extends TreeViewer
- implements IMenuListener, ISystemDeleteTarget,
- ISystemRenameTarget, ISystemSelectAllTarget,
- ISystemResourceChangeListener, ISystemRemoteChangeListener,
- ISelectionChangedListener, ISelectionProvider
-{
- private Object _objectInput;
- //private ArrayList _attributeColumns;
- private TableLayout _layout;
- private SystemScratchpadViewProvider _provider;
- private MenuManager _menuManager;
-
- // these variables were copied from SystemView to allow for limited support
- // of actions. I say limited because somethings don't yet work properly.
- protected SystemRefreshAction _refreshAction;
- protected PropertyDialogAction _propertyDialogAction;
- protected SystemRemotePropertiesAction _remotePropertyDialogAction;
- protected SystemOpenExplorerPerspectiveAction _openToPerspectiveAction;
- protected SystemShowInTableAction _showInTableAction;
-
- // global actions
- // Note the Edit menu actions are set in SystemViewPart. Here we use these
- // actions from our own popup menu actions.
- protected SystemCommonDeleteAction _deleteAction;
- // for global delete menu item
- protected SystemCommonRenameAction _renameAction;
- // for common rename menu item
- protected SystemCommonSelectAllAction _selectAllAction;
- // for common Ctrl+A select-all
- protected ClearSelectedAction _clearSelectedAction;
- protected ClearAction _clearAllAction;
-
- protected boolean _selectionShowRefreshAction;
- protected boolean _selectionShowOpenViewActions;
- protected boolean _selectionShowDeleteAction;
- protected boolean _selectionShowRenameAction;
- protected boolean _selectionEnableDeleteAction;
- protected boolean _selectionEnableRenameAction;
-
- protected boolean _selectionIsRemoteObject = true;
- protected boolean _selectionFlagsUpdated = false;
-
- private IWorkbenchPart _workbenchPart = null;
-
- private ISystemMessageLine _messageLine;
- protected boolean menuListenerAdded = false;
-
- private static final int LEFT_BUTTON = 1;
- private int mouseButtonPressed = LEFT_BUTTON;
-
- /**
- * Constructor for the table view
- *
- */
- public SystemScratchpadView(Tree tableTree, ISystemMessageLine msgLine)
- {
- super(tableTree);
- _messageLine = msgLine;
- //_attributeColumns = new ArrayList();
- _layout = new TableLayout();
-
- _provider = new SystemScratchpadViewProvider(this);
-
-
- setContentProvider(_provider);
-
- IWorkbench wb = PlatformUI.getWorkbench();
- setLabelProvider(new DecoratingLabelProvider(_provider, wb.getDecoratorManager().getLabelDecorator()));
-
- //setLabelProvider(_provider);
-
- _menuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- _menuManager.setRemoveAllWhenShown(true);
- _menuManager.addMenuListener(this);
- Menu menu = _menuManager.createContextMenu(tableTree);
- tableTree.setMenu(menu);
-
- addSelectionChangedListener(this);
-
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().addSystemRemoteChangeListener(this);
-
- initDragAndDrop();
-
- tableTree.setVisible(false);
- // key listening for delete press
- getControl().addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent e)
- {
- handleKeyPressed(e);
- }
- });
- getControl().addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- mouseButtonPressed = e.button; //d40615
- }
- });
- }
-
- public Layout getLayout()
- {
- return _layout;
- }
-
- public void setWorkbenchPart(IWorkbenchPart part)
- {
- _workbenchPart = part;
- }
-
-
- /**
- * Return the popup menu for the table
- */
- public Menu getContextMenu()
- {
- return getTree().getMenu();
- }
- /**
- * Return the popup menu for the table
- */
- public MenuManager getContextMenuManager()
- {
- return _menuManager;
- }
-
- /**
- * Called whenever the input for the view changes
- */
- public void inputChanged(Object newObject, Object oldObject)
- {
- if (newObject instanceof IAdaptable)
- {
- getTree().setVisible(true);
- _objectInput = newObject;
-
- SystemScratchpadViewProvider provider = (SystemScratchpadViewProvider) getContentProvider();
- Object[] children = provider.getChildren(_objectInput);
-
- super.inputChanged(newObject, oldObject);
- }
- else if (newObject == null)
- {
- getTree().setVisible(false);
- _objectInput = null;
- }
- }
-
- public Object getInput()
- {
- return _objectInput;
- }
-
- /**
- * Convenience method for retrieving the view adapter for an object
- */
- protected ISystemViewElementAdapter getAdapter(Object obj)
- {
- return SystemAdapterHelpers.getAdapter(obj, this);
- }
-
-
-
-
- protected void initDragAndDrop()
- {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance(), EditorInputTransfer.getInstance(), FileTransfer.getInstance()};
-
- addDragSupport(ops, transfers, new SystemViewDataDragAdapter(this));
- addDropSupport(ops | DND.DROP_DEFAULT, transfers, new SystemViewDataDropAdapter(this));
- }
-
- /**
- * Used to asynchronously update the view whenever properties change.
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- Object parent = event.getParent();
- Object child = event.getSource();
- int eventType = event.getType();
- switch (eventType)
- {
- case ISystemResourceChangeEvents.EVENT_RENAME_FILTER_REFERENCE:
- case ISystemResourceChangeEvents.EVENT_CHANGE_FILTER_REFERENCE:
- case ISystemResourceChangeEvents.EVENT_CHANGE_FILTERSTRING_REFERENCE:
- {
- if (child instanceof ISystemFilter)
- {
- IRSEBaseReferencingObject[] references = ((ISystemFilter)child).getReferencingObjects();
- for (int i = 0; i < references.length; i++)
- {
- IRSEBaseReferencingObject ref = references[i];
- Widget w = findItem(ref);
- if (w != null)
- {
- internalRefresh(ref);
- }
- }
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE :
- case ISystemResourceChangeEvents.EVENT_PROPERTYSHEET_UPDATE :
- case ISystemResourceChangeEvents.EVENT_ICON_CHANGE:
- {
- Widget w = findItem(child);
-
- if (w != null)
- {
- updateItem(w, child);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_ADD :
- case ISystemResourceChangeEvents.EVENT_ADD_RELATIVE :
- {
- boolean addingConnection = (child instanceof IHost);
- if (_objectInput instanceof ISystemRegistry && addingConnection)
- {
- SystemScratchpadViewProvider provider = (SystemScratchpadViewProvider) getContentProvider();
-
- if (provider != null)
- {
-
- internalRefresh(_objectInput);
- }
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_REFRESH:
- {
- internalRefresh(parent);
- }
- break;
- case ISystemResourceChangeEvents.EVENT_REFRESH_SELECTED:
- {
- IStructuredSelection sel = (IStructuredSelection)getSelection();
- Iterator iter = sel.iterator();
- while (iter.hasNext())
- {
- Object obj = iter.next();
- internalRefresh(obj);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_RENAME:
- {
- Widget w = findItem(child);
- if (w != null)
- {
- updateItem(w, child);
- }
- }
- break;
- case ISystemResourceChangeEvents.EVENT_DELETE:
- case ISystemResourceChangeEvents.EVENT_DELETE_MANY:
- {
- if (child instanceof ISystemFilterReference)
- {
- Widget w = findItem(child);
- if (w != null)
- {
- remove(child);
- RSEUIPlugin.getTheSystemRegistry().getSystemScratchPad().removeChild(child);
- }
- }
- }
- break;
-
- default :
- break;
-
- }
-
- if (child == _objectInput || parent == _objectInput)
- {
- SystemScratchpadViewProvider provider = (SystemScratchpadViewProvider) getContentProvider();
-
- if (provider != null)
- {
-
-
- try
- {
- internalRefresh(_objectInput);
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError(e.getMessage());
- }
- }
- }
- }
-
- /**
- * This is the method in your class that will be called when a remote resource
- * changes. You will be called after the resource is changed.
- * @see org.eclipse.rse.model.ISystemRemoteChangeEvent
- */
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- int eventType = event.getEventType();
- Object remoteResourceParent = event.getResourceParent();
- Object remoteResource = event.getResource();
- //boolean originatedHere = (event.getOriginatingViewer() == this);
- Vector remoteResourceNames = null;
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- String remoteResourceParentName = getRemoteResourceAbsoluteName(remoteResourceParent);
- String remoteResourceName = getRemoteResourceAbsoluteName(remoteResource);
- if (remoteResourceName == null)
- return;
- SystemScratchpadViewProvider provider = (SystemScratchpadViewProvider) getContentProvider();
-
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE CHANGED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
- {
- if (remoteResourceParent == getInput())
- {
- Widget w = findItem(remoteResource);
- if (w != null)
- {
- updateItem(w, remoteResource);
- }
-
- }
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE CREATED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
- {
- internalRefresh(remoteResourceParent);
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- if (remoteResourceParent != null)
- {
- internalRefresh(remoteResourceParent);
- }
- else
- {
- remove(remoteResource);
-
- }
- /*
- {
- Object dchild = remoteResource;
-
-
- ISystemViewElementAdapter dadapt = getAdapter(dchild);
- if (dadapt != null)
- {
- SubSystem dSubSystem = dadapt.getSubSystem(dchild);
- String dkey = dadapt.getAbsoluteName(dchild);
-
- if (provider != null)
- {
- Object[] children = provider.getChildren(_objectInput);
- for (int i = 0; i < children.length; i++)
- {
- Object existingChild = children[i];
- if (existingChild != null)
- {
- ISystemViewElementAdapter eadapt = getAdapter(existingChild);
- SubSystem eSubSystem = eadapt.getSubSystem(existingChild);
-
- if (dSubSystem == eSubSystem)
- {
- String ekey = eadapt.getAbsoluteName(existingChild);
- if (ekey.equals(dkey))
- {
- // do a full refresh
- refresh();
- }
- }
-
- }
- }
- }
- }
- }
- */
-
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- String oldName = event.getOldName();
- Object child = event.getResource();
-
- if (provider != null)
- {
- Widget widget = findItem(child);
- if (widget != null)
- {
- widget.setData(child);
- updateItem(widget, child);
- return;
- }
- }
- }
-
- break;
- }
- }
-
- /**
- * Turn a given remote object reference into a fully qualified absolute name
- */
- private String getRemoteResourceAbsoluteName(Object remoteResource)
- {
- if (remoteResource == null)
- return null;
- String remoteResourceName = null;
- if (remoteResource instanceof String)
- remoteResourceName = (String) remoteResource;
- else
- {
- ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource);
- if (ra == null)
- return null;
- remoteResourceName = ra.getAbsoluteName(remoteResource);
- }
- return remoteResourceName;
- }
-
- /**
- * Display a message/status on the message/status line
- */
- public void displayMessage(String msg)
- {
- if (_messageLine != null)
- _messageLine.setMessage(msg);
- }
- /**
- * Clear message/status shown on the message/status line
- */
- public void clearMessage()
- {
- if (_messageLine != null)
- _messageLine.clearMessage();
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
-
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null)
- return;
-
- _selectionFlagsUpdated = false;
- ISystemViewElementAdapter adapter = getAdapter(firstSelection);
- if (adapter != null)
- {
- displayMessage(adapter.getStatusLineText(firstSelection));
- if ((mouseButtonPressed == LEFT_BUTTON))
- adapter.selectionChanged(firstSelection);
- }
- else
- clearMessage();
- }
-
- public void dispose()
- {
- removeAsListener();
-
- Composite tree = getTree();
-
- boolean isDisposed = tree.isDisposed();
-
- // dispose control if not disposed
- if (!isDisposed) {
- tree.dispose();
- }
- }
-
- /**
- * Remove as listener.
- */
- public void removeAsListener() {
-
- // remove listeners
- removeSelectionChangedListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- RSEUIPlugin.getTheSystemRegistry().removeSystemRemoteChangeListener(this);
-
- //Composite tree = getTree();
- //boolean isDisposed = tree.isDisposed();
- }
-
- /*
- * Everything below is basically stuff copied and pasted from SystemsView
- * -There needs to be cleaning up of the below code as some of this stuff
- * is broken for the table view
- *
- *
- public void createStandardGroups(IMenuManager menu)
- {
- if (!menu.isEmpty())
- return;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW));
- // new->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO));
- // expand to->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND));
- // expand, collapse
- // goto into, go->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH));
- // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH));
- // browse with ->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN));
- // open xxx
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH));
- // work with->
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_SHOW)); // show->type hierarchy, in-navigator
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD));
- // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE));
- // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE));
- // rename,move,copy,delete,bookmark,refactoring
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER));
- // move up, move down
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE));
- // getters/setters, etc. Typically in editor
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH));
- // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION));
- // connection-related actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT));
- // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS));
- // actions queried from adapters
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS));
- // user or BP/ISV additions
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM));
- // Team
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_COMPAREWITH));
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_REPLACEWITH));
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES));
- // Properties
- }*/
-
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected PropertyDialogAction getPropertyDialogAction()
- {
- if (_propertyDialogAction == null)
- {
- _propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this);
- //propertyDialogAction.setToolTipText(" ");
- }
- _propertyDialogAction.selectionChanged(getSelection());
- return _propertyDialogAction;
- }
- /**
- * Rather than pre-defining this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected SystemRemotePropertiesAction getRemotePropertyDialogAction()
- {
- if (_remotePropertyDialogAction == null)
- {
- _remotePropertyDialogAction = new SystemRemotePropertiesAction(getShell());
- }
- _remotePropertyDialogAction.setSelection(getSelection());
- return _remotePropertyDialogAction;
- }
- /**
- * Return the select All action
- */
- protected IAction getSelectAllAction()
- {
- if (_selectAllAction == null)
- _selectAllAction = new SystemCommonSelectAllAction(getShell(), this, this);
- return _selectAllAction;
- }
-
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getRenameAction()
- {
- if (_renameAction == null)
- _renameAction = new SystemCommonRenameAction(getShell(), this);
- return _renameAction;
- }
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getDeleteAction()
- {
- if (_deleteAction == null)
- _deleteAction = new SystemCommonDeleteAction(getShell(), this);
- return _deleteAction;
- }
-
- protected IAction getClearSelectedAction()
- {
- if (_clearSelectedAction == null)
- _clearSelectedAction = new ClearSelectedAction(this);
- _clearSelectedAction.checkEnabledState();
- return _clearSelectedAction;
- }
-
- protected IAction getClearAllAction()
- {
- if (_clearAllAction == null)
- _clearAllAction = new ClearAction(this);
- _clearAllAction.checkEnabledState();
- return _clearAllAction;
- }
-
- /**
- * Return the refresh action
- */
- protected IAction getRefreshAction()
- {
- if (_refreshAction == null)
- _refreshAction = new SystemRefreshAction(getShell());
- return _refreshAction;
- }
- /*
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- *
- protected SystemCascadingOpenToAction getOpenToAction()
- {
- if (openToAction == null)
- openToAction = new SystemCascadingOpenToAction(getShell(),getWorkbenchWindow());
- return openToAction;
- } NOT USED YET */
- /**
- * Get the common "Open to->" action for opening a new Remote Systems Explorer view,
- * scoped to the currently selected object.
- */
- protected SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction()
- {
- if (_openToPerspectiveAction == null)
- {
- IWorkbench desktop = PlatformUI.getWorkbench();
- IWorkbenchWindow win = desktop.getActiveWorkbenchWindow();
-
- _openToPerspectiveAction = new SystemOpenExplorerPerspectiveAction(getShell(), win);
- }
- //getWorkbenchWindow());
- return _openToPerspectiveAction;
- }
-
- protected SystemShowInTableAction getShowInTableAction()
- {
- if (_showInTableAction == null)
- {
- _showInTableAction = new SystemShowInTableAction(getShell());
- }
- //getWorkbenchWindow());
- return _showInTableAction;
- }
-
- public Shell getShell()
- {
- return getTree().getShell();
- }
-
- /**
- * Required method from ISystemDeleteTarget.
- * Decides whether to even show the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowDeleteAction;
- }
- /**
- * Required method from ISystemDeleteTarget
- * Decides whether to enable the delete menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canDelete()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableDeleteAction;
- }
-
- /*
- * Required method from ISystemDeleteTarget
- */
- public boolean doDelete(IProgressMonitor monitor)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- //Object multiSource[] = new Object[selectedCount];
- //int idx = 0;
- Object element = null;
- //Object parentElement = getSelectedParent();
- ISystemViewElementAdapter adapter = null;
- boolean ok = true;
- boolean anyOk = false;
- Vector deletedVector = new Vector();
- try
- {
- while (ok && elements.hasNext())
- {
- element = elements.next();
- //multiSource[idx++] = element;
- adapter = getAdapter(element);
- ok = adapter.doDelete(getShell(), element, monitor);
- if (ok)
- {
- anyOk = true;
- deletedVector.addElement(element);
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- String msg = exc.getMessage();
- if ((msg == null) || (exc instanceof ClassCastException))
- msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_DELETING).makeSubstitution(element, msg));
- ok = false;
- }
- if (anyOk)
- {
- Object[] deleted = new Object[deletedVector.size()];
- for (int idx = 0; idx < deleted.length; idx++)
- deleted[idx] = deletedVector.elementAt(idx);
- if (_selectionIsRemoteObject)
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, deletedVector, null, null, null, this);
- else
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(deleted, ISystemResourceChangeEvents.EVENT_DELETE_MANY, getInput()));
- }
- return ok;
- }
-
- // ---------------------------
- // ISYSTEMRENAMETARGET METHODS
- // ---------------------------
-
- /**
- * Required method from ISystemRenameTarget.
- * Decides whether to even show the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean showRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionShowRenameAction;
- }
- /**
- * Required method from ISystemRenameTarget
- * Decides whether to enable the rename menu item.
- * Assumes scanSelections() has already been called
- */
- public boolean canRename()
- {
- if (!_selectionFlagsUpdated)
- scanSelections();
- return _selectionEnableRenameAction;
- }
-
- // default implementation
- // in default table, parent is input
- protected Object getParentForContent(Object element)
- {
- return _objectInput;
- }
-
- /**
- * Required method from ISystemRenameTarget
- */
- public boolean doRename(String[] newNames)
- {
- SystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- //int selectedCount = selection.size();
- Object element = null;
-
- ISystemViewElementAdapter adapter = null;
- ISystemRemoteElementAdapter remoteAdapter = null;
- String oldFullName = null;
- boolean ok = true;
- try
- {
- int nameIdx = 0;
- while (ok && elements.hasNext())
- {
- element = elements.next();
- adapter = getAdapter(element);
- Object parentElement = getParentForContent(element);
-
- remoteAdapter = getRemoteAdapter(element);
- if (remoteAdapter != null)
- oldFullName = remoteAdapter.getAbsoluteName(element);
- // pre-rename
- ok = adapter.doRename(getShell(), element, newNames[nameIdx++]);
- if (ok)
- {
- if (remoteAdapter != null) {
- sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, remoteAdapter.getSubSystem(element), oldFullName, this);
- }
- else {
- sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement));
- }
- }
- }
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayErrorMessage(getShell(), exc.getSystemMessage());
- ok = false;
- }
- catch (Exception exc)
- {
- //String msg = exc.getMessage();
- //if ((msg == null) || (exc instanceof ClassCastException))
- // msg = exc.getClass().getName();
- SystemMessageDialog.displayErrorMessage(getShell(), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_RENAMING).makeSubstitution(element, exc),
- //msg),
- exc);
- ok = false;
- }
- return ok;
- }
-
- /**
- * Returns the implementation of ISystemRemoteElement for the given
- * object. Returns null if this object does not adaptable to this.
- */
- protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
- {
- ISystemRemoteElementAdapter adapter = null;
- if (!(o instanceof IAdaptable))
- adapter = (ISystemRemoteElementAdapter) Platform.getAdapterManager().getAdapter(o, ISystemRemoteElementAdapter.class);
- else
- adapter = (ISystemRemoteElementAdapter) ((IAdaptable) o).getAdapter(ISystemRemoteElementAdapter.class);
- if ((adapter != null) && (adapter instanceof ISystemViewElementAdapter))
- ((ISystemViewElementAdapter) adapter).setViewer(this);
- return adapter;
- }
-
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection)
- {
- return true;
- }
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection)
- {
-
- Tree tree = getTree();
-
- Tree theTree = tree;
- theTree.setSelection(theTree.getItems());
- TreeItem[] items = theTree.getItems();
- Object[] objects = new Object[items.length];
- for (int idx = 0; idx < items.length; idx++)
- objects[idx] = items[idx].getData();
- fireSelectionChanged(new SelectionChangedEvent(this, new StructuredSelection(objects)));
-
-
- }
-
- public void menuAboutToShow(IMenuManager manager)
- {
- SystemView.createStandardGroups(manager);
- if (!menuListenerAdded)
- {
- if (manager instanceof MenuManager)
- {
- Menu m = ((MenuManager)manager).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- if (_messageLine != null)
- ml.setShowToolTipText(true, _messageLine);
- m.addMenuListener(ml);
- }
- }
- }
- fillContextMenu(manager);
- }
-
- public ISelection getSelection()
- {
- ISelection selection = super.getSelection();
- if (selection == null || selection.isEmpty())
- {
- // make the selection the parent
- ArrayList list = new ArrayList();
- if (_objectInput != null)
- {
- list.add(_objectInput);
- selection = new StructuredSelection(list);
- }
- }
-
- return selection;
- }
-
- public void fillContextMenu(IMenuManager menu) {
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
-
- boolean allSelectionsFromSameParent = true;
- int selectionCount = selection.size();
-
-
-
- if (selectionCount == 0) // nothing selected
- {
- return;
- }
- else
- {
-
- if (selectionCount == 1) {
-
- if (selection.getFirstElement() == getInput()) {
- //return;
- }
- }
-
- if (selectionCount > 1)
- {
- allSelectionsFromSameParent = sameParent();
-
- if (!allSelectionsFromSameParent)
- {
- if (selectionHasAncestryRelationship())
- {
- // don't show the menu because actions with
- // multiple select on objects that are ancestors
- // of each other is problematic
- // still create the standard groups
- SystemView.createStandardGroups(menu);
- return;
- }
- }
- }
-
- // Partition into groups...
- SystemView.createStandardGroups(menu);
-
- // ADD COMMON ACTIONS...
- // COMMON REFRESH ACTION...
- if (showRefresh())
- {
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getRefreshAction());
- }
-
- // COMMON RENAME ACTION...
- if (canRename())
- {
- if (showRename())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getRenameAction());
- }
-
- // ADAPTER SPECIFIC ACTIONS
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- Iterator elements = selection.iterator();
- Hashtable adapters = new Hashtable();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter != null)
- {
- adapters.put(adapter, element); // want only unique adapters
- }
- }
- Enumeration uniqueAdapters = adapters.keys();
- Shell shell = getShell();
- while (uniqueAdapters.hasMoreElements())
- {
- ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter) uniqueAdapters.nextElement();
- nextAdapter.addActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- if (nextAdapter instanceof AbstractSystemViewAdapter)
- {
- AbstractSystemViewAdapter aVA = (AbstractSystemViewAdapter)nextAdapter;
- // add remote actions
- aVA.addCommonRemoteActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADAPTERS);
-
- // add dynamic menu popups
- aVA.addDynamicPopupMenuActions(ourMenu, selection, shell, ISystemContextMenuConstants.GROUP_ADDITIONS);
- }
- }
-
-
-
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx = 0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) && (((ActionContributionItem) items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) (((ActionContributionItem) items[idx]).getAction());
- item.setInputs(getShell(), this, selection);
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager) items[idx];
- item.setInputs(getShell(), this, selection);
- }
- }
-
- // COMMON DELETE ACTION...
- if (canDelete() && showDelete())
- {
- //menu.add(getDeleteAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_REORGANIZE, getDeleteAction());
- ((ISystemAction) getDeleteAction()).setInputs(getShell(), this, selection);
- menu.add(new Separator());
- }
-
- // REMOVE FROM VIEW ACTION...
-
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_ADDITIONS, getClearSelectedAction());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_ADDITIONS, getClearAllAction());
-
- // PROPERTIES ACTION...
- // This is supplied by the system, so we pretty much get it for free. It finds the
- // registered propertyPages extension points registered for the selected object's class type.
- //propertyDialogAction.selectionChanged(selection);
-
- if (!_selectionIsRemoteObject) // is not a remote object
- {
- PropertyDialogAction pdAction = getPropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- {
-
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- }
- // OPEN IN NEW PERSPECTIVE ACTION... if (fromSystemViewPart && showOpenViewActions())
- {
- //SystemCascadingOpenToAction openToAction = getOpenToAction();
- SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
- SystemShowInTableAction showInTableAction = getShowInTableAction();
- openToPerspectiveAction.setSelection(selection);
- showInTableAction.setSelection(selection);
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToAction.getSubMenu());
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, openToPerspectiveAction);
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, showInTableAction);
-
- }
- }
- else // is a remote object
- {
- //Object firstSelection = selection.getFirstElement();
- //ISystemRemoteElementAdapter remoteAdapter = getRemoteAdapter(firstSelection);
- //logMyDebugMessage(this.getClass().getName(), ": there is a remote adapter");
- SystemRemotePropertiesAction pdAction = getRemotePropertyDialogAction();
- if (pdAction.isApplicableForSelection())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- //else
- //logMyDebugMessage(this.getClass().getName(), ": but it is not applicable for selection");
- // --------------------------------------------------------------------------------------------------------------------
- // look for and add any popup menu actions registered via our org.eclipse.rse.core.popupMenus extension point...
- // --------------------------------------------------------------------------------------------------------------------
- if (_workbenchPart != null)
- {
- SystemPopupMenuActionContributorManager.getManager().contributeObjectActions(_workbenchPart, ourMenu, this, null);
- }
- }
-
- }
- }
-
-
- /**
- * Decides whether to even show the refresh menu item.
- * Assumes scanSelections() has already been called
- */
- protected boolean showRefresh()
- {
- return _selectionShowRefreshAction;
- }
-
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent()
- {
- boolean same = true;
-
- Tree tree = getTree();
-
- TreeItem[] items = tree.getSelection();
-
- if ((items == null) || (items.length ==0)) {
- return true;
- }
-
- TreeItem prevParent = null;
- TreeItem currParent = null;
-
- for (int idx = 0; idx < items.length; idx++)
- {
- currParent = items[idx].getParentItem();
-
- if ((idx>0) && (currParent != prevParent)) {
- same = false;
- break;
- }
- else
- {
- prevParent = currParent;
- }
- }
- return same;
- }
-
- private boolean selectionHasAncestryRelationship() {
- Tree tree = getTree();
-
- TreeItem[] items = tree.getSelection();
-
- for (int idx=0; idx<items.length; idx++)
- {
- TreeItem item = items[idx];
-
- for (int c=0; c < items.length; c++)
- {
- if (item != items[c])
- {
- if (isAncestorOf(item, items[c], false))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Returns whether an item is an ancestor of another item. The ancestor can be direct or indirect.
- * @param container the item which might be an ancestor.
- * @param item the child.
- * @param direct <code>true</code> if the container must be a direct ancestor of the child item,
- * <code>false</code> otherwise.
- * @return <code>true</code> if there is an ancestry relationship, <code>false</code> otherwise.
- */
- private boolean isAncestorOf(TreeItem container, TreeItem item, boolean direct)
- {
- TreeItem[] children = null;
-
- // does not have to be a direct ancestor
- if (!direct) {
- // get the children of the container's parent, i.e. the container's siblings
- // as well as itself
- TreeItem parent = container.getParentItem();
-
- // check if parent is null
- // parent is null if the container is a root item
- if (parent != null) {
- children = parent.getItems();
- }
- else {
- children = getTree().getItems();
- }
- }
- // must be a direct ancestor
- else {
- // get the children of the container
- children = container.getItems();
- }
-
- // go through all the children
- for (int i = 0; i < children.length; i++) {
-
- TreeItem child = children[i];
-
- // if one of the children matches the child item, return true
- if (child == item && direct) {
- return true;
- }
- // otherwise, go through children, and see if any of those are ancestors of
- // the child item
- else if (child.getItemCount() > 0) {
-
- // we check for direct ancestry
- if (isAncestorOf(child, item, true)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * --------------------------------------------------------------------------------
- * For many actions we have to walk the selection list and examine each selected
- * object to decide if a given common action is supported or not.
- * <p>
- * Walking this list multiple times while building the popup menu is a performance
- * hit, so we have this common method that does it only once, setting instance
- * variables for all of the decisions we are in interested in.
- * --------------------------------------------------------------------------------
- */
- protected void scanSelections()
- {
- // initial these variables to true. Then if set to false even once, leave as false always...
- _selectionShowRefreshAction = true;
- _selectionShowOpenViewActions = true;
- _selectionShowDeleteAction = true;
- _selectionShowRenameAction = true;
- _selectionEnableDeleteAction = true;
- _selectionEnableRenameAction = true;
- _selectionIsRemoteObject = true;
- _selectionFlagsUpdated = true;
-
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- Iterator elements = selection.iterator();
- while (elements.hasNext())
- {
- Object element = elements.next();
- ISystemViewElementAdapter adapter = getAdapter(element);
- if (adapter != null)
- {
- if (_selectionShowRefreshAction)
- _selectionShowRefreshAction = adapter.showRefresh(element);
-
- if (_selectionShowOpenViewActions)
- _selectionShowOpenViewActions = adapter.showOpenViewActions(element);
-
- if (_selectionShowDeleteAction)
- _selectionShowDeleteAction = adapter.showDelete(element);
-
- if (_selectionShowRenameAction)
- _selectionShowRenameAction = adapter.showRename(element);
-
- if (_selectionEnableDeleteAction)
- _selectionEnableDeleteAction = _selectionShowDeleteAction && adapter.canDelete(element);
- //System.out.println("ENABLE DELETE SET TO " + selectionEnableDeleteAction);
-
- if (_selectionEnableRenameAction)
- _selectionEnableRenameAction = _selectionShowRenameAction && adapter.canRename(element);
-
- if (_selectionIsRemoteObject)
- _selectionIsRemoteObject = (getRemoteAdapter(element) != null);
- }
- }
-
- }
-
-
- void handleKeyPressed(KeyEvent event)
- {
- //System.out.println("Key Pressed");
- //System.out.println("...event character : " + event.character + ", "+(int)event.character);
- //System.out.println("...event state mask: " + event.stateMask);
- //System.out.println("...CTRL : " + SWT.CTRL);
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection) getSelection()).size() > 0))
- {
- scanSelections();
- if (showDelete() && canDelete())
- {
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction) getDeleteAction();
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(this);
- dltAction.run();
- }
- }
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewPart.java
deleted file mode 100644
index 61b8c7749..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewPart.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.scratchpad;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.actions.SystemRefreshAction;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.IRSEViewPart;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.ViewPart;
-
-
-/**
- * This class is the Remote Scratchpad view.
- */
-public class SystemScratchpadViewPart extends ViewPart implements ISelectionListener, ISelectionChangedListener,
- ISystemResourceChangeListener, ISystemMessageLine, IRSEViewPart
-{
-
-
- private SystemScratchpadView _viewer;
-
- // common actions
- private SystemCopyToClipboardAction _copyAction;
- private SystemPasteFromClipboardAction _pasteAction;
- private SystemCommonDeleteAction _deleteAction;
- private ClearAction _clearAction;
- private ClearSelectedAction _clearSelectionAction;
-
- // for ISystemMessageLine
- private String _message, _errorMessage;
- private SystemMessage sysErrorMessage;
- private IStatusLineManager _statusLine = null;
-
- // constants
- public static final String ID = "org.eclipse.rse.ui.view.scratchpad.SystemScratchpadViewPart"; // matches id in plugin.xml, view tag
-
- public void setFocus()
- {
- _viewer.getControl().setFocus();
- }
-
- public SystemScratchpadView getViewer()
- {
- return _viewer;
- }
-
- public Viewer getRSEViewer()
- {
- return _viewer;
- }
-
- public void createPartControl(Composite parent)
- {
- Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
-
- _viewer = new SystemScratchpadView(tree, this);
- _viewer.setWorkbenchPart(this);
-
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.addSelectionListener(this);
- _viewer.addSelectionChangedListener(this);
- getSite().setSelectionProvider(_viewer);
-
- _viewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- handleDoubleClick(event);
- }
- });
-
- fillLocalToolBar();
-
- // register global edit actions
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
- Clipboard clipboard = registry.getSystemClipboard();
-
- CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
-
- _copyAction = new SystemCopyToClipboardAction(_viewer.getShell(), clipboard);
- _pasteAction = new SystemPasteFromClipboardAction(_viewer.getShell(), clipboard);
- _deleteAction = new SystemCommonDeleteAction(_viewer.getShell(), _viewer);
-
- editorActionHandler.setCopyAction(_copyAction);
- editorActionHandler.setPasteAction(_pasteAction);
- editorActionHandler.setDeleteAction(_deleteAction);
- //editorActionHandler.setSelectAllAction(new SelectAllAction());
-
- registry.addSystemResourceChangeListener(this);
-
- SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "scrp0000");
-
- setInput(registry.getSystemScratchPad());
-
- getSite().registerContextMenu(_viewer.getContextMenuManager(), _viewer);
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection sel)
- {
- }
-
- public void dispose()
- {
- ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
- selectionService.removeSelectionListener(this);
- _viewer.removeSelectionChangedListener(this);
-
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
-
- if (_viewer != null)
- {
- _viewer.dispose();
- }
-
- super.dispose();
- }
-
- private void handleDoubleClick(DoubleClickEvent event)
- {
- IStructuredSelection s = (IStructuredSelection) event.getSelection();
- Object element = s.getFirstElement();
-
- if (element == null)
- return;
-
- ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) element).getAdapter(ISystemViewElementAdapter.class);
- boolean alreadyHandled = false;
-
- if (adapter != null)
- {
- if (adapter.hasChildren(element))
- {
- setInput((IAdaptable) element);
- }
- else
- {
- alreadyHandled = adapter.handleDoubleClick(element);
- }
- }
- }
-
- public void updateActionStates()
- {
- if (_clearAction == null)
- fillLocalToolBar();
-
- _clearAction.checkEnabledState();
- _clearSelectionAction.checkEnabledState();
- }
-
- public void fillLocalToolBar()
- {
- //if (_refreshAction == null)
- if (_clearAction == null)
- {
- // refresh action
- //_refreshAction = new RefreshAction();
- _clearAction = new ClearAction(_viewer);
- _clearSelectionAction = new ClearSelectedAction(_viewer);
-
- }
-
- updateActionStates();
-
- IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolBarManager = actionBars.getToolBarManager();
- IMenuManager menuMgr = actionBars.getMenuManager();
-
- SystemRefreshAction refreshAction = new SystemRefreshAction(getShell());
- actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
- _statusLine = actionBars.getStatusLineManager();
-
- addToolBarItems(toolBarManager);
- addToolBarMenuItems(menuMgr);
- }
-
- private void addToolBarMenuItems(IMenuManager menuManager)
- {
- menuManager.removeAll();
- menuManager.add(_clearSelectionAction);
- menuManager.add(new Separator());
- menuManager.add(_clearAction);
- }
-
- private void addToolBarItems(IToolBarManager toolBarManager)
- {
- toolBarManager.removeAll();
- toolBarManager.add(_clearSelectionAction);
- toolBarManager.add(new Separator());
- toolBarManager.add(_clearAction);
- }
-
- public void selectionChanged(SelectionChangedEvent e)
- {
- // listener for this view
- updateActionStates();
-
- IStructuredSelection sel = (IStructuredSelection) e.getSelection();
- _copyAction.setEnabled(_copyAction.updateSelection(sel));
- _pasteAction.setEnabled(_pasteAction.updateSelection(sel));
- _deleteAction.setEnabled(_deleteAction.updateSelection(sel));
- }
-
- public void setInput(IAdaptable object)
- {
- setInput(object, null);
-
- }
-
- public void setInput(IAdaptable object, String[] filters)
- {
- if (_viewer != null && object != null)
- {
- _viewer.setInput(object);
-
- updateActionStates();
-
- }
- }
-
- /**
- * Used to asynchronously update the view whenever properties change.
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- Object child = event.getSource();
- Object parent = event.getParent();
- Object input = _viewer.getInput();
-
- if (event.getType() == ISystemResourceChangeEvents.EVENT_RENAME)
- {
- }
-
- if (parent == _viewer.getInput())
- {
- updateActionStates();
- }
- }
-
- public Shell getShell()
- {
- return _viewer.getShell();
- }
-
-
-// -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- _errorMessage = null;
- sysErrorMessage = null;
- if (_statusLine != null)
- _statusLine.setErrorMessage(_errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- _message = null;
- if (_statusLine != null)
- _statusLine.setMessage(_message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return _errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return _message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this._errorMessage = message;
- if (_statusLine != null)
- _statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this._message = message;
- if (_statusLine != null)
- _statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewProvider.java
deleted file mode 100644
index 3c29cc9d3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/scratchpad/SystemScratchpadViewProvider.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.scratchpad;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-
-/**
- * This is the content and label provider for the SystemScratchpadView.
- * This class is used both to populate the SystemScratchpadView but also
- * to resolve the icon and labels for the cells in the table/tree.
- *
- */
-public class SystemScratchpadViewProvider implements ILabelProvider, ITreeContentProvider
-{
-
-
- private ListenerList listeners = new ListenerList(1);
-
-
- /**
- * The cache of images that have been dispensed by this provider.
- * Maps ImageDescriptor->Image.
- */
- private Map imageTable = new Hashtable(40);
- private SystemScratchpadView _view;
-
- public SystemScratchpadViewProvider(SystemScratchpadView view)
- {
- super();
- _view = view;
- }
-
- public void inputChanged(Viewer visualPart, Object oldInput, Object newInput)
- {
- }
-
-
-
- public boolean isDeleted(Object element)
- {
- return false;
- }
-
- public Object[] getChildren(Object object)
- {
- return getElements(object);
- }
-
- public Object getParent(Object object)
- {
- return getAdapterFor(object).getParent(object);
- }
-
- public boolean hasChildren(Object object)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- return adapter.hasChildren(object);
- }
- else if (object instanceof IAdaptable)
- {
- IWorkbenchAdapter wa = (IWorkbenchAdapter)((IAdaptable)object).getAdapter(IWorkbenchAdapter.class);
- if (wa != null)
- return wa.getChildren(object).length > 0;
- }
- return false;
- }
-
- public Object getElementAt(Object object, int i)
- {
-
- return null;
- }
-
- protected ISystemViewElementAdapter getAdapterFor(Object object)
- {
- if (object instanceof IAdaptable)
- {
- IAdaptable adapt = (IAdaptable) object;
- ISystemViewElementAdapter result = (ISystemViewElementAdapter) adapt.getAdapter(ISystemViewElementAdapter.class);
- if (result != null)
- {
- result.setPropertySourceInput(object);
- result.setViewer(_view);
- return result;
- }
- }
- return null;
- }
-
- public Object[] getElements(Object object)
- {
- Object[] results = null;
-
- if (object instanceof IAdaptable)
- {
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null && adapter.hasChildren(object))
- {
- results = adapter.getChildren(object);
- }
- else
- {
- IWorkbenchAdapter wa = (IWorkbenchAdapter)((IAdaptable)object).getAdapter(IWorkbenchAdapter.class);
- if (wa != null)
- return wa.getChildren(object);
- }
- }
- if (results == null)
- {
- return new Object[0];
- }
-
- return results;
- }
-
- public String getText(Object object)
- {
- if (object instanceof String)
- {
- return (String)object;
- }
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- return adapter.getText(object);
- }
- else if (object instanceof IAdaptable)
- {
- IWorkbenchAdapter wa = (IWorkbenchAdapter)((IAdaptable)object).getAdapter(IWorkbenchAdapter.class);
- if (wa != null)
- {
- return wa.getLabel(object);
- }
- }
- return object.toString();
- }
-
- public Image getImage(Object object)
- {
- Image image = null;
- if (object instanceof String)
- {
- return null;
- }
- ISystemViewElementAdapter adapter = getAdapterFor(object);
- if (adapter != null)
- {
- ImageDescriptor descriptor = adapter.getImageDescriptor(object);
-
-
- if (descriptor != null)
- {
- Object iobj = imageTable.get(descriptor);
- if (iobj == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- else
- {
- image = (Image) iobj;
- }
- }
- return image;
- }
- else if (object instanceof IAdaptable)
- {
- IWorkbenchAdapter wa = (IWorkbenchAdapter)((IAdaptable)object).getAdapter(IWorkbenchAdapter.class);
- if (wa != null)
- {
- ImageDescriptor descriptor = wa.getImageDescriptor(object);
- if (descriptor != null)
- {
- Object iobj = imageTable.get(descriptor);
- if (iobj == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- else
- {
- image = (Image) iobj;
- }
- }
- return image;
- }
- }
- return null;
- }
-
-
- public void addListener(ILabelProviderListener listener)
- {
- listeners.add(listener);
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- listeners.remove(listener);
- }
-
- public void dispose()
- {
- // TODO Auto-generated method stub
-
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchClearHistoryAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchClearHistoryAction.java
deleted file mode 100644
index 48521302c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchClearHistoryAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This action clears the history in the Remote Search view.
- */
-public class SystemSearchClearHistoryAction extends SystemBaseAction {
-
- private SystemSearchViewPart searchView;
-
- /**
- * Constructor for action.
- * @param searchView the remote search view.
- * @param shell the shell.
- */
- public SystemSearchClearHistoryAction(SystemSearchViewPart searchView, Shell shell) {
- super(SystemResources.RESID_SEARCH_CLEAR_HISTORY_LABEL,SystemResources.RESID_SEARCH_CLEAR_HISTORY_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SEARCH_CLEAR_HISTORY_ID), shell);
-
- this.searchView = searchView;
- RSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, RSEUIPlugin.HELPPREFIX + "search_clear_history");
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- searchView.deleteAllPages();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchCopyToClipboardAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchCopyToClipboardAction.java
deleted file mode 100644
index 3c1c99cb3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchCopyToClipboardAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.ui.actions.SystemCopyToClipboardAction;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Action that copies objects selected in Remote Search view to clipboard.
- */
-public class SystemSearchCopyToClipboardAction extends SystemCopyToClipboardAction {
-
- /**
- * Constructor.
- * @param shell the shell.
- * @param clipboard the system clipboard.
- */
- public SystemSearchCopyToClipboardAction(Shell shell, Clipboard clipboard) {
- super(shell, clipboard);
- }
-
- /**
- * Returns the string "\t" if the object is a remote search result, otherwise returns the super class
- * implementation.
- * @see org.eclipse.rse.ui.actions.SystemCopyToClipboardAction#getTextTransferPrepend(java.lang.Object, org.eclipse.rse.ui.view.ISystemViewElementAdapter)
- */
- protected String getTextTransferPrepend(Object obj, ISystemViewElementAdapter adapter) {
- /** shouldn't be coupled with search (files ui)
- if (adapter instanceof SystemViewRemoteSearchResultAdapter)
- {
- return "\t";
- }
- else
- **/
- {
- return super.getTextTransferPrepend(obj, adapter);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchHistoryAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchHistoryAction.java
deleted file mode 100644
index 63050e1b7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchHistoryAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-/**
- * This is the history action for the remote system search view.
- */
-public class SystemSearchHistoryAction extends Action {
-
-
-
- private SystemSearchViewPart searchView;
- private int index;
-
- /**
- * Constructor for SystemSearchHistoryAction.
- * @param text the text for the action.
- * @param image the image.
- * @param searchView the search view.
- * @param index the index in the history.
- */
- public SystemSearchHistoryAction(String text, ImageDescriptor image, SystemSearchViewPart searchView, int index) {
- super(text, image);
- setToolTipText(text);
- this.searchView = searchView;
- this.index = index;
- RSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, RSEUIPlugin.HELPPREFIX + "search_history");
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- searchView.showSearchResult(index);
- }
-
- /**
- * Sets the text and the tooltip.
- * @see org.eclipse.jface.action.IAction#setText(java.lang.String)
- */
- public void setText(String text) {
- super.setText(text);
- setToolTipText(text);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveAllMatchesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveAllMatchesAction.java
deleted file mode 100644
index d27c4626e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveAllMatchesAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This action removes all matches from the Remote Search view.
- */
-public class SystemSearchRemoveAllMatchesAction extends SystemBaseAction {
-
- private SystemSearchViewPart searchView;
-
- /**
- * Constructor for action.
- * @param searchView the remote search view.
- * @param shell the shell.
- */
- public SystemSearchRemoveAllMatchesAction(SystemSearchViewPart searchView, Shell shell) {
- super(SystemResources.RESID_SEARCH_REMOVE_ALL_MATCHES_LABEL,SystemResources.RESID_SEARCH_REMOVE_ALL_MATCHES_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES_ID),
- shell);
-
- this.searchView = searchView;
- RSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, RSEUIPlugin.HELPPREFIX + "search_remove_all");
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- searchView.deleteCurrentPage();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveSelectedMatchesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveSelectedMatchesAction.java
deleted file mode 100644
index 57f762958..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchRemoveSelectedMatchesAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This action removes selected matches from the Remote Search view.
- */
-public class SystemSearchRemoveSelectedMatchesAction extends SystemBaseAction {
-
- private SystemSearchViewPart searchView;
-
- /**
- * Constructor for action.
- * @param searchView the remote search view.
- * @param shell the shell.
- */
- public SystemSearchRemoveSelectedMatchesAction(SystemSearchViewPart searchView, Shell shell) {
- super(SystemResources.RESID_SEARCH_REMOVE_SELECTED_MATCHES_LABEL,SystemResources.RESID_SEARCH_REMOVE_SELECTED_MATCHES_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID),
- shell);
-
- this.searchView = searchView;
- RSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, RSEUIPlugin.HELPPREFIX + "search_remove_selected");
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- searchView.deleteSelected();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableView.java
deleted file mode 100644
index 8f545b043..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableView.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import java.util.Vector;
-
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.model.ISystemRemoteChangeEvent;
-import org.eclipse.rse.model.ISystemRemoteChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
-import org.eclipse.rse.services.search.IHostSearchResultSet;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemDecoratingLabelProvider;
-import org.eclipse.rse.ui.view.SystemTableTreeView;
-import org.eclipse.rse.ui.view.SystemTableTreeViewProvider;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.Widget;
-
-
-public class SystemSearchTableView extends SystemTableTreeView
-{
-
-
- private boolean _firstRefresh = true;
- private IHostSearchResultSet resultSet;
-
- public SystemSearchTableView(Tree tabletree, IHostSearchResultSet resultSet, ISystemMessageLine msgLine)
- {
- super(tabletree, msgLine);
- this.resultSet = resultSet;
-
- _provider.disableDeferredQueries(true);
- setLabelProvider(new SystemDecoratingLabelProvider(_provider, RSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
- }
-
- public IHostSearchResultSet getResultSet() {
- return resultSet;
- }
-
-
- public void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
- {
- int eventType = event.getEventType();
-
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider)getContentProvider();
-
- IHostSearchResultSet resultSet = null;
-
- if (getInput() instanceof IHostSearchResultSet) {
- resultSet = (IHostSearchResultSet)getInput();
- }
-
- if (resultSet == null) {
- return;
- }
-
- switch (eventType)
- {
- // --------------------------
- // REMOTE RESOURCE DELETED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
- {
- {
- Object remoteResource = event.getResource();
- Vector remoteResourceNames = null;
-
- if (remoteResource instanceof Vector)
- {
- remoteResourceNames = (Vector) remoteResource;
- remoteResource = remoteResourceNames.elementAt(0);
- }
- else
- {
- remoteResourceNames = new Vector();
- remoteResourceNames.add(remoteResource);
- }
-
- for (int d = 0; d < remoteResourceNames.size(); d++)
- {
- Object dchild = remoteResourceNames.get(d);
-
- ISystemViewElementAdapter dadapt = getAdapter(dchild);
- ISubSystem dSubSystem = dadapt.getSubSystem(dchild);
- String dkey = dadapt.getAbsoluteName(dchild);
-
- // this will use cache if there is one already
- // note: do not call provider.getCache() since the
- // cache is changed if getChildren() is called with
- // an object other than the input (so if we expand
- // a tree node then the cache will be the children
- // of that node, and not the root nodes of the tree)
- Object[] children = provider.getChildren(resultSet);
-
- for (int i = 0; i < children.length; i++)
- {
- Object existingChild = children[i];
-
- if (existingChild != null)
- {
- ISystemViewElementAdapter eadapt = getAdapter(existingChild);
- ISubSystem eSubSystem = eadapt.getSubSystem(existingChild);
-
- if (dSubSystem == eSubSystem)
- {
- String ekey = eadapt.getAbsoluteName(existingChild);
-
- boolean matches = false;
-
- // to compare absolute paths, check whether the system
- // is case sensitive or not
- if (dSubSystem.getSubSystemConfiguration().isCaseSensitive()) {
- matches = ekey.equals(dkey);
- }
- else {
- matches = ekey.equalsIgnoreCase(dkey);
- }
-
- if (matches)
- {
- resultSet.removeResult(existingChild);
- provider.setCache(resultSet.getAllResults());
- remove(existingChild);
- }
- }
- }
- }
- }
- }
-
- }
- break;
-
- // --------------------------
- // REMOTE RESOURCE RENAMED...
- // --------------------------
- case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED :
- {
- Object resource = event.getResource();
- // String resourceOldPath = event.getOldName();
-
- /** FIXME - IREmoteFile is systems.core independent now
- // we only care about remote file renames
- if (resource instanceof IRemoteFile) {
-
- ISystemRemoteElementAdapter adapter = getRemoteAdapter(resource);
- resourceSubSystem = adapter.getSubSystem(resource);
-
- if (resourceSubSystem == null) {
- return;
- }
- }
- else
- {
- return;
- }
- */
- if (true) // DKM - hack to avoid this
- return;
- if (provider != null)
- {
- // this will use cache if there is one already
- // note: do not call provider.getCache() since the
- // cache is changed if getChildren() is called with
- // an object other than the input (so if we expand
- // a tree node then the cache will be the children
- // of that node, and not the root nodes of the tree)
- Object[] children = provider.getChildren(resultSet);
-
- for (int i = 0; i < children.length; i++)
- {
- Object child = children[i];
-
- // found same object. This means:
- // a) rename happened in this view, or
- // b) we are using the same object to populate this view
- // and another view, and the rename happened in the
- // other view
- if (child == resource)
- {
- Widget widget = findItem(child);
-
- if (widget != null)
- {
- update(child, null);
- return;
- }
- }
-
- /** FIXME - IREmoteFile is systems.core independent now
- // did not find object
- // rename happened in another view and we are not populating
- // this view and the other view with the same object
- else if (child instanceof IRemoteFile)
- {
- ISystemRemoteElementAdapter adapt = getRemoteAdapter(child);
- ISubSystem childSubSystem = adapt.getSubSystem(child);
-
- // check if both are from the same subsystem
- if (childSubSystem == resourceSubSystem) {
-
- String childPath = adapt.getAbsoluteName(child);
-
- // find out if system is case sensitive
- boolean isCaseSensitive = resourceSubSystem.getParentSubSystemConfiguration().isCaseSensitive();
-
- boolean matches = false;
-
- // look for the child whose path matches the old path of the resource
- if (isCaseSensitive) {
- matches = childPath.equals(resourceOldPath);
- }
- else {
- matches = childPath.equalsIgnoreCase(resourceOldPath);
- }
-
- // if paths match, update the object and then update the view
- if (matches) {
-
-
-
- // now update label for child
- Widget widget = findItem(child);
-
- if (widget != null) {
- update(child, null);
- return;
- }
- }
- }
- }*/
-
- }
- }
- break;
- }
- default :
- super.systemRemoteResourceChanged(event);
- break;
- }
- }
-
- protected void doUpdateItem(Widget widget, Object element, boolean flag)
- {
- if (_firstRefresh)
- {
- computeLayout(true);
- _firstRefresh = false;
- }
-
- super.doUpdateItem(widget, element, flag);
- }
-
- public void systemResourceChanged(ISystemResourceChangeEvent event) {
- Object actualSource = event.getSource();
-
- switch (event.getType()) {
-
- case ISystemResourceChangeEvents.EVENT_REFRESH :
-
- if (actualSource == null) {
- return;
- }
-
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider)getContentProvider();
-
- if (provider == null) {
- return;
- }
-
- if (actualSource instanceof IHostSearchResultConfiguration) {
-
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)actualSource;
- IHostSearchResultSet resultSet = config.getParentResultSet();
-
- if (resultSet == getInput()) {
- // this will use cache if there is one already
- // note: do not call provider.getCache() since the
- // cache is changed if getChildren() is called with
- // an object other than the input (so if we expand
- // a tree node then the cache will be the children
- // of that node, and not the root nodes of the tree)
- Object[] previousResults = provider.getCachedObjects(resultSet);
- Object[] newResults = resultSet.getAllResults();
-
- int newSize = newResults.length;
-
- // merge items so only one creation
- if ((previousResults == null || previousResults.length == 0) && newResults.length != 0) {
- provider.flushCache();
- refresh(getInput());
-
- }
- else if (previousResults != null) {
-
- int deltaSize = newSize - previousResults.length;
-
- if (deltaSize > 0) {
-
- Object[] delta = new Object[deltaSize];
- int d = 0;
-
- for (int i = 0; i < newSize; i++) {
- Object nobj = newResults[i];
-
- if (previousResults.length > i) {
- Object pobj = previousResults[i];
-
- if (pobj == null) {
- delta[d] = nobj;
- d++;
- }
- }
- else {
- delta[d] = nobj;
- d++;
- }
- }
-
- // must set the cache before calling add()
- provider.setCache(newResults);
-
- // set the cached objects
- provider.setCachedObjects(resultSet, newResults);
-
- if (delta.length > 2000) {
- internalRefresh(getInput());
- }
- else {
- add(getInput(), delta);
- }
- }
- }
- }
- }
-
- break;
-
- default :
- super.systemResourceChanged(event);
- break;
- }
- }
-
- protected Object getParentForContent(Object element)
- {
- return getAdapter(element).getParent(element);
- }
-
-
- /**
- * Does nothing.
- * @see org.eclipse.rse.ui.view.SystemTableTreeView#handleKeyPressed(org.eclipse.swt.events.KeyEvent)
- */
- protected void handleKeyPressed(KeyEvent event) {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableViewProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableViewProvider.java
deleted file mode 100644
index 992e7f459..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchTableViewProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.ui.view.SystemTableTreeViewProvider;
-import org.eclipse.rse.ui.view.SystemTableViewColumnManager;
-
-public class SystemSearchTableViewProvider extends SystemTableTreeViewProvider
-{
-
- public SystemSearchTableViewProvider(SystemTableViewColumnManager columnManager)
- {
- super(columnManager);
- }
-
- public String getText(Object object)
- {
- String text = getAdapterFor(object).getName(object);
- /** FIXME - IREmoteFile is systems.core independent now
- if (object instanceof IRemoteFile) {
- IRemoteFile parent = ((IRemoteFile)object).getParentRemoteFile();
- String absolutePath = getAdapterFor(parent).getAbsoluteName(parent);
- return text + " - " + absolutePath;
- }
- else {
- return text;
- }
- */
- return text;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchUI.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchUI.java
deleted file mode 100644
index d46fcd775..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchUI.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.ui.PartInitException;
-
-
-/**
- * A singleton class for dealing with Remote Search view
- */
-public class SystemSearchUI {
-
-
-
- // singleton instance
- private static SystemSearchUI instance;
-
- // search view id
- public static final String SEARCH_RESULT_VIEW_ID = "org.eclipse.rse.ui.view.SystemSearchView";
-
- /**
- * Constructor for SystemSearchUI.
- */
- private SystemSearchUI() {
- super();
- }
-
- /**
- * Get the singleton instance.
- * @return the singleton object of this type
- */
- public static SystemSearchUI getInstance() {
-
- if (instance == null) {
- instance = new SystemSearchUI();
- }
-
- return instance;
- }
-
- /**
- * Activate search result view.
- * @return <code>true</code> if successful, <code>false</false> otherwise
- */
- public SystemSearchViewPart activateSearchResultView() {
-
- SystemSearchViewPart searchView = null;
-
- try {
- searchView = (SystemSearchViewPart)(SystemBasePlugin.getActiveWorkbenchWindow().getActivePage().showView(SystemSearchUI.SEARCH_RESULT_VIEW_ID));
- }
- catch (PartInitException e) {
- SystemBasePlugin.logError("Can not open search result view", e);
- }
-
- return searchView;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewContentProvider.java
deleted file mode 100644
index a7d63c3fd..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewContentProvider.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.ui.part.ViewPart;
-
-
-/**
- * This class is the content provider for the remote systems search viewer.
- */
-public class SystemSearchViewContentProvider implements ITreeContentProvider {
-
-
- private ViewPart viewPart;
-
- /**
- * Constructor for SystemSearchViewContentProvider.
- */
- public SystemSearchViewContentProvider() {
- super();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
-
- if (parentElement == null) {
- return null;
- }
-
- if (parentElement instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(parentElement);
-
- if (adapter == null) {
- return null;
- }
- else {
- return adapter.getChildren(parentElement);
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element) {
-
- if (element == null) {
- return null;
- }
-
- if (element instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (adapter == null) {
- return null;
- }
- else {
- return adapter.getParent(element);
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
-
- if (element == null) {
- return false;
- }
-
- if (element instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (adapter == null) {
- return false;
- }
- else {
- return adapter.hasChildren(element);
- }
- }
-
- return false;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
-
- if (inputElement == null) {
- return null;
- }
-
- if (inputElement instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(inputElement);
-
- if (adapter == null) {
- return null;
- }
- else {
- return adapter.getChildren(inputElement);
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- if (newInput == null) {
- return;
- }
-
- if (newInput instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(newInput);
-
- if (adapter != null) {
- viewer.refresh();
- }
- }
- }
-
- /**
- * Get the adapter for the given object.
- * @param the object
- * @return the adapter
- */
- public ISystemViewElementAdapter getAdapter(Object element)
- {
- return SystemAdapterHelpers.getAdapter(element);
- }
- /**
- * Set the ViewPart of this provider
- * @param ViewPart of this provider
- */
- public void setViewPart(ViewPart viewPart)
- {
- this.viewPart = viewPart;
- }
- /**
- * Get the ViewPart of this provider
- * @return ViewPart of this provider
- */
- public ViewPart getViewPart()
- {
- return viewPart;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewLabelProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewLabelProvider.java
deleted file mode 100644
index a8eee8db1..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewLabelProvider.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * This is the label provider for the remote systems search view.
- */
-public class SystemSearchViewLabelProvider extends LabelProvider {
-
-
-
- /**
- * Constructor for SystemSearchViewLabelProvider.
- */
- public SystemSearchViewLabelProvider() {
- super();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object)
- */
- public Image getImage(Object element) {
-
- if (element == null) {
- return null;
- }
-
- if (element instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (adapter != null) {
- ImageDescriptor descriptor = adapter.getImageDescriptor(element);
-
- if (descriptor != null) {
- return descriptor.createImage();
- }
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
- */
- public String getText(Object element) {
-
- if (element == null) {
- return null;
- }
-
- if (element instanceof IAdaptable) {
- ISystemViewElementAdapter adapter = getAdapter(element);
-
- if (adapter != null) {
- return adapter.getText(element);
- }
- }
-
- return null;
- }
-
- /**
- * Get the adapter for the given object.
- * @param the object
- * @return the adapter
- */
- public ISystemViewElementAdapter getAdapter(Object element)
- {
- return SystemAdapterHelpers.getAdapter(element);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewPart.java
deleted file mode 100644
index 645cde406..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/search/SystemSearchViewPart.java
+++ /dev/null
@@ -1,1281 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.search;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.model.SystemRegistry;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
-import org.eclipse.rse.services.search.IHostSearchResultSet;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.IRSEViewPart;
-import org.eclipse.rse.ui.view.ISystemRemoveElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemTableTreeViewProvider;
-import org.eclipse.rse.ui.view.SystemView;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-
-
-
-/**
- * This class defines the Remote Search view.
- */
-public class SystemSearchViewPart extends ViewPart
- implements ISystemResourceChangeListener,
- IMenuListener, ISelectionChangedListener,
- ISystemMessageLine, IRSEViewPart
-{
- private PageBook pageBook;
- private StructuredViewer currentViewer;
-
- private IActionBars actionBars;
- private IMenuManager mMgr;
- private IToolBarManager tbMgr;
- //private IStatusLineManager slMgr;
-
- private static final String MENU_HISTORY_GROUP_NAME = "historyGroup";
- private static final String MENU_CLEAR_HISTORY_GROUP_NAME = "clearHistoryGroup";
-
- private ArrayList viewers = new ArrayList();
- private ArrayList historyActions = new ArrayList();
-
- private CancelAction cancelAction;
- private SystemSearchClearHistoryAction clearHistoryAction;
- private SystemSearchRemoveSelectedMatchesAction removeSelectedAction;
- private SystemSearchRemoveAllMatchesAction removeAllAction;
-
- private SystemSearchCopyToClipboardAction copyAction;
- private SystemPasteFromClipboardAction pasteAction;
-
- // for ISystemMessageLine
- private String _message, _errorMessage;
- private SystemMessage sysErrorMessage;
- private IStatusLineManager _statusLine = null;
-
-
- /**
- * Double click listener.
- */
- public class SystemSearchDoubleClickListener implements IDoubleClickListener {
-
- /**
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IStructuredSelection selection = (IStructuredSelection) (event.getSelection());
-
- if (!selection.isEmpty()) {
- Object element = selection.getFirstElement();
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapter.setViewer(currentViewer);
- adapter.handleDoubleClick(element);
- }
- }
- }
-
- class SelectAllAction extends Action {
-
- public SelectAllAction() {
- super(SystemResources.ACTION_SELECT_ALL_LABEL, null);
- }
-
- public void run() {
-
- if ((currentViewer != null) && (currentViewer instanceof TableViewer)) {
- TableViewer viewer = (TableViewer) currentViewer;
- viewer.getTable().selectAll();
- // force viewer selection change
- viewer.setSelection(viewer.getSelection());
- }
- }
- }
-
- public class CancelAction extends Action {
-
- public CancelAction() {
- super(SystemResources.ACTION_CANCEL_SEARCH_LABEL, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_STOP_ID));
- setToolTipText(SystemResources.ACTION_CANCEL_SEARCH_TOOLTIP);
- RSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, RSEUIPlugin.HELPPREFIX + "search_cancel");
- }
-
- public void run() {
-
- if (currentViewer == null) {
- return;
- }
-
- Object input = currentViewer.getInput();
-
- if (input != null) {
-
- if (input instanceof IHostSearchResultSet) {
- IHostSearchResultSet resultSet = (IHostSearchResultSet)input;
- setEnabled(false);
- resultSet.cancel();
- }
- }
- }
-
- public void updateEnableState(IAdaptable input) {
-
- // no input yet, so disable it
- if (input == null) {
- setEnabled(false);
- }
-
- if (input instanceof IHostSearchResultSet) {
- IHostSearchResultSet set = (IHostSearchResultSet)input;
-
- // running, so enable it
- if (set.isRunning()) {
- setEnabled(true);
- }
- // otherwise, disable
- else {
- setEnabled(false);
- }
- }
- // some other input, disable it
- else {
- setEnabled(false);
- }
- }
- }
-
- /**
- * Constructor for SystemSearchViewPart.
- */
- public SystemSearchViewPart() {
- super();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
-
- // create the page book
- pageBook = new PageBook(parent, SWT.NONE);
-
- // pageBook.showPage(createDummyControl());
-
- // get view site
- IViewSite site = getViewSite();
-
- // set a dummy selection provider
- // getSite().setSelectionProvider(createDummySelectionProvider());
-
- // get action bars
- actionBars = site.getActionBars();
-
- // get the menu manager
- mMgr = actionBars.getMenuManager();
-
- // get the tool bar manager
- tbMgr = actionBars.getToolBarManager();
-
- _statusLine = actionBars.getStatusLineManager();
-
-
- // initialize toolbar actions
- initToolBarActions(tbMgr);
-
- // get the status line manager
- //slMgr = actionBars.getStatusLineManager();
-
- // update action bars
- actionBars.updateActionBars();
-
- // add view as a system listener
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
-
- // set help
- SystemWidgetHelpers.setHelp(pageBook, RSEUIPlugin.HELPPREFIX + "srch0000");
- }
-
- private void initToolBarActions(IToolBarManager tbMgr) {
-
- // create cancel action
- if (cancelAction == null) {
- cancelAction = new CancelAction();
-
- if (currentViewer == null) {
- cancelAction.setEnabled(false);
- }
- else if (currentViewer.getInput() == null){
- cancelAction.setEnabled(false);
- }
- else {
- cancelAction.setEnabled(true);
- }
- }
-
- // create remove selected matches action
- if (removeSelectedAction == null) {
- removeSelectedAction = new SystemSearchRemoveSelectedMatchesAction(this, getShell());
-
- if (currentViewer == null) {
- removeSelectedAction.setEnabled(false);
- }
- else {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
- }
-
- // create remove all matches action
- if (removeAllAction == null) {
- removeAllAction = new SystemSearchRemoveAllMatchesAction(this, getShell());
-
- if (currentViewer == null) {
- removeAllAction.setEnabled(false);
- }
- else {
- Object input = currentViewer.getInput();
- removeAllAction.setEnabled(isRemoveAllEnabled((IAdaptable)input));
- }
- }
-
- // add cancel action
- tbMgr.add(cancelAction);
-
- // add remove selected action
- tbMgr.add(removeSelectedAction);
-
- // add remove all action
- tbMgr.add(removeAllAction);
-
- // register global edit actions
- SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
-
- // clipboard
- Clipboard clipboard = registry.getSystemClipboard();
-
- Shell shell = registry.getShell();
-
- copyAction = new SystemSearchCopyToClipboardAction(shell, clipboard);
- pasteAction = new SystemPasteFromClipboardAction(shell, clipboard);
-
- CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
-
- editorActionHandler.setCopyAction(copyAction);
- editorActionHandler.setPasteAction(pasteAction);
- editorActionHandler.setDeleteAction(removeSelectedAction);
- // editorActionHandler.setSelectAllAction(new SelectAllAction());
- }
-
- /**
- * Updates the remove selected action.
- * @return <code>true</code> if remove selected action should be enabled, <code>false</code> otherwise.
- */
- private boolean isRemoveSelectedEnabled() {
-
- ISelection selection = getSelection();
-
- if (selection == null) {
- return false;
- }
- else if (selection.isEmpty()) {
- return false;
- }
- else {
-
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection strSel = (IStructuredSelection)selection;
-
- // note that SystemSearchTableView returns the current input
- // if the actual selection is null
- // so we check for it and return null
- if (strSel.getFirstElement() == currentViewer.getInput()) {
- return false;
- }
- else {
- return true;
- }
- }
- else {
- return false;
- }
- }
- }
-
- /**
- * Updates the remove all matches action.
- * @param input the input to the current viewer, or <code>null</code> if there is currently no input.
- * @return <code>true</code> if remove all action should be enabled, <code>false</code> otherwise.
- */
- private boolean isRemoveAllEnabled(IAdaptable input) {
-
- if (input == null) {
- return false;
- }
-
- ISystemViewElementAdapter adapter = getAdapter(input);
-
- if (adapter == null) {
- return false;
- }
- else {
- return adapter.hasChildren(input);
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- pageBook.setFocus();
- }
-
- /**
- * @see org.eclipse.ui.IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- }
-
- /**
- * @see org.eclipse.ui.IViewPart#saveState(IMemento)
- */
- public void saveState(IMemento memento) {
- super.saveState(memento);
- }
-
- /**
- * Add a search result set.
- * @param resultSet the search result set
- */
- public void addSearchResult(IAdaptable resultSet) {
-
- // if the correct adapter is not registered, then return
- ISystemViewElementAdapter adapter = getAdapter(resultSet);
-
- if (adapter == null) {
- return;
- }
-
- if (resultSet instanceof IHostSearchResultSet) {
- currentViewer = createSearchResultsTable((IHostSearchResultSet)resultSet, adapter);
- }
- else {
- currentViewer = createSearchResultsTree(resultSet, adapter);
-
- TreeViewer treeViewer = (TreeViewer)currentViewer;
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- Tree tree = (Tree)treeViewer.getControl();
- Menu menu = menuMgr.createContextMenu(tree);
- tree.setMenu(menu);
- }
-
- // set input
- currentViewer.setInput(resultSet);
-
- // add as selection changed listener to current viewer
- currentViewer.addSelectionChangedListener(this);
-
- // set as selection provider
- getSite().setSelectionProvider(currentViewer);
-
- // add double click listener
- currentViewer.addDoubleClickListener(new SystemSearchDoubleClickListener());
-
- // set help for control
- SystemWidgetHelpers.setHelp(currentViewer.getControl(), RSEUIPlugin.HELPPREFIX + "srch0000");
-
- // add current viewer to viewer list
- viewers.add(currentViewer);
-
- // get title to use from adapter
- String title = adapter.getText(resultSet);
-
- // set the title of the view
- setContentDescription(title);
-
- int num = viewers.size()-1;
-
- // create history action
- SystemSearchHistoryAction historyAction = new SystemSearchHistoryAction(title, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT_ID), this, num);
-
- // add to list of history actions
- historyActions.add(historyAction);
-
- // if this is the first result set, add the clear history action
- if (viewers.size() == 1) {
-
- // create a group for history actions
- mMgr.add(new GroupMarker(MENU_HISTORY_GROUP_NAME));
-
- // create a separator with a group for clear history action
- mMgr.add(new Separator(MENU_CLEAR_HISTORY_GROUP_NAME));
-
- // add the clear history action to the group
- clearHistoryAction = new SystemSearchClearHistoryAction(this, getShell());
- mMgr.appendToGroup(MENU_CLEAR_HISTORY_GROUP_NAME, clearHistoryAction);
- }
-
- // add history action to the menu manager
- mMgr.appendToGroup(MENU_HISTORY_GROUP_NAME, historyAction);
-
- // add global actions
- // actionBars.setGlobalActionHandler(ActionFactory.DELETE, new SystemSearchDeleteAction(this));
-
- // update action bars
- actionBars.updateActionBars();
-
- // show the control
- pageBook.showPage(currentViewer.getControl());
-
- // enable/disable state for this input
- if (cancelAction != null) {
- cancelAction.updateEnableState(resultSet);
- }
-
- // enable/disable state
- if (removeSelectedAction != null) {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
-
- // enable/disable state for this input
- if (removeAllAction != null) {
- removeAllAction.setEnabled(isRemoveAllEnabled(resultSet));
- }
- }
-
- private StructuredViewer createSearchResultsTree(IAdaptable resultSet, ISystemViewElementAdapter adapter)
- {
-
- // create the current tree
- Tree currentControl = new Tree(pageBook, SWT.MULTI);
-
- // create the current viewer
- TreeViewer currentViewer = new TreeViewer(currentControl);
- currentViewer.setUseHashlookup(true);
- currentViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
-
- // create a new content provider
- SystemSearchViewContentProvider contentProvider = new SystemSearchViewContentProvider();
- // save the viewpart to the provider
- contentProvider.setViewPart(this);
- // add the content provider to the viewer
- currentViewer.setContentProvider(contentProvider);
-
- // create a new label provider
- SystemSearchViewLabelProvider labelProvider = new SystemSearchViewLabelProvider();
-
- // add the label provider to the viewer
- currentViewer.setLabelProvider(labelProvider);
-
- return currentViewer;
- }
-
- private StructuredViewer createSearchResultsTable(IHostSearchResultSet resultSet, ISystemViewElementAdapter adapter) {
-
- // create table portion
- // TODO change to tabletree when eclipse fixes the swt widget
- //TableTree table = new TableTree(pageBook, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- Tree tabletree = new Tree(pageBook, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- SystemSearchTableView viewer = new SystemSearchTableView(tabletree, resultSet, this);
- viewer.setWorkbenchPart(this);
-
- getSite().registerContextMenu(viewer.getContextMenuManager(), viewer);
- return viewer;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
-
- // remove as resource change listener
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
-
- // clear viewers
- clearViewers();
-
- // clear arrays
- viewers.clear();
- historyActions.clear();
-
- // call super as required
- super.dispose();
- }
-
- /**
- * Remove current viewer as selection provider, removes children of all the inputs and disposes
- * the controls if they haven't already been disposed.
- */
- private void clearViewers() {
-
- // remove current viewer as selection provider if it exists
- if (currentViewer != null) {
-
- // remove as selection changed listener to current viewer
- currentViewer.removeSelectionChangedListener(this);
-
- if (getSite().getSelectionProvider() == currentViewer) {
- getSite().setSelectionProvider(null);
- }
- }
-
- for (int i = 0; i < viewers.size(); i++) {
-
- Object viewer = viewers.get(i);
-
- // if we're dealing with universal search
- if (viewer instanceof SystemSearchTableView) {
-
- SystemSearchTableView tableView = (SystemSearchTableView)viewer;
-
- Object input = tableView.getInput();
-
- // dispose the remote search result set
- // which cancels the search and removes contents from the input
- // (i.e. removes from model)
- if (input instanceof IHostSearchResultSet) {
- IHostSearchResultSet set = (IHostSearchResultSet)input;
- set.dispose();
- }
-
- // dispose viewer
- tableView.dispose();
- }
- // other search
- else if (viewer instanceof TreeViewer){
-
- TreeViewer treeView = (TreeViewer)viewer;
-
- Object input = treeView.getInput();
-
- ISystemViewElementAdapter adapter = getAdapter(input);
-
- if (adapter != null && adapter instanceof ISystemRemoveElementAdapter) {
- ISystemRemoveElementAdapter rmAdapter = (ISystemRemoveElementAdapter)adapter;
- rmAdapter.removeAllChildren(input);
-
- Control control = treeView.getControl();
-
- if (!control.isDisposed()) {
- control.dispose();
- }
- }
- }
- }
- }
-
- /**
- * Show search result with the given index.
- * @param index the index in the result history list
- */
- public void showSearchResult(int index) {
-
- // remove as selection listener from current viewer
- if (currentViewer != null) {
- currentViewer.removeSelectionChangedListener(this);
- }
-
- // get viewer with this index and make it current
- currentViewer = (StructuredViewer)(viewers.get(index));
-
- // set as selection provider
- getSite().setSelectionProvider(currentViewer);
-
- // add as selection changed listener to current viewer
- currentViewer.addSelectionChangedListener(this);
-
- // get the input
- IAdaptable resultSet = (IAdaptable)(currentViewer.getInput());
-
- if (resultSet == null) {
- return;
- }
-
- ISystemViewElementAdapter adapter = getAdapter(resultSet);
-
- // if the correct adapter is not registered, then return
- if (adapter == null) {
- return;
- }
-
- // get title to use from adapter
- String title = adapter.getText(resultSet);
-
- // set the title of the view
- setContentDescription(title);
-
- // get the associated control
- Control currentControl = currentViewer.getControl();
-
- // show the control
- pageBook.showPage(currentControl);
-
- // enable/disable state for this input
- if (cancelAction != null) {
- cancelAction.updateEnableState(resultSet);
- }
-
- // enable/disable state
- if (removeSelectedAction != null) {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
-
- // enable/disable state for this input
- if (removeAllAction != null) {
- removeAllAction.setEnabled(isRemoveAllEnabled(resultSet));
- }
- }
-
- /**
- * Delete the selected object in the view.
- * @return <code>true</code> if the selection has been deleted, <code>false</code> otherwise.
- */
- public boolean deleteSelected() {
-
- if (currentViewer == null) {
- return false;
- }
-
- IStructuredSelection selection = (IStructuredSelection)(currentViewer.getSelection());
-
- if (selection == null || selection.isEmpty()) {
- return false;
- }
-
- Object input = currentViewer.getInput();
-
- ISystemViewElementAdapter adapter = getAdapter(input);
-
- // adapter should be an instance of ISystemRemoveElementAdapter
- if (adapter == null || !(adapter instanceof ISystemRemoveElementAdapter)) {
- return false;
- }
-
- Iterator elements = selection.iterator();
-
- ArrayList removeElements = new ArrayList();
-
- while (elements.hasNext()) {
- Object element = elements.next();
- ((ISystemRemoveElementAdapter)adapter).remove(input, element);
- removeElements.add(element);
- }
-
- // current viewer should be an instance of tree viewer
- // remove the elements from it to update the view
- if (currentViewer instanceof TreeViewer) {
- ((TreeViewer)currentViewer).remove(removeElements.toArray());
- }
-
- // get title to use from adapter
- String title = adapter.getText(input);
-
- // set the title of the view
- setContentDescription(title);
-
- // enable/disable state for this input
- if (cancelAction != null) {
- cancelAction.updateEnableState((IAdaptable)input);
- }
-
- // enable/disable state for this input
- if (removeSelectedAction != null) {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
-
- // enable/disable state for this input
- if (removeAllAction != null) {
- removeAllAction.setEnabled(isRemoveAllEnabled((IAdaptable)input));
- }
-
- return true;
- }
-
- /**
- * Deletes all the pages in the view.
- * @return <code>true</code> if all pages have been deleted, <code>false</code> otherwise.
- */
- public boolean deleteAllPages() {
-
- // first show a dummy control in page book
- // this must be done before viewers are cleared
- // reason is that current showing control in page book can not be disposed
- // SWT doesn't seem to like it
- // This is fixed in 3.0
- pageBook.showPage(createDummyControl());
-
- // clear viewers
- clearViewers();
-
- // current viewer is null again
- currentViewer = null;
-
- // clear the viewer list
- viewers.clear();
-
- // disable cancel action
- cancelAction.setEnabled(false);
-
- // disable remove all action
- removeSelectedAction.setEnabled(false);
-
- // disable remove all action
- removeAllAction.setEnabled(false);
-
- // clear the history action list
- historyActions.clear();
-
- // get rid of all menu manager actions
- mMgr.removeAll();
-
- // update action bars
- actionBars.updateActionBars();
-
- // clear the content description
- setContentDescription("");
-
- return true;
- }
-
- /**
- * Creates a dummy control to show in the page book.
- * @return a dummy control.
- */
- private Control createDummyControl() {
- Control control = new Composite(pageBook, SWT.NONE);
- return control;
- }
-
- /**
- * Deletes the current page.
- * @return <code>true</code> if the current page has been deleted, <code>false</code> otherwise.
- */
- public boolean deleteCurrentPage() {
-
- // remove current viewer as selection provider if it exists
- if (currentViewer != null) {
-
- // remove as selection changed listener to current viewer
- currentViewer.removeSelectionChangedListener(this);
-
- if (getSite().getSelectionProvider() == currentViewer) {
- getSite().setSelectionProvider(null);
- }
- }
- else {
- return false;
- }
-
- Object input = currentViewer.getInput();
-
- ISystemViewElementAdapter adapter = getAdapter(input);
-
- // universal search
- if (currentViewer instanceof SystemSearchTableView)
- {
-
- SystemSearchTableView tableView = (SystemSearchTableView)currentViewer;
-
- // remove viewer as listener
- tableView.removeAsListener();
-
- // clear model
- if (input instanceof IHostSearchResultSet) {
- IHostSearchResultSet set = (IHostSearchResultSet)input;
- set.dispose();
- }
-
- // now refresh viewer
- // but flush cache of the provider first for an accurate refresh
- SystemTableTreeViewProvider provider = (SystemTableTreeViewProvider)(tableView.getContentProvider());
- provider.flushCache();
- tableView.refresh();
- }
- // other search
- else if (currentViewer instanceof TreeViewer){
-
- TreeViewer treeView = (TreeViewer)currentViewer;
-
- if (adapter != null && adapter instanceof ISystemRemoveElementAdapter) {
- ISystemRemoveElementAdapter rmAdapter = (ISystemRemoveElementAdapter)adapter;
- rmAdapter.removeAllChildren(input);
- treeView.refresh();
- }
- }
-
- // get title to use from adapter
- String title = adapter.getText(input);
-
- // set the title of the view
- setContentDescription(title);
-
- // disable cancel action
- cancelAction.setEnabled(false);
-
- // disable remove selected action
- removeSelectedAction.setEnabled(false);
-
- // disable remove all action
- removeAllAction.setEnabled(false);
-
- return true;
- }
-
- /**
- * Get the adapter for the given object.
- * @param element the object the object for which I want the adapter.
- * @return the adapter for the object.
- */
- public ISystemViewElementAdapter getAdapter(Object element) {
- return SystemAdapterHelpers.getAdapter(element);
- }
-
- /**
- * Get the shell.
- * @return the shell
- */
- public Shell getShell() {
- return getSite().getShell();
- }
-
- public void systemResourceChanged(ISystemResourceChangeEvent event) {
-
- // need to introduce another event type for this....
- if (event.getType() == ISystemResourceChangeEvents.EVENT_SEARCH_FINISHED) {
-
- // the view is added as a system listener when the part is created
- // so the current viewer may not exist if the search results has not been added yet
- if (currentViewer == null) {
- return;
- }
-
- Object actualSource = event.getSource();
-
- if (actualSource instanceof IHostSearchResultConfiguration) {
-
- IHostSearchResultSet source = ((IHostSearchResultConfiguration)actualSource).getParentResultSet();
-
- // get title to use from adapter
- ISystemViewElementAdapter adapter = getAdapter(source);
-
- if (adapter == null) {
- return;
- }
-
- int index = -1;
-
- // if the source is the input to the current viewer
- // update view title and cancel action
- // also update the history action corresponding to the current view
- if (currentViewer.getInput() == source) {
-
- // end of a search
- String title = adapter.getText(source);
-
- // set the title of the view
- setContentDescription(title);
-
- // enable/disable state for this input
- if (cancelAction != null) {
- cancelAction.updateEnableState((IAdaptable)source);
- }
-
- // enable/disable state for this input
- if (removeSelectedAction != null) {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
-
- // enable/disable state for this input
- if (removeAllAction != null) {
- removeAllAction.setEnabled(isRemoveAllEnabled((IAdaptable)source));
- }
-
- // find out where the current viewer is in the viewer list
- index = viewers.indexOf(currentViewer);
- }
- // if the source is not the input to the current view
- // we simply update the history action
- else {
-
- for (int i = 0; i < viewers.size(); i++) {
-
- SystemSearchTableView view = (SystemSearchTableView)viewers.get(i);
-
- if (view.getInput() == source) {
- index = i;
- break;
- }
- }
- }
-
- // since the history actions list paralles the viewer list, use the index to
- // get the history action
- if (index >= 0) {
- SystemSearchHistoryAction historyAction = (SystemSearchHistoryAction)historyActions.get(index);
- historyAction.setText(adapter.getText(source));
- }
- }
- }
- }
-
- //------------------------------------------------------
- // Methods used by the tree view pop-up menu
- //------------------------------------------------------
- /**
- * Fill context for the tree view pop-up menu.
- * @param menu the menu manager.
- */
- public void fillContextMenu(IMenuManager menu)
- {
- IStructuredSelection selection = (IStructuredSelection)currentViewer.getSelection();
-
- if (selection == null) {
- return;
- }
-
- int selectionCount = selection.size();
-
- if (selectionCount == 0) { // nothing selected
- return;
- }
- else {
-
- // if only one selection, check if selection is the input
- // if so add no actions
- if (selectionCount == 1) {
-
- if (selection.getFirstElement() == currentViewer.getInput()) {
- return;
- }
- }
-
- // if selection count is more than 1
- // check if all have same parent
- // if not, check if they have ancestor relationship
- // if so, add no actions
-// if (selectionCount > 1) {
-// boolean allSelectionsFromSameParent = sameParent();
-//
-// // if all selections do not have the same parent, do not show anything in the menu
-// if (!allSelectionsFromSameParent) {
-//
-// if (selectionHasAncestryRelationship()) {
-// // don't show the menu because actions with
-// // multiple select on objects that are ancestors
-// // of each other is problematic
-// // still create the standard groups
-// SystemView.createStandardGroups(menu);
-// return;
-// }
-// }
-// }
-
- // partition into groups...
- SystemView.createStandardGroups(menu);
-
- // adapter actions
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
- Object element = selection.getFirstElement();
- ISystemViewElementAdapter adapter = getAdapter(element);
- adapter.setViewer(currentViewer);
- adapter.addActions(ourMenu, selection,
- getShell(),
- ISystemContextMenuConstants.GROUP_ADAPTERS);
- }
- }
-
- /**
- * This is called to ensure all elements in a multiple-selection have the same parent in the
- * tree viewer. If they don't we automatically disable all actions.
- * <p>
- * Designed to be as fast as possible by going directly to the SWT widgets
- */
- public boolean sameParent()
- {
- boolean same = true;
-
- Tree tree = null;
-
- if (currentViewer instanceof AbstractTreeViewer) {
- tree = (Tree)(currentViewer.getControl());
- }
- else {
- return false;
- }
-
- TreeItem[] items = tree.getSelection();
-
- if ((items == null) || (items.length == 0))
- return true;
-
- TreeItem prevParent = null;
- TreeItem currParent = null;
-
- for (int idx=0; same && (idx<items.length); idx++)
- {
- currParent = items[idx].getParentItem();
-
- if ((idx>0) && (currParent != prevParent))
- {
- same = false;
- }
- else
- {
- prevParent = currParent;
- }
- }
-
- return same;
- }
-
- /**
- * Called when the context menu is about to open.
- * Calls {@link #fillContextMenu(IMenuManager)}
- */
- public void menuAboutToShow(IMenuManager menu)
- {
- fillContextMenu(menu);
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- currentViewer.addSelectionChangedListener(listener);
- }
-
- /**
- * Returns the current selection for this provider.
- *
- * @return the current selection
- */
- public ISelection getSelection()
- {
- if (currentViewer == null) {
- return null;
- }
- else {
- return currentViewer.getSelection();
- }
- }
- /**
- * Removes the given selection change listener from this selection provider.
- * Has no affect if an identical listener is not registered.
- *
- * @param listener a selection changed listener
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- currentViewer.removeSelectionChangedListener(listener);
- }
- /**
- * Sets the current selection for this selection provider.
- *
- * @param selection the new selection
- */
- public void setSelection(ISelection selection)
- {
- currentViewer.setSelection(selection);
- }
- /**
- * Set the title of this view part
- * @param title
- */
- public void setViewPartTitle(String title)
- {
- setContentDescription(title);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
-
- if (event.getSelectionProvider() == currentViewer) {
- removeSelectedAction.setEnabled(isRemoveSelectedEnabled());
- }
- else {
- removeSelectedAction.setEnabled(false);
- }
-
- IStructuredSelection sel = (IStructuredSelection)(event.getSelection());
-
- Iterator iter = sel.iterator();
-
- // set viewer for adapters of the selected elements
- while (iter.hasNext()) {
- ISystemViewElementAdapter adapter = getAdapter(iter.next());
- adapter.setViewer(currentViewer);
- }
-
- copyAction.setEnabled(copyAction.updateSelection(sel));
- pasteAction.setEnabled(pasteAction.updateSelection(sel));
- }
-
- /**
- * Gets the current viewer, i.e. the viewer whose control is being currently displayed in the view.
- * @return the current viewer, or <code>null</code> if there is no current viewer.
- */
- public StructuredViewer getCurrentViewer() {
- return currentViewer;
- }
-
- public Viewer getRSEViewer()
- {
- return currentViewer;
- }
-
-// -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- _errorMessage = null;
- sysErrorMessage = null;
- if (_statusLine != null)
- _statusLine.setErrorMessage(_errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- _message = null;
- if (_statusLine != null)
- _statusLine.setMessage(_message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return _errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return _message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this._errorMessage = message;
- if (_statusLine != null)
- _statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this._message = message;
- if (_statusLine != null)
- _statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemResourceAdaptableProfile.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemResourceAdaptableProfile.java
deleted file mode 100644
index 7bcd0b77d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemResourceAdaptableProfile.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.rse.core.model.ISystemProfile;
-
-/**
- * This class wrappers a SystemProfile and adapts it to an IResource
- * by mapping to its underlying folder.
- */
-public class SystemResourceAdaptableProfile
-{
- /**
- * Constructor
- */
- public SystemResourceAdaptableProfile(ISystemProfile profile)
- {
- super();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamView.java
deleted file mode 100644
index 17e454a4b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamView.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.view.ISystemSelectAllTarget;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-
-//import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-
-/**
- * We specialize tree viewer for the Team view, so we know
- * when we are dealing with the team view in common code.
- */
-public class SystemTeamView extends TreeViewer implements ISystemSelectAllTarget, ISystemResourceChangeListener
-{
- private SystemTeamViewPart teamViewPart;
-
- /**
- * @param parent
- */
- public SystemTeamView(Composite parent, SystemTeamViewPart teamViewPart)
- {
- super(parent);
- this.teamViewPart = teamViewPart;
- SystemWidgetHelpers.setHelp(getTree(), RSEUIPlugin.HELPPREFIX+"teamview");
- }
-
- /**
- * @param parent
- * @param style
- */
- public SystemTeamView(Composite parent, int style, SystemTeamViewPart teamViewPart)
- {
- super(parent, style);
- this.teamViewPart = teamViewPart;
- SystemWidgetHelpers.setHelp(getTree(), RSEUIPlugin.HELPPREFIX+"teamview");
- }
-
- /**
- * @param tree
- */
- public SystemTeamView(Tree tree, SystemTeamViewPart teamViewPart)
- {
- super(tree);
- this.teamViewPart = teamViewPart;
- SystemWidgetHelpers.setHelp(getTree(), RSEUIPlugin.HELPPREFIX+"teamview");
- }
-
- /**
- * Return the part view part of this tree view
- */
- public SystemTeamViewPart getTeamViewPart()
- {
- return teamViewPart;
- }
-
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- */
- public Object[] getElementNodes(Object element)
- {
- Widget w = findItem(element);
- if ((w != null) && (w instanceof TreeItem))
- return getElementNodes((TreeItem)w);
- return null;
- }
- /**
- * This returns an array containing each element in the tree, up to but not including the root.
- * The array is in reverse order, starting at the leaf and going up.
- * This flavour is optimized for the case when you have the tree item directly.
- */
- public Object[] getElementNodes(TreeItem item)
- {
- Vector v = new Vector();
- v.addElement(item.getData());
- while (item != null)
- {
- item = item.getParentItem();
- if (item != null)
- v.addElement(item.getData());
- }
- Object[] nodes = new Object[v.size()];
- for (int idx=0; idx<nodes.length; idx++)
- nodes[idx] = v.elementAt(idx);
- return nodes;
- }
-
- /**
- * Use findItem to find a tree item given its data object, or null if given object not in tree.
- */
- public TreeItem findTreeItem(Object dataObject)
- {
- Widget widget = findItem(dataObject);
- if (widget instanceof TreeItem)
- return (TreeItem)widget;
- else
- return null;
- }
- /**
- * Given a tree item, search the immediate children for an item representing the given object.
- */
- public TreeItem findChildTreeItem(TreeItem parentItem, Object dataObject)
- {
- TreeItem[] childItems = parentItem.getItems();
- TreeItem childItem = null;
- for (int idx=0; (childItem==null) && (idx<childItems.length); idx++)
- {
- if ((childItems[idx].getData() != null) && childItems[idx].getData().equals(dataObject))
- childItem = childItems[idx];
- }
- return childItem;
- }
-
- /**
- * Called when a property is updated and we need to inform the Property Sheet viewer.
- * There is no formal mechanism for this so we simulate a selection changed event as
- * this is the only event the property sheet listens for.
- */
- public void updatePropertySheet()
- {
- ISelection selection = getSelection();
- if (selection == null)
- return;
- // create an event
- SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection());
- // fire the event
- fireSelectionChanged(event);
- }
-
- // ----------------------------------------
- // ISystemResourceChangeListener methods...
- // ----------------------------------------
-
- /**
- * Called when something changes in the model
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- int type = event.getType();
- Object src = event.getSource();
- Object parent = event.getParent();
- switch(type)
- {
- case ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL:
- collapseToLevel(getInput(), AbstractTreeViewer.ALL_LEVELS);
- break;
- }
- }
-
- /**
- * Return the shell
- */
- public Shell getShell()
- {
- return super.getControl().getShell();
- }
-
- // -----------------------------------------------------------------
- // ISystemSelectAllTarget methods to facilitate the global action...
- // -----------------------------------------------------------------
- /**
- * Return true if select all should be enabled for the given object.
- * For a tree view, you should return true if and only if the selected object has children.
- * You can use the passed in selection or ignore it and query your own selection.
- */
- public boolean enableSelectAll(IStructuredSelection selection)
- {
- Tree tree = getTree();
- TreeItem[] items = tree.getSelection();
- if ((items==null) || (items.length!=1)) // only allow for single selections
- return false;
-
- TreeItem ti = items[0];
- int count = getItemCount(ti);
- if (count == 1) // is it a dummy?
- {
- if ((getItems(ti)[0]).getData() == null)
- count = 0; // assume a dummy
- }
- return (count > 0);
- }
- /**
- * When this action is run via Edit->Select All or via Ctrl+A, perform the
- * select all action. For a tree view, this should select all the children
- * of the given selected object. You can use the passed in selected object
- * or ignore it and query the selected object yourself.
- */
- public void doSelectAll(IStructuredSelection selection)
- {
- Tree tree = getTree();
- TreeItem[] currSel = tree.getSelection();
- TreeItem[] childItems = currSel[0].getItems();
- if (childItems.length == 0)
- return;
- tree.setSelection(childItems);
- Object[] childObjects = new Object[childItems.length];
- for (int idx=0; idx<childObjects.length; idx++)
- childObjects[idx] = childItems[idx].getData();
- fireSelectionChanged(
- new SelectionChangedEvent(this,
- new StructuredSelection(childObjects)));
- }
-
- /**
- * Handles a collapse-selected request
- */
- public void collapseSelected()
- {
- TreeItem[] selectedItems = ((Tree)getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length>0))
- {
- for (int idx=0; idx<selectedItems.length; idx++)
- selectedItems[idx].setExpanded(false);
- }
- }
- /**
- * Handles an expand-selected request
- */
- public void expandSelected()
- {
- TreeItem[] selectedItems = ((Tree)getControl()).getSelection();
- if ((selectedItems != null) && (selectedItems.length>0))
- {
- for (int idx=0; idx<selectedItems.length; idx++)
- {
- if (!selectedItems[idx].getExpanded())
- {
- createChildren(selectedItems[idx]);
- }
- selectedItems[idx].setExpanded(true);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewActiveProfileAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewActiveProfileAction.java
deleted file mode 100644
index 0a6928308..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewActiveProfileAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to activate/de-activate a selected profile.
- * @deprecated
- * TODO: delete this action after next MRI rev, as it will be replaced by
- * {@link org.eclipse.rse.ui.view.team.SystemTeamViewActiveProfileAction} and
- * {@link org.eclipse.rse.ui.view.team.SystemTeamViewMakeInActiveProfileAction}.
- */
-public class SystemTeamViewActiveProfileAction extends SystemBaseAction
-
-{
-
- /**
- * Constructor
- */
- public SystemTeamViewActiveProfileAction(Shell parent)
- {
- super(SystemResources.ACTION_PROFILE_ACTIVATE_LABEL,SystemResources.ACTION_PROFILE_ACTIVATE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID),
- parent);
- allowOnMultipleSelection(true); // as requested by WSDD team
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- setHelp(RSEUIPlugin.HELPPREFIX+"actnactp"); //$NON-NLS-1$
- setChecked(false);
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- ISystemProfile profile = (ISystemProfile)getFirstSelection();
- if (profile == null)
- return false;
- ISystemProfileManager mgr = SystemProfileManager.getSystemProfileManager();
- // todo... we need to have two actions, one to make active, and one to make inactive.
- while (profile != null)
- {
- setChecked(mgr.isSystemProfileActive(profile.getName()));
- profile = (ISystemProfile)getNextSelection();
- }
- return true;
- }
-
- /**
- * This is the method called when the user selects this action.
- */
- public void run()
- {
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISystemProfile profile = (ISystemProfile)getFirstSelection();
- boolean check = isChecked();
- while (profile != null)
- {
- sr.setSystemProfileActive(profile, check);
- profile = (ISystemProfile)getNextSelection();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryAdapter.java
deleted file mode 100644
index 790cf81e2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryAdapter.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.ISystemUserIdConstants;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying and processing SystemTeamViewCategoryNode objects in tree views, such as
- * the Team view.
- */
-public class SystemTeamViewCategoryAdapter
- extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter, ISystemUserIdConstants
-{
-
- private boolean actionsCreated = false;
- //private Hashtable categoriesByProfile = new Hashtable();
-
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (!actionsCreated)
- createActions();
- //menu.add(menuGroup, copyAction);
- }
- private void createActions()
- {
- actionsCreated = true;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getImageDescriptor();
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getLabel();
- }
-
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getLabel();
- }
-
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getProfile() + "." + category.getLabel(); //$NON-NLS-1$
- }
-
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return SystemViewResources.RESID_PROPERTY_TEAM_CATEGORY_TYPE_VALUE;
- }
-
- /**
- * Return the string to display in the status line when the given object is selected.
- * We return:
- */
- public String getStatusLineText(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return SystemResources.RESID_TEAMVIEW_CATEGORY_VALUE + ": " + category.getLabel() + " - " + category.getDescription(); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Return the parent of this object. We return the RemoteSystemsConnections project
- */
- public Object getParent(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getProfile();
- }
-
- /**
- * Return the children of this profile.
- */
- public Object[] getChildren(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- ISystemProfile profile = category.getProfile();
- String categoryType = category.getMementoHandle();
- if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_CONNECTIONS))
- {
- return profile.getHosts();
- }
- else
- return createSubSystemConfigurationNodes(profile, category);
- }
- /**
- * Create subsystem factory child nodes for expanded category node
- */
- private SystemTeamViewSubSystemConfigurationNode[] createSubSystemConfigurationNodes(ISystemProfile profile, SystemTeamViewCategoryNode category)
- {
- SystemTeamViewSubSystemConfigurationNode[] nodes = null;
-
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISubSystemConfiguration[] factories = sr.getSubSystemConfigurations();
- if (factories != null)
- {
- Vector v = new Vector();
- String categoryType = category.getMementoHandle();
- for (int idx=0; idx<factories.length; idx++)
- {
- boolean createNode = false;
- ISubSystemConfiguration ssf = factories[idx];
- if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS))
- {
- createNode = ssf.supportsFilters() && (profile.getFilterPools(ssf).length > 0);
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS))
- {
- createNode = ssf.supportsUserDefinedActions(); // && profile.getUserActions(ssf).length > 0;
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS))
- {
- createNode = ssf.supportsCompileActions(); // && profile.getCompileCommandTypes(ssf).length > 0;
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_TARGETS))
- {
- createNode = ssf.supportsTargets(); // && profile.getTargets(ssf).length > 0;
- }
- if (createNode)
- v.addElement(new SystemTeamViewSubSystemConfigurationNode(profile, category, factories[idx]));
- }
- nodes = new SystemTeamViewSubSystemConfigurationNode[v.size()];
- for (int idx=0; idx<nodes.length; idx++)
- {
- nodes[idx] = (SystemTeamViewSubSystemConfigurationNode)v.elementAt(idx);
- }
- }
- return nodes;
- }
-
- /**
- * Return true if this profile has children. We return true.
- */
- public boolean hasChildren(Object element)
- {
- return true;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties.
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- /*
- propertyDescriptorArray = new PropertyDescriptor[1];
- RSEUIPlugin plugin = RSEUIPlugin.getDefault();
- int idx = 0;
- // status
- propertyDescriptorArray[idx] = new PropertyDescriptor(ISystemPropertyConstants.P_IS_ACTIVE,
- SystemViewResources.RESID_PROPERTY_PROFILESTATUS_LABEL);
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_PROFILESTATUS_DESCRIPTION));
- ++idx;
- */
- }
- return propertyDescriptorArray;
- }
-
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param key - the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object internalGetPropertyValue(Object key)
- {
- /*
- if (name.equals(P_IS_ACTIVE))
- {
- boolean active = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName());
- if (active)
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL);
- else
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL);
- }
- else
- */
- return null;
- }
-
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- */
- public String getMementoHandle(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getMementoHandle();
- }
- /**
- * Return a short string to uniquely identify the type of resource.
- */
- public String getMementoHandleKey(Object element)
- {
- SystemTeamViewCategoryNode category = (SystemTeamViewCategoryNode)element;
- return category.getProfile().getName() + "." + category.getLabel(); //$NON-NLS-1$
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryNode.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryNode.java
deleted file mode 100644
index 403a80a21..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewCategoryNode.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.model.ISystemProfile;
-
-
-/**
- * This class represents a child node under a profile, in the Team view.
- * It represents expandable categories such as "Connections", "Filter Pools",
- * "User Actions" and "Compile Commands".
- */
-public class SystemTeamViewCategoryNode implements IAdaptable
-{
- private String label, mementoHandle, description;
- private ImageDescriptor imageDescriptor;
- private ISystemProfile profile;
- public static final String MEMENTO_CONNECTIONS = "conns"; //$NON-NLS-1$
- public static final String MEMENTO_FILTERPOOLS = "pools"; //$NON-NLS-1$
- public static final String MEMENTO_USERACTIONS = "actions"; //$NON-NLS-1$
- public static final String MEMENTO_COMPILECMDS = "cmds"; //$NON-NLS-1$
- public static final String MEMENTO_TARGETS = "targets"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public SystemTeamViewCategoryNode(ISystemProfile profile)
- {
- super();
- this.profile = profile;
- }
-
- /**
- * This is the method required by the IAdaptable interface.
- * Given an adapter class type, return an object castable to the type, or
- * null if this is not possible.
- */
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- /**
- * Return this node's image
- * @return the image to show in the tree, for this node
- */
- public ImageDescriptor getImageDescriptor()
- {
- return imageDescriptor;
- }
-
- /**
- * Return this node's label
- * @return the translated label to show in the tree, for this node
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Set the image for this node
- * @param descriptor ... the image to show in the tree, for this node
- */
- public void setImageDescriptor(ImageDescriptor descriptor)
- {
- imageDescriptor = descriptor;
- }
-
- /**
- * Set the label for this node
- * @param string ... the label to show in the tree, for this node
- */
- public void setLabel(String string)
- {
- label = string;
- }
- /**
- * Convert to string. We call getLabel()
- */
- public String toString()
- {
- return getLabel();
- }
-
- /**
- * @return profile this category is associated with
- */
- public ISystemProfile getProfile()
- {
- return profile;
- }
-
- /**
- * @param profile ... the profile this category is associated with
- */
- public void setProfile(ISystemProfile profile)
- {
- this.profile = profile;
- }
-
- /**
- * @return the untranslated value to store in the memento, to uniquely identify this node
- */
- public String getMementoHandle()
- {
- return mementoHandle;
- }
-
- /**
- * Set the untranslated value to store in the memento, to uniquely identify this node
- * @param string - untranslated value
- */
- public void setMementoHandle(String string)
- {
- mementoHandle = string;
- }
-
- /**
- * Return the description of this node. Shown on status line.
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Set the description of this node. Shown on status line.
- */
- public void setDescription(String string)
- {
- description = string;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewContentProvider.java
deleted file mode 100644
index 7c540e79f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewContentProvider.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewInputProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-
-
-/**
- * Content provider for the RSE's Team view part.
- */
-public class SystemTeamViewContentProvider extends WorkbenchContentProvider
-{
- private SystemTeamViewInputProvider inputProvider = null;
- private Viewer viewer;
- /**
- * Constructor
- */
- public SystemTeamViewContentProvider()
- {
- }
-
- /**
- * Return the children of the given node, when it is expanded
- */
- public Object[] getChildren(Object element)
- {
- Object[] children;
- // for the project root node, return the SystemProfile objects
- if (element instanceof IProject)
- {
- //IProject rseProject = (IProject)element;
- ISystemProfile[] profiles = RSEUIPlugin.getTheSystemRegistry().getAllSystemProfiles();
- children = profiles;
- //return profiles;
- }
- else
- {
- ISystemViewElementAdapter adapter = getSystemViewAdapter(element);
- if (adapter != null)
- children = adapter.getChildren(element);
- else
- children = super.getChildren(element);
- }
- /*
- String name = element.getClass().getName();
- if (element instanceof SystemTeamViewSubSystemConfigurationNode)
- {
- SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode)element;
- name = ssfNode.getParentCategory().getLabel() + "." + ssfNode.getSubSystemConfiguration().getName();
- }
- else if (element instanceof SystemTeamViewCategoryNode)
- {
- SystemTeamViewCategoryNode catNode = (SystemTeamViewCategoryNode)element;
- name = catNode.getLabel();
- }
- System.out.println(" "+Integer.toString(counter-1)+". In getChildren for object '"+name +"', returned "+((children==null)?"null":Integer.toString(children.length)));
- */
- return children;
- }
-
- /**
- * Return the parent of the given node
- */
- public Object getParent(Object element)
- {
- if (element instanceof ISystemProfile)
- return SystemResourceManager.getRemoteSystemsProject();
- ISystemViewElementAdapter adapter = getSystemViewAdapter(element);
- if (adapter != null)
- return adapter.getParent(element);
- return super.getParent(element);
- }
-
- /**
- * Return true if given element has children.
- */
- public boolean hasChildren(Object element)
- {
- boolean children = false;
- if (element instanceof IProject)
- children = (getChildren(element).length > 0);
- else
- {
- ISystemViewElementAdapter adapter = getSystemViewAdapter(element);
- if (adapter != null)
- children = adapter.hasChildren(element);
- else
- children = super.hasChildren(element);
- }
- /* debug info
- String name = element.getClass().getName();
- if (element instanceof SystemTeamViewSubSystemConfigurationNode)
- {
- SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode)element;
- name = ssfNode.getParentCategory().getLabel() + "." + ssfNode.getSubSystemConfiguration().getName();
- }
- else if (element instanceof SystemTeamViewCategoryNode)
- {
- SystemTeamViewCategoryNode catNode = (SystemTeamViewCategoryNode)element;
- name = catNode.getLabel();
- }
- System.out.println(Integer.toString(counter++)+". In hasChildren for object: '"+name+"', returned "+children);
- */
- return children;
- }
-
- /**
- * Return the roots elements to display in the tree initially.
- * For us, this is the RSE singleton project.
- */
- public Object[] getElements(Object element)
- {
- if (inputProvider == null)
- return new Object[0];
- else
- return inputProvider.getRoots(); // returns our single RSE project
- }
-
- /**
- * View is going away: dispose of any local resources
- */
- public void dispose()
- {
- super.dispose();
- // we need to remove this provider from the Workspace
- // ResourceChange listeners list. The parent dispose will
- // not do this for us.
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- }
-
- /**
- * This hooks this content provider as an IResourceChangeListener.<br>
- * We will not use parent code.
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.viewer = viewer;
-
- // TODO DKM - replace this with appropriate thing
- // super.viewer = viewer;
-
- // TODO DKM - get rid of inputChanged. I put it here temporarily so that there's a way to set super.viewer in 3.0
- super.inputChanged(viewer, oldInput, newInput);
-
- //System.out.println("inside inputChanged. oldInput = " + oldInput + ", newInput = " + newInput);
- if (newInput != null)
- {
- if (newInput instanceof SystemTeamViewInputProvider)
- {
- inputProvider = (SystemTeamViewInputProvider)newInput;
- /*
- getResourceDeltaHandler().registerTreeViewer((TreeViewer)viewer);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
- //IResourceChangeEvent.POST_AUTO_BUILD
- //IResourceChangeEvent.PRE_AUTO_BUILD
- IResourceChangeEvent.POST_CHANGE
- // IResourceChangeEvent.PRE_CLOSE
- //| IResourceChangeEvent.PRE_DELETE
- //| IResourceChangeEvent.POST_AUTO_BUILD
- );
- */
- }
- }
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getSystemViewAdapter(Object o)
- {
- ISystemViewElementAdapter adapter = null;
- if (o == null)
- {
- SystemBasePlugin.logWarning("ERROR: null passed to getAdapter in SystemTeamViewContentProvider");
- return null;
- }
- if (!(o instanceof IAdaptable))
- adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
- else
- adapter = (ISystemViewElementAdapter)((IAdaptable)o).getAdapter(ISystemViewElementAdapter.class);
- //if (adapter == null)
- // RSEUIPlugin.logWarning("ADAPTER IS NULL FOR ELEMENT OF TYPE: " + o.getClass().getName());
- if ((adapter!=null) && (viewer != null))
- {
- Shell shell = null;
- if (viewer instanceof ISystemResourceChangeListener)
- shell = ((ISystemResourceChangeListener)viewer).getShell();
- else if (viewer != null)
- shell = viewer.getControl().getShell();
- if (shell != null)
- adapter.setShell(shell);
- adapter.setViewer(viewer);
- if (viewer.getInput() instanceof ISystemViewInputProvider)
- {
- ISystemViewInputProvider inputProvider = (ISystemViewInputProvider)viewer.getInput();
- adapter.setInput(inputProvider);
- }
- }
- else if (viewer == null)
- SystemBasePlugin.logWarning("VIEWER IS NULL FOR SystemTeamViewContentProvider");
- return adapter;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewInputProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewInputProvider.java
deleted file mode 100644
index 7a4390f73..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewInputProvider.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.view.ISystemViewInputProvider;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Represents the input to the team viewer.
- * For now, this really doesn't do much since we always list the same thing.
- */
-public class SystemTeamViewInputProvider implements IAdaptable, ISystemViewInputProvider
-{
- private Object[] roots = new Object[1];
- private Shell shell;
- private Viewer viewer;
-
- /**
- * Constructor for SystemTeamViewInputProvider.
- */
- public SystemTeamViewInputProvider()
- {
- super();
- }
-
- /**
- * Return the roots to display in the team viewer.
- * This is simply the RSE singleton project
- */
- public Object[] getRoots()
- {
- if (roots[0] == null)
- roots[0] = SystemResourceManager.getRemoteSystemsProject();
- return roots;
- }
-
- /**
- * This is the method required by the IAdaptable interface.
- * Given an adapter class type, return an object castable to the type, or
- * null if this is not possible.
- */
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- // ----------------------------------------
- // Methods from ISystemViewInputProvider...
- // ----------------------------------------
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getSystemViewRoots()
- */
- public Object[] getSystemViewRoots()
- {
- return getRoots();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#hasSystemViewRoots()
- */
- public boolean hasSystemViewRoots()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#showingConnections()
- */
- public boolean showingConnections()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getConnectionChildren(org.eclipse.rse.model.IHost)
- */
- public Object[] getConnectionChildren(IHost selectedConnection)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#hasConnectionChildren(org.eclipse.rse.model.IHost)
- */
- public boolean hasConnectionChildren(IHost selectedConnection)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#setShell(org.eclipse.swt.widgets.Shell)
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getShell()
- */
- public Shell getShell()
- {
- return shell;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#setViewer(org.eclipse.jface.viewers.Viewer)
- */
- public void setViewer(Viewer viewer)
- {
- this.viewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer()
- */
- public Viewer getViewer()
- {
- return viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#showActionBar()
- */
- public boolean showActionBar()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#showButtonBar()
- */
- public boolean showButtonBar()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#showActions()
- */
- public boolean showActions()
- {
- return false;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewLabelProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewLabelProvider.java
deleted file mode 100644
index ccf933940..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewLabelProvider.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.model.ISystemResourceChangeListener;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.ISystemViewInputProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-
-/**
- * Base label provider for System Team View part
- */
-public class SystemTeamViewLabelProvider extends LabelProvider
-{
-
- public static final String Copyright =
- "(C) Copyright IBM Corp. 2002, 2003. All Rights Reserved.";
-
- // Used to grab Workbench standard icons.
- private WorkbenchLabelProvider aWorkbenchLabelProvider = new WorkbenchLabelProvider();
- private Viewer viewer;
- /**
- * The cache of images that have been dispensed by this provider.
- * Maps ImageDescriptor->Image.
- */
- private Map imageTable = new Hashtable(40);
-
- /**
- * Constructor
- */
- public SystemTeamViewLabelProvider(Viewer viewer)
- {
- super();
- this.viewer = viewer;
- }
- /**
- * Get the image to display
- */
- public Image getImage(Object element)
- {
- Image image = null;
-
- if (element instanceof ISystemProfile)
- {
- ISystemProfile profile = (ISystemProfile)element;
- if (RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName()))
- return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE_ID);
- else
- return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
- }
-
- // If we have a project, return the resource project images.
- else if (element instanceof IProject)
- {
- Image projectImage = aWorkbenchLabelProvider.getImage(element);
- return projectImage;
- }
-
- // User system view element adapter
- ISystemViewElementAdapter adapter = getSystemViewAdapter(element);
- if (adapter != null)
- {
- //return adapter.getImage(element);
- ImageDescriptor descriptor = adapter.getImageDescriptor(element);
- if (descriptor != null)
- {
- return getImageFromImageDescriptor(descriptor);
- }
- }
-
- // use Workbench stuff.
- image = aWorkbenchLabelProvider.getImage(element);
- if (image != null)
- {
- return image;
- }
-
- // all failed, use parent code.
- return super.getImage(element);
- }
- /**
- * Turn image descriptor into image
- */
- private Image getImageFromImageDescriptor(ImageDescriptor descriptor)
- {
- if (descriptor == null)
- return null;
- Image image = (Image) imageTable.get(descriptor);
- if (image == null)
- {
- image = descriptor.createImage();
- imageTable.put(descriptor, image);
- }
- return image;
-
- }
-
- /**
- * Get the label to display
- */
- public String getText(Object element)
- {
- ISystemViewElementAdapter adapter = getSystemViewAdapter(element);
- if (adapter != null)
- return adapter.getText(element);
-
- // If we have a project, return the resource project images.
- if (element instanceof IProject)
- {
- return ((IProject)element).getName();
- }
- // use Workbench stuff.
- String text = aWorkbenchLabelProvider.getText(element);
- if (text.length() > 0)
- return text;
-
- // all failed, use parent code.
- return super.getText(element);
- }
-
- /**
- * Dispose of images created here.<br>
- */
- public void dispose()
- {
- // The following we got from WorkbenchLabelProvider
- if (imageTable != null)
- {
- Collection imageValues = imageTable.values();
- if (imageValues!=null)
- {
- Iterator images = imageValues.iterator();
- if (images!=null)
- while (images.hasNext())
- ((Image)images.next()).dispose();
- imageTable = null;
- }
- }
- }
-
- /**
- * Returns the implementation of ISystemViewElement for the given
- * object. Returns null if the adapter is not defined or the
- * object is not adaptable.
- */
- protected ISystemViewElementAdapter getSystemViewAdapter(Object o)
- {
- ISystemViewElementAdapter adapter = null;
- if (o == null)
- {
- SystemBasePlugin.logWarning("ERROR: null passed to getAdapter in SystemTeamViewLabelProvider");
- return null;
- }
- if (!(o instanceof IAdaptable))
- adapter = (ISystemViewElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemViewElementAdapter.class);
- else
- adapter = (ISystemViewElementAdapter)((IAdaptable)o).getAdapter(ISystemViewElementAdapter.class);
- //if (adapter == null)
- // RSEUIPlugin.logWarning("ADAPTER IS NULL FOR ELEMENT OF TYPE: " + o.getClass().getName());
- if ((adapter!=null) && (viewer != null))
- {
- Shell shell = null;
- if (viewer instanceof ISystemResourceChangeListener)
- shell = ((ISystemResourceChangeListener)viewer).getShell();
- else if (viewer != null)
- shell = viewer.getControl().getShell();
- if (shell != null)
- adapter.setShell(shell);
- adapter.setViewer(viewer);
- if (viewer.getInput() instanceof ISystemViewInputProvider)
- {
- ISystemViewInputProvider inputProvider = (ISystemViewInputProvider)viewer.getInput();
- adapter.setInput(inputProvider);
- }
- }
- else if (viewer == null)
- SystemBasePlugin.logWarning("VIEWER IS NULL FOR SystemTeamViewLabelProvider");
- return adapter;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeActiveProfileAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeActiveProfileAction.java
deleted file mode 100644
index ed91464a6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeActiveProfileAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to activate all selected profiles
- */
-public class SystemTeamViewMakeActiveProfileAction extends SystemBaseAction
-
-{
-
- /**
- * Constructor
- */
- public SystemTeamViewMakeActiveProfileAction(Shell parent)
- {
- super(SystemResources.ACTION_PROFILE_MAKEACTIVE_LABEL,SystemResources.ACTION_PROFILE_MAKEACTIVE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- setHelp(RSEUIPlugin.HELPPREFIX+"ActionMakeActive"); //$NON-NLS-1$
- }
-
- /**
- * Here we decide whether to enable ths action or not. We enable it
- * if every selected object is a profile, and if its not the case
- * that every selected profile is already active.
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- Object currsel = getFirstSelection();
- if (!(currsel instanceof ISystemProfile))
- return false;
- ISystemProfile profile = (ISystemProfile)currsel;
- ISystemProfileManager mgr = SystemProfileManager.getSystemProfileManager();
- boolean allActive = true;
- while (profile != null)
- {
- if (!mgr.isSystemProfileActive(profile.getName()))
- allActive = false;
- currsel = getNextSelection();
- if ((currsel!=null) && !(currsel instanceof ISystemProfile))
- return false;
- profile = (ISystemProfile)currsel;
- }
- return !allActive;
- }
-
- /**
- * This is the method called when the user selects this action.
- * It walks through all the selected profiles and make them all active
- */
- public void run()
- {
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISystemProfile profile = (ISystemProfile)getFirstSelection();
- while (profile != null)
- {
- sr.setSystemProfileActive(profile, true);
- profile = (ISystemProfile)getNextSelection();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeInActiveProfileAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeInActiveProfileAction.java
deleted file mode 100644
index 458d707b7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewMakeInActiveProfileAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to de-activate all selected profiles
- */
-public class SystemTeamViewMakeInActiveProfileAction extends SystemBaseAction
-
-{
-
- /**
- * Constructor
- */
- public SystemTeamViewMakeInActiveProfileAction(Shell parent)
- {
- super(SystemResources.ACTION_PROFILE_MAKEINACTIVE_LABEL,SystemResources.ACTION_PROFILE_MAKEINACTIVE_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE_ID),
- parent);
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_CHANGE);
- setHelp(RSEUIPlugin.HELPPREFIX+"ActionMakeInactive"); //$NON-NLS-1$
- }
-
- /**
- * Here we decide whether to enable ths action or not. We enable it
- * if every selected object is a profile, and if its not the case
- * that every selected profile is already inactive.
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- Object currsel = getFirstSelection();
- if (!(currsel instanceof ISystemProfile))
- return false;
- ISystemProfile profile = (ISystemProfile)currsel;
- ISystemProfileManager mgr = SystemProfileManager.getSystemProfileManager();
- boolean allInActive = true;
- while (profile != null)
- {
- if (mgr.isSystemProfileActive(profile.getName()))
- allInActive = false;
- currsel = getNextSelection();
- if ((currsel!=null) && !(currsel instanceof ISystemProfile))
- return false;
- profile = (ISystemProfile)currsel;
- }
- return !allInActive;
- }
-
- /**
- * This is the method called when the user selects this action.
- * It walks through all the selected profiles and make them all inactive
- */
- public void run()
- {
- // TODO: test if attempting to disable all profiles, and issue an error
- // that at least one needs to be active. Or, at least a warning.
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISystemProfile profile = (ISystemProfile)getFirstSelection();
- while (profile != null)
- {
- sr.setSystemProfileActive(profile, false);
- profile = (ISystemProfile)getNextSelection();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewPart.java
deleted file mode 100644
index 03db718ca..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewPart.java
+++ /dev/null
@@ -1,1540 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.SameShellProvider;
-import org.eclipse.rse.core.SystemAdapterHelpers;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.filters.ISystemFilter;
-import org.eclipse.rse.core.filters.ISystemFilterPool;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemModelChangeEvent;
-import org.eclipse.rse.core.model.ISystemModelChangeEvents;
-import org.eclipse.rse.core.model.ISystemModelChangeListener;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemProfileManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.model.SystemStartHere;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemDeleteTarget;
-import org.eclipse.rse.ui.ISystemRenameTarget;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.ISystemAction;
-import org.eclipse.rse.ui.actions.SystemCollapseAllAction;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonSelectAllAction;
-import org.eclipse.rse.ui.actions.SystemNewProfileAction;
-import org.eclipse.rse.ui.actions.SystemSubMenuManager;
-import org.eclipse.rse.ui.actions.SystemTeamReloadAction;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.view.IRSEViewPart;
-import org.eclipse.rse.ui.view.ISystemMementoConstants;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewMenuListener;
-import org.eclipse.rse.ui.view.SystemViewPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.ui.part.ViewPart;
-import org.osgi.framework.Bundle;
-
-
-/**
- * The viewer and view part for the Team view
- */
-public class SystemTeamViewPart
- extends ViewPart
- implements ISetSelectionTarget, ISelectionProvider, ISystemModelChangeListener,
- ISystemMessageLine, ISelectionChangedListener,
- ISystemDeleteTarget, ISystemRenameTarget, IRSEViewPart
-{
-
- private boolean menuListenerAdded;
- public static final String ID = "org.eclipse.rse.ui.view.teamView";
-
- private SystemTeamViewInputProvider input = null;
- private SystemTeamView treeViewer = null;
- //private FrameList frameList = null;
- private IStatusLineManager statusLine = null;
- private String message, errorMessage;
- private SystemMessage sysErrorMessage;
-
- // selectionChangedListeners
- private ListenerList selectionChangedListeners = new ListenerList(ListenerList.IDENTITY);
-
- // context menu actions for project...
- protected SystemTeamReloadAction reloadRSEAction;
- protected SystemNewProfileAction newProfileAction;
- // common context menu actions...
- protected SystemCommonDeleteAction deleteAction;
- protected PropertyDialogAction propertyDialogAction;
- protected SystemTeamViewRefreshAllAction toolBarRefreshAllAction, menuRefreshAllAction;
- protected SystemCollapseAllAction collapseAllAction;
-
- protected ISystemViewElementAdapter profileAdapter = RSEUIPlugin.getDefault().getSystemViewAdapterFactory().getProfileAdapter();
-
- // remember-state variables...
- private IMemento fMemento;
- // state...
- static final String TAG_RELEASE= "release";
- static final String TAG_SELECTION= "selection";
- static final String TAG_EXPANDED_TO= "expandedTo";
- static final String TAG_EXPANDED= "expanded";
- static final String TAG_ELEMENT= "element";
- static final String TAG_PATH= "path";
- static final String TAG_INPUT= "svInput";
- static final String TAG_VERTICAL_POSITION= "verticalPosition";
- static final String TAG_HORIZONTAL_POSITION= "horizontalPosition";
- static final String MEMENTO_DELIM = "///";
-
- /**
- * Remove a selection change listener
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.remove(listener);
- }
- /**
- * Add a selection change listener
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.add(listener);
- }
-
- /**
- * Returns selection for the tree view
- */
- public ISelection getSelection()
- {
- return treeViewer.getSelection();
- }
-
- public void setSelection(ISelection selection)
- {
- treeViewer.setSelection(selection);
- }
-
- /**
- * Returns the tree viewer selection as a structured selection
- */
- public IStructuredSelection getStructuredSelection()
- {
- // we know we have a ss.
- return (IStructuredSelection) (treeViewer.getSelection());
- }
-
- public TreeViewer getTreeViewer() {
- return treeViewer;
- }
-
- public Viewer getRSEViewer()
- {
- return treeViewer;
- }
-
- /**
- * We are getting focus
- */
- public void setFocus()
- {
- if (treeViewer == null)
- return;
- Tree tree = treeViewer.getTree();
- if (tree != null)
- treeViewer.getTree().setFocus();
- }
-
- /**
- * Create the viewer to go in this view part.
- */
- public void createPartControl(Composite parent)
- {
- treeViewer =
- //new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- new SystemTeamView(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, this);
- treeViewer.setUseHashlookup(true);
- treeViewer.setContentProvider(new SystemTeamViewContentProvider());
- treeViewer.setLabelProvider(new SystemTeamViewLabelProvider(treeViewer));
-
- treeViewer.setInput(getInput());
-
- addTreeViewerListeners();
-
- // create the frame list.
- //frameList = createFrameList();
-
- // now update title of the view part.
- updateTitle();
-
- // Handle menus:
- // think about menu manager id later.
- MenuManager menuMgr = new MenuManager();
- menuMgr.setRemoveAllWhenShown(true);
- Menu menu = menuMgr.createContextMenu(treeViewer.getTree());
- treeViewer.getTree().setMenu(menu);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- fillContextMenu(manager);
- addMenuListener(manager);
- }
- });
- getSite().registerContextMenu(menuMgr, treeViewer);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- scrubOtherContributions(manager);
- }
- });
- // important to add our listener after registering, so we are called second!
- // This gives us the opportunity to scrub the contributions added by others, to screen out
- // non-team additions.
- /*
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- SystemTeamViewPart.this.fillContextMenu(manager);
- }
- });*/
-
- // Fill the action bars and update the global action handlers'
- // enabled state to match the current selection. We pass the selection
- // based on the iSeries object model. The action group will handle
- // delegating the correct object model to the actions.
- fillActionBars(getViewSite().getActionBars());
- //updateActionBars(getStructuredSelection());
-
- // this is a must here to get Properties Pages to work.
- getSite().setSelectionProvider(treeViewer);
- //getSite().setSelectionProvider(this);
-
- // Update status line.
- statusLine = getViewSite().getActionBars().getStatusLineManager();
- //updateStatusLine(getStructuredSelection());
-
- // we need to refresh viewer when page gets activated for Marker updates
- //pageListener = new CurrentPageListener(getSite().getPage());
- //getSite().getWorkbenchWindow().addPageListener(pageListener);
-
- // update F1 help
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IF1HelpContextID.NAV01);
-
- RSEUIPlugin.getTheSystemRegistry().addSystemModelChangeListener(this);
-
- treeViewer.setAutoExpandLevel(2); // dang, it doesn't work!
-
- // ----------------------
- // Restore previous state
- // ----------------------
- if (fMemento != null)
- restoreState(fMemento);
- fMemento= null;
- }
-
- private void addMenuListener(IMenuManager menu) {
- if (!menuListenerAdded)
- {
- if (menu instanceof MenuManager)
- {
- Menu m = ((MenuManager)menu).getMenu();
- if (m != null)
- {
- menuListenerAdded = true;
- SystemViewMenuListener ml = new SystemViewMenuListener();
- ml.setShowToolTipText(true, this);
- m.addMenuListener(ml);
- }
- }
- }
- }
-
- // -------------------------------------------
- // MEMENTO SUPPORT (SAVING/RESTORING STATE)...
- // -------------------------------------------
- /**
- * Initializes this view with the given view site. A memento is passed to
- * the view which contains a snapshot of the views state from a previous
- * session. Where possible, the view should try to recreate that state
- * within the part controls.
- * <p>
- * The parent's default implementation will ignore the memento and initialize
- * the view in a fresh state. Subclasses may override the implementation to
- * perform any state restoration as needed.
- */
- public void init(IViewSite site,IMemento memento) throws PartInitException
- {
- super.init(site,memento);
- fMemento = memento;
- //System.out.println("INSIDE INIT");
- }
-
- /**
- * Adds the listeners to the tree viewer.
- */
- protected void addTreeViewerListeners()
- {
- treeViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event) {
- handleDoubleClick(event);
- }
- });
-
- //System.out.println("Add key listener");
-
- treeViewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- handleKeyReleased(e);
- } });
- treeViewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- } });
-
- treeViewer.addSelectionChangedListener(this);
-
- treeViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- handleOpen(event);
- }
- });
- }
-
-
- /**
- * Returns the shell to use for opening dialogs.
- * Used in this class, and in the actions.
- */
- public Shell getShell()
- {
- return getViewSite().getShell();
- }
-
- /**
- * Handles double clicks in viewer. It is responsible for expanding
- * and collapsing of folders.
- */
- private void handleDoubleClick(DoubleClickEvent event)
- {
- /*
- IStructuredSelection rseSSel =
- (IStructuredSelection) event.getSelection();
- Object rseObject = rseSSel.getFirstElement();
- if (treeViewer.isExpandable(rseObject))
- {
- treeViewer.setExpandedState(
- rseObject,
- !treeViewer.getExpandedState(rseObject));
- }
- */
- }
-
- /**
- * Handles an open event from the viewer.
- * Opens an editor on the selected file.
- */
- protected void handleOpen(OpenEvent event)
- {
- }
-
- /**
- * Handles key events in viewer.<br>
- * This is needed for various keys (eg: delete key) and for model dump.
- */
- private void handleKeyReleased(KeyEvent event)
- {
- //System.out.println("in handleKeyPressed. keyCode == SWT.F5? " + (event.keyCode==SWT.F5) + ", keyCode: "+event.keyCode);
- if (event.keyCode == SWT.F5)
- {
- getRefreshAllToolbarAction(getStructuredSelection()).run();
- }
- }
- /**
- * Handles key events in viewer.<br>
- * This is needed for various keys (eg: delete key) and for model dump.
- */
- private void handleKeyPressed(KeyEvent event)
- {
- //System.out.println("in handleKeyPressed. keyCode == SWT.F5? " + (event.keyCode==SWT.F5) + ", keyCode: "+event.keyCode);
- IStructuredSelection selection = (IStructuredSelection)getSelection();
- if ((event.character == SWT.DEL) && (event.stateMask == 0) && (selection.size()>0) )
- {
- if (showDelete() && canDelete())
- {
- SystemCommonDeleteAction dltAction = (SystemCommonDeleteAction)getDeleteAction(selection);
- dltAction.setShell(getShell());
- dltAction.setSelection(getSelection());
- dltAction.setViewer(getViewer());
- dltAction.run();
- }
- }
- else if ((event.character == '-') && (event.stateMask == SWT.CTRL) )
- {
- SystemCollapseAllAction collapseAllAction = getCollapseAllAction();
- collapseAllAction.setShell(getShell());
- collapseAllAction.run();
- }
- else if ((event.character == '-') && (selection.size()>0) )
- {
- //System.out.println("Inside Ctrl+- processing");
- treeViewer.collapseSelected();
- }
- else if ((event.character == '+') && (selection.size()>0) )
- {
- //System.out.println("Inside Ctrl++ processing");
- treeViewer.expandSelected();
- }
-
- }
-
- /**
- * Reveal and selects the passed selection in viewer.<br>
- */
- public void selectReveal(ISelection selection)
- {
- if (!(selection instanceof StructuredSelection))
- return;
- StructuredSelection ssel = (StructuredSelection)selection;
- if (!ssel.isEmpty()) {
- // select and reveal the item
- treeViewer.setSelection(ssel, true);
- }
- }
-
- /**
- * Called when the context menu is about to open.
- */
- private void fillContextMenu(IMenuManager menu)
- {
- SystemMenuManager ourMenu = new SystemMenuManager(menu);
-
- // Populate with our stuff...
- IStructuredSelection selection = getStructuredSelection();
- Object firstSelection = selection.getFirstElement();
- createStandardGroups(menu);
- if (firstSelection instanceof IProject)
- {
- // Scrub unrelated menu items
- if (selection.size() == 1)
- fillProjectContextMenu(ourMenu, selection);
- }
- else
- {
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(firstSelection, treeViewer);
- if (adapter != null)
- {
- if ((firstSelection instanceof SystemTeamViewSubSystemConfigurationNode) ||
- // FIXME - compile actions separate now (firstSelection instanceof SystemTeamViewCompileTypeNode) ||
- (firstSelection instanceof ISystemProfile))
- {
- addActions(ourMenu, selection);
- }
- else if (firstSelection instanceof ISystemFilterPool)
- {
- //SystemTestingAction testAction = new SystemTestingAction(getShell(), this);
- //testAction.setSelection(getSelection());
- //ourMenu.add(ISystemContextMenuConstants.GROUP_CHANGE, testAction);
- }
- }
- }
- // whale through all actions, updating shell and selection
- IContributionItem[] items = menu.getItems();
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- try{
- item.setInputs(getShell(), getViewer(), selection);
- } catch (Exception e)
- {
- SystemBasePlugin.logError("Error configuring action " + item.getClass().getName(),e);
- System.err.println("Error configuring action " + item.getClass().getName());
- }
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- item.setInputs(getShell(), getViewer(), selection);
- }
- }
- PropertyDialogAction pdAction = getPropertyDialogAction(selection);
- if (pdAction.isApplicableForSelection())
- menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
- }
-
- /**
- * Let each object add their own actions...
- * @param menu
- */
- protected void addActions(SystemMenuManager ourMenu, IStructuredSelection selection)
- {
- // ADAPTER SPECIFIC ACTIONS
- Iterator elements= selection.iterator();
- Hashtable adapters = new Hashtable();
- while (elements.hasNext())
- {
- Object element= elements.next();
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(element, treeViewer);
- if (adapter != null)
- adapters.put(adapter,element); // want only unique adapters
- }
- Enumeration uniqueAdapters = adapters.keys();
- Shell shell = getShell();
- while (uniqueAdapters.hasMoreElements())
- {
- ISystemViewElementAdapter nextAdapter = (ISystemViewElementAdapter)uniqueAdapters.nextElement();
- nextAdapter.addActions(ourMenu,selection,shell,ISystemContextMenuConstants.GROUP_ADAPTERS);
- //if (nextAdapter instanceof AbstractSystemViewAdapter)
- // ((AbstractSystemViewAdapter)nextAdapter).addCommonRemoteActions(ourMenu,selection,shell,ISystemContextMenuConstants.GROUP_ADAPTERS);
- }
-
- // wail through all actions, updating shell and selection
- IContributionItem[] items = ourMenu.getMenuManager().getItems();
- for (int idx=0; idx < items.length; idx++)
- {
- if ((items[idx] instanceof ActionContributionItem) &&
- (((ActionContributionItem)items[idx]).getAction() instanceof ISystemAction))
- {
- ISystemAction item = (ISystemAction) ( ((ActionContributionItem)items[idx]).getAction() );
- try{
- item.setInputs(getShell(), treeViewer, selection);
- } catch (Exception e)
- {
- SystemBasePlugin.logError("Error configuring action " + item.getClass().getName(),e);
- System.out.println("Error configuring action " + item.getClass().getName());
- }
- }
- else if (items[idx] instanceof SystemSubMenuManager)
- {
- SystemSubMenuManager item = (SystemSubMenuManager)items[idx];
- item.setInputs(getShell(), treeViewer, selection);
- }
- }
- }
-
- /**
- * Creates the Systems plugin standard groups in a context menu.
- */
- public void createStandardGroups(IMenuManager menu)
- {
- //if (!menu.isEmpty())
- // return;
- // simply sets partitions in the menu, into which actions can be directed.
- // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
- // Deleted groups are not used yet.
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW_NONCASCADING)); // new stuff
- /*
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand to->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND)); // expand, collapse
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH)); // open with->
- */
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH)); // work with->
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
- /*
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
- menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // connection-related actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_STARTSERVER)); // Start Remote Server cascading menu
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
- */
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_VIEWER_SETUP)); // ? Probably View->by xxx, yyy
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM)); // Team
- menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
- }
-
-
- /**
- * Fill context menu for IProjects
- */
- private void fillProjectContextMenu(SystemMenuManager menu, IStructuredSelection selection)
- {
- menu.add(ISystemContextMenuConstants.GROUP_BUILD,getRefreshAllMenuAction(selection));
- menu.add(ISystemContextMenuConstants.GROUP_BUILD,getReloadRSEAction(selection));
- menu.add(ISystemContextMenuConstants.GROUP_NEW,getNewProfileAction(selection));
- //menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES));
- //menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, getPropertyDialogAction(selection));
- }
-
- /**
- * Get the properties dialog action
- */
- private PropertyDialogAction getPropertyDialogAction(IStructuredSelection selection)
- {
- if (propertyDialogAction == null)
- propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), treeViewer);
- propertyDialogAction.selectionChanged(selection);
- return propertyDialogAction;
- }
- /**
- * Get the reload RSE action for the context menu
- */
- private SystemTeamReloadAction getReloadRSEAction(IStructuredSelection selection)
- {
- boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
- if (reloadRSEAction == null)
- reloadRSEAction = new SystemTeamReloadAction(getShell());
- reloadRSEAction.setSelection(selection);
- if (privateProfileStillExists)
- reloadRSEAction.setEnabled(false);
- return reloadRSEAction;
- }
- /**
- * Get the refresh All action for the context menu
- */
- private SystemTeamViewRefreshAllAction getRefreshAllMenuAction(IStructuredSelection selection)
- {
- if (menuRefreshAllAction == null)
- menuRefreshAllAction = new SystemTeamViewRefreshAllAction(getShell(), this);
- menuRefreshAllAction.setSelection(selection);
- return menuRefreshAllAction;
- }
- /**
- * Get the refresh All action for the toolbar
- */
- private SystemTeamViewRefreshAllAction getRefreshAllToolbarAction(IStructuredSelection selection)
- {
- if (toolBarRefreshAllAction == null)
- toolBarRefreshAllAction = new SystemTeamViewRefreshAllAction(getShell(), this);
- toolBarRefreshAllAction.setSelection(selection);
- return toolBarRefreshAllAction;
- }
- /**
- * Get the New Profile actoin
- */
- private SystemNewProfileAction getNewProfileAction(IStructuredSelection selection)
- {
- if (newProfileAction == null)
- {
- newProfileAction = new SystemNewProfileAction(getShell(), false);
- newProfileAction.setViewer(getViewer());
- }
- newProfileAction.setSelection(selection);
- return newProfileAction;
- }
- /**
- * Rather than pre-defined this common action we wait until it is first needed,
- * for performance reasons.
- */
- protected IAction getDeleteAction(IStructuredSelection selection)
- {
- if (deleteAction == null)
- {
- deleteAction = new SystemCommonDeleteAction(getShell(),this);
- deleteAction.setViewer(getViewer());
- deleteAction.setHelp(RSEUIPlugin.HELPPREFIX+"actndlpr");
- deleteAction.setDialogHelp(RSEUIPlugin.HELPPREFIX+"ddltprfl");
- deleteAction.setPromptLabel(SystemResources.RESID_DELETE_PROFILES_PROMPT);
- }
- deleteAction.setSelection(selection);
- return deleteAction;
- }
-
- /**
- * Scrub the popup menu to remove everything but team-related stuff...
- */
- private void scrubOtherContributions(IMenuManager menuMgr) {
- IStructuredSelection selection = getStructuredSelection();
- Object firstSelection = selection.getFirstElement();
- if (firstSelection instanceof IProject) {
- boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
- IContributionItem items[] = menuMgr.getItems();
- if (items != null) {
- for (int idx = 0; idx < items.length; idx++) {
- IContributionItem item = items[idx];
- if (item.getId() != null) {
- if (!item.getId().equals("team.main") || privateProfileStillExists) menuMgr.remove(item);
- }
- }
- }
- }
- }
-
- public void dispose()
- {
- RSEUIPlugin.getTheSystemRegistry().removeSystemModelChangeListener(this);
- super.dispose();
- }
-
- /**
- * Return our viewer.
- */
- public TreeViewer getViewer()
- {
- return treeViewer;
- }
-
- /**
- * Updates the title text and title tool tip.
- * Called whenever the input of the viewer changes.
- */
- public void updateTitle()
- {
-// Object input = getTreeViewer().getInput();
-// String viewName = getConfigurationElement().getAttribute("name");
- setPartName(getTitle());
- setTitleToolTip("");
- }
-
- /**
- * Determines the input for the viewer. This is needed for the "Open
- * in New Window" action that sets the input to the workbench page,
- * and expects the viewers to use it.
- */
- protected IAdaptable getInput()
- {
- if (input == null)
- input = new SystemTeamViewInputProvider();
- return input;
- }
-
- /**
- * Adds the actions in this group and its subgroups to the action bars.
- */
- public void fillActionBars(IActionBars actionBars)
- {
- IStructuredSelection selection = getStructuredSelection();
- actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), getPropertyDialogAction(selection));
- SystemTeamViewRefreshAllAction refreshAllAction = getRefreshAllToolbarAction(selection);
- actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAllAction);
-
- actionBars.getToolBarManager().add(getNewProfileAction(selection));
- // now add the global Refresh action in the view tool bar.
- actionBars.getToolBarManager().add(refreshAllAction);
-
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getDeleteAction(selection));
- SystemCommonSelectAllAction selAllAction = new SystemCommonSelectAllAction(getShell(), treeViewer, treeViewer);
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selAllAction);
-
- actionBars.getToolBarManager().add(new Separator());
- actionBars.getToolBarManager().add(getCollapseAllAction());
-
- statusLine = actionBars.getStatusLineManager();
- }
-
- /**
- * Return the collapseAll action
- */
- protected SystemCollapseAllAction getCollapseAllAction()
- {
- if (collapseAllAction == null)
- {
- collapseAllAction = new SystemCollapseAllAction(getShell());
- collapseAllAction.setSelectionProvider(treeViewer);
- collapseAllAction.setViewer(treeViewer);
- collapseAllAction.setImageDescriptor(getNavigatorImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
- // DKM - changed this icon from clcl16 since navigator no longer has it
- collapseAllAction.setHoverImageDescriptor(getNavigatorImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
- }
- return collapseAllAction;
- }
-
- /**
- * Updates the actions which were added to the action bars.
- */
- public void updateActionBars(IStructuredSelection selection)
- {
- getPropertyDialogAction(selection);
- getRefreshAllToolbarAction(selection);
- getDeleteAction(selection);
- }
-
- /**
- * This is the method in your class that will be called when a resource in the
- * RSE model changes. You will be called after the resource is changed.
- * @see ISystemModelChangeEvent
- */
- public void systemModelResourceChanged(ISystemModelChangeEvent event)
- {
- int resourceType = event.getResourceType();
- boolean testMode = false;
- if ((event.getEventType() == ISystemModelChangeEvents.SYSTEM_RESOURCE_ALL_RELOADED) ||
- (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_PROFILE))
- {
- getTreeViewer().refresh();
- treeViewer.updatePropertySheet();
- if (testMode && (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_PROFILE))
- System.out.println("Profile change event of type: " + event.getEventType());
- }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_FILTER)
- {
- if (testMode)
- System.out.println("Filter change event of type: " + event.getEventType());
- ISystemFilter filter = (ISystemFilter)event.getResource();
- ISystemFilterPool pool = filter.getParentFilterPool();
- if (pool == null) // maybe for transient filters?
- return;
- if (isModelObjectExpanded(pool)) // if parent is expanded...
- treeViewer.refresh(pool); // refresh the parent.
- }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_FILTERPOOL)
- {
- if (testMode)
- System.out.println("Filter Pool change event of type: " + event.getEventType());
- ISystemFilterPool pool = (ISystemFilterPool)event.getResource();
- ISystemProfile profile = ((ISubSystemConfiguration)pool.getProvider()).getSystemProfile(pool);
- TreeItem filterCategoryItem = getCategoryNodeTreeItem(profile, SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS);
- if ((filterCategoryItem!=null) && filterCategoryItem.getExpanded())
- treeViewer.refresh(filterCategoryItem.getData());
- }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION)
- {
- if (testMode)
- System.out.println("Connection change event of type: " + event.getEventType());
- IHost conn = (IHost)event.getResource();
- ISystemProfile profile = conn.getSystemProfile();
-
- TreeItem connCategoryItem = getCategoryNodeTreeItem(profile, SystemTeamViewCategoryNode.MEMENTO_CONNECTIONS);
- if ((connCategoryItem != null) && connCategoryItem.getExpanded())
- {
- treeViewer.refresh(connCategoryItem.getData());
- }
- }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM)
- {
- if (testMode)
- System.out.println("SubSystem change event of type: " + event.getEventType());
- }
-
-// FIXME - user actions separate now
-// else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION)
-// {
-// if (testMode)
-// System.out.println("User Action change event of type: " + event.getEventType());
-// SystemUDActionElement action = (SystemUDActionElement)event.getResource();
-// ISystemProfile profile = action.getProfile();
-// TreeItem actionCategoryItem = getCategoryNodeTreeItem(profile, SystemTeamViewCategoryNode.MEMENTO_USERACTIONS);
-// if ((actionCategoryItem!=null) && actionCategoryItem.getExpanded())
-// {
-// // note if the updated action is currently selected, we lose that selection because
-// // when we save actions, their wrapper objects are recreated (yes, its bad but who
-// // has time to fix it?) and so the binary address of the old no longer exists.
-// // To circumvent we need to detect the situation and reselect the new one. But how to tell
-// // if one action is equal to another? Compare their xml element nodes.
-// ISelection s = getSelection();
-// boolean reselect = false;
-// if (s instanceof StructuredSelection)
-// {
-// Object firstSel = ((StructuredSelection)s).getFirstElement();
-// if (firstSel instanceof SystemUDActionElement)
-// if ( ((SystemUDActionElement)firstSel).getElement() ==
-// action.getElement() )
-// reselect = true;
-// }
-// // the problem we have here is refresh will cause yet another fresh set of SystemUDActionElement objects
-// // to be created! We really should fix that.
-//
-// //if (event.getEventType() != ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED)
-// treeViewer.refresh(actionCategoryItem.getData());
-// // I tried this and update didn't update the label, damn.
-// //else
-// //{
-// //String[] allProps = {IBasicPropertyConstants.P_TEXT,IBasicPropertyConstants.P_IMAGE};
-// //treeViewer.update(actionCategoryItem.getData(), allProps);
-// //}
-// if (reselect)
-// treeViewer.setSelection(new StructuredSelection(action));
-// }
-// }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE)
- {
- if (testMode)
- System.out.println("Named Type change event of type: " + event.getEventType());
- }
-
-// compile actions separate now
-// else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD)
-// {
-// if (testMode)
-// System.out.println("Compile Command change event of type: " + event.getEventType());
-// SystemCompileCommand cmd = (SystemCompileCommand)event.getResource();
-// ISystemProfile profile = cmd.getParentType().getParentProfile().getProfile();
-// TreeItem actionCategoryItem = getCategoryNodeTreeItem(profile, SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS);
-// if ((actionCategoryItem!=null) && actionCategoryItem.getExpanded())
-// treeViewer.refresh(actionCategoryItem.getData());
-// }
- }
- /**
- * Return true if the given profile is expanded
- */
- private boolean isModelObjectExpanded(Object object)
- {
- TreeItem item = treeViewer.findTreeItem(object);
- return ((item != null) && item.getExpanded());
- }
- /**
- * Find a category node of a particular type, under the node of a given profile
- */
- private TreeItem getCategoryNodeTreeItem(ISystemProfile profile, String mementoKey)
- {
- TreeItem item = treeViewer.findTreeItem(profile);
- if ((item==null) || !item.getExpanded() )
- return null;
-
- TreeItem[] childItems = item.getItems();
- item = null;
- if (childItems != null)
- {
- boolean found = false;
- for (int idx=0; !found && (idx<childItems.length); idx++)
- {
- if (childItems[idx].getData() instanceof SystemTeamViewCategoryNode)
- {
- SystemTeamViewCategoryNode node = (SystemTeamViewCategoryNode)childItems[idx].getData();
- if ((node!=null) && node.getMementoHandle().equals(mementoKey))
- {
- found = true;
- item = childItems[idx];
- }
- }
- }
- }
- return item;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemDeleteTarget#showDelete()
- */
- public boolean showDelete()
- {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemDeleteTarget#canDelete()
- */
- public boolean canDelete()
- {
- boolean ok = true;
- IStructuredSelection selection= getStructuredSelection();
- Iterator elements= selection.iterator();
- ISystemProfileManager mgr = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager();
- int nbrActiveProfiles = mgr.getActiveSystemProfiles().length;
- int activeCount = 0;
- while (ok && elements.hasNext())
- {
- Object currObj = elements.next();
- if (!(currObj instanceof ISystemProfile))
- {
- ok = false;
- //System.out.println("selection: "+currObj.getClass().getName());
- }
- else if (!mgr.isSystemProfileActive(((ISystemProfile)currObj).getName()))
- activeCount++;
- }
- if (ok && (activeCount == nbrActiveProfiles)) // attempting to delete all active profiles?
- ok = false; // don't allow that!
- //System.out.println("Inside canDelete: "+ok);
- return ok;
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemDeleteTarget#doDelete()
- */
- public boolean doDelete(IProgressMonitor monitor)
- {
- boolean ok = true;
- IStructuredSelection selection= getStructuredSelection();
- Iterator elements= selection.iterator();
- Object currObj = null;
- while (ok && elements.hasNext())
- {
- currObj = elements.next();
- try {
- ok = profileAdapter.doDelete(getShell(), currObj, monitor);
- } catch (Exception exc)
- {
- String msg = "Exception deleting profile "+((ISystemProfile)currObj).getName();
- SystemBasePlugin.logError(msg, exc);
- SystemMessageDialog.displayExceptionMessage(getShell(),exc);
- ok = false;
- }
- }
- return ok;
- }
-
- // ------------------------------
- // ISystemRenameTarget methods...
- // ------------------------------
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemRenameTarget#showRename()
- */
- public boolean showRename()
- {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemRenameTarget#canRename()
- */
- public boolean canRename()
- {
- boolean ok = true;
- IStructuredSelection selection= getStructuredSelection();
- Iterator elements= selection.iterator();
- while (ok && elements.hasNext())
- {
- Object currObj = elements.next();
- if (!(currObj instanceof ISystemProfile))
- ok = false;
- }
- //System.out.println("Inside canRename: "+ok);
- return ok;
- }
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.ui.ISystemRenameTarget#doRename(java.lang.String[])
- */
- public boolean doRename(String[] newNames)
- {
- boolean ok = true;
- IStructuredSelection selection= getStructuredSelection();
- Iterator elements= selection.iterator();
- Object currObj = null;
- int idx = 0;
- while (ok && elements.hasNext())
- {
- currObj = elements.next();
- try {
- profileAdapter.doRename(getShell(), currObj, newNames[idx++]);
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayMessage(getShell(), exc);
- ok = false;
- }
- catch (Exception exc)
- {
- String msg = "Exception renaming profile ";
- SystemBasePlugin.logError(msg, exc);
- //System.out.println(msg + exc.getMessage() + ": " + exc.getClass().getName());
- SystemMessageDialog.displayExceptionMessage(getShell(),exc);
- ok = false;
- }
- }
- return ok;
- }
-
- /**
- * Returns the image descriptor with the given relative path.
- */
- protected ImageDescriptor getNavigatorImageDescriptor(String relativePath) {
- String iconPath = "icons/full/"; //$NON-NLS-1$
- try {
- Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
- URL installURL = bundle.getEntry("");
- URL url = new URL(installURL, iconPath + relativePath);
- return ImageDescriptor.createFromURL(url);
- } catch (MalformedURLException e) {
- // should not happen
- return ImageDescriptor.getMissingImageDescriptor();
- }
- }
-
- // ----------------
- // MEMENTO STUFF...
- // ----------------
-
- /**
- * Method declared on IViewPart.
- */
- public void saveState(IMemento memento)
- {
- if (treeViewer == null)
- {
- // part has not been created
- if (fMemento != null) //Keep the old state;
- memento.putMemento(fMemento);
- return;
- }
-
- // We record the current release for future in case anything significant changes from release to release
- memento.putString(TAG_RELEASE, SystemResources.CURRENT_RELEASE_NAME);
-
- /*
- String inputMemento = memento.getString("factoryID"); // see IWorkbenchWindow ... this is only clue I can figure out!
- if (inputMemento != null)
- {
- saveInputState(memento);
- return;
- }*/
-
- Tree tree = treeViewer.getTree();
-
- // SAVE EXPANSION STATE
- Object expandedElements[]= treeViewer.getVisibleExpandedElements();
- if ( (expandedElements!=null) && (expandedElements.length > 0) )
- {
- IMemento expandedMem= memento.createChild(TAG_EXPANDED);
- for (int i= 0; i < expandedElements.length; i++)
- {
- Object o = expandedElements[i];
- String mementoHandle = getMementoHandle(o);
- if (mementoHandle != null)
- {
- IMemento elementMem= expandedMem.createChild(TAG_ELEMENT);
- elementMem.putString(TAG_PATH, getMementoHandle(o));
- //System.out.println("Added to saved expansion list: " + getMementoHandle(o));
- }
- }
- }
-
- // SAVE SELECTION STATE
- Object elements[]= ((IStructuredSelection) treeViewer.getSelection()).toArray();
- if ( (elements!=null) && (elements.length > 0) )
- {
- IMemento selectionMem= memento.createChild(TAG_SELECTION);
- for (int i= 0; i < elements.length; i++)
- {
- Object o= elements[i];
- String mementoHandle = getMementoHandle(o);
- if (mementoHandle != null)
- {
- IMemento elementMem= selectionMem.createChild(TAG_ELEMENT);
- elementMem.putString(TAG_PATH, getMementoHandle(o));
- }
- }
- }
-
- //save vertical position
- ScrollBar bar= tree.getVerticalBar();
- int position= bar != null ? bar.getSelection() : 0;
- memento.putString(TAG_VERTICAL_POSITION, String.valueOf(position));
- //save horizontal position
- bar= tree.getHorizontalBar();
- position= bar != null ? bar.getSelection() : 0;
- memento.putString(TAG_HORIZONTAL_POSITION, String.valueOf(position));
-
- }
- /**
- * Return the memento handle key plus the memento handle for
- * each part leading up to the current object.
- */
- protected String getMementoHandle(Object o)
- {
- String mementoKey = internalGetMementoHandleKey(o);
- if (mementoKey == null)
- return null;
- StringBuffer idBuffer = new StringBuffer(mementoKey);
- Object[] elementNodes = treeViewer.getElementNodes(o);
- if (elementNodes != null)
- {
- for (int idx=elementNodes.length-1; idx>=0; idx--)
- {
- o = elementNodes[idx];
- idBuffer.append(MEMENTO_DELIM+internalGetMementoHandle(o));
- }
- }
- //System.out.println("MEMENTO HANDLE: " + idBuffer.toString());
- return idBuffer.toString();
- }
- /**
- * Encapsulate code to look at object class type and determine what to return for
- * a memento handle key
- */
- protected String internalGetMementoHandleKey(Object o)
- {
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(o, treeViewer);
- String handle = null;
- if (adapter != null)
- handle = adapter.getMementoHandleKey(o);
- else if (o instanceof IResource)
- {
- if (o instanceof IProject)
- handle = "Project";
- else if (o instanceof IFolder)
- handle = "Folder";
- else
- handle = "File";
- }
- else if (o instanceof ISystemProfile)
- handle = "Profile";
- else if (o instanceof SystemTeamViewCategoryNode)
- //handle = "Category";
- handle = null; // decided not to re-expand past profiles
-
- return handle;
- }
- /**
- * Encapsulate code to look at object class type and determine what to return for
- * a memento handle
- */
- protected String internalGetMementoHandle(Object o)
- {
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(o, treeViewer);
- String handle = null;
- if (adapter != null)
- handle = adapter.getMementoHandle(o);
- else if (o instanceof IResource)
- handle = ((IResource)o).getName();
- else if (o instanceof ISystemProfile)
- handle = ((ISystemProfile)o).getName();
- else if (o instanceof SystemTeamViewCategoryNode)
- handle = ((SystemTeamViewCategoryNode)o).getMementoHandle();
- return handle;
- }
-
- /**
- * Our own method for restoring state
- */
- void restoreState(IMemento memento)
- {
- RestoreStateRunnable restoreAction = new RestoreStateRunnable(memento);
- Display.getDefault().syncExec(restoreAction);
- }
-
- /**
- * Inner class for running restore-state in a thread
- */
- public class RestoreStateRunnable implements Runnable
- {
- private IMemento _memento;
- public RestoreStateRunnable(IMemento memento)
- {
- _memento = memento;
- }
-
- public void run()
- {
- IMemento memento = _memento;
- IMemento childMem = null;
-
- // restore expansion state
- childMem = memento.getChild(TAG_EXPANDED);
- if (childMem != null)
- {
- ArrayList elements = new ArrayList();
- IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
- for (int i = 0; i < elementMem.length; i++)
- {
- Object element = getObjectFromMemento(elementMem[i].getString(TAG_PATH));
- if (element != null)
- elements.add(element);
- }
- // expand objects...
- treeViewer.setExpandedElements(elements.toArray());
- }
-
- // restoreSelection
- childMem = memento.getChild(TAG_SELECTION);
- if (childMem != null)
- {
- ArrayList list = new ArrayList();
- IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
- for (int i = 0; i < elementMem.length; i++)
- {
- Object element = getObjectFromMemento(elementMem[i].getString(TAG_PATH));
- if (element != null)
- list.add(element);
- }
- treeViewer.setSelection(new StructuredSelection(list));
- }
-
- Tree tree = treeViewer.getTree();
- //restore vertical position
- ScrollBar bar = tree.getVerticalBar();
- if (bar != null)
- {
- try
- {
- String posStr = memento.getString(TAG_VERTICAL_POSITION);
- if (posStr != null)
- {
- int position;
- position = new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- //restore vertical position
- bar = tree.getHorizontalBar();
- if (bar != null)
- {
- try
- {
- String posStr = memento.getString(TAG_HORIZONTAL_POSITION);
- if (posStr != null)
- {
- int position;
- position = new Integer(posStr).intValue();
- bar.setSelection(position);
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- }
- }
- /**
- * Private method to deconstruct an expanded/selected memento into an actual object
- */
- protected Object getObjectFromMemento(String memento)
- {
- if (memento == null)
- return null;
-
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISystemProfile profile = null;
- IProject project = null;
- SystemTeamViewCategoryNode category = null;
- String elementType = "";
-
- //System.out.println("PARSING MEMENTO: " + memento);
-
- Vector v = SystemViewPart.tokenize(memento, MEMENTO_DELIM);
-
- // 0. element type
- // 1. RSE Project
- // 2. Profiles
- // 3. Categories
-
- for (int idx=0; idx<v.size(); idx++)
- {
- String token = (String)v.elementAt(idx);
- switch (idx)
- {
- // type of element
- case 0: elementType = token; break;
- // profile
- case 1:
- project = SystemResourceManager.getRemoteSystemsProject();
- break;
- case 2:
- profile = sr.getSystemProfile(token);
- break;
- case 3:
- SystemTeamViewProfileAdapter profileAdapter = RSEUIPlugin.getDefault().getSystemViewAdapterFactory().getProfileAdapter();
- category = profileAdapter.restoreCategory(profile, token);
- //System.out.println("Restored category: "+(category==null?"null":category.getLabel()));
- break;
- }
- }
-
- if (elementType.equals("Project"))
- {
- //System.out.println("...PARSED INTO A PROJECT: " + project.getName());
- return project;
- }
- else if (elementType.equals(ISystemMementoConstants.MEMENTO_KEY_PROFILE))
- {
- //System.out.println("...PARSED INTO A PROFILE: " + profile.getName());
- return profile;
- }
- if (elementType.equals("Category"))
- {
- //System.out.println("...PARSED INTO A CATEGORY: " + category.getLabel());
- return category;
- }
- else
- {
- //System.out.println("...UNKNOWN MEMENTO ");
- }
- return null;
- }
-
- // -----------------------------
- // ISelectionListener methods...
- // -----------------------------
-
- /**
- * Handles selection changed in viewer.
- * Updates global actions.
- * Links to editor (if option enabled)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- updateActionBars(sel);
- Object firstSelection = sel.getFirstElement();
- if (firstSelection == null)
- return;
- ISystemViewElementAdapter adapter = SystemAdapterHelpers.getAdapter(firstSelection);
- if (adapter != null)
- {
- setMessage(adapter.getStatusLineText(firstSelection));
- //if ((mouseButtonPressed == LEFT_BUTTON) && (!expandingTreeOnly)) //d40615
- //adapter.selectionChanged(firstSelection); //d40615
- }
- else
- setMessage(internalGetMementoHandle(firstSelection));
-
- if (newProfileAction != null)
- newProfileAction.refreshEnablement(); // not selection related, but we have no other trigger
- }
-
- // -------------------------------
- // ISystemMessageLine interface...
- // -------------------------------
- /**
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- errorMessage = null;
- sysErrorMessage = null;
- if (statusLine != null)
- statusLine.setErrorMessage(errorMessage);
- }
- /**
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- message = null;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public String getErrorMessage()
- {
- return errorMessage;
- }
- /**
- * Get the currently displayed message.
- * @return The message. If no message is displayed <code>null<code> is returned.
- */
- public String getMessage()
- {
- return message;
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- this.errorMessage = message;
- if (statusLine != null)
- statusLine.setErrorMessage(message);
- }
- /**
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- return sysErrorMessage;
- }
-
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- sysErrorMessage = message;
- setErrorMessage(message.getLevelOneText());
- }
- /**
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(Throwable exc)
- {
- setErrorMessage(exc.getMessage());
- }
-
- /**
- * Set the message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- this.message = message;
- if (statusLine != null)
- statusLine.setMessage(message);
- }
- /**
- *If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- setMessage(message.getLevelOneText());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewProfileAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewProfileAdapter.java
deleted file mode 100644
index b7bcbe2a3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewProfileAdapter.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.ISystemUserIdConstants;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.model.SystemStartHere;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemCommonDeleteAction;
-import org.eclipse.rse.ui.actions.SystemCommonRenameAction;
-import org.eclipse.rse.ui.actions.SystemProfileNameCopyAction;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorProfileName;
-import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
-import org.eclipse.rse.ui.view.ISystemMementoConstants;
-import org.eclipse.rse.ui.view.ISystemPropertyConstants;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying and processing SystemProfile objects in tree views, such as
- * the Team view.
- */
-public class SystemTeamViewProfileAdapter
- extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter, ISystemUserIdConstants
-{
-
- private boolean actionsCreated = false;
- private Hashtable categoriesByProfile = new Hashtable();
- // context menu actions for profiles...
- protected SystemTeamViewActiveProfileAction activeProfileAction;
- protected SystemTeamViewMakeActiveProfileAction makeProfileActiveAction;
- protected SystemTeamViewMakeInActiveProfileAction makeProfileInactiveAction;
- protected SystemCommonRenameAction renameAction;
- protected SystemCommonDeleteAction deleteAction;
- protected SystemProfileNameCopyAction copyProfileAction;
-
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (!actionsCreated)
- createActions();
-
- boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
- copyProfileAction.setProfile((ISystemProfile)selection.getFirstElement());
-
- if (activeProfileAction != null)
- {
- activeProfileAction.setEnabled(!privateProfileStillExists);
- menu.add(ISystemContextMenuConstants.GROUP_CHANGE,activeProfileAction);
- }
- else
- {
- menu.add(ISystemContextMenuConstants.GROUP_CHANGE,makeProfileActiveAction);
- menu.add(ISystemContextMenuConstants.GROUP_CHANGE,makeProfileInactiveAction);
- }
- menu.add(ISystemContextMenuConstants.GROUP_REORGANIZE,copyProfileAction);
- menu.add(ISystemContextMenuConstants.GROUP_REORGANIZE,deleteAction);
- menu.add(ISystemContextMenuConstants.GROUP_REORGANIZE,renameAction);
- }
- private void createActions()
- {
- // activate profile action...
- // TODO: Delete the activeProfileAction logic when we have another mri rev, and can use the new actions.
- if (SystemResources.ACTION_PROFILE_MAKEACTIVE_LABEL.equals("test")) //$NON-NLS-1$
- activeProfileAction = new SystemTeamViewActiveProfileAction(getShell());
- else
- {
- makeProfileActiveAction = new SystemTeamViewMakeActiveProfileAction(getShell());
- makeProfileInactiveAction = new SystemTeamViewMakeInActiveProfileAction(getShell());
- }
-
- copyProfileAction = new SystemProfileNameCopyAction(getShell());
-
- deleteAction = new SystemCommonDeleteAction(getShell(),getTeamViewPart());
- deleteAction.setHelp(RSEUIPlugin.HELPPREFIX+"actndlpr"); //$NON-NLS-1$
- deleteAction.setDialogHelp(RSEUIPlugin.HELPPREFIX+"ddltprfl"); //$NON-NLS-1$
- deleteAction.setPromptLabel(SystemResources.RESID_DELETE_PROFILES_PROMPT);
-
- renameAction = new SystemCommonRenameAction(getShell(),getTeamViewPart());
- renameAction.setHelp(RSEUIPlugin.HELPPREFIX+"actnrnpr"); //$NON-NLS-1$
- renameAction.setDialogSingleSelectionHelp(RSEUIPlugin.HELPPREFIX+"drnsprfl"); //$NON-NLS-1$
- renameAction.setDialogMultiSelectionHelp(RSEUIPlugin.HELPPREFIX+"drnmprfl"); //$NON-NLS-1$
- renameAction.setSingleSelectPromptLabel(SystemResources.RESID_SIMPLE_RENAME_PROFILE_PROMPT_LABEL,
- SystemResources.RESID_SIMPLE_RENAME_PROFILE_PROMPT_TIP);
- renameAction.setMultiSelectVerbage(SystemResources.RESID_MULTI_RENAME_PROFILE_VERBAGE);
-
- actionsCreated = true;
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- ISystemProfile profile = (ISystemProfile)element;
- if (RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName()))
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE_ID);
- else
- return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
- }
- /**
- * Return the team view part
- */
- private SystemTeamViewPart getTeamViewPart()
- {
- SystemTeamView viewer = (SystemTeamView)getViewer();
- //System.out.println("Team view part set? " + (viewer != null));
- return viewer.getTeamViewPart();
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- return ((ISystemProfile)element).getName();
- }
-
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return ((ISystemProfile)element).getName();
- }
-
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- return ((ISystemProfile)element).getName();
- }
-
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return SystemViewResources.RESID_PROPERTY_PROFILE_TYPE_VALUE;
- }
-
- /**
- * Return the string to display in the status line when the given object is selected.
- * We return:
- * Connection: name - Host name: hostName - Description: description
- */
- public String getStatusLineText(Object element)
- {
- ISystemProfile profile = (ISystemProfile)element;
- boolean active = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName());
- return getType(element) + ": " + profile.getName() + ", " +
- SystemViewResources.RESID_PROPERTY_PROFILESTATUS_LABEL + ": " +
- (active ? SystemViewResources.RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL : SystemViewResources.RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL);
- }
-
- /**
- * Return the parent of this object. We return the RemoteSystemsConnections project
- */
- public Object getParent(Object element)
- {
- return SystemResourceManager.getRemoteSystemsProject();
- }
-
- /**
- * Return the children of this profile.
- */
- public Object[] getChildren(Object element)
- {
- ISystemProfile profile = (ISystemProfile)element;
- return getCategoryChildren(profile);
- }
-
- /**
- * Given a profile, return all the category children for it. If this child objects have yet to be created,
- * create them now.
- */
- public SystemTeamViewCategoryNode[] getCategoryChildren(ISystemProfile profile)
- {
- SystemTeamViewCategoryNode[] children = (SystemTeamViewCategoryNode[])categoriesByProfile.get(profile);
- if (children == null)
- {
- children = new SystemTeamViewCategoryNode[2]; //5];
- for (int idx=0; idx<children.length; idx++)
- children[idx] = new SystemTeamViewCategoryNode(profile);
- children[0].setLabel(SystemResources.RESID_TEAMVIEW_CATEGORY_CONNECTIONS_LABEL);
- children[0].setDescription(SystemResources.RESID_TEAMVIEW_CATEGORY_CONNECTIONS_TOOLTIP);
- children[0].setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTION_ID));
- children[0].setMementoHandle(SystemTeamViewCategoryNode.MEMENTO_CONNECTIONS);
-
- children[1].setLabel(SystemResources.RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_LABEL);
- children[1].setDescription(SystemResources.RESID_TEAMVIEW_CATEGORY_FILTERPOOLS_TOOLTIP);
- children[1].setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTERPOOL_ID));
- children[1].setMementoHandle(SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS);
-/*
- children[2].setLabel(SystemResources.RESID_TEAMVIEW_CATEGORY_USERACTIONS_LABEL);
- children[2].setDescription(SystemResources.RESID_TEAMVIEW_CATEGORY_USERACTIONS_TOOLTIP);
- children[2].setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_USERACTION_USR_ID));
- children[2].setMementoHandle(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS);
-
- children[3].setLabel(SystemResources.RESID_TEAMVIEW_CATEGORY_COMPILECMDS_LABEL);
- children[3].setDescription(SystemResources.RESID_TEAMVIEW_CATEGORY_COMPILECMDS_TOOLTIP);
- children[3].setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID));
- children[3].setMementoHandle(SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS);
- */
- /*
- children[4].setLabel(SystemResources.RESID_TEAMVIEW_CATEGORY_TARGETS_LABEL);
- children[4].setDescription(SystemResources.RESID_TEAMVIEW_CATEGORY_TARGETS_TOOLTIP);
- children[4].setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_TARGET_ID));
- children[4].setMementoHandle(SystemTeamViewCategoryNode.MEMENTO_TARGETS);
- */
-
- categoriesByProfile.put(profile, children);
- }
- return children;
- }
- /**
- * Given a profile and memento handle, return the appropriate category node. This is used when
- * restoring the expansion and selection state of the team view.
- */
- public SystemTeamViewCategoryNode restoreCategory(ISystemProfile profile, String mementoHandle)
- {
- SystemTeamViewCategoryNode[] children = getCategoryChildren(profile);
- SystemTeamViewCategoryNode category = null;
- for (int idx=0; (category==null) && (idx<2); idx++)
- {
- if (children[idx].getMementoHandle().equals(mementoHandle))
- category = children[idx];
- }
- return category;
- }
-
- /**
- * Return true if this profile has children. We return true.
- */
- public boolean hasChildren(Object element)
- {
- return true;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties.
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- propertyDescriptorArray = new PropertyDescriptor[1];
- RSEUIPlugin plugin = RSEUIPlugin.getDefault();
- int idx = 0;
- // status
- propertyDescriptorArray[idx++] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_IS_ACTIVE,SystemViewResources.RESID_PROPERTY_PROFILESTATUS_LABEL, SystemViewResources.RESID_PROPERTY_PROFILESTATUS_TOOLTIP);
- }
- return propertyDescriptorArray;
- }
-
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param key - the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object internalGetPropertyValue(Object key)
- {
- String name = (String)key;
- ISystemProfile profile = (ISystemProfile)propertySourceInput;
-
- if (name.equals(P_IS_ACTIVE))
- {
- boolean active = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName());
- if (active)
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL;
- else
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL;
- }
- else
- return null;
- }
-
-
- // FOR COMMON DELETE ACTIONS
- /**
- * Return true if this object is deletable by the user. If so, when selected,
- * the Edit->Delete menu item will be enabled.
- */
- public boolean canDelete(Object element)
- {
- boolean ok = true;
- if (!(element instanceof ISystemProfile))
- {
- ok = false;
- //System.out.println("selection: "+currObj.getClass().getName());
- }
- return ok;
- }
- /**
- * Perform the delete action.
- */
- public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
- {
- boolean ok = true;
- RSEUIPlugin.getTheSystemRegistry().deleteSystemProfile((ISystemProfile)element);
- return ok;
- }
-
- // FOR COMMON RENAME ACTIONS
- /**
- * Return true if this object is renamable by the user. If so, when selected,
- * the Rename popup menu item will be enabled.
- */
- public boolean canRename(Object element)
- {
- boolean ok = true;
- if (!(element instanceof ISystemProfile))
- ok = false;
- return ok;
- }
- /**
- * Perform the rename action.
- */
- public boolean doRename(Shell shell, Object element, String newName) throws Exception
- {
- boolean ok = true;
- RSEUIPlugin.getTheSystemRegistry().renameSystemProfile((ISystemProfile)element, newName);
- return ok;
- }
- /**
- * Return a validator for verifying the new name is correct.
- */
- public ISystemValidator getNameValidator(Object element)
- {
- return new ValidatorProfileName(RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfileNamesVector());
- }
- /**
- * Parent override.
- * <p>
- * Form and return a new canonical (unique) name for this object, given a candidate for the new
- * name. This is called by the generic multi-rename dialog to test that all new names are unique.
- * To do this right, sometimes more than the raw name itself is required to do uniqueness checking.
- * <p>
- * Returns profile.connectionName, upperCased
- */
- public String getCanonicalNewName(Object element, String newName)
- {
- return newName.toUpperCase();
- }
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- */
- public String getMementoHandle(Object element)
- {
- ISystemProfile profile = (ISystemProfile)element;
- return profile.getName();
- }
- /**
- * Return a short string to uniquely identify the type of resource.
- */
- public String getMementoHandleKey(Object element)
- {
- return ISystemMementoConstants.MEMENTO_KEY_PROFILE;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewRefreshAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewRefreshAllAction.java
deleted file mode 100644
index 7aa5c93b6..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewRefreshAllAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Michael Berger (IBM) - 146339 Added refresh action graphic.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.actions.SystemBaseAction;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The action allows users to refresh the entire System Team tree view
- */
-public class SystemTeamViewRefreshAllAction extends SystemBaseAction
- //
-{
- private SystemTeamViewPart teamView;
-
- /**
- * Constructor for SystemRefreshAllAction
- */
- public SystemTeamViewRefreshAllAction(Shell parent, SystemTeamViewPart teamView)
- {
- super(SystemResources.ACTION_REFRESH_ALL_LABEL,SystemResources.ACTION_REFRESH_ALL_TOOLTIP,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID),
- parent);
- this.teamView = teamView;
- allowOnMultipleSelection(true);
- setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
- setSelectionSensitive(false);
-
- setHelp(RSEUIPlugin.HELPPREFIX+"actn0009");
- }
-
- /**
- * @see SystemBaseAction#updateSelection(IStructuredSelection)
- */
- public boolean updateSelection(IStructuredSelection selection)
- {
- boolean enable = true;
- return enable;
- }
-
- /**
- * This is the method called when the user selects this action.
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run()
- {
- try {
- SystemResourceManager.getRemoteSystemsProject().refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception exc) {}
-
- SystemTeamView teamViewer = (SystemTeamView)teamView.getTreeViewer();
- teamViewer.refresh();
- //System.out.println("Running refresh all");
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewResourceAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewResourceAdapterFactory.java
deleted file mode 100644
index bdfa5c26d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewResourceAdapterFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.rse.core.SystemResourceManager;
-import org.eclipse.rse.core.model.ISystemRegistry;
-
-
-/**
- * Special adapter factory that maps Remote Systems Framework objects to underlying workbench resources
- */
-public class SystemTeamViewResourceAdapterFactory implements IAdapterFactory
-{
- /**
- * @see IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList()
- {
- return new Class[] {IResource.class};
- }
- /**
- * Called by our plugin's startup method to register our adaptable object types
- * with the platform. We prefer to do it here to isolate/encapsulate all factory
- * logic in this one place.
- */
- public void registerWithManager(IAdapterManager manager)
- {
- manager.registerAdapters(this, ISystemRegistry.class);
- //manager.registerAdapters(this, SystemProfile.class); DEFERRED UNTIL NEXT RELEASE
- }
- /**
- * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType)
- {
- Object adapter = null;
- if (adaptableObject instanceof ISystemRegistry)
- {
- //SystemRegistry sr = (SystemRegistry)adaptableObject;
- adapter = SystemResourceManager.getRemoteSystemsProject();
- }
- /* deferred
- else if (adaptableObject instanceof SystemProfile)
- {
- SystemProfile profile = (SystemProfile)adaptableObject;
- adapter = SystemResourceManager.getProfileFolder(profile);
- }*/
- return adapter;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationAdapter.java
deleted file mode 100644
index e06ba26d3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationAdapter.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.SystemMenuManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.filters.actions.SystemFilterWorkWithFilterPoolsAction;
-import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
-import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
-import org.eclipse.rse.ui.view.SystemViewResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-
-/**
- * Adapter for displaying and processing SystemTeamViewSubSystemConfigurationNode objects in tree views, such as
- * the Team view.
- */
-public class SystemTeamViewSubSystemConfigurationAdapter
- extends AbstractSystemViewAdapter
- implements ISystemViewElementAdapter
-{
- private boolean actionsCreated = false;
- //private Hashtable categoriesByProfile = new Hashtable();
- private SystemFilterWorkWithFilterPoolsAction wwPoolsAction;
-
- // -------------------
- // property descriptors
- // -------------------
- private static PropertyDescriptor[] propertyDescriptorArray = null;
-
-
- /**
- * Returns any actions that should be contributed to the popup menu
- * for the given element.
- * @param menu The menu to contribute actions to
- * @param selection The window's current selection.
- * @param shell Shell of viewer
- * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
- */
- public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
- {
- if (!actionsCreated)
- createActions();
-
- SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode)selection.getFirstElement();
- SystemTeamViewCategoryNode category = ssfNode.getParentCategory();
- String categoryType = category.getMementoHandle();
-
-// FIXME - user actions and compilecmds no longer coupled to core
-// if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS) && ssfNode.getSubSystemConfiguration().supportsUserDefinedActions())
-// {
-// wwActionsAction.reset();
-// wwActionsAction.setShell(shell);
-// menu.add(menuGroup, wwActionsAction);
-// }
-// else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS) && ssfNode.getSubSystemConfiguration().supportsCompileActions())
-// {
-// wwCmdsAction.reset();
-// wwCmdsAction.setShell(shell);
-// menu.add(menuGroup, wwCmdsAction);
-// }
- if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS) && ssfNode.getSubSystemConfiguration().supportsFilters())
- {
- wwPoolsAction.reset();
- wwPoolsAction.setShell(shell);
- wwPoolsAction.setFilterPoolManagerProvider(ssfNode.getSubSystemConfiguration());
- ISystemFilterPoolManager[] poolMgrs = new ISystemFilterPoolManager[1];
- poolMgrs[0] = ssfNode.getSubSystemConfiguration().getFilterPoolManager(ssfNode.getProfile());
- wwPoolsAction.setFilterPoolManagers(poolMgrs);
- menu.add(menuGroup, wwPoolsAction);
- }
- }
- private void createActions()
- {
- actionsCreated = true;
-
-// FIXME - user actions and compile actions no longer coupled to core
-// wwActionsAction = new SystemWorkWithUDAsAction(null, true);
-// wwCmdsAction = new SystemWorkWithCompileCommandsAction(null, true);
- wwPoolsAction = new SystemFilterWorkWithFilterPoolsAction(null, false);
- }
-
- /**
- * Returns an image descriptor for the image. More efficient than getting the image.
- * @param element The element for which an image is desired
- */
- public ImageDescriptor getImageDescriptor(Object element)
- {
- return ((SystemTeamViewSubSystemConfigurationNode)element).getImageDescriptor();
- }
-
- /**
- * Return the label for this object
- */
- public String getText(Object element)
- {
- return ((SystemTeamViewSubSystemConfigurationNode)element).getLabel();
- }
-
- /**
- * Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
- * <p>
- * Called by common rename and delete actions.
- */
- public String getName(Object element)
- {
- return ((SystemTeamViewSubSystemConfigurationNode)element).getLabel();
- }
-
- /**
- * Return the absolute name, versus just display name, of this object
- */
- public String getAbsoluteName(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode factory = (SystemTeamViewSubSystemConfigurationNode)element;
- return factory.getProfile().getName() + "." + factory.getParentCategory().getLabel() + factory.getLabel(); //$NON-NLS-1$
- }
-
- /**
- * Return the type label for this object
- */
- public String getType(Object element)
- {
- return SystemViewResources.RESID_PROPERTY_TEAM_SSFACTORY_TYPE_VALUE;
- }
-
- /**
- * Return the string to display in the status line when the given object is selected.
- */
- public String getStatusLineText(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode factory = (SystemTeamViewSubSystemConfigurationNode)element;
- return SystemResources.RESID_TEAMVIEW_SUBSYSFACTORY_VALUE + ": " + factory.getLabel(); //$NON-NLS-1$
- }
-
- /**
- * Return the parent of this object. We return the RemoteSystemsConnections project
- */
- public Object getParent(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode factory = (SystemTeamViewSubSystemConfigurationNode)element;
- return factory.getParentCategory();
- }
-
- /**
- * Return the children of this profile.
- */
- public Object[] getChildren(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode)element;
- SystemTeamViewCategoryNode category = ssfNode.getParentCategory();
- ISystemProfile profile = ssfNode.getProfile();
- String categoryType = category.getMementoHandle();
- ISubSystemConfiguration ssf = ssfNode.getSubSystemConfiguration();
- if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS))
- {
- return profile.getFilterPools(ssf);
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS))
- {
- /* FIXME
- SystemUDActionElement[] children = profile.getUserActions(ssf);
- for (int idx=0; idx<children.length; idx++)
- {
- children[idx].setData(ssfNode);
- }
- return children;
- */
- return null;
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS))
- {
- /* FIXME
- SystemCompileType[] types = profile.getCompileCommandTypes(ssf);
- if (types != null)
- {
- SystemTeamViewCompileTypeNode[] typeNodes = new SystemTeamViewCompileTypeNode[types.length];
- for (int idx=0; idx<types.length; idx++)
- typeNodes[idx] = new SystemTeamViewCompileTypeNode(ssfNode, types[idx]);
- return typeNodes;
- }
- else
- */
- return null;
- }
- else
- return null;
- }
-
- /**
- * Return true if this profile has children. We return true.
- */
- public boolean hasChildren(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode ssConfNode = (SystemTeamViewSubSystemConfigurationNode)element;
- SystemTeamViewCategoryNode category = ssConfNode.getParentCategory();
- //ISystemProfile profile = ssConfNode.getProfile();
- String categoryType = category.getMementoHandle();
- //ISubSystemConfiguration ssConf = ssConfNode.getSubSystemConfiguration();
- if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_FILTERPOOLS))
- return true;
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS))
- {
- /* FIXME
- return (profile.getUserActions(ssConf).length > 0);
- */
- return false;
- }
- else if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_COMPILECMDS))
- {
- /* FIXME
- return (profile.getCompileCommandTypes(ssConf).length > 0);
- */
- return false;
- }
- else
- return false;
- }
-
- // Property sheet descriptors defining all the properties we expose in the Property Sheet
- /**
- * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties.
- */
- protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
- {
- if (propertyDescriptorArray == null)
- {
- /*
- propertyDescriptorArray = new PropertyDescriptor[1];
- RSEUIPlugin plugin = RSEUIPlugin.getDefault();
- int idx = 0;
- // status
- propertyDescriptorArray[idx] = new PropertyDescriptor(ISystemPropertyConstants.P_IS_ACTIVE,
- SystemViewResources.RESID_PROPERTY_PROFILESTATUS_LABEL);
- propertyDescriptorArray[idx].setDescription(SystemViewResources.RESID_PROPERTY_PROFILESTATUS_DESCRIPTION));
- ++idx;
- */
- }
- return propertyDescriptorArray;
- }
-
- /**
- * Returns the current value for the named property.
- * The parent handles P_TEXT and P_TYPE only, and we augment that here.
- * @param key - the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object internalGetPropertyValue(Object key)
- {
- /*
- if (name.equals(P_IS_ACTIVE))
- {
- boolean active = RSEUIPlugin.getTheSystemRegistry().getSystemProfileManager().isSystemProfileActive(profile.getName());
- if (active)
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_ACTIVE_LABEL);
- else
- return SystemViewResources.RESID_PROPERTY_PROFILESTATUS_NOTACTIVE_LABEL);
- }
- else
- */
- return null;
- }
-
-
- // ------------------------------------------------------------
- // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER...
- // ------------------------------------------------------------
- /**
- * Return what to save to disk to identify this element in the persisted list of expanded elements.
- */
- public String getMementoHandle(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode factory = (SystemTeamViewSubSystemConfigurationNode)element;
- return factory.getMementoHandle();
- }
- /**
- * Return a short string to uniquely identify the type of resource.
- */
- public String getMementoHandleKey(Object element)
- {
- SystemTeamViewSubSystemConfigurationNode factory = (SystemTeamViewSubSystemConfigurationNode)element;
- return factory.getProfile().getName() + "." + factory.getParentCategory().getLabel() + "." + factory.getLabel(); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationNode.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationNode.java
deleted file mode 100644
index 87cba6cce..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/team/SystemTeamViewSubSystemConfigurationNode.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.view.team;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.ui.SystemResources;
-
-
-/**
- * This class represents a child node under category nodes, in the Team view.
- * It represents expandable subsystem factories such as "Files" or "iSeries Objects".
- */
-public class SystemTeamViewSubSystemConfigurationNode implements IAdaptable
-{
- private String mementoHandle;
- private ISystemProfile profile;
- private ISubSystemConfiguration ssf;
- private SystemTeamViewCategoryNode parentCategory;
- private String name = null;
-
- /**
- * Constructor
- */
- public SystemTeamViewSubSystemConfigurationNode(ISystemProfile profile, SystemTeamViewCategoryNode parentCategory, ISubSystemConfiguration ssf)
- {
- super();
- this.profile = profile;
- this.ssf = ssf;
- this.parentCategory = parentCategory;
- }
-
- /**
- * This is the method required by the IAdaptable interface.
- * Given an adapter class type, return an object castable to the type, or
- * null if this is not possible.
- */
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- /**
- * Compare this node to another.
- */
- public boolean equals(Object o)
- {
- if (o instanceof SystemTeamViewSubSystemConfigurationNode)
- {
- SystemTeamViewSubSystemConfigurationNode other = (SystemTeamViewSubSystemConfigurationNode)o;
- if ((ssf == other.getSubSystemConfiguration()) &&
- (parentCategory == other.getParentCategory()) &&
- (profile == other.getProfile()))
- return true;
- else
- return false;
- }
- else
- return super.equals(o);
- }
-
- /**
- * Return this node's image
- * @return the image to show in the tree, for this node
- */
- public ImageDescriptor getImageDescriptor()
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssf.getAdapter(ISubSystemConfigurationAdapter.class);
- return adapter.getImage(ssf);
- }
-
- /**
- * Return this node's label
- * @return the translated label to show in the tree, for this node
- */
- public String getLabel()
- {
- if (name == null)
- {
- name = ""; //$NON-NLS-1$
- String[] types = ssf.getSystemTypes();
- if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes())
- {
- name = SystemResources.TERM_ALL;
- }
- else
- {
- for (int idx=0; idx<types.length; idx++)
- {
- if (idx==0)
- name += types[idx];
- else
- name += ", " + types[idx]; //$NON-NLS-1$
- }
- }
- name = ssf.getName() + " ("+name+")"; //$NON-NLS-1$ //$NON-NLS-2$
- //name = ssf.getName() + ": "+name;
- }
- return name;
- }
-
- /**
- * Convert to string. We call getLabel()
- */
- public String toString()
- {
- return getLabel();
- }
-
- /**
- * @return profile this category is associated with
- */
- public ISystemProfile getProfile()
- {
- return profile;
- }
-
- /**
- * @param profile ... the profile this category is associated with
- */
- public void setProfile(ISystemProfile profile)
- {
- this.profile = profile;
- }
-
- /**
- * @return the untranslated value to store in the memento, to uniquely identify this node
- */
- public String getMementoHandle()
- {
- return mementoHandle;
- }
-
- /**
- * Set the untranslated value to store in the memento, to uniquely identify this node
- * @param string - untranslated value
- */
- public void setMementoHandle(String string)
- {
- mementoHandle = string;
- }
-
- /**
- * Return the subsystem factory this node represents
- */
- public ISubSystemConfiguration getSubSystemConfiguration()
- {
- return ssf;
- }
-
- /**
- * Set the subsystem factory this node represents
- */
- public void setSubSystemConfiguration(ISubSystemConfiguration factory)
- {
- ssf = factory;
- }
-
- /**
- * Return the parent category this is a child of.
- */
- public SystemTeamViewCategoryNode getParentCategory()
- {
- return parentCategory;
- }
-
- /**
- * Set the parent category this is a child of.
- */
- public void setParentCategory(SystemTeamViewCategoryNode node)
- {
- parentCategory = node;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/EnvironmentVariablesForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/EnvironmentVariablesForm.java
deleted file mode 100644
index 5d7a9f225..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/EnvironmentVariablesForm.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.dialogs.EnvironmentVariablesPromptDialog;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-
-/**
- * Preference page which allows the user to manage persisted environment
- * variables for an RSE connection.
- */
-public class EnvironmentVariablesForm extends SystemBaseForm implements SelectionListener, MouseListener {
-
-
- // constants
- private static final String VAR_NAME = "NAME";
- private static final String VAR_VALUE = "VALUE";
- private static final String[] COLUMN_PROPERTIES = {VAR_NAME, VAR_VALUE};
-
- // instance variables
- private Table envVarTable;
- private Vector envVars;
- private EnvironmentVariablesTableContentProvider provider;
- private Object selectedObject;
- private TableViewer envVarTableViewer;
- private String systemType;
- private String invalidNameChars;
-
- private Button addButton, changeButton, removeButton, moveUpButton, moveDownButton;
-
- // Temporary class for storing environment variable information
- // until we pass it to the commands subsystem.
- public class EnvironmentVariable {
- protected String _name;
- protected String _value;
-
- public EnvironmentVariable(String name, String value)
- {
- _name = name;
- _value = value;
- }
-
- public String getName() { return _name;}
- public String getValue() { return _value;}
- public void setName(String name) {_name = name;}
- public void setValue(String value) { _value = value;}
- }
-
- protected class EnvironmentVariablesTableContentProvider implements IStructuredContentProvider,
- ITableLabelProvider,
- ICellModifier, ICellEditorValidator
- {
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- return envVars.toArray();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex == 0) {
- return ((EnvironmentVariable) element).getName();
- } else {
- return ((EnvironmentVariable) element).getValue();
- }
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- }
-
- // yantzi:2.1.2 Added ability to directly edit in env var table
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property) {
- if (VAR_NAME.equals(property))
- {
- return ((EnvironmentVariable) element).getName();
- }
- else // VAR_VALUE
- {
- return ((EnvironmentVariable) element).getValue();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value) {
- if (VAR_NAME.equals(property))
- {
- SystemMessage msg = validateName((String)value);
- if (msg != null)
- {
- getMessageLine().setErrorMessage(msg);
- }
- else
- {
- if (invalidNameChars != null && invalidNameChars.indexOf(' ') != -1)
- {
- ((EnvironmentVariable) ((TableItem)element).getData()).setName(((String) value).trim());
- }
- else
- {
- ((EnvironmentVariable) ((TableItem)element).getData()).setName((String) value);
- }
- getMessageLine().clearErrorMessage();
- }
- }
- else
- {
- ((EnvironmentVariable) ((TableItem)element).getData()).setValue((String) value);
- }
-
- envVarTableViewer.refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object value)
- {
- SystemMessage msg = validateName((String) value);
- if (msg != null)
- {
- getMessageLine().setErrorMessage(msg);
- }
- else
- {
- getMessageLine().clearErrorMessage();
- }
-
- // always return null because we handle displaying the error message
- return null;
- }
-
- }
-
- /**
- * Constructor for EnvironmentVariablesForm.
- * @param msgLine
- */
- public EnvironmentVariablesForm(Shell shell, ISystemMessageLine msgLine, Object selectedObject, String invalidNameChars) {
- super(shell, msgLine);
- this.selectedObject = selectedObject;
- this.invalidNameChars = invalidNameChars;
- envVars = new Vector();
- provider = new EnvironmentVariablesTableContentProvider();
-
- if (selectedObject instanceof ISubSystem)
- {
- systemType = ((ISubSystem) selectedObject).getHost().getSystemType();
- }
-
- }
-
- /**
- * @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
- */
- public Control createContents(Composite parent) {
-
- SystemWidgetHelpers.createLabel(parent, SystemResources.RESID_SUBSYSTEM_ENVVAR_DESCRIPTION);
-
- // Environment Variables List
- envVarTable = new Table(parent, SWT.FULL_SELECTION |SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- envVarTable.setLinesVisible(true);
- envVarTable.setHeaderVisible(true);
- envVarTable.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_TOOLTIP);
- envVarTable.addSelectionListener(this);
- envVarTable.addMouseListener(this);
-
- TableLayout tableLayout = new TableLayout();
- tableLayout.addColumnData(new ColumnWeightData(100, true));
- tableLayout.addColumnData(new ColumnWeightData(100, true));
- envVarTable.setLayout(tableLayout);
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
- gd.heightHint = 200;
- envVarTable.setLayoutData(gd);
-
- // Name column
- TableColumn hostnameColumn = new TableColumn(envVarTable, SWT.NONE);
- hostnameColumn.setText(SystemResources.RESID_SUBSYSTEM_ENVVAR_NAME_TITLE);
-
- // Value column
- TableColumn sysTypeColumn = new TableColumn(envVarTable, SWT.NONE);
- sysTypeColumn.setText(SystemResources.RESID_SUBSYSTEM_ENVVAR_VALUE_TITLE);
-
- envVarTableViewer = new TableViewer(envVarTable);
- envVarTableViewer.setContentProvider(provider);
- envVarTableViewer.setLabelProvider(provider);
-
- // yantzi:2.1.2 Added ability to directly edit in env var table
- envVarTableViewer.setCellModifier(provider);
- envVarTableViewer.setColumnProperties(COLUMN_PROPERTIES);
-
- CellEditor[] cellEditors = new CellEditor[2];
- cellEditors[0] = new TextCellEditor(envVarTable);
- cellEditors[0].setValidator(provider);
- cellEditors[1] = new TextCellEditor(envVarTable);
- envVarTableViewer.setCellEditors(cellEditors);
-
- envVarTableViewer.setInput(selectedObject);
-
- // Create the buttons for add, change, remove, move up and move down
- Composite buttonBar = SystemWidgetHelpers.createComposite(parent, 5);
-
- addButton = SystemWidgetHelpers.createPushButton(buttonBar, SystemResources.RESID_PREF_SIGNON_ADD_LABEL, null);
- addButton.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_ADD_TOOLTIP);
- addButton.addSelectionListener(this);
-
- changeButton = SystemWidgetHelpers.createPushButton(buttonBar, SystemResources.RESID_PREF_SIGNON_CHANGE_LABEL, null);
- changeButton.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_CHANGE_TOOLTIP);
- changeButton.addSelectionListener(this);
- changeButton.setEnabled(false);
-
- removeButton = SystemWidgetHelpers.createPushButton(buttonBar, SystemResources.RESID_PREF_SIGNON_REMOVE_LABEL, null);
- removeButton.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_REMOVE_TOOLTIP);
- removeButton.addSelectionListener(this);
- removeButton.setEnabled(false);
-
- moveUpButton = SystemWidgetHelpers.createPushButton(buttonBar, SystemResources.RESID_SUBSYSTEM_ENVVAR_MOVEUP_LABEL, null);
- moveUpButton.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_MOVEUP_TOOLTIP);
- moveUpButton.addSelectionListener(this);
- moveUpButton.setEnabled(false);
-
- moveDownButton = SystemWidgetHelpers.createPushButton(buttonBar, SystemResources.RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_LABEL, null);
- moveDownButton.setToolTipText(SystemResources.RESID_SUBSYSTEM_ENVVAR_MOVEDOWN_TOOLTIP);
- moveDownButton.addSelectionListener(this);
- moveDownButton.setEnabled(false);
-
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "envv0000");
-
- return parent;
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- /**
- * Helper method for retrieving the list of existing environment variable names
- */
- private String[] getVariableNames()
- {
- String[] existingNames = new String[envVars.size()];
- for (int i = 0; i < envVars.size(); i++)
- {
- existingNames[i] = ((EnvironmentVariable) envVars.get(i))._name;
- }
-
- return existingNames;
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
-
- if (e.getSource() == addButton)
- {
- // Prompt the user for the new environment variable
- EnvironmentVariablesPromptDialog dialog =
- new EnvironmentVariablesPromptDialog(
- getShell(),
- SystemResources.RESID_SUBSYSTEM_ENVVAR_ADD_TITLE,
- systemType,
- invalidNameChars,
- getVariableNames(),
- false);
-
- if (dialog.open() == Window.OK) {
- // Add new variable to model
- EnvironmentVariable var = new EnvironmentVariable(dialog.getName(), dialog.getValue());
- envVars.add(var);
- envVarTableViewer.refresh();
-
- //dy defect 47040 position table so new variable is shown
- envVarTableViewer.reveal(var);
- }
- }
- else if (e.getSource() == removeButton)
- {
- int[] selections = envVarTable.getSelectionIndices();
- if (selections != null && selections.length > 0) {
- for (int loop = selections.length - 1; loop >= 0; loop--) {
- envVars.remove(selections[loop]);
- }
- envVarTableViewer.refresh();
- }
- }
- else if (e.getSource() == changeButton)
- {
- changeCurrentlySelectedVariable();
- }
- else if (e.getSource() == moveUpButton)
- {
- int[] selections = envVarTable.getSelectionIndices();
- envVarTable.deselectAll();
-
- if (selections != null) {
- // Move the selected objects up one position in the table
- Object temp;
- for (int loop=0; loop < selections.length; loop++) {
- temp = envVars.remove(selections[loop]);
- envVars.add(selections[loop] - 1, temp);
- }
-
- envVarTableViewer.refresh();
-
- //dy defect 47040 position table so top variable is shown
- envVarTableViewer.reveal(envVars.get(selections[0] - 1));
-
- // Reselect the entries
- for (int loop=0; loop < selections.length; loop++) {
- if (selections[loop] > 0)
- envVarTable.select(selections[loop] - 1);
- else
- envVarTable.select(selections[loop]);
- }
- }
- }
- else if (e.getSource() == moveDownButton)
- {
- int[] selections = envVarTable.getSelectionIndices();
- envVarTable.deselectAll();
-
- // move the selected entries down one position in the table
- if (selections != null) {
- Object temp;
- for (int loop=selections.length - 1; loop >= 0; loop--) {
- if (selections[loop] < envVars.size() - 1) {
- temp = envVars.remove(selections[loop]);
- envVars.add(selections[loop] + 1, temp);
- }
- }
-
- envVarTableViewer.refresh();
-
- //dy defect 47040 position table so bottom variable is shown
- envVarTableViewer.reveal(envVars.get(selections[selections.length - 1] + 1));
-
- // reselect the entries
- for (int loop=0; loop < selections.length; loop++) {
- if (selections[loop] < envVars.size() - 1)
- envVarTable.select(selections[loop] + 1);
- else
- envVarTable.select(selections[loop]);
- }
- }
- }
-
- // Update table buttons based on changes
- if (envVarTable.getSelectionCount() == 0) {
- changeButton.setEnabled(false);
- removeButton.setEnabled(false);
- moveUpButton.setEnabled(false);
- moveDownButton.setEnabled(false);
- } else {
- int[] selectionIndices = envVarTable.getSelectionIndices();
- boolean upEnabled = true;
- boolean downEnabled = true;
- for (int loop = 0; loop < selectionIndices.length; loop++) {
- if (selectionIndices[loop] == 0)
- upEnabled = false;
-
- if (selectionIndices[loop] == (envVarTable.getItemCount() - 1))
- downEnabled = false;
- }
-
- if (selectionIndices.length == 1)
- {
- changeButton.setEnabled(true);
- }
- else
- {
- changeButton.setEnabled(false);
- }
- removeButton.setEnabled(true);
- moveUpButton.setEnabled(upEnabled);
- moveDownButton.setEnabled(downEnabled);
- }
-
- }
-
- /**
- * Get the environment variables currently in the table.
- */
- public Collection getEnvVars()
- {
- return envVars;
- }
-
- /**
- * Set the input for the environment variables table
- */
- public void setEnvVars(Vector envVars)
- {
- this.envVars = envVars;
- if (envVarTableViewer != null)
- {
- envVarTableViewer.refresh();
- }
- }
-
- /**
- * Helper method so the same code can be run when the user selets the chagne button or
- * double clicks in the table.
- */
- private void changeCurrentlySelectedVariable()
- {
- int[] selections = envVarTable.getSelectionIndices();
- if (selections != null && selections.length == 1)
- {
- EnvironmentVariablesPromptDialog dialog = new
- EnvironmentVariablesPromptDialog(
- getShell(),
- SystemResources.RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE,
- systemType,
- invalidNameChars,
- getVariableNames(),
- true);
- dialog.setName(((EnvironmentVariable)envVars.get(selections[0])).getName());
- dialog.setValue(((EnvironmentVariable)envVars.get(selections[0])).getValue());
-
- if (dialog.open() == Window.OK)
- {
- envVars.remove(selections[0]);
- envVars.add(selections[0], new EnvironmentVariable(dialog.getName(), dialog.getValue()));
- envVarTableViewer.refresh();
- }
- }
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e)
- {
- // Shortcut for change
- changeCurrentlySelectedVariable();
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseDown(MouseEvent)
- */
- public void mouseDown(MouseEvent e)
- {
- }
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseUp(MouseEvent)
- */
- public void mouseUp(MouseEvent e)
- {
- }
-
- /**
- * validate the environment variable's name
- */
- private SystemMessage validateName(String value)
- {
- SystemMessage msg = null;
- String name = value;
- if (name == null || name.trim().equals(""))
- {
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_NONAME);
- }
- else
- {
- if (invalidNameChars != null)
- {
- if (invalidNameChars.indexOf(' ') != -1)
- {
- name = (value).trim();
- }
-
- // first check for invalid characters
- if (invalidNameChars != null)
- {
- for (int i = 0; i < invalidNameChars.length() && msg == null; i++)
- {
- if (name.indexOf(invalidNameChars.charAt(i)) != -1)
- {
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_INVALIDCHAR);
- }
- }
- }
-
- // next check for duplicate env var names
- String existingName;
- int currentSelection = envVarTable.getSelectionIndex();
- for (int i = 0; i < envVars.size() && msg == null; i++)
- {
- existingName = ((EnvironmentVariable) envVars.get(i)).getName();
- if (currentSelection != i && existingName.equals(name))
- {
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_ENVVAR_DUPLICATE);
- msg.makeSubstitution(existingName);
- }
- }
- }
- }
-
- return msg;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/GridUtil.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/GridUtil.java
deleted file mode 100644
index 2b20210a7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/GridUtil.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.swt.layout.GridData;
-
-/**
- * A utility class to create convenient grid data objects.
- */
-public class GridUtil
-{
- /**
- * GridUtil constructor comment.
- */
- public GridUtil()
- {
- super();
- }
-
- /**
- * Creates a grid data object that occupies vertical and horizontal space.
- */
- static public GridData createFill()
- {
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- return gd;
- }
-
- /**
- * Creates a grid data object that occupies horizontal space.
- */
- static public GridData createHorizontalFill()
- {
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- return gd;
- }
-
- /**
- * Creates a grid data object that occupies vertical space.
- */
- static public GridData createVerticalFill()
- {
- GridData gd = new GridData();
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- return gd;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IInheritableEntryFieldStateChangeListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IInheritableEntryFieldStateChangeListener.java
deleted file mode 100644
index 21b634a5d..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IInheritableEntryFieldStateChangeListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-/**
- * Any listener that wants to be notified of state changes to the inheritable
- * entry field widget must implement this interface.
- */
-public interface IInheritableEntryFieldStateChangeListener {
-
- /**
- * Called when the state of the inheritable field has changed. The new state of the field can be queried by calling
- * <code>isLocal</code> on on the entry field.
- * @param field the inheritable field which has changed state.
- */
- public void stateChanged(InheritableEntryField field);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IServerLauncherForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IServerLauncherForm.java
deleted file mode 100644
index 40e9d9011..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/IServerLauncherForm.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * An interface implemented by server launchers in order to prompt for the
- * properties of that server launcher.
- * @see org.eclipse.rse.core.subsystems.IServerLauncherProperties
- */
-public interface IServerLauncherForm
-{
- /**
- * Create the contents of the form
- */
- public abstract Control createContents(Composite parent);
-
- /*
- * Sets the hostname associated with this form
- */
- public void setHostname(String hostname);
-
- /**
- * Set the initial values for the widgets, based on the server launcher values
- */
- public void initValues(IServerLauncherProperties launcher);
- /**
- * Verify the contents of the widgets, when OK is pressed.
- * Return true if all is well, false if an error found.
- */
- public boolean verify();
- /**
- * Update the actual values in the server launcher, from the widgets. Called on successful press of OK.
- * @return true if all went well, false if something failed for some reason.
- */
- public boolean updateValues(IServerLauncherProperties launcher);
-
- /**
- * Did anythign change?
- * @return
- */
- public boolean isDirty();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemAddListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemAddListener.java
deleted file mode 100644
index f1bfcfce2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemAddListener.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.rse.core.model.IHost;
-/**
- * This is an interface used by the AS400SelectFieldForm, AS400SelectFieldDialog and
- * AS400SelectFieldAction classes to enable the caller to be informed when the user
- * presses the Add button for the selected field.
- * <p>
- * If you call the enableAddButton method you must pass an object that implements this interface.
- * The dialog will call you back when the user presses the Add button, so you can take
- * appropriate action.
- */
-public interface ISystemAddListener
-{
-
-
- /**
- * The user has pressed the Add button.
- * Do something appropriate with the request.
- * If this action fails for some reason, or you wish to display a completion
- * message, return message text that will be displayed in the dialog's message
- * line. Else, return null.
- */
- public String addButtonPressed(IHost selectedConnection, Object selectedObject);
- /**
- * The user has selected an object. Is this field valid to be added?
- * If so, return null. If not, return a string to display on the
- * message line indicating why it is not valid, such as it already has
- * been added
- */
- public String okToEnableAddButton(IHost selectedConnection, Object selectedObject);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCollapsableSectionListener.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCollapsableSectionListener.java
deleted file mode 100644
index 9b3b82846..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCollapsableSectionListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-/**
- * Listener for collapse / expand events on the SystemCollapsableSection widget.
- */
-public interface ISystemCollapsableSectionListener {
-
-
- /**
- * Notify listeners of a section collapsed or expanded.
- *
- * @return true if the section was collapsed, false if the section was expanded.
- */
- public void sectionCollapsed(boolean collapsed);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCombo.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCombo.java
deleted file mode 100644
index f5b629ed9..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemCombo.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Combo;
-
-
-/**
- * We have a number of composite widgets that include a combo-box. This
- * interface enforces some common methods on all of them to make it easier
- * to code to this in a consistent manner.
- */
-public interface ISystemCombo
-{
-
-
-
- /**
- * Return the embedded combo box widget
- */
- public Combo getCombo();
- /**
- * Set auto-uppercase. When enabled, all non-quoted values are uppercased when appropriate
- */
- public void setAutoUpperCase(boolean enable);
- /**
- * Set the width hint for the combo box widget (in pixels).
- * A rule of thumb is 10 pixels per character, but allow 15 for the litte button on the right.
- * You must call this versus setting it yourself, else you may see truncation.
- */
- public void setWidthHint(int widthHint);
- /**
- * Query the combo field's current contents
- */
- public String getText();
- /**
- * Disable/Enable all the child controls
- */
- public void setEnabled(boolean enabled);
- /**
- * Set the tooltip text for the combo field
- */
- public void setToolTipText(String tip);
- /**
- * Set the tooltip text for the history button
- */
- public void setButtonToolTipText(String tip);
- /**
- * Set the focus to the combo field
- */
- public boolean setFocus();
- /**
- * Select the combo dropdown list entry at the given index
- */
- public void select(int selIdx);
- /**
- * Same as {@link #select(int)}
- */
- public void setSelectionIndex(int selIdx);
- /**
- * Clear the entered/selected contents of the combo box. Clears the text selection and the list selection
- */
- public void clearSelection();
- /**
- * Clear the entered/selected contents of the combo box. Clears only the text selection, not the list selection
- */
- public void clearTextSelection();
- /**
- * Get the index number of the currently selected item.
- */
- public int getSelectionIndex();
- /**
- * Register a listener interested in an item is selected in the combo box
- * @see #removeSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener);
- /**
- * Remove a previously set combo box selection listener.
- * @see #addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemEditPaneStates.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemEditPaneStates.java
deleted file mode 100644
index 4a8171caf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ISystemEditPaneStates.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-/**
- * @author coulthar
- *
- * This interfaces defines the constants for the modes and states
- * of the {@link org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine}
- * class.
- */
-public interface ISystemEditPaneStates
-{
-
- /**
- * MODE - UNSET. Nothing is selected so overall edit pane is hidden/disabled
- */
- public static final int MODE_UNSET = 2;
- /**
- * MODE - NEW. The user is creating a "new" thing
- */
- public static final int MODE_NEW = 4;
- /**
- * MODE - EDIT. The user is editing an existing thing
- */
- public static final int MODE_EDIT = 8;
-
- /**
- * STATE - NO CHANGES. No changes have been made by the user
- */
- public static final int STATE_INITIAL = 128;
- /**
- * STATE - CHANGES PENDING. User has made changes but they haven't been applied yet
- */
- public static final int STATE_PENDING = 256;
- /**
- * STATE - CHANGES MADE. User has made changes and applied them. None pending
- */
- public static final int STATE_APPLIED = 512;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritButton.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritButton.java
deleted file mode 100644
index 6591ffa32..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritButton.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * An InheritButton is a specialized control that
- * wraps a push button control with two states:
- * "inherit" and "local". The initial state is "inherit". The button is
- * painted with arrowhead image that points either left or right if the
- * button is in "inherit" or "local" state respectively.
- * <p>
- * Pressing the button will trigger a SelectionEvent which the client
- * can listen for. Typically the client will use this to change the
- * button state.
- * <p>
- * An InheritButton is assumed to exist inside a composite control with a GridLayout.
- * There is no need to set its layout data unless you wish to override the
- * default characteristics.
- * <p>
- * Although this control extends Composite, it does not make sense to
- * add children to this control or to set a layout on it.
- */
-public class InheritButton extends Composite {
-
- /**
- * Value is 12 pixels.
- */
- public static final int DEFAULT_WIDTH = 12;
-
- /**
- * Value is 20 pixels.
- */
- public static final int DEFAULT_HEIGHT = 20;
-
- private Image leftArrow = null; // arrow points left, value is inherited
- private Image rightArrow = null; // arrow points right, value is the local value
- private boolean isLocal = false; // default is "inherit"
- private Button toggle = null;
- private boolean isDrawn = false; // button is to be drawn or use arrow implementation
-
- /**
- * Create a new InheritButton.
- * @param parent
- */
- public InheritButton(Composite parent) {
- super(parent, SWT.NONE);
- isDrawn = System.getProperty("os.name").toLowerCase().startsWith("win");
- if (isDrawn) {
- GridData data = new GridData(SWT.CENTER, SWT.CENTER, false, false);
- data.widthHint = DEFAULT_WIDTH;
- data.heightHint = DEFAULT_HEIGHT;
- setLayoutData(data);
- }
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- setLayout(layout);
- initializeToggle(this);
- }
-
- private void initializeToggle(Composite parent) {
- if (isDrawn) {
- toggle = new Button(parent, SWT.PUSH );
- createToggleImages(toggle.getBackground());
- toggle.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- disposeToggleImages();
- }
- });
- } else {
- toggle = new Button(parent, SWT.ARROW );
- }
- toggle.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getHelp(AccessibleEvent e) { // this is the one that should supply the text heard.
- e.result = "";
- }
- public void getName(AccessibleEvent e) { // this is the one that apparently does supply the text heard.
- e.result = toggle.getToolTipText();
- String prefix = null;
- Composite parent = toggle.getParent();
- while (parent != null && prefix == null) {
- if (parent instanceof Group) {
- Group group = (Group) parent;
- prefix = group.getText();
- }
- parent = parent.getParent();
- }
- if (prefix != null) {
- e.result = prefix + " " + e.result;
- }
- }
- });
- toggle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- setToggleImage();
- }
-
- /**
- * Set the inherit/local state.
- * In the "local" state, the arrow image points to the right.
- * In the "inherit" state, the arrow image points to the left.
- * @param isLocal true if the button should be in "local" state. false if the
- * button should be in "inherit" state.
- */
- public void setLocal(boolean isLocal) {
- this.isLocal = isLocal;
- setToggleImage();
- }
-
- /**
- * Query the inherit/local state.
- * @return true if the button is in local state
- */
- public boolean isLocal() {
- return isLocal;
- }
-
- /**
- * Register a listener interested in when the button is pressed.
- * <p>
- * @see InheritButton#removeSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener) {
- if (toggle == null) return;
- toggle.addSelectionListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#addKeyListener(org.eclipse.swt.events.KeyListener)
- */
- public void addKeyListener(KeyListener listener) {
- if (toggle == null) return;
- toggle.addKeyListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#removeKeyListener(org.eclipse.swt.events.KeyListener)
- */
- public void removeKeyListener(KeyListener listener) {
- if (toggle == null) return;
- toggle.removeKeyListener(listener);
- }
-
- /**
- * Remove a previously set selection listener.
- * @see InheritButton#addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener) {
- if (toggle == null) return;
- toggle.removeSelectionListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#setFocus()
- */
- public boolean setFocus() {
- return toggle.setFocus();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#isFocusControl()
- */
- public boolean isFocusControl() {
- return toggle.isFocusControl();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#setToolTipText(java.lang.String)
- */
- public void setToolTipText(String string) {
- toggle.setToolTipText(string);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Control#getToolTipText()
- */
- public String getToolTipText() {
- return toggle.getToolTipText();
- }
-
- /**
- * Places the correct graphic on the button depending on the current
- * button state.
- * In the "local" state, the arrow image points to the right.
- * In the "inherit" state, the arrow image points to the left.
- */
- private void setToggleImage() {
- if (isDrawn) {
- toggle.setImage(isLocal ? rightArrow : leftArrow);
- } else {
- int alignment = isLocal ? SWT.RIGHT : SWT.LEFT;
- toggle.setAlignment(alignment);
- }
- }
-
- /**
- * Creates the images used for the button graphics. This should be done
- * when the button is created.
- * @param backgroundColor The background color with which the arrow images
- * should be painted. The foreground color is black.
- */
- private void createToggleImages(Color backgroundColor) {
- Display display = Display.getCurrent();
- GC gc = null;
- if (display != null) {
- leftArrow = new Image(display, 3, 5);
- gc = new GC(leftArrow);
- gc.setBackground(backgroundColor);
- gc.fillRectangle(leftArrow.getBounds());
- gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.drawLine(0, 2, 0, 2);
- gc.drawLine(1, 1, 1, 3);
- gc.drawLine(2, 0, 2, 4);
- gc.dispose();
- rightArrow = new Image(display, 3, 5);
- gc = new GC(rightArrow);
- gc.setBackground(backgroundColor);
- gc.fillRectangle(rightArrow.getBounds());
- gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.drawLine(0, 0, 0, 4);
- gc.drawLine(1, 1, 1, 3);
- gc.drawLine(2, 2, 2, 2);
- gc.dispose();
- }
- }
-
- /**
- * Dispose of the images used for the arrow graphics. Should be invoked
- * when the button is disposed.
- */
- private void disposeToggleImages() {
- if (leftArrow != null) leftArrow.dispose();
- if (rightArrow != null) rightArrow.dispose();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControl.java
deleted file mode 100644
index 487c7d3d5..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControl.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.TypedListener;
-
-/**
- * A widget like the old ET/400 inherit/override widget.
- * There are left and right arrows beside each other.
- * Typically, clicking on left means to inherit from parent,
- * clicking on right means to override locally.
- * However, the control can be used for any binary decision!
- * THIS IS NOT USED AND NOT WORKING. USE INHERITABLEENTRYFIELD INSTEAD
- *
- * @deprecated
- * @see org.eclipse.rse.ui.widgets.InheritableEntryField
- */
-public class InheritControl
- extends Composite
-{
- private Image local,interim,inherit;
- private Button button;
- private boolean isLocal=false;
- /**
- * Constructor.
- * @param parent Composite to place this widget into
- * @param style Widget style. Passed on to
- * {@link org.eclipse.swt.widgets.Composite#Composite(org.eclipse.swt.widgets.Composite, int) constructor} of parent class Composite
- */
- public InheritControl(Composite parent, int style)
- {
- super(parent, style);
- setLayout(new InheritControlLayout());
- //Class c = InheritControl.class;
- //String imagePath = "icons" + java.io.File.separatorChar;
- //RSEUIPlugin sp = RSEUIPlugin.getDefault();
- try
- {
- //ImageData source = new ImageData(c.getResourceAsStream (imagePath+"local.gif"));
- /*
- Image image = sp.getImage(ISystemConstants.ICON_INHERITWIDGET_LOCAL_ID);
- ImageData source = image.getImageData();
- ImageData mask = source.getTransparencyMask();
- //local = new Image (null, source, mask);
- local = image;
-
- image = sp.getImage(ISystemConstants.ICON_INHERITWIDGET_INHERIT_ID);
- source = image.getImageData();
- //source = new ImageData(c.getResourceAsStream (imagePath+"inherit.gif"));
- mask = source.getTransparencyMask();
- //inherit = new Image (null, source, mask);
- inherit = image;
-
- // don't know how to add third state, and don't really
- // need it for Button. Could use it if we implement as Label ....
- //source = new ImageData(c.getResourceAsStream (imagePath+"interim.gif"));
- image = sp.getImage(ISystemConstants.ICON_INHERITWIDGET_INTERIM_ID);
- source = image.getImageData();
- mask = source.getTransparencyMask();
- //interim = new Image (null, source, mask);
- interim = image;
- */
- } catch (Throwable ex)
- {
- System.out.println ("failed to load images");
- ex.printStackTrace();
- }
- button=new Button(this,style);
- setLocal(true);
- addDisposeListener(new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent e)
- {
- // dispose of created resources!
- InheritControl.this.widgetDisposed(e);
- }
- });
- // Add the button listener
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- setLocal(!isLocal());
- notifyListeners(SWT.Selection, new Event());
- }
- };
- button.addSelectionListener(selectionListener);
- }
- /**
- * Add a listener that is called whenever the left or right side is selected.
- * <p>
- * Call {@link #isLocal()} to determine if left (false) or right (true) was pressed.
- * @see #addSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener)
- {
- addListener(SWT.Selection, new TypedListener(listener));
- }
- /**
- * Returns true if the right-side is selected, false if the left is selected
- */
- public boolean isLocal()
- {
- return isLocal;
- }
- /**
- * Remove a previously set selection listener.
- * @see #addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener)
- {
- removeListener(SWT.Selection, listener);
- }
- /**
- * Programmatically select left (false) or right/local (true) arrow.
- */
- public void setLocal(boolean l)
- {
- isLocal=l;
- button.setImage(isLocal?local:inherit);
- }
- /**
- * Set tooltip text (hover help)
- */
- public void setToolTipText(String tip)
- {
- button.setToolTipText(tip);
- }
- /**
- * Private hook called by system when this widget is disposed.
- */
- public void widgetDisposed(DisposeEvent e)
- {
- if (local!=null)
- local.dispose();
- if (interim!=null)
- interim.dispose();
- if (inherit!=null)
- inherit.dispose();
- }
- /*
- public static void main(String[] args)
- {
- // Example on how to use widget
- final InheritControl c1,c2,c3;
- final Text text1,text2,text3;
- Display display = new Display();
- Shell shell = new Shell();
- GridLayout g=new GridLayout();
- g.numColumns=2;
- shell.setLayout(g);
- c1=new InheritControl(shell,SWT.NULL);
- text1 = new Text (shell, SWT.BORDER);
- c2=new InheritControl(shell,SWT.NULL);
- text2 = new Text (shell, SWT.BORDER);
- c3=new InheritControl(shell,SWT.NULL);
- text3 = new Text (shell, SWT.BORDER);
- Button b1=new Button(shell,SWT.NULL);
- b1.setText("Normal button ....");
- //Add listeners:
- c1.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- text1.setEnabled(c1.isLocal);
- };
- });
- c2.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- text2.setEnabled(c2.isLocal);
- };
- });
- c3.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- text3.setEnabled(c3.isLocal);
- };
- });
- shell.pack();
- shell.open();
- // Event loop
- while (! shell.isDisposed())
- {
- if (! display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- System.exit(0);
- }
- */
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControlLayout.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControlLayout.java
deleted file mode 100644
index ca002ff0c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritControlLayout.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-public class InheritControlLayout extends Layout
-{
- private Point iExtent; // the cached size
-
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean changed)
- {
- Control [] children = composite.getChildren();
- if (changed || (iExtent == null) )
- //iExtent = children[0].computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- iExtent = children[0].computeSize(wHint, hHint, true);
- return new Point(iExtent.x, iExtent.y);
- }
- protected void layout(Composite composite, boolean changed)
- {
- Control [] children = composite.getChildren();
- if (changed || (iExtent == null) )
- iExtent = children[0].computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- children[0].setBounds(0, 0, iExtent.x, iExtent.y);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritableEntryField.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritableEntryField.java
deleted file mode 100644
index ccf229f7a..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/InheritableEntryField.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * This is an entry which allows the user to decide whether to
- * inherit a parent value or type in his own local value.
- * <p>
- * To accomplish this, we create a composite containing a toggle button
- * followed by an entry field.
- * <p>
- * The toggle button has left and right arrows.
- * Typically, an arrow pointing to the left means to inherit from parent,
- * and pointing to the right means to override locally.
- * However, the control can be used for any binary decision!
- * <p>
- * Although this control inherits from Composite it does not make sense to
- * set a layout for it or to add children to it.
- */
-/*
- * dwd: modified for defect 57974 (accessibility problems)
- * Formatted source and organized imports.
- * Removed all references to InheritControl.
- * Changed button from SWT.ARROW to SWT.PUSH. SWT.ARROW buttons are not accessible.
- * Simplified internal call structure complicated by case handling for InheritControl.
- */
-public class InheritableEntryField extends Composite implements KeyListener {
- private InheritButton toggleButton = null;
- private Text entryField = null;
- private String inheritValue = "";
- private String localValue = "";
- private boolean isLocal = true;
- private boolean allowEditOfInherited = false;
- private List listeners;
-
- /**
- * Constructor
- * @param parent The parent composite to hold this widget
- * @param style the SWT style for this widget (eg, SWT.BORDER or SWT.NULL)
- */
- public InheritableEntryField(Composite parent, int style) {
- this(parent, style, SWT.NULL, SWT.SINGLE | SWT.BORDER, true);
- }
-
- /**
- * Constructor when you want to set the style of the toggle button and entry field too.
- * @param parent The parent composite to hold this widget
- * @param style the SWT style for this overall widget (eg, SWT.BORDER or SWT.NULL)
- * @param style the SWT style for the toggle button widget
- * @param style the SWT style for the entry field widget
- */
- public InheritableEntryField(Composite parent, int style, int buttonStyle, int textStyle) {
- this(parent, style, buttonStyle, textStyle, true);
- }
-
- /**
- * Constructor when you want to hide the toggle button
- * @param parent The parent composite to hold this widget
- * @param style the SWT style for this overall widget (eg, SWT.BORDER or SWT.NULL)
- * @param style the SWT style for the toggle button widget
- * @param style the SWT style for the entry field widget
- * @param showToggleButton true to show the toggle button, false not to
- */
- public InheritableEntryField(Composite parent, int style, int buttonStyle, int textStyle, boolean showToggleButton) {
- super(parent, style);
-
- // must initialize list of listeners before anything else
- listeners = new Vector();
-
- prepareComposite(2);
- if (showToggleButton) {
- createToggleButton(this, buttonStyle);
- }
- createTextField(this, textStyle);
- setLocal(true); // default state
- }
-
- /**
- * Toggle the inherit/local state.
- * It is important that you have already called setLocalText and setInheritedText
- */
- public void setLocal(boolean local) {
- boolean wasLocal = isLocal;
- isLocal = local;
-
- if (isLocal != wasLocal) {
- notifyStateChangeListeners();
- }
-
- if (isLocal) { // from inherit to local
- if (allowEditOfInherited && !wasLocal) inheritValue = entryField.getText();
- entryField.setEnabled(true);
- entryField.setText(localValue);
- } else { // from local to inherit
- if (wasLocal) // if this is actually a toggle
- localValue = entryField.getText(); // remember what old local value was
- entryField.setText(inheritValue);
- entryField.setEnabled(allowEditOfInherited);
- }
- if (toggleButton != null) {
- toggleButton.setLocal(isLocal);
- }
- }
-
- /**
- * Query the inherit/local state
- */
- public boolean isLocal() {
- return isLocal;
- }
-
- /**
- * Specify if user is allowed to edit the inherited text. Default is false.
- */
- public void setAllowEditingOfInheritedText(boolean allow) {
- allowEditOfInherited = allow;
- }
-
- /**
- * Set the entry field's inherited text value
- */
- public void setInheritedText(String text) {
- if (text == null) text = "";
- this.inheritValue = text;
- }
-
- /**
- * Query the entry field's inherited text value.
- * If widget is in inherit mode, returns entry field contents, else returns cached value
- */
- public String getInheritedText() {
- if (!isLocal)
- return entryField.getText();
- else
- return inheritValue;
- }
-
- /**
- * Set the entry field's local text value
- */
- public void setLocalText(String text) {
- if (text == null) text = "";
- this.localValue = text;
- }
-
- /**
- * Query the entry field's local text value.
- * If widget is in local mode, returns entry field contents, else returns "".
- */
- public String getLocalText() {
- if (isLocal)
- return entryField.getText();
- else
- return "";
- }
-
- /**
- * Query the entry field's current contents, regardless of local/inherit state
- */
- public String getText() {
- return entryField.getText();
- }
-
- /**
- * Return a reference to the entry field
- */
- public Text getTextField() {
- return entryField;
- }
-
- /**
- * Return the toggle button
- */
- public InheritButton getToggleButton() {
- return toggleButton;
- }
-
- /**
- * Disable the toggle. Used when there is no inherited value
- */
- public void setToggleEnabled(boolean enabled) {
- if (toggleButton == null) return;
- toggleButton.setEnabled(enabled);
- }
-
- /**
- * Set the tooltip text for the toggle button
- */
- public void setToggleToolTipText(String tip) {
- if (toggleButton == null) return;
- toggleButton.setToolTipText(tip);
- }
-
- /**
- * Set the tooltip text for the entry field
- */
- public void setTextFieldToolTipText(String tip) {
- entryField.setToolTipText(tip);
- }
-
- /**
- * Set the entry field's text limit
- */
- public void setTextLimit(int limit) {
- entryField.setTextLimit(limit);
- }
-
- /**
- * Set the focus to the toggle button
- */
- public void setToggleButtonFocus() {
- if (toggleButton == null) return;
- toggleButton.setFocus();
- }
-
- /**
- * Set the focus to the entry field
- */
- public void setTextFieldFocus() {
- entryField.setFocus();
- }
-
- /**
- * Register a listener interested in when the button is toggled
- * <p>
- * Call {@link #isLocal()} to determine if left (false) or right (true) was pressed.
- * @see #removeSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener) {
- if (toggleButton == null) return;
- toggleButton.addSelectionListener(listener);
- }
-
- /**
- * Remove a previously set toggle button selection listener.
- * @see #addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener) {
- if (toggleButton == null) return;
- toggleButton.removeSelectionListener(listener);
- }
-
- /**
- * Register a listener interested in entry field modify events
- * <p>
- * @see #removeModifyListener(ModifyListener)
- */
- public void addModifyListener(ModifyListener listener) {
- entryField.addModifyListener(listener);
- }
-
- /**
- * Remove a previously set entry field listener.
- * @see #addModifyListener(ModifyListener)
- */
- public void removeModifyListener(ModifyListener listener) {
- entryField.removeModifyListener(listener);
- }
-
- // -----------------------
- // INTERNAL-USE METHODS...
- // -----------------------
- /**
- * Prepares this composite control and sets the default layout data.
- * @param Number of columns the new group will contain.
- */
- protected Composite prepareComposite(int numColumns) {
- Composite composite = this;
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.horizontalSpacing = 0;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
- return composite;
- }
-
- /**
- * Create our text field and insert it into a GridLayout.
- * Assign the listener to the passed in implementer of Listener.
- * @param GridLayout composite to put the field into.
- */
- protected void createTextField(Composite parent, int textStyle) {
- entryField = new Text(parent, textStyle);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = 150;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- entryField.setLayoutData(data);
- entryField.addKeyListener(this);
- }
-
- protected void createToggleButton(Composite parent, int buttonStyle) {
- toggleButton = new InheritButton(parent);
- toggleButton.addKeyListener(this);
- toggleButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setLocal(!isLocal());
- }
- });
- }
-
- public void setToggleButtonHeight(int height) {
- if (toggleButton == null) return;
- ((GridData) toggleButton.getLayoutData()).heightHint = height;
- ((GridData) toggleButton.getLayoutData()).grabExcessVerticalSpace = false;
- ((GridData) toggleButton.getLayoutData()).verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
- }
-
- public void keyPressed(KeyEvent e) {
- }
-
- public void keyReleased(KeyEvent e) {
- if ((e.stateMask == SWT.CTRL) && (e.keyCode == SWT.ARROW_LEFT) && isLocal()) {
- setLocal(false);
- } else if ((e.stateMask == SWT.CTRL) && (e.keyCode == SWT.ARROW_RIGHT) && !isLocal()) {
- setLocal(true);
- }
- }
-
- /**
- * Adds a state change listener. If the listener was already added, it will not be added again.
- * @param l the listener to add.
- */
- public void addStateChangeListener(IInheritableEntryFieldStateChangeListener l) {
-
- if (!listeners.contains(l)) {
- listeners.add(l);
- }
- }
-
- /**
- * Removes a state change listener.
- * @param l the listener to remove.
- */
- public void removeStateChangeListener(IInheritableEntryFieldStateChangeListener l) {
- listeners.remove(l);
- }
-
- /**
- * Notifies all state change listeners.
- */
- private void notifyStateChangeListeners() {
- Iterator iter = listeners.iterator();
-
- while (iter.hasNext()) {
- IInheritableEntryFieldStateChangeListener listener = (IInheritableEntryFieldStateChangeListener)(iter.next());
- listener.stateChanged(this);
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteBaseServerLauncherForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteBaseServerLauncherForm.java
deleted file mode 100644
index c5de40d76..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteBaseServerLauncherForm.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.rse.core.internal.subsystems.RemoteServerLauncherConstants;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.core.subsystems.ServerLaunchType;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Base IBM server launcher form. Extend this to provide a specialized server launcher form
- */
-public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implements IServerLauncherForm, RemoteServerLauncherConstants, ISystemConnectionWizardErrorUpdater
-{
-
-
-
- protected String _hostName;
-
- protected ISystemMessageLine _msgLine;
-
- /**
- * Constructor for EnvironmentVariablesForm.
- * @param msgLine
- */
- public RemoteBaseServerLauncherForm(Shell shell, ISystemMessageLine msgLine)
- {
- super(shell, msgLine);
- _msgLine = msgLine;
- }
-
- public abstract void disable();
-
-
- /**
- * @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
- */
- public Control createContents(Composite parent)
- {
- // server lanucher group
- Group group =createGroupControl(parent);
-
- // create launcher type controls
- createLauncherControls(group);
-
- // help
- SystemWidgetHelpers.setCompositeHelp(parent, RSEUIPlugin.HELPPREFIX + "srln0000");
-
- // initialization
- initDefaults();
- return parent;
- }
-
- protected Group createGroupControl(Composite parent)
- {
- return SystemWidgetHelpers.createGroupComposite(
- parent,
- 1,
- SystemResources.RESID_PROP_SERVERLAUNCHER_MEANS);
-
- }
- protected abstract void createLauncherControls(Group group);
- protected abstract ServerLaunchType getLaunchType();
- protected abstract void setLaunchType(ServerLaunchType type);
-
-
-
-
- protected abstract void initDefaults();
-
-
-
- /**
- * Verify page contents on OK.
- * @return true if all went well, false if error found.
- */
- public abstract boolean verify();
-
- /**
- * Update the actual values in the server launcher, from the widgets. Called on successful press of OK.
- * @return true if all went well, false if something failed for some reason.
- */
- public abstract boolean updateValues(IServerLauncherProperties launcher);
-
-
- public void setHostname(String hostname)
- {
- _hostName = hostname;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java
deleted file mode 100644
index 65479046c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.rse.core.subsystems.IRemoteServerLauncher;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.core.subsystems.ServerLaunchType;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.SystemNumericVerifyListener;
-import org.eclipse.rse.ui.validators.ValidatorPortInput;
-import org.eclipse.rse.ui.validators.ValidatorServerPortInput;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Comment goes here
- */
-public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
-{
-
- private Button _radioDaemon, _radioRexec, _radioNone, _checkBoxSSL, _checkBoxRexecSSL, _checkBoxAutoDetect;
- private Text _fieldDaemonPort;
- private Label _labelDaemonPort;
-
- private Text _fieldRexecPath, _fieldRexecInvocation, _fieldRexecPort;
- private Label _labelRexecPath, _labelRexecInvocation, _labelRexecPort;
-
- private Composite _daemonControls, _rexecControls, _noneControls;
-
- private ValidatorServerPortInput _serverPortValidator;
- private ValidatorPortInput _daemonPortValidator;
- private ValidatorPortInput _rexecPortValidator;
-
-
- private ServerLaunchType _origlaunchType;
- private String _origPath;
- private String _origInvocation;
- private int _origRexecPort;
- private int _origDaemonPort;
- private boolean _origUseSSL;
- private boolean _origAutoDetect;
-
- /**
- * Constructor for EnvironmentVariablesForm.
- * @param msgLine
- */
- public RemoteServerLauncherForm(Shell shell, ISystemMessageLine msgLine)
- {
- super(shell, msgLine);
- _daemonPortValidator = new ValidatorPortInput();
- _serverPortValidator = new ValidatorServerPortInput();
- _rexecPortValidator = new ValidatorPortInput();
- }
-
- public boolean isDirty()
- {
- boolean isDirty = _origlaunchType != getLaunchType() ||
- !_origPath.equals(getServerInstallPath()) ||
- !_origInvocation.equals(getServerInvocation()) ||
- _origRexecPort != getREXECPortAsInt() ||
- _origDaemonPort != getDaemonPortAsInt() ||
- _origUseSSL != getUseSSL() ||
- _origAutoDetect != getAutoDetect();
- return isDirty;
- }
-
- public void disable()
- {
- _radioDaemon.setEnabled(false);
- _radioRexec.setEnabled(false);
- _radioNone.setEnabled(false);
- _fieldRexecInvocation.setEnabled(false);
- _fieldRexecPath.setEnabled(false);
- _fieldRexecPort.setEnabled(false);
- _fieldDaemonPort.setEnabled(false);
- _checkBoxSSL.setEnabled(false);
- _checkBoxRexecSSL.setEnabled(false);
- _checkBoxAutoDetect.setEnabled(false);
- }
-
-
-
- protected void createLauncherControls(Group group)
- {
- // daemon controls
- _radioDaemon =
- SystemWidgetHelpers.createRadioButton(
- group,
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON,
- this);
- _radioDaemon.setToolTipText(
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_DAEMON_TOOLTIP);
-
- _daemonControls = SystemWidgetHelpers.createComposite(group, 1);
- GridLayout dlayout = new GridLayout();
- dlayout.numColumns = 3;
- GridData ddata = new GridData(GridData.FILL_HORIZONTAL);
- ddata.horizontalIndent = 20;
-
- GridData dd = new GridData();
- dd.widthHint = 30;
- String portRange = " (1-" + ValidatorPortInput.MAXIMUM_PORT_NUMBER + ")";
- _labelDaemonPort =
- SystemWidgetHelpers.createLabel(
- _daemonControls,
- SystemResources.RESID_CONNECTION_DAEMON_PORT_LABEL + portRange);
- _fieldDaemonPort = SystemWidgetHelpers.createTextField(_daemonControls, this);
- _fieldDaemonPort.setToolTipText(SystemResources.RESID_CONNECTION_DAEMON_PORT_TIP);
- _fieldDaemonPort.setLayoutData(dd);
- _fieldDaemonPort.addVerifyListener(new SystemNumericVerifyListener());
- _daemonControls.setLayout(dlayout);
- _daemonControls.setLayoutData(ddata);
-
- // rexec controls
- _radioRexec =
- SystemWidgetHelpers.createRadioButton(
- group,
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_REXEC,
- this);
- _radioRexec.setToolTipText(
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_REXEC_TOOLTIP);
-
- _rexecControls = SystemWidgetHelpers.createComposite(group, 1);
- GridLayout layout = new GridLayout();
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 20;
- _labelRexecPath =
- SystemWidgetHelpers.createLabel(
- _rexecControls,
- SystemResources.RESID_PROP_SERVERLAUNCHER_PATH);
- _fieldRexecPath = SystemWidgetHelpers.createTextField(_rexecControls, this);
- _fieldRexecPath.setToolTipText(
- SystemResources.RESID_PROP_SERVERLAUNCHER_PATH_TOOLTIP);
-
- Composite subRexecControls = SystemWidgetHelpers.createComposite(_rexecControls, 1);
- GridLayout l2 = new GridLayout();
- GridData d2 = new GridData(GridData.FILL_HORIZONTAL);
- l2.numColumns = 4;
-
- _labelRexecInvocation =
- SystemWidgetHelpers.createLabel(
- subRexecControls,
- SystemResources.RESID_PROP_SERVERLAUNCHER_INVOCATION);
- _fieldRexecInvocation = SystemWidgetHelpers.createTextField(subRexecControls, this);
- _fieldRexecInvocation.setToolTipText(
- SystemResources.RESID_PROP_SERVERLAUNCHER_INVOCATION_TOOLTIP);
-
- GridData d3 = new GridData();
- d3.widthHint = 30;
-
- _labelRexecPort =
- SystemWidgetHelpers.createLabel(
- subRexecControls,
- SystemResources.RESID_CONNECTION_PORT_LABEL + portRange);
- _fieldRexecPort = SystemWidgetHelpers.createTextField(subRexecControls, this);
- _fieldRexecPort.setToolTipText(SystemResources.RESID_CONNECTION_PORT_TIP);
- _fieldRexecPort.setLayoutData(d3);
- _fieldRexecPort.addVerifyListener(new SystemNumericVerifyListener());
-
- subRexecControls.setLayout(l2);
- subRexecControls.setLayoutData(d2);
-
- _checkBoxAutoDetect = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_AUTODETECT_LABEL, this);
- _checkBoxAutoDetect.setToolTipText(SystemResources.RESID_SUBSYSTEM_AUTODETECT_TIP);
- _checkBoxRexecSSL = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_SSL_LABEL, this);
- _checkBoxRexecSSL.setToolTipText(SystemResources.RESID_SUBSYSTEM_SSL_TIP);
-
- _rexecControls.setLayout(layout);
- _rexecControls.setLayoutData(data);
-
- // manual controls
- _radioNone =
- SystemWidgetHelpers.createRadioButton(
- group,
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_NONE,
- this);
- _radioNone.setToolTipText(
- SystemResources.RESID_PROP_SERVERLAUNCHER_RADIO_NONE_TOOLTIP);
- _noneControls = SystemWidgetHelpers.createComposite(group, 1);
- GridLayout nlayout = new GridLayout();
- GridData ndata = new GridData(GridData.FILL_HORIZONTAL);
- ndata.horizontalIndent = 20;
- _checkBoxSSL = SystemWidgetHelpers.createCheckBox(_noneControls, SystemResources.RESID_SUBSYSTEM_SSL_LABEL, this);
- _checkBoxSSL.setToolTipText(SystemResources.RESID_SUBSYSTEM_SSL_TIP);
- _noneControls.setLayout(nlayout);
- _noneControls.setLayoutData(ndata);
-
- // help
- SystemWidgetHelpers.setHelp(_radioDaemon, RSEUIPlugin.HELPPREFIX + "srln0001");
- SystemWidgetHelpers.setHelp(_radioRexec, RSEUIPlugin.HELPPREFIX + "srln0002");
- SystemWidgetHelpers.setHelp(_radioNone, RSEUIPlugin.HELPPREFIX + "srln0003");
- SystemWidgetHelpers.setHelp(_fieldRexecPath, RSEUIPlugin.HELPPREFIX + "srln0004");
- SystemWidgetHelpers.setHelp(_fieldRexecInvocation, RSEUIPlugin.HELPPREFIX + "srln0005");
- }
-
- protected void initDefaults()
- {
- _radioDaemon.setSelection(true);
- _fieldDaemonPort.setEnabled(_radioDaemon.getSelection());
- _fieldRexecPath.setEnabled(_radioRexec.getSelection());
- _labelRexecPath.setEnabled(_radioRexec.getSelection());
- _fieldRexecInvocation.setEnabled(_radioRexec.getSelection());
- _labelRexecInvocation.setEnabled(_radioRexec.getSelection());
- _labelRexecPort.setEnabled(_radioRexec.getSelection());
- _fieldRexecPort.setEnabled(_radioRexec.getSelection());
- _checkBoxRexecSSL.setEnabled(_radioRexec.getSelection());
- _checkBoxAutoDetect.setEnabled(_radioRexec.getSelection());
- _checkBoxSSL.setEnabled(_radioNone.getSelection());
-
- _fieldDaemonPort.setText(String.valueOf(DEFAULT_DAEMON_PORT));
- _fieldRexecPath.setText(DEFAULT_REXEC_PATH);
- _fieldRexecInvocation.setText(DEFAULT_REXEC_SCRIPT);
- _fieldRexecPort.setText(String.valueOf(DEFAULT_REXEC_PORT));
- }
-
- /**
- * Set the initial values for the widgets, based on the server launcher
- */
- public void initValues(IServerLauncherProperties launcher)
- {
- IRemoteServerLauncher isl = (IRemoteServerLauncher)launcher;
-
- ServerLaunchType type = isl.getServerLaunchType();
- String path = isl.getServerPath();
- String invocation = isl.getServerScript();
- int rexecport = isl.getRexecPort(); // changed from getPortAsInt via d54335
- int daemonPort = isl.getDaemonPort(); // defect 54335
- boolean useSSL = isl.getConnectorService().isUsingSSL();
- boolean autoDetectSSL = isl.getAutoDetectSSL();
-
- // find out if daemon can be launched
- boolean allowDaemon = isl.isEnabledServerLaunchType(ServerLaunchType.DAEMON_LITERAL);
-
- // find out if rexec can be launched
- boolean allowRexec = isl.isEnabledServerLaunchType(ServerLaunchType.REXEC_LITERAL);
-
- // find out if connect to running server should be allowed
- boolean allowNo = isl.isEnabledServerLaunchType(ServerLaunchType.RUNNING_LITERAL);
-
- // enable/disable as appropriate
- setDaemonLaunchEnabled(allowDaemon);
- setRexecLaunchEnabled(allowRexec);
- setNoLaunchEnabled(allowNo);
-
- setLaunchType(type);
-
- setDaemonPort(daemonPort);
- setServerInstallPath(path);
- setServerInvocation(invocation);
- setREXECPort(rexecport);
- setUseSSL(useSSL);
- setAutoDetect(autoDetectSSL);
-
- if (!allowDaemon && !allowRexec && !allowNo) {
- disable();
- }
-
-
- _origlaunchType = getLaunchType();
- _origPath = getServerInstallPath();
- _origInvocation = getServerInvocation();
- _origRexecPort = getREXECPortAsInt();
- _origDaemonPort = getDaemonPortAsInt();
- _origUseSSL = getUseSSL();
- _origAutoDetect = getAutoDetect();
- }
-
- /**
- * Verify page contents on OK.
- * @return true if all went well, false if error found.
- */
- public boolean verify()
- {
- SystemMessage msg = null;
- ServerLaunchType launchType = getLaunchType();
- if (launchType == ServerLaunchType.REXEC_LITERAL)
- {
- String port = getREXECPort();
- msg = _rexecPortValidator.validate(port);
-
- if (msg == null)
- {
- String path = getServerInstallPath();
-
- if (path == null || path.length() == 0)
- {
- msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD);
- }
-
- if (msg != null)
- {
- _msgLine.setErrorMessage(msg.getLevelOneText());
- }
- else
- {
- _msgLine.clearErrorMessage();
- }
- }
- else
- {
- _msgLine.setErrorMessage(msg);
- }
- }
- else if (launchType == ServerLaunchType.DAEMON_LITERAL)
- {
- String port = getDaemonPort();
- msg = _daemonPortValidator.validate(port);
-
- if (msg == null)
- {
- _msgLine.clearErrorMessage();
- }
- else
- {
- _msgLine.setErrorMessage(msg);
- }
- }
- else
- {
- _msgLine.clearErrorMessage();
- }
- notifyVerifyListeners();
- return (msg==null);
- }
-
- /**
- * Update the actual values in the server launcher, from the widgets. Called on successful press of OK.
- * @return true if all went well, false if something failed for some reason.
- */
- public boolean updateValues(IServerLauncherProperties launcher)
- {
- ServerLaunchType launchType = getLaunchType();
- String path = getServerInstallPath();
- String invocation = getServerInvocation();
- int rexecPort = getREXECPortAsInt();
- int daemonPort = getDaemonPortAsInt();
- boolean useSSL = getUseSSL();
- boolean autoDetect = getAutoDetect();
-
- IRemoteServerLauncher isl = (IRemoteServerLauncher)launcher;
- isl.setServerLaunchType(launchType);
- isl.setServerPath(path);
- isl.setServerScript(invocation);
- isl.setRexecPort(rexecPort); // changed from setPort via d54335. Phil
- isl.setDaemonPort(daemonPort);
- isl.setAutoDetectSSL(autoDetect);
- isl.getConnectorService().setIsUsingSSL(useSSL);
- try
- {
- isl.getConnectorService().commit();
- }
- catch (Exception e)
- {
- return false;
- }
- return true;
- }
-
-
- public void handleEvent(Event evt)
- {
-
- boolean useRexec = _radioRexec.getSelection();
- _fieldDaemonPort.setEnabled(_radioDaemon.getSelection());
- _fieldRexecPath.setEnabled(useRexec);
- _labelRexecPath.setEnabled(useRexec);
- _fieldRexecInvocation.setEnabled(useRexec);
- _labelRexecInvocation.setEnabled(useRexec);
- _fieldRexecPort.setEnabled(useRexec);
- _labelRexecPort.setEnabled(useRexec);
- _checkBoxAutoDetect.setEnabled(useRexec);
- _checkBoxRexecSSL.setEnabled(useRexec && !_checkBoxAutoDetect.getSelection());
- _checkBoxSSL.setEnabled(_radioNone.getSelection());
-
- verify();
- }
-
- protected ServerLaunchType getLaunchType()
- {
- if (_radioDaemon.getSelection())
- return ServerLaunchType.DAEMON_LITERAL;
- else if (_radioRexec.getSelection())
- return ServerLaunchType.REXEC_LITERAL;
- else if (_radioNone.getSelection())
- return ServerLaunchType.RUNNING_LITERAL;
- else
- return null;
- }
-
- protected boolean getUseSSL()
- {
- if (_radioRexec.getSelection())
- return _checkBoxRexecSSL.getSelection();
- else return _checkBoxSSL.getSelection();
- }
-
- protected boolean getAutoDetect()
- {
- if (_radioNone.getSelection()) return false;
- if (_radioRexec.getSelection())
- return _checkBoxAutoDetect.getSelection();
- else return true;
- }
-
- protected void setUseSSL(boolean use)
- {
- _checkBoxSSL.setSelection(use);
- _checkBoxRexecSSL.setSelection(use);
- }
-
- protected void setAutoDetect(boolean use)
- {
- _checkBoxAutoDetect.setSelection(use);
- }
-
- protected void setLaunchType(ServerLaunchType type)
- {
- if (type == ServerLaunchType.DAEMON_LITERAL)
- {
- _radioDaemon.setSelection(true);
- _radioRexec.setSelection(false);
- _radioNone.setSelection(false);
- }
- else if (type == ServerLaunchType.REXEC_LITERAL)
- {
- _radioRexec.setSelection(true);
- _radioDaemon.setSelection(false);
- _radioNone.setSelection(false);
- }
- else if (type == ServerLaunchType.RUNNING_LITERAL)
- {
- _radioNone.setSelection(true);
- _radioRexec.setSelection(false);
- _radioDaemon.setSelection(false);
- }
- else
- {
- _radioNone.setSelection(false);
- _radioRexec.setSelection(false);
- _radioDaemon.setSelection(false);
- }
- }
-
-
- /**
- * Sets whether to enable daemon launch.
- * @param enable <code>true</code> if daemon launch should be enabled, <code>false</code> otherwise.
- */
- public void setDaemonLaunchEnabled(boolean enable)
- {
- //_radioDaemon.setVisible(enable);
- //_daemonControls.setVisible(enable);
- //_daemonControls.getLayout().
- _labelDaemonPort.setEnabled(enable);
- _fieldDaemonPort.setEnabled(enable);
-
- _radioDaemon.setEnabled(enable);
- }
-
- /**
- * Sets whether to enable rexec launch.
- * @param enable <code>true</code> if rexec launch should be enabled, <code>false</code> otherwise.
- */
- public void setRexecLaunchEnabled(boolean enable)
- {
- /*
- _radioRexec.setVisible(enable);
- _rexecControls.setVisible(enable);
- _labelRexecInvocation.setVisible(enable);
- _labelRexecPath.setVisible(enable);
- _labelRexecPort.setVisible(enable);
- */
- _fieldRexecInvocation.setEnabled(enable);
- _fieldRexecPath.setEnabled(enable);
- _fieldRexecPort.setEnabled(enable);
-
- _radioRexec.setEnabled(enable);
- }
-
- public void setHostname(String hostname)
- {
- _hostName = hostname;
- }
-
- /**
- * Set the daemon port widget value
- * @param port - the port value as a string
- */
- public void setDaemonPort(String port)
- {
- _fieldDaemonPort.setText(port);
- }
-
- /**
- * Set the daemon port widget value
- * @param port - the port value as an int
- */
- public void setDaemonPort(int port)
- {
- _fieldDaemonPort.setText(Integer.toString(port));
- }
-
- /**
- * Get the Daemon port widget value
- * @return the widget's current value as an int
- */
- public int getDaemonPortAsInt()
- {
- int port = 0;
- try {
- port = Integer.parseInt(_fieldDaemonPort.getText().trim());
- } catch (Exception exc) { }
- return port;
- }
- /**
- * Get the daemon port widget value
- * @return the widget's current value as a string
- */
- public String getDaemonPort()
- {
- return _fieldDaemonPort.getText().trim();
- }
-
- /**
- * Set the REXEC port's widget value, as a String
- * @param port - the value to apply to the widget
- */
- public void setREXECPort(String port)
- {
- _fieldRexecPort.setText(port);
- }
- /**
- * Set the REXEC port's widget value, given an int port value
- * @param port - the value to apply to the widget.
- */
- public void setREXECPort(int port)
- {
- _fieldRexecPort.setText(Integer.toString(port));
- }
- /**
- * Get the REXEC port widget value
- * @return the widget's current value as an int
- */
- public int getREXECPortAsInt()
- {
- int port = 0;
- try {
- port = Integer.parseInt(_fieldRexecPort.getText().trim());
- } catch (Exception exc) { }
- return port;
- }
- /**
- * Get the REXEC port widget value
- * @return the widget's current value as a string
- */
- public String getREXECPort()
- {
- return _fieldRexecPort.getText().trim();
- }
-
-
- /**
- * Sets whether to enable no launch.
- * @param enable <code>true</code> if no launch should be enabled, <code>false</code> otherwise.
- */
- public void setNoLaunchEnabled(boolean enable)
- {
- _radioNone.setEnabled(enable);
- _checkBoxSSL.setEnabled(enable);
- }
- /**
- * Return the current value of the REXEC server install path widget
- * @return widget value as a string
- */
- public String getServerInstallPath()
- {
- return _fieldRexecPath.getText().trim();
- }
- /**
- * Set the REXEC server install path widget's value
- * @param path - the text to set the widget's value to
- */
- public void setServerInstallPath(String path)
- {
- _fieldRexecPath.setText(path);
- }
- /**
- * Return the current value of the REXEC server invocation widget
- * @return widget value as a string
- */
- public String getServerInvocation()
- {
- return _fieldRexecInvocation.getText();
- }
- /**
- * Set the REXEC server invocation widget's value
- * @param invocation - the text to set the widget's value to
- */
- public void setServerInvocation(String invocation)
- {
- _fieldRexecInvocation.setText(invocation);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SSLForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SSLForm.java
deleted file mode 100644
index 59485a79e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SSLForm.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-
-
-/**
- * This class provides a reusable widget for selecting whether or not
- * a communications connection should use SSL
- */
-public class SSLForm extends SystemBaseForm {
-
-
- private Button _sslCheckBox;
- private Button _nonsslCheckBox;
-
- /**
- * Constructor for SSLForm.
- * @param msgLine
- */
- public SSLForm(ISystemMessageLine msgLine) {
- super(null, msgLine); // null is the shell.
- }
-
- /**
- * Determines whether ssl is checked or not
- * @return
- */
- public boolean isSSLAlertChecked()
-
- {
- return _sslCheckBox.getSelection();
- }
-
- /**
- * Check/uncheck the ssl checkbox
- * @param flag
- */
- public void setSSLALertIsChecked(boolean flag)
-
- {
- _sslCheckBox.setSelection(flag);
- }
-
- /**
- * Determines whether non-ssl is checked or not
- * @return
- */
- public boolean isNonSSLAlertChecked()
- {
- return _nonsslCheckBox.getSelection();
- }
-
-
- /**
- * Check/uncheck the ssl checkbox
- * @param flag
- */
- public void setNonSSLALertIsChecked(boolean flag)
- {
- _nonsslCheckBox.setSelection(flag);
- }
-
- /**
- * Enable/disable the ssl checkbox
- * @param flag
- */
- public void enableCheckBoxes(boolean flag)
-
- {
- _sslCheckBox.setEnabled(flag);
- _nonsslCheckBox.setEnabled(flag);
- }
-
- /**
- * @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
- */
- public Control createContents(Composite parent)
- {
- super.setShell(parent.getShell());
- _sslCheckBox = SystemWidgetHelpers.createCheckBox(parent, SystemResources.RESID_SUBSYSTEM_SSL_ALERT_LABEL, this);
- _sslCheckBox.setToolTipText(SystemResources.RESID_SUBSYSTEM_SSL_ALERT_TIP);
- _nonsslCheckBox = SystemWidgetHelpers.createCheckBox(parent, SystemResources.RESID_SUBSYSTEM_NONSSL_ALERT_LABEL, this);
- _nonsslCheckBox.setToolTipText(SystemResources.RESID_SUBSYSTEM_NONSSL_ALERT_TIP);
- return parent;
- }
-
-
-
- public void handleEvent(Event evt)
- {
-
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ServerConnectionSecurityForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ServerConnectionSecurityForm.java
deleted file mode 100644
index 8c12fc165..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/ServerConnectionSecurityForm.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-
-package org.eclipse.rse.ui.widgets;
-
-
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class ServerConnectionSecurityForm extends SystemBaseForm
-{
-
-
-
- private SSLForm _sslForm;
-
- private ISystemMessageLine _msgLine;
-
- public ServerConnectionSecurityForm(Shell shell, ISystemMessageLine msgLine)
- {
- super(shell, msgLine);
- _msgLine = msgLine;
- }
-
- public void disable()
- {
- _sslForm.enableCheckBoxes(false);
- }
-
- public void enable()
- {
- _sslForm.enableCheckBoxes(true);
- }
-
- /**
- * @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
- */
- public Control createContents(Composite parent)
- {
-
- _sslForm = new SSLForm(_msgLine);
- _sslForm.createContents(parent);
-
- // help
-
- // initialization
- initDefaults();
- return parent;
- }
-
- private void initDefaults()
- {
- // pull info from preferences and/or persistence model
-
- }
-
- public void setAlertSSL(boolean flag)
- {
- _sslForm.setSSLALertIsChecked(flag);
- }
-
- public boolean getAlertSSL()
- {
- return _sslForm.isSSLAlertChecked();
- }
-
- public void setAlertNonSSL(boolean flag)
- {
- _sslForm.setNonSSLALertIsChecked(flag);
- }
-
- public boolean getAlertNonSSL()
- {
- return _sslForm.isNonSSLAlertChecked();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemCollapsableSection.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemCollapsableSection.java
deleted file mode 100644
index 4e8370389..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemCollapsableSection.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Class to provide a collapsible composite that can be collapsed
- * to hide some controls
- */
-public class SystemCollapsableSection extends Composite implements MouseListener, PaintListener
-{
-
- public static final String Copyright =
- "(C) Copyright IBM Corp. 2002, 2003. All Rights Reserved.";
-
- protected boolean _bCollapsed = false;
- protected boolean _bMouseOver = false;
- protected Composite _compositePage = null;
- protected String _strText = null;
- protected String _strExpandedText = null;
- protected String _strCollapsedText = null;
- protected String _strExpandedToolTip = null;
- protected String _strCollapsedToolTip = null;
- protected Label _labelTitle = null;
-
- protected static Color _colorCollapsable = null;
-
- // yantzi: added so we can have a collapse / expand action in the iSeries table view for
- // accessability reasons.
- private List listeners = new ArrayList(5);
-
- /**
- *
- */
- protected class RTwisteeLayout extends Layout
- {
-
- /**
- *
- */
- protected Point computeSize(
- Composite composite,
- int wHint,
- int hHint,
- boolean flushCache)
- {
- checkWidget();
-
- Point ptSize = getTitleSize(_strText);
- Point ptPageSize =
- _compositePage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
-
- ptSize.x = Math.max(ptSize.x, ptPageSize.x + 8);
-
- if (_bCollapsed == false)
- ptSize.y += ptPageSize.y;
-
- return ptSize;
- }
-
- /**
- * Layout.
- */
- protected void layout(Composite composite, boolean flushCache)
- {
- Point ptTitleSize = getTitleSize(_strText);
- Point ptLocation = getLocation();
-
- if (_bCollapsed == true)
- {
- Rectangle rectClient = getClientArea();
- Point ptPageSize =
- new Point(
- rectClient.width - 16,
- rectClient.height - ptTitleSize.y);
- _compositePage.setBounds(16, ptTitleSize.y, ptPageSize.x, 4);
- setSize(
- Math.max(ptTitleSize.x, ptPageSize.x + 16),
- ptTitleSize.y);
- }
-
- else
- {
- Rectangle rectClient = getClientArea();
- Point ptPageSize =
- new Point(
- rectClient.width - 16,
- rectClient.height - ptTitleSize.y);
- // Point ptPageSize = _compositePage.computeSize( SWT.DEFAULT, SWT.DEFAULT, true );
- _compositePage.setBounds(
- 16,
- ptTitleSize.y,
- ptPageSize.x,
- ptPageSize.y);
- setSize(
- Math.max(ptTitleSize.x, ptPageSize.x + 16),
- ptTitleSize.y + ptPageSize.y);
- }
- }
- }
-
- /**
- * Constructor
- */
- public SystemCollapsableSection(Composite compositeParent)
- {
-
- super(compositeParent, SWT.NULL);
-
- if (_colorCollapsable == null)
- {
- Display display = Display.getCurrent();
- _colorCollapsable = new Color(display, 0, 140, 140);
- }
-
- setLayout(new RTwisteeLayout());
-
- // Page content
- //-------------
- _compositePage = new Composite(this, SWT.NULL);
-
- GridData gridData = new GridData();
- setLayoutData(gridData);
-
- addPaintListener(this);
- addMouseListener(this);
- }
-
- /**
- * Get the actual composite inside the collapsible section to
- * be usde for filling it up with controls
- */
- public Composite getPageComposite()
- {
- return _compositePage;
- }
-
- /**
- * Compute the title area size.
- */
- private Point getTitleSize(String strText)
- {
-
- if (strText == null || strText.length() == 0)
- {
- strText = "MMMMMMMMMMMM";
- }
-
- GC gc = new GC(this);
-
- Point ptSize = gc.textExtent(strText);
- ptSize.y = Math.max(ptSize.y, gc.getFontMetrics().getHeight());
-
- ptSize.x += 20;
- ptSize.y = Math.max(ptSize.y, 20);
-
- gc.dispose();
-
- return ptSize;
- }
-
- /**
- * Return the collapse state
- */
- public boolean getCollapsed()
- {
- return _bCollapsed;
- }
-
- /**
- * Get the default title text
- */
- public String getText()
- {
- return _strText;
- }
-
- /**
- *
- */
- public void mouseDoubleClick(MouseEvent e)
- {
-
- }
-
- /**
- *
- */
- public void mouseDown(MouseEvent e)
- {
-
- }
-
- /**
- * Handle the collapse or expand request from the mouse up event
- */
- public void mouseUp(MouseEvent e)
- {
-
- _bCollapsed = _bCollapsed == true ? false : true;
-
- if (_bCollapsed)
- {
- setToolTipText(_strCollapsedToolTip);
- }
- else
- {
- setToolTipText(_strExpandedToolTip);
- }
-
- List list = new ArrayList();
-
- Composite compositeParent = this;
-
- do
- {
- list.add(compositeParent);
- compositeParent = compositeParent.getParent();
- }
- while (compositeParent instanceof Shell == false);
-
- for (int i = list.size() - 1; i >= 0; --i)
- {
- compositeParent = (Composite) list.get(i);
- compositeParent.layout();
- }
-
- fireCollapseEvent(_bCollapsed);
- // composite.redraw();
- }
-
- /**
- * Paint the control
- */
- public void paintControl(PaintEvent e)
- {
-
- paintCollapsable(e.gc, 0, 2, _bCollapsed);
-
- if (_bCollapsed)
- {
- setToolTipText(_strCollapsedToolTip);
- if (_strCollapsedText != null)
- _strText = _strCollapsedText;
- }
- else
- {
- setToolTipText(_strExpandedToolTip);
- if (_strExpandedText != null)
- _strText = _strExpandedText;
- }
-
- if (_strText == null)
- return;
-
- e.gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
- e.gc.drawString(_strText, 17, 0, true);
- }
-
- /**
- * Paints the two states of a collapsable indicator of a collapsable container.
- */
- public static void paintCollapsable(
- GC gc,
- int iX,
- int iY,
- boolean bCollapsed)
- {
-
- // Not collapsed: v
- //-----------------
-
- if (bCollapsed == false)
- {
- gc.setForeground(_colorCollapsable);
-
- int iA = iX;
- int iB = iY + 3;
- gc.drawLine(iA, iB, iA + 10, iB);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA + 8, iB);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA + 6, iB);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA + 4, iB);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA + 2, iB);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB);
-
- iA = iX;
- iB = iY;
- }
-
- // Collapsed: >
- //-------------
- else
- {
- gc.setForeground(_colorCollapsable);
-
- int iA = iX + 2;
- int iB = iY;
-
- gc.drawLine(iA, iB, iA, iB + 10);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB + 8);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB + 6);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB + 4);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB + 2);
- iA++;
- iB++;
- gc.drawLine(iA, iB, iA, iB);
- }
- }
-
- /**
- * Set the section to be collapsed
- */
- public void setCollapsed(boolean bCollapsed)
- {
-
- _bCollapsed = bCollapsed;
- if (_bCollapsed)
- setToolTipText(_strCollapsedToolTip);
- else
- setToolTipText(_strExpandedToolTip);
-
- redraw();
-
- fireCollapseEvent(bCollapsed);
- }
-
- /**
- * Set the default text title
- */
- public void setText(String strText)
- {
- _strText = strText;
- redraw();
- }
- /**
- * Set the title to be displayed when the section is expanded
- */
- public void setExpandedText(String strText)
- {
- _strExpandedText = strText;
- }
- /**
- * Set the title to be displayed when the section is collapsed
- */
- public void setCollapsedText(String strText)
- {
- _strCollapsedText = strText;
- }
-
- /**
- * Set the two tooltips used in expanded state and collapsed state
- * @param String - tooltip for the expanded state. e.g. Click line to collapse the section
- * @param String - tooltip for the collapsed state. e.g. Click line to expand the section
- */
- public void setToolTips(String strExpandedToolTip, String strCollapsedToolTip)
- {
- _strCollapsedToolTip = strCollapsedToolTip;
- _strExpandedToolTip = strExpandedToolTip;
- }
-
- /**
- * Add a collapse / expand event listener
- */
- public void addCollapseListener(ISystemCollapsableSectionListener listener)
- {
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- /**
- * Remove a collapse / expand event listener
- */
- public void removeCollapseListener(ISystemCollapsableSectionListener listener)
- {
- listeners.remove(listener);
- }
-
- /**
- * Notify collapse / expand listeners of an event
- */
- private void fireCollapseEvent(boolean collapsed)
- {
- for (int i = 0; i < listeners.size(); i++)
- {
- ((ISystemCollapsableSectionListener) listeners.get(i)).sectionCollapsed(collapsed);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemEditPaneStateMachine.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemEditPaneStateMachine.java
deleted file mode 100644
index 839aa5c6c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemEditPaneStateMachine.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * @author coulthar
- *
- * This class attempts to encapsulate the states an edit page (with apply/reset buttons)
- * can go through and handle managing the state transitions. For example, it manages
- * the enabled/disabled state of the apply/reset buttons.
- * <p>
- * There are three <b>modes</b> supported:
- * <ol>
- * <li>New -> user is creating a "new thing". In this state, the apply button label is
- * "New", and the reset button is hidden
- * <li>Edit -> user is editing an existing thing. The apply and reset buttons have usual labels
- * <li>Unset -> overall composite is hidden
- * </ol>
- * In addition to the modes, there are these <b>states</b> supported
- * <ol>
- * <li>No changes -> the apply and reset buttons are disabled
- * <li>Changes pending -> the apply and reset buttons are enabled
- * <li>Changes made -> the apply and reset buttons are disabled
- * </ol>
- * There are constants for these modes and states in {@link org.eclipse.rse.ui.widgets.ISystemEditPaneStates}
- * <p>
- * To use this properly, call the following methods at the appropriate times:
- * <ul>
- * <li>{@link #setNewMode()} -> when users selects to create a new thing.
- * <li>{@link #setEditMode()} -> when user selects to edit an existing thing.
- * <li>{@link #setUnsetMode()} -> when user selects nothing or something not editable
- * <li>{@link #setChangesMade()} -> when user changes anything in the pane!
- * <li>{@link #isSaveRequired()} -> if changes are pending, this will prompt the user if they wish to save the
- * changes or discard the changes. Returns true or false.
- * <li>{@link #applyPressed()} -> when user successfully presses apply
- * <li>{@link #resetPressed()} -> when user successfully presses reset
- * </ul>
- */
-public class SystemEditPaneStateMachine implements ISystemEditPaneStates
- //, SelectionListener
-{
- // state
- private Composite composite;
- private Button applyButton, resetButton;
- private int mode, state;
- private int backupMode, backupState;
- private SystemMessage pendingMsg;
- private String applyLabel_applyMode;
- private String applyLabel_newMode;
- private String applyTip_applyMode;
- private String applyTip_newMode;
- private boolean applyLabelMode;
- private boolean newSetByDelete; //d47125
-
-
- /**
- * Constructor for SystemEditPaneStateMachine.
- * <p>
- * This constructor sets the initial mode to MODE_UNSET.
- * <p>
- * While this class will handle enabling/disabling the apply/reset buttons,
- * it is still your job to add listeners and actually do the applying and resetting!
- * @param composite - overall composite of the edit pane
- * @param applyButton - the Apply pushbutton
- * @param resetButton - the Reset pushbutton. Can be null.
- */
- public SystemEditPaneStateMachine(Composite composite, Button applyButton, Button resetButton)
- {
- super();
- this.composite = composite;
- this.applyButton = applyButton;
- this.resetButton = resetButton;
-
- this.applyLabel_applyMode = applyButton.getText();
- this.applyTip_applyMode = applyButton.getToolTipText();
- this.applyLabelMode = true;
-
- setApplyLabelForNewMode(SystemResources.BUTTON_CREATE_LABEL, SystemResources.BUTTON_CREATE_TOOLTIP);
-
- setUnsetMode();
- //setMode(MODE_UNSET);
- //setState(STATE_INITIAL);
- //enableButtons();
-
- // I have decided it is safer to force the user of this class to call this,
- // since it is possible that Apply will find errors and not actually do the apply
- /*
- applyButton.addSelectionListener(this);
- if (resetButton != null)
- resetButton.addSelectionListener(this);
- */
- }
-
- /**
- * Set the label and tooltip to use for the apply button in "new" mode.
- * By default, generic values are used
- */
- public void setApplyLabelForNewMode(String label, String tooltip)
- {
- this.applyLabel_newMode = label;
- this.applyTip_newMode = tooltip;
- }
-
- /**
- * Set the mode to "New". User has selected "new" and wants to create a new thing.
- * It is your responsibility to call {@link #isSaveRequired()} first.
- * It is assumed that after the object is created by pressing Apply, your UI will
- * select the new object and then call setEditMode
- */
- public void setNewMode()
- {
- setButtonText(mode, MODE_NEW);
- setMode(MODE_NEW);
- setState(STATE_INITIAL);
- enableButtons();
- if (!composite.isVisible())
- composite.setVisible(true);
- }
- /**
- * Set the mode to "Edit". User has selected an existing object and wants to changed/edit it
- * It is your responsibility to call {@link #isSaveRequired()} first.
- */
- public void setEditMode()
- {
- setButtonText(mode, MODE_EDIT);
- setMode(MODE_EDIT);
- setState(STATE_INITIAL);
- enableButtons();
- if (!composite.isVisible())
- composite.setVisible(true);
- }
- /**
- * Set the mode to "Unset". User has selected nothing or something not editable
- * It is your responsibility to call {@link #isSaveRequired()} first.
- */
- public void setUnsetMode()
- {
- setButtonText(mode, MODE_UNSET);
- setMode(MODE_UNSET);
- setState(STATE_INITIAL);
- enableButtons();
- if (composite.isVisible())
- composite.setVisible(false);
- }
- /**
- * User has made changes, such as typing text or selecting a checkbox or radio button.
- * It is VERY important this be called religiously for every possible change the user can make!
- */
- public void setChangesMade()
- {
- setState(STATE_PENDING);
- enableButtons();
- }
- /**
- * Query if it is ok to switch modes.
- * If no changes pending, returns false
- * If changes pending, user is asked to whether to save (true) or discard (false).
- */
- public boolean isSaveRequired()
- {
- boolean changesPending = areChangesPending();
- if (changesPending)
- {
- if (pendingMsg == null)
- {
- pendingMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONFIRM_CHANGES);
- }
- SystemMessageDialog pendingMsgDlg = new SystemMessageDialog(composite.getShell(), pendingMsg);
- try {
- changesPending = pendingMsgDlg.openQuestion();
- } catch (Exception exc) {}
- }
- //if (!changesPending) // user has made decision, so clear state
- setState(STATE_INITIAL); // one way or another, decision has been made
- return changesPending;
- }
-
- /**
- * User has successfully pressed Apply (that is, no errors found)
- */
- public void applyPressed()
- {
- setState(STATE_APPLIED);
- enableButtons();
- }
- /**
- * User has successfully pressed Reset (that is, no errors found)
- */
- public void resetPressed()
- {
- setState(STATE_INITIAL);
- enableButtons();
- }
-
- /**
- * Are any changes pending?
- */
- public boolean areChangesPending()
- {
- return (state == STATE_PENDING);
- }
-
- // -----------------------------------
- // GETTERS FOR STUFF PASSED IN CTOR...
- // -----------------------------------
- /**
- * Returns the resetButton.
- * @return Button
- */
- public Button getResetButton()
- {
- return resetButton;
- }
-
- /**
- * Returns the applyButton.
- * @return Button
- */
- public Button getApplyButton()
- {
- return applyButton;
- }
-
- /**
- * Returns the composite.
- * @return Composite
- */
- public Composite getComposite()
- {
- return composite;
- }
-
- // -----------------------------------
- // GETTERS FOR MODE AND STATE
- // -----------------------------------
- /**
- * Returns the mode.
- * @return int
- * @see org.eclipse.rse.ui.widgets.ISystemEditPaneStates
- */
- public int getMode()
- {
- return mode;
- }
-
- /**
- * Returns the state.
- * @return int
- * @see org.eclipse.rse.ui.widgets.ISystemEditPaneStates
- */
- public int getState()
- {
- return state;
- }
-
-
- // -------------------
- // INTERNAL METHODS...
- // -------------------
-
- /**
- * enable/disable buttons based on state
- */
- private void enableButtons()
- {
- boolean enableApply = false;
- boolean enableReset = false;
- switch(state)
- {
- case STATE_INITIAL:
- enableApply = false;
- enableReset = false;
- break;
- case STATE_APPLIED:
- enableApply = false;
- enableReset = false; // true; only true if reset returns to pre-applied values. Not usually the case
- break;
- case STATE_PENDING:
- enableApply = true;
- enableReset = true;
- break;
- }
- applyButton.setEnabled(enableApply);
- if (resetButton != null)
- resetButton.setEnabled(enableReset);
- }
-
- /**
- * Change apply button label and tooltiptext when switching
- * to/from new/edit modes.
- */
- private void setButtonText(int oldMode, int newMode)
- {
- if (oldMode != newMode)
- {
- if ((newMode == MODE_NEW) && applyLabelMode)
- {
- applyButton.setText(applyLabel_newMode);
- applyButton.setToolTipText(applyTip_newMode);
- applyLabelMode = false;
- if (resetButton != null)
- {
- //resetButton.setVisible(false);
- //GridData gd = (GridData)applyButton.getLayoutData();
- //if (gd != null)
- //{
- // gd.horizontalSpan = 2;
- // composite.layout(true);
- //}
- }
- }
- else if ((newMode == MODE_EDIT) && !applyLabelMode)
- {
- applyButton.setText(applyLabel_applyMode);
- applyButton.setToolTipText(applyTip_applyMode);
- applyLabelMode = true;
- if (resetButton != null)
- {
- //resetButton.setVisible(true);
- //GridData gd = (GridData)applyButton.getLayoutData();
- //if (gd != null)
- //{
- // gd.horizontalSpan = 1;
- // composite.layout(true);
- //}
- }
- }
- }
- }
-
- /**
- * Sets the mode.
- * @param mode The mode to set
- * @see org.eclipse.rse.ui.widgets.ISystemEditPaneStates
- */
- private void setMode(int mode)
- {
- this.mode = mode;
- }
-
- /**
- * Sets the state.
- * @param state The state to set
- * @see org.eclipse.rse.ui.widgets.ISystemEditPaneStates
- */
- private void setState(int state)
- {
- this.state = state;
- }
-
- /*
- * Keep track of the fact that New is selected by the Delete action and not by user
- * so that user can exit later by using OK without supplying a command //d47125
- */
- public void setNewSetByDelete(boolean newSetByDelete)
- {
- this.newSetByDelete = newSetByDelete;
- }
-
- public boolean getNewSetByDelete()
- {
- return newSetByDelete;
- }
- /*
- * Internal method.
- * From SelectionListener. Called when user presses Apply or Reset buttons
- *
- public void widgetSelected(SelectionEvent event)
- {
- Object source = event.getSource();
- if (source == applyButton)
- {
- setState(STATE_APPLIED);
- enableButtons();
- }
- else if (source == resetButton)
- {
- setState(STATE_INITIAL);
- enableButtons();
- }
- }
- **
- * Internal method.
- * From SelectionListener. Called when user presses Enter?
- *
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- */
-
- /**
- * Backup state method
- */
- public void backup()
- {
- backupMode = mode;
- backupState = state;
- }
-
- /**
- * Restore state method
- */
- public void restore()
- {
- switch(backupMode)
- {
- case MODE_UNSET:
- setUnsetMode();
- break;
- case MODE_NEW:
- setNewMode();
- break;
- case MODE_EDIT:
- setEditMode();
- break;
- }
- switch(backupState)
- {
- case STATE_PENDING:
- setChangesMade();
- break;
- case STATE_INITIAL:
- break;
- case STATE_APPLIED:
- applyPressed();
- break;
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHistoryCombo.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHistoryCombo.java
deleted file mode 100644
index 4909ccdfc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHistoryCombo.java
+++ /dev/null
@@ -1,715 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.dialogs.SystemWorkWithHistoryDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-
-
-/**
- * This re-usable widget is for a combox box that persists its history and
- * allows the user to manipulate that history.
- * <p>
- * The composite is layed as follows:</p>
- * <pre><code>
- * ______________v...
- * </code></pre>
- * @see #updateHistory()
- */
-public class SystemHistoryCombo extends Composite implements ISystemCombo, TraverseListener, KeyListener
-{
- private Combo historyCombo = null;
- private Button historyButton = null;
- private String historyKey = null;
- private String[] defaultHistory; // pc41439
- private boolean readonly = false;
- private boolean autoUppercase = false;
-
- private int maxComboEntries; // DY: Debugger requested we provide support to limit the number of entries
- private static final int DEFAULT_MAX_COMBO_ENTRIES = 20; // in the combo box for transient data like job name / number. Note: this does
- // not affect the edit history portion of this widget. I have guessed at a
- // default limit of 20 entries.
-
- private static final int DEFAULT_COMBO_WIDTH = 100;
- // dwd private static final int DEFAULT_BUTTON_WIDTH = 10;
- private static final int DEFAULT_BUTTON_WIDTH = 13; // dwd: changed from 10 to accomodate focus rectangle
- private static final int DEFAULT_MARGIN = 1;
-
-
- /**
- * Constructor for SystemHistoryCombo
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically it is just SWT.NULL
- * @param key The unique string used as a preferences key to persist the history for this widget
- * @param readonly Set to true for a readonly combo vs user-editable combo box
- */
- public SystemHistoryCombo(Composite parent, int style, String key, boolean readonly)
- {
- this(parent, style, key, DEFAULT_MAX_COMBO_ENTRIES, readonly);
- }
-
- /**
- * Constructor for SystemHistoryCombo
- * @param parent The owning composite
- * @param style The swt style to apply to the overall composite. Typically it is just SWT.NULL
- * @param key The unique string used as a preferences key to persist the history for this widget
- * @param maxComboEntries The number of history entries to show in the combo box. This only restricts the
- * combo box not the full history list
- * @param readonly Set to true for a readonly combo vs user-editable combo box
- */
- public SystemHistoryCombo(Composite parent, int style, String key, int maxComboEntries, boolean readonly)
- {
- super(parent, style);
- historyKey = key;
- this.readonly = readonly;
- prepareComposite(2);
- historyCombo = createCombo(this, readonly);
- //historyCombo.addTraverseListener(this);
- historyCombo.addKeyListener(this);
- //setWidthHint(DEFAULT_COMBO_WIDTH+DEFAULT_BUTTON_WIDTH+DEFAULT_MARGIN);
- this.maxComboEntries = maxComboEntries;
- createHistoryButton();
- String[] history = getHistory();
- if (history.length > 0)
- setItems(history);
- addOurButtonSelectionListener();
- }
-
- /**
- * Return the combo box widget
- */
- public Combo getCombo()
- {
- return historyCombo;
- }
- /**
- * Set the width hint for the combo box widget (in pixels).
- * Default is only 100, so you may want to set it.
- * A rule of thumb is 10 pixels per character, but allow 15 for the litte button on the right.
- * You must call this versus setting it yourself, else you may see truncation.
- */
- public void setWidthHint(int widthHint)
- {
- // after much research it was decided that it was the wrong thing to do to
- // explicitly set the widthHint of a child widget without our composite, as
- // that could end up being a bigger number than the composites widthHint itself
- // if the caller set its it directly.
- // Rather, we just set the overall composite width and specify the combo child
- // widget is to grab all the space within that which the little button does not use.
- /*((GridData)historyCombo.getLayoutData()).grabExcessHorizontalSpace = true;
- ((GridData)historyCombo.getLayoutData()).horizontalAlignment = GridData.FILL;
- ((GridData)historyCombo.getLayoutData()).widthHint = widthHint;*/
- ((GridData)getLayoutData()).widthHint = widthHint + DEFAULT_BUTTON_WIDTH + DEFAULT_MARGIN;
- }
-
- /**
- * Set auto-uppercase. When enabled, all non-quoted values are uppercases when added to the history.
- */
- public void setAutoUpperCase(boolean enable)
- {
- this.autoUppercase = enable;
- }
-
- /**
- * Return the history button widget
- */
- public Button getHistoryButton()
- {
- return historyButton;
- }
-
- /**
- * Set the combo field's current contents
- */
- public void setText(String text)
- {
- if (!readonly)
- {
- historyCombo.setText(text);
- updateHistory();
- }
- else
- {
- int selIdx = -1;
- String[] currentItems = historyCombo.getItems();
- String[] newItems = new String[currentItems.length + 1];
- newItems[0] = text;
- for (int idx=0; (selIdx==-1) && (idx<currentItems.length); idx++)
- {
- if (text.equals(currentItems[idx]))
- selIdx = idx;
- else
- newItems[idx+1] = currentItems[idx];
- }
- // did not find the given text in the history, so update history...
- if (selIdx == -1)
- {
- setItems(newItems);
- selIdx = currentItems.length;
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, newItems);
- }
- if (selIdx >= 0)
- {
- historyCombo.select(selIdx);
- }
- }
- }
-
- /**
- * Query the history combo field's current contents
- */
- public String getText()
- {
- return historyCombo.getText();
- }
-
- /**
- * Disable/Enable all the child controls.
- */
- public void setEnabled(boolean enabled)
- {
- historyCombo.setEnabled(enabled);
- historyButton.setEnabled(enabled);
- }
- /**
- * Set the tooltip text for the combo field
- */
- public void setToolTipText(String tip)
- {
- historyCombo.setToolTipText(tip);
- }
- /**
- * Set the tooltip text for the history button
- */
- public void setHistoryButtonToolTipText(String tip)
- {
- historyButton.setToolTipText(tip);
- }
- /**
- * Same as #setHistoryButtonToolTipText(String)
- */
- public void setButtonToolTipText(String tip)
- {
- historyButton.setToolTipText(tip);
- }
-
- /**
- * Set the combo field's text limit
- */
- public void setTextLimit(int limit)
- {
- historyCombo.setTextLimit(limit);
- }
- /**
- * Set the focus to the combo field
- */
- public boolean setFocus()
- {
- return historyCombo.setFocus();
- }
-
- /**
- * Set the items in the combo field
- */
- public void setItems(String[] items)
- {
- // DY; Modified to add maxComboSize restriction
- if ((items != null) && (items.length > maxComboEntries))
- {
- String[] historySubSet = new String[maxComboEntries];
- System.arraycopy(items, 0, historySubSet, 0, maxComboEntries);
- historyCombo.setItems(historySubSet);
- }
- else
- {
- historyCombo.setItems(items);
- }
- }
-
- /**
- * Set the items to default the history to, IF the history
- * is currently empty.
- */
- public void setDefaultHistory(String[] items)
- {
- this.defaultHistory = items; // pc41439
- if (historyCombo.getItemCount() == 0)
- {
- setItems(items);
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, items); //d41439
- //updateHistory(); d41439
- }
- }
-
- /**
- * Reset the history key. This changes the contents!
- * You should re-call setDefaultHistory() as well after this, if you had called it before
- */
- public void setHistoryKey(String key)
- {
- this.historyKey = key;
- String[] history = getHistory();
- if (history.length > 0)
- setItems(history);
- else
- historyCombo.removeAll();
- }
-
- /**
- * Get the items in the combo field
- */
- public String[] getItems()
- {
- return historyCombo.getItems();
- }
-
- /**
- * Select the combo dropdown list entry at the given index
- */
- public void select(int selIdx)
- {
- if (selIdx >= historyCombo.getItemCount())
- return;
- historyCombo.deselectAll();
- historyCombo.select(selIdx);
- historyCombo.clearSelection(); // so text is not selected
- //sendEvent(SWT.Selection);
- // for some reason no event is fired on selection.
- // This overcomes that shortcoming ... uses same solution as jface
- Event e = new Event();
- //e.time = event.time;
- //e.stateMask = event.stateMask;
- //e.doit = event.doit;
- historyCombo.notifyListeners(SWT.Selection, e);
- }
- /**
- * Select the given text. This finds the given string in the list,
- * determines its zero-based offset, and calls select for that index.
- * If the item is not found it does nothing.
- * Returns the index number of the found string, or -1 if not found.
- */
- public int select(String itemText)
- {
- String[] items = historyCombo.getItems();
- int matchIdx = -1;
- if ((items==null) || (items.length==0))
- return matchIdx;
- for (int idx=0; (matchIdx==-1) && (idx<items.length); idx++)
- if (itemText.equals(items[idx]))
- matchIdx = idx;
- if (matchIdx != -1)
- select(matchIdx);
- return matchIdx;
- }
- /**
- * Same as {@link #select(int)}
- */
- public void setSelectionIndex(int selIdx)
- {
- select(selIdx);
- }
-
- /**
- * Clear the selection of the text in the entry field part of the combo.
- * Also deselects the list part.
- */
- public void clearSelection()
- {
- //if (!readonly)
- historyCombo.clearSelection();
- //else
- historyCombo.deselectAll();
- }
- /**
- * Clear the selection of the text in the entry field part of the combo.
- * Does not deselect the list part.
- */
- public void clearTextSelection()
- {
- //historyCombo.clearSelection();
- String text = historyCombo.getText();
- historyCombo.deselectAll();
- historyCombo.setText(text);
- }
-
- /**
- * Get the index number of the currently selected item. Only really
- * reliable in readonly mode.
- */
- public int getSelectionIndex()
- {
- return historyCombo.getSelectionIndex();
- }
-
- /**
- * Register a listener interested in an item is selected in the combo box
- * @see #removeSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener)
- {
- historyCombo.addSelectionListener(listener);
- }
- /**
- * Remove a previously set combo box selection listener.
- * @see #addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener)
- {
- historyCombo.removeSelectionListener(listener);
- }
- /**
- * Register a listener interested in entry field modify events
- * @see #removeModifyListener(ModifyListener)
- */
- public void addModifyListener(ModifyListener listener)
- {
- historyCombo.addModifyListener(listener);
- }
- /**
- * Remove a previously set entry field listener.
- * @see #addModifyListener(ModifyListener)
- */
- public void removeModifyListener(ModifyListener listener)
- {
- historyCombo.removeModifyListener(listener);
- }
-
- /**
- * Return the current history for the directory combo box
- */
- public String[] getHistory()
- {
- return SystemPreferencesManager.getPreferencesManager().getWidgetHistory(historyKey);
- }
- /**
- * Update the history with current entry field setting, but don't refresh contents.
- * <p>
- * This is called automatically for you when setText is called. However, for non-readonly
- * versions, you should still call this yourself when OK is successfully pressed on the
- * dialog box.
- */
- public void updateHistory()
- {
- updateHistory(false);
- }
- /**
- * Update the history with current entry field setting, and optionally refresh the list from the new history
- * <p>
- * This is called automatically for you when setText is called. However, for non-readonly
- * versions, you should still call this yourself when OK is successfully pressed on the
- * dialog box.
- */
- public void updateHistory(boolean refresh)
- {
- String textValue = historyCombo.getText().trim();
- if (autoUppercase)
- if (!(textValue.startsWith("\"")&& textValue.endsWith("\"")))
- textValue = textValue.toUpperCase();
- boolean alreadyThere = false;
- String[] newHistory = null;
- if (textValue.length() > 0)
- {
- // d41463 - seletced item should go to the top
- String[] currentHistory = historyCombo.getItems();
- if ( currentHistory.length > 0)
- {
- if (!textValue.equals(currentHistory[0]))
- {
- alreadyThere = false;
- // if string exists
- for (int idx=0; !alreadyThere && (idx<currentHistory.length); idx++)
- {
- if (textValue.equals(currentHistory[idx]))
- alreadyThere = true;
- }
-
- if (alreadyThere)
- newHistory = new String[currentHistory.length];
- else
- {
- newHistory = new String[currentHistory.length >= maxComboEntries ? maxComboEntries : currentHistory.length + 1];
- }
- newHistory[0] = textValue;
- int idx2 = 1;
- // copy the rest
- for (int idx=0; idx< currentHistory.length && idx2 < newHistory.length; idx++)
- {
- if (!textValue.equals(currentHistory[idx]))
- {
- newHistory[idx2] = currentHistory[idx];
- ++idx2;
- }
- }
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, newHistory);
- }
- }
- else
- {
- newHistory =new String[1];
- newHistory[0] = textValue;
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, newHistory);
- }
- if (refresh && (newHistory != null))
- {
- setItems(newHistory);
- setText(textValue);
- }
- /*
- String[] currentHistory = historyCombo.getItems();
- String[] newHistory = new String[currentHistory.length + 1];
- newHistory[0] = textValue;
- boolean alreadyThere = false;
- for (int idx=0; !alreadyThere && (idx<currentHistory.length); idx++)
- {
- if (textValue.equals(currentHistory[idx]))
- alreadyThere = true;
- else
- newHistory[idx+1] = currentHistory[idx];
- }
- if (!alreadyThere)
- SystemPreferencesManager.getGlobalPreferences().setWidgetHistory(historyKey, newHistory);
- */
- }
- }
- /**
- * Set the history to the given array of strings. Replaces what is there.
- */
- public void setHistory(String[] newHistory)
- {
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, newHistory);
- }
-
- // -----------------------
- // INTERNAL-USE METHODS...
- // -----------------------
- /**
- * Prepares this composite control and sets the default layout data.
- * @param Number of columns the new group will contain.
- */
- protected Composite prepareComposite(int numColumns)
- {
- Composite composite = this;
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.horizontalSpacing = 0;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- // horizontal data...
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = DEFAULT_COMBO_WIDTH+DEFAULT_BUTTON_WIDTH+DEFAULT_MARGIN;
- // vertical data...
- data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
- data.grabExcessVerticalSpace = false;
-
- composite.setLayoutData(data);
- return composite;
- }
- /**
- * Creates a new combobox instance and sets the default
- * layout data.
- * <p>
- * Does NOT set the widthHint as that causes problems. Instead the combo will
- * consume what space is available within this composite.
- * @param parent composite to put the button into.
- */
- public static Combo createCombo(Composite parent, boolean readonly)
- {
- Combo combo = null;
- if (!readonly)
- combo = new Combo(parent, SWT.DROP_DOWN);
- else
- combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- //System.out.println("Default widthHint = " + data.widthHint);
- combo.setLayoutData(data);
- return combo;
- }
-
- protected void addOurButtonSelectionListener()
- {
- // Add the button listener
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- historyButtonPressed();
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- widgetSelected(event);
- }
-
- };
- historyButton.addSelectionListener(selectionListener);
- }
-
- protected void historyButtonPressed()
- {
- SystemWorkWithHistoryDialog dlg = new SystemWorkWithHistoryDialog(getShell(), getHistory());
- if (defaultHistory != null)
- dlg.setDefaultHistory(defaultHistory);
- dlg.setBlockOnOpen(true);
- dlg.open();
- if (!dlg.wasCancelled())
- {
- String value = historyCombo.getText(); // d41471
- String[] newHistory = dlg.getHistory();
- SystemPreferencesManager.getPreferencesManager().setWidgetHistory(historyKey, newHistory);
- setItems(newHistory);
- historyCombo.setText(value); // Restore the value d41471
- }
- }
-
- protected Button createHistoryButton()
- {
- /*
- dwd: modified for defect 57974 - tab enable, provide focus rectangle, and accessibility text for history button. Original
- scheme used an SWT.ARROW button style which was not tab enabled and could not provide a focus rectangle.
- Changes: made the control a push button, programmatically drew the arrow on the button, and provided accessibility information.
- */
- boolean isDrawn = System.getProperty("os.name").toLowerCase().startsWith("win");
- if (isDrawn) {
- historyButton = new Button(this, SWT.PUSH);
- Display display = this.getDisplay();
- final Image upArrow = new Image(display, 5, 6);
- GC gc = new GC(upArrow);
- gc.setBackground(historyButton.getBackground());
- gc.fillRectangle(upArrow.getBounds());
- gc.setForeground(historyButton.getForeground());
- gc.drawLine(0, 5, 4, 5);
- gc.drawLine(0, 4, 4, 4);
- gc.drawLine(1, 3, 3, 3);
- gc.drawLine(1, 2, 3, 2);
- gc.drawLine(2, 1, 2, 1);
- gc.drawLine(2, 0, 2, 0);
- gc.dispose();
- historyButton.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- upArrow.dispose();
- }
- });
- historyButton.setImage(upArrow);
- } else {
- historyButton = new Button(this, SWT.ARROW);
- historyButton.setAlignment(SWT.UP);
- }
- historyButton.setToolTipText(SystemResources.RESID_WORKWITHHISTORY_BUTTON_TIP);
- historyButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getHelp(AccessibleEvent e) { // this is the one that should supply the text heard.
- e.result = "";
- }
- public void getName(AccessibleEvent e) { // this is the one that apparently does supply the text heard.
- e.result = historyButton.getToolTipText();
- String prefix = null;
- Composite parent = historyButton.getParent();
- while (parent != null && prefix == null) {
- if (parent instanceof Group) {
- Group group = (Group) parent;
- prefix = group.getText();
- }
- parent = parent.getParent();
- }
- if (prefix != null) {
- e.result = prefix + " " + e.result;
- }
- }
- });
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
- data.grabExcessHorizontalSpace = false ;
- data.widthHint = DEFAULT_BUTTON_WIDTH;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = true;
- data.heightHint = 20;
- historyButton.setLayoutData(data);
- return historyButton;
- }
-
- public void setHistoryButtonHeight(int height)
- {
- ((GridData)historyButton.getLayoutData()).heightHint = height;
- ((GridData)historyButton.getLayoutData()).grabExcessVerticalSpace = false;
- ((GridData)historyButton.getLayoutData()).verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
- }
-
- public void keyTraversed(TraverseEvent e)
- {
- int detail = e.detail;
- String s = "unknown";
- switch (detail)
- {
- case SWT.TRAVERSE_ARROW_NEXT: s="Arrow Next"; break;
- case SWT.TRAVERSE_ARROW_PREVIOUS: s="Arrow Previous"; break;
- case SWT.TRAVERSE_ESCAPE: s="Escape"; break;
- case SWT.TRAVERSE_RETURN: s="Return"; break;
- case SWT.TRAVERSE_TAB_NEXT:
- s="Tab Next";
- //historyButton.setFocus();
- historyButton.forceFocus();
- //e.doit=false;
- break;
- case SWT.TRAVERSE_TAB_PREVIOUS: s="Tab Previous"; break;
- }
- System.out.println("keyTraversed: "+s);
- }
-
- public void keyPressed(KeyEvent e)
- {
-
- }
- public void keyReleased(KeyEvent e)
- {
- if ((e.stateMask == SWT.CTRL) && (e.keyCode == SWT.ARROW_UP))
- {
- historyButtonPressed();
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java
deleted file mode 100644
index 371da9040..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java
+++ /dev/null
@@ -1,1121 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.rse.core.SystemPreferencesManager;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
-import org.eclipse.rse.model.ISystemResourceChangeEvent;
-import org.eclipse.rse.model.ISystemResourceChangeEvents;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.actions.SystemNewConnectionAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * This re-usable widget is for selecting a connection from the master list of connections.
- * The list is subsettable by one or more system types.
- * There is also the option of including a "New" button to the right of the connection
- * dropdown, for the purpose of creating a new connection.
- * <p>
- * Without the New button, the composite is layed as follows:</p>
- * <pre><code>
- * Connection: ______________________v
- * </code></pre>
- * <p>
- * With the New button, the composite is layed as follows:</p>
- * <pre><code>
- * Connection: ______________v New...
- * </code></pre>
- * <p>
- * There are numerous ways to subset the connection list:</p>
- * <ul>
- * <li>By system type, either by a single type or an array of types. Only connections of these types are listed.
- * <li>By subsystem factory. Only connections with subsystems owned by the given subsystem factory are listed.
- * <li>By subsystem factory category. Only connections which contain subsystems owned by subsystem factories which
- * are defined in their xml extension point as being of the given category are listed.
- * For a list of pre-defined categories, see {@link org.eclipse.rse.core.model.ISubSystemConfigurationCategories}.
- * </ul>
- */
-public class SystemHostCombo extends Composite implements ISelectionProvider, ISystemCombo,
- org.eclipse.rse.model.ISystemResourceChangeListener,
- ISystemResourceChangeEvents, DisposeListener
-{
- protected Label connectionLabel = null;
- protected Combo connectionCombo = null;
- protected Button newButton = null;
- protected boolean showNewButton = true;
- protected boolean showLabel = true;
- protected boolean showQualifiedNames;
- protected boolean listeningForConnectionEvents = false;
- private IHost[] connections = null;
- private SystemNewConnectionAction newConnectionAction = null;
- private String[] restrictSystemTypesTo = null;
- private int gridColumns = 2;
- //private static final int DEFAULT_COMBO_WIDTH = 300;
- //private static final int DEFAULT_BUTTON_WIDTH = 80;
- private String label;
- private String populateSystemType = null; /* used as criteria when refresh is done */
- private String[] populateSystemTypes = null; /* used as criteria when refresh is done */
- private ISubSystemConfiguration populateSSFactory = null; /* used as criteria when refresh is done */
- private String populateSSFactoryId = null; /* used as criteria when refresh is done */
- private String populateSSFactoryCategory = null; /* used as criteria when refresh is done */
- private Cursor waitCursor;
-
- /**
- * Constructor for SystemConnectionCombo when there is only a single system type to restrict the connection list to.
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param systemType the system type to restrict the connection list to. Can be null or * for all.
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param showNewButton true if a New... button is to be included in this composite
- */
- public SystemHostCombo(Composite parent, int style, String systemType, IHost defaultConnection, boolean showNewButton)
- {
- super(parent, style);
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- init(parent, showNewButton);
- populateSystemType = systemType;
- populateConnectionCombo(connectionCombo, systemType, defaultConnection, true);
- setConnectionToolTipText();
- addOurConnectionSelectionListener();
- }
- /**
- * Constructor for SystemConnectionCombo when there is an array of system types to restrict the connection list to.
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param systemTypes the system type array to restrict the connection list to.
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param showNewButton true if a New... button is to be included in this composite
- */
- public SystemHostCombo(Composite parent, int style, String[] systemTypes, IHost defaultConnection, boolean showNewButton)
- {
- super(parent, style);
- restrictSystemTypesTo = systemTypes;
- init(parent, showNewButton);
- populateSystemTypes = systemTypes;
- populateConnectionCombo(connectionCombo, systemTypes, defaultConnection);
- setConnectionToolTipText();
- addOurConnectionSelectionListener();
- }
- /**
- * Constructor for SystemConnectionCombo when there is a subsystem factory to restrict the list to.
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param ssConfig Only connections with subsystems owned by this factory are returned.
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param showNewButton true if a New... button is to be included in this composite
- */
- public SystemHostCombo(Composite parent, int style, ISubSystemConfiguration ssConfig, IHost defaultConnection, boolean showNewButton)
- {
- super(parent, style);
- restrictSystemTypesTo = ssConfig.getSystemTypes();
- init(parent, showNewButton);
- populateSSFactory = ssConfig;
- populateConnectionCombo(connectionCombo, ssConfig, defaultConnection);
- setConnectionToolTipText();
- addOurConnectionSelectionListener();
- }
- /**
- * Constructor for SystemConnectionCombo when there is a subsystem factory id to restrict the list to.
- * To avoid collision with the constructor that takes a string for the system type, this one places the
- * subystem factory Id string parameter after the defaultConnection constructor
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param ssConfigId Only connections with subsystems owned by this configuration are returned.
- * @param showNewButton true if a New... button is to be included in this composite
- */
- public SystemHostCombo(Composite parent, int style, IHost defaultConnection, String ssConfigId, boolean showNewButton)
- {
- super(parent, style);
- restrictSystemTypesTo = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfiguration(ssConfigId).getSystemTypes();
- init(parent, showNewButton);
- populateSSFactoryId = ssConfigId;
- populateConnectionCombo(connectionCombo, ssConfigId, defaultConnection);
- setConnectionToolTipText();
- addOurConnectionSelectionListener();
- }
-
- /**
- * Constructor for SystemConnectionCombo when there is a subsystem factory category to restrict the list to.
- * To avoid collision with the constructor that takes a string for the system type, this one places the
- * string parameter at the end.
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param showNewButton true if a New... button is to be included in this composite
- * @param ssConfigCategory Only connections with subsystems owned by configurations of this category are returned.
- */
- public SystemHostCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton, String ssConfigCategory)
- {
- this(parent, style, defaultConnection, showNewButton, ssConfigCategory, true);
- }
-
- /**
- * Constructor for SystemConnectionCombo when there is a subsystem factory category to restrict the list to.
- * To avoid collision with the constructor that takes a string for the system type, this one places the
- * string parameter at the end.
- * @param parent Parent composite
- * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL
- * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
- * @param showNewButton true if a New... button is to be included in this composite
- * @param ssFactoryCategory Only connections with subsystems owned by factories of this category are returned.
- * @param showLabel true if a 'Connection' label is to be included in this composite
- */
- public SystemHostCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton, String ssFactoryCategory, boolean showLabel)
- {
- super(parent, style);
- if (showNewButton) // this is expensive, so only need to do this if New is enabled
- {
- ISubSystemConfigurationProxy[] ssfProxies = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationProxiesByCategory(ssFactoryCategory);
- Vector vTypes = new Vector();
- for (int idx=0; idx<ssfProxies.length; idx++)
- {
- String[] types = ssfProxies[idx].getSystemTypes();
- for (int jdx=0; jdx<types.length; jdx++)
- {
- if (!vTypes.contains(types[jdx]))
- vTypes.addElement(types[jdx]);
- }
- }
- restrictSystemTypesTo = new String[vTypes.size()];
- for (int idx=0; idx<vTypes.size(); idx++)
- restrictSystemTypesTo[idx] = (String)vTypes.elementAt(idx);
- }
- init(parent, showNewButton, showLabel);
- populateSSFactoryCategory = ssFactoryCategory;
- populateConnectionCombo(connectionCombo, defaultConnection, ssFactoryCategory);
- setConnectionToolTipText();
- addOurConnectionSelectionListener();
- }
-
- /**
- * Set auto-uppercase. When enabled, all non-quoted values are uppercases when added to the history.
- * <p>
- * This method is part of ISystemCombo, so we must support it, but it does not apply this combo widget since the
- * contents are read-only. Hence, it does nothing!
- */
- public void setAutoUpperCase(boolean enable)
- {
-
- }
-
-
- protected void init(Composite parent, boolean showNewButton)
- {
- init(parent, showNewButton, true);
- }
-
-
- protected void init(Composite parent, boolean showNewButton, boolean showLabel)
- {
- this.showNewButton = showNewButton;
- this.showLabel = showLabel;
- showQualifiedNames = SystemPreferencesManager.getPreferencesManager().getQualifyConnectionNames();
- //prepareComposite(showNewButton ? 3 : 2);
- prepareComposite(3);
-
- if ( showLabel )
- //connectionLabel = SystemWidgetHelpers.createLabel(this,rb,ISystemConstants.WIDGET_CONNECTION_ROOT);
- {
- if (label == null)
- connectionLabel = SystemWidgetHelpers.createLabel(this,SystemResources.WIDGET_CONNECTION_LABEL);
- else
- connectionLabel = SystemWidgetHelpers.createLabel(this,label);
- }
- connectionCombo = createConnectionCombo(this);
- if (showNewButton)
- {
- //newConnectionAction = new SystemNewConnectionAction(parent.getShell(), false, this);
- newConnectionAction = getNewConnectionAction(parent.getShell(), this);
- newConnectionAction.restrictSystemTypes(restrictSystemTypesTo);
- newButton = createPushButton(this,SystemResources.WIDGET_BUTTON_NEWCONNECTION_LABEL,SystemResources.WIDGET_BUTTON_NEWCONNECTION_TOOLTIP);
- addOurButtonSelectionListener();
- if ( !showLabel )
- ((GridData)connectionCombo.getLayoutData()).horizontalSpan = 2;
- }
- else
- {
- if( showLabel )
- ((GridData)connectionCombo.getLayoutData()).horizontalSpan = 2;
- else
- ((GridData)connectionCombo.getLayoutData()).horizontalSpan = 3;
- }
- addDisposeListener(this);
- }
- /**
- * Overridable method.
- * Returns action to be called when New... pressed.
- */
- protected SystemNewConnectionAction getNewConnectionAction(Shell shell, ISelectionProvider selectionProvider)
- {
- return new SystemNewConnectionAction(shell, false, selectionProvider);
- }
-
- /**
- * Get the user selected SystemConnection object.
- * Might be null if the list is empty.
- */
- public IHost getHost()
- {
- IHost connection = null;
- int idx = connectionCombo.getSelectionIndex();
- if ((idx >= 0) && (connections!=null) && (idx<connections.length))
- connection = connections[idx];
- return connection;
- }
-
- /**
- * Return the combo box widget
- */
- public Combo getCombo()
- {
- return connectionCombo;
- }
- /**
- * Set the width hint for this whole composite
- * Default is 180.
- */
- public void setWidthHint(int widthHint)
- {
- // after much research it was decided that it was the wrong thing to do to
- // explicitly set the widthHint of a child widget without our composite, as
- // that could end up being a bigger number than the composites widthHint itself
- // if the caller set its it directly.
- // Rather, we just set the overall composite width and specify the combo child
- // widget is to grab all the space within that which the little button does not use.
- ((GridData)getLayoutData()).widthHint = widthHint;
- }
- /**
- * Set button width hint
- */
- public void setButtonWidthHint(int widthHint)
- {
- if (newButton != null)
- {
- ((GridData)newButton.getLayoutData()).widthHint = widthHint;
- }
- }
- /**
- * Set button width hint, based on the width of another widget
- */
- public void setButtonWidthHint(Control otherWidget)
- {
- if (newButton != null)
- {
- //System.out.println("Curr button width = " + newButton.getSize().x);
- //System.out.println("Setting button width to = " + otherWidget.getSize().x);
- ((GridData)newButton.getLayoutData()).widthHint = otherWidget.getSize().x;
- //System.out.println("New button width = " + newButton.getSize().x);
- }
- //else
- // System.out.println("New button is null");
- }
-
- /**
- * Return the number of grid data columns within this composite.
- * Will vary depending if there is a New button or not.
- */
- public int getGridColumns()
- {
- return gridColumns;
- }
- /**
- * Return the New... button widget
- */
- public Button getNewButton()
- {
- return newButton;
- }
- /**
- * Get the prompt Label widget
- */
- public Label getPromptLabel()
- {
- return connectionLabel;
- }
- /**
- * Set the items in the combo field
- */
- public void setItems(String[] items)
- {
- connectionCombo.setItems(items);
- }
- /**
- * Get the items in the combo field
- */
- public String[] getItems()
- {
- return connectionCombo.getItems();
- }
- /**
- * Return the text in the connection combo entry field.
- * This is only of limited value. You should call getSystemConnection() instead.
- */
- public String getText()
- {
- return connectionCombo.getText();
- }
- /**
- * Disable/Enable all the child controls.
- */
- public void setEnabled(boolean enabled)
- {
- connectionCombo.setEnabled(enabled);
- if (newButton != null)
- newButton.setEnabled(enabled);
- }
- /**
- * Set the tooltip text for the directory combo field
- */
- public void setToolTipText(String tip)
- {
- if ( connectionLabel != null )
- connectionLabel.setToolTipText(tip);
- //connectionCombo.setToolTipText(tip);
- }
- /**
- * Set the tooltip text for the new button
- */
- public void setNewButtonToolTipText(String tip)
- {
- if (newButton != null)
- newButton.setToolTipText(tip);
- }
- /**
- * Same as {@link #setNewButtonToolTipText(String)}
- */
- public void setButtonToolTipText(String tip)
- {
- setNewButtonToolTipText(tip);
- }
-
- /**
- * Set the label to use for the prompt.
- */
- public void setLabel(String label)
- {
- this.label = label;
- if (connectionLabel != null)
- connectionLabel.setText(label);
- }
-
- /**
- * Set the focus to the directory combo field
- */
- public boolean setFocus()
- {
- return connectionCombo.setFocus();
- }
- /**
- * Set the focus to the new button
- */
- public void setNewButtonFocus()
- {
- if (newButton != null)
- newButton.setFocus();
- }
-
- /**
- * Select the combo dropdown list entry at the given index.
- */
- public void select(int selIdx)
- {
- connectionCombo.select(selIdx);
- //if (fireEvent)
- {
- Event e = new Event();
- //e.time = event.time;
- //e.stateMask = event.stateMask;
- //e.doit = event.doit;
- connectionCombo.notifyListeners(SWT.Selection, e);
- }
- }
- /**
- * Same as {@link #select(int)}
- */
- public void setSelectionIndex(int selIdx)
- {
- select(selIdx);
- }
- /**
- * Select a connection from the dropdown
- */
- public void select(IHost connection)
- {
- if (connections != null)
- {
- int matchIdx = -1;
- for (int idx=0; (matchIdx==-1) && (idx<connections.length); idx++)
- if (connection == connections[idx])
- matchIdx = idx;
- if (matchIdx != -1)
- select(matchIdx);
- }
- }
-
-
- /**
- * Deselect
- */
- public void clearSelection()
- {
- connectionCombo.clearSelection();
- connectionCombo.deselectAll();
- Event e = new Event();
- //e.time = event.time;
- //e.stateMask = event.stateMask;
- //e.doit = event.doit;
- connectionCombo.notifyListeners(SWT.Selection, e);
- }
- /**
- * Clear the entered/selected contents of the combo box. Clears only the text selection, not the list selection
- */
- public void clearTextSelection()
- {
- connectionCombo.clearSelection();
- }
-
- /**
- * Get the index number of the currently selected item.
- */
- public int getSelectionIndex()
- {
- return connectionCombo.getSelectionIndex();
- }
-
- /**
- * Register a listener interested in an item is selected in the combo box
- * @see #removeSelectionListener(SelectionListener)
- */
- public void addSelectionListener(SelectionListener listener)
- {
- connectionCombo.addSelectionListener(listener);
- }
- /**
- * Remove a previously set combo box selection listener.
- * @see #addSelectionListener(SelectionListener)
- */
- public void removeSelectionListener(SelectionListener listener)
- {
- connectionCombo.removeSelectionListener(listener);
- }
-
- /**
- * Register a listener interested in when the new button is selected
- * @see #removeNewButtonSelectionListener(SelectionListener)
- */
- public void addNewButtonSelectionListener(SelectionListener listener)
- {
- if (newButton != null)
- newButton.addSelectionListener(listener);
- }
- /**
- * Remove a previously set new button selection listener.
- * @see #addNewButtonSelectionListener(SelectionListener)
- */
- public void removeNewButtonSelectionListener(SelectionListener listener)
- {
- if (newButton != null)
- newButton.removeSelectionListener(listener);
- }
-
- /**
- * Register a listener interested in entry field modify events
- * @see #removeModifyListener(ModifyListener)
- */
- public void addModifyListener(ModifyListener listener)
- {
- connectionCombo.addModifyListener(listener);
- }
- /**
- * Remove a previously set entry field listener.
- * @see #addModifyListener(ModifyListener)
- */
- public void removeModifyListener(ModifyListener listener)
- {
- connectionCombo.removeModifyListener(listener);
- }
-
- // -----------------------
- // INTERNAL-USE METHODS...
- // -----------------------
- /**
- * Prepares this composite control and sets the default layout data.
- * @param Number of columns the new group will contain.
- */
- protected Composite prepareComposite(int numColumns)
- {
- gridColumns = numColumns;
- Composite composite = this;
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- //layout.horizontalSpacing = 0;
- //layout.verticalSpacing = 0;
- composite.setLayout(layout);
- //GridData
- GridData data = new GridData();
- // horizontal clues
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = showNewButton ? 250 : 200;
- // vertical clues
- data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING; //GridData.CENTER;
- data.grabExcessVerticalSpace = false; // true;
-
- composite.setLayoutData(data);
- return composite;
- }
- /**
- * Creates a new readonly connection combobox instance and sets the default
- * layout data, with tooltip text.
- * Assign the listener to the passed in implementer of Listener.
- * <p>
- * This fills the combination with the names of all the active connections of the given
- * system type.
- * @param parent composite to put the button into.
- */
- protected Combo createConnectionCombo(Composite parent)
- {
- Combo combo = createCombo(parent,true);
- setToolTipText(SystemResources.WIDGET_CONNECTION_TOOLTIP);
- return combo;
- }
-
- /**
- * Creates a new combobox instance and sets the default
- * layout data.
- * <p>
- * Does NOT set the widthHint as that causes problems. Instead the combo will
- * consume what space is available within this composite.
- * @param parent composite to put the button into.
- */
- public static Combo createCombo(Composite parent, boolean readonly)
- {
- Combo combo = null;
- if (!readonly)
- combo = new Combo(parent, SWT.DROP_DOWN);
- else
- combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- combo.setLayoutData(data);
- return combo;
- }
-
- /**
- * Populates a readonly connection combobox instance with system connections for the given
- * system type.
- * <p>
- * This fills the combination with the names of all the active connections of the given
- * system type.
- * @param connectionCombo composite to populate
- * @param systemType the system type to restrict the connection list to. Pass null or * for all system types
- * @param defaultConnection the default system connection to preselect.
- * @param preSelectIfNoMatch true if we should preselect the first item if the given connection is not found
- * @return true if given default connection was found and selected
- */
- protected boolean populateConnectionCombo(Combo combo, String systemType, IHost defaultConnection,
- boolean preSelectIfNoMatch)
- {
- return populateConnectionCombo(combo, systemType, defaultConnection, preSelectIfNoMatch, false);
- }
-
- /**
- * Populates a readonly connection combobox instance with system connections for the given
- * system type.
- * <p>
- * This fills the combination with the names of all the active connections of the given
- * system type.
- * @param connectionCombo composite to populate
- * @param systemType the system type to restrict the connection list to. Pass null or * for all system types
- * @param defaultConnection the default system connection to preselect.
- * @param preSelectIfNoMatch true if we should preselect the first item if the given connection is not found
- * @param appendToCombo indicates whether or not to append to combo with population or replace
- * @return true if given default connection was found and selected
- */
- protected boolean populateConnectionCombo(Combo combo, String systemType, IHost defaultConnection,
- boolean preSelectIfNoMatch, boolean appendToCombo)
- {
- boolean matchFound = false;
- IHost[] additionalConnections = null;
- if ( (systemType == null) || (systemType.equals("*")) ) //$NON-NLS-1$
- additionalConnections = RSEUIPlugin.getTheSystemRegistry().getHosts();
- else
- additionalConnections = RSEUIPlugin.getTheSystemRegistry().getHostsBySystemType(systemType);
- if (additionalConnections != null)
- {
- String[] connectionNames = new String[additionalConnections.length];
- int selectionIndex = -1;
- for (int idx=0; idx<connectionNames.length; idx++)
- {
- connectionNames[idx] = getConnectionName(additionalConnections[idx]);
- if ((defaultConnection != null) && (additionalConnections[idx] == defaultConnection))
- {
- if (connections == null)
- selectionIndex = idx;
- else
- selectionIndex = connections.length+idx;
- }
- }
- // DKM - fix for 55830
- if (appendToCombo)
- {
- for (int i = 0; i < connectionNames.length; i++)
- combo.add(connectionNames[i]);
- }
- else
- {
- combo.setItems(connectionNames);
- }
- if (selectionIndex >=0)
- {
- //combo.select(selectionIndex);
- select(selectionIndex);
- matchFound = true;
- }
- else if (preSelectIfNoMatch && (combo.getItemCount()>0))
- //combo.select(0);
- select(0);
- }
- if (connections == null)
- connections = additionalConnections;
- else if ((additionalConnections != null) && (additionalConnections.length>0))
- {
- IHost[] totalConnections = new IHost[connections.length+additionalConnections.length];
- int totalIdx = 0;
- for (int idx=0; idx<connections.length; idx++)
- totalConnections[totalIdx++] = connections[idx];
- for (int idx=0; idx<additionalConnections.length; idx++)
- totalConnections[totalIdx++] = additionalConnections[idx];
- connections = totalConnections;
- }
- return matchFound;
- }
- /**
- * Populates a readonly connection combobox instance with system connections for the given
- * array of system types.
- * @param connectionCombo composite to populate
- * @param systemTypes the system types to restrict the connection list to. Pass null or * for all system types
- * @param defaultConnection the default system connection to preselect.
- */
- protected void populateConnectionCombo(Combo combo, String[] systemTypes, IHost defaultConnection)
- {
- boolean match = false;
- boolean anyMatch = false;
- for (int idx=0; idx<systemTypes.length; idx++)
- {
- match = populateConnectionCombo(combo, systemTypes[idx], defaultConnection, false, true);
- if (match)
- anyMatch = true;
- }
- if (!anyMatch && (combo.getItemCount()>0))
- //combo.select(0);
- select(0);
- }
- /**
- * Populates a readonly connection combobox instance with system connections which have subsystems
- * owned by the given subsystem factory.
- * <p>
- * @param connectionCombo composite to populate
- * @param subsystemFactory the subsystem factory to restrict the connection list to.
- * @param defaultConnection the default system connection to preselect.
- * @return true if given default connection was found and selected
- */
- protected boolean populateConnectionCombo(Combo combo, ISubSystemConfiguration ssFactory, IHost defaultConnection)
- {
- connections = RSEUIPlugin.getTheSystemRegistry().getHostsBySubSystemConfiguration(ssFactory);
- return addConnections(combo, connections, defaultConnection);
- }
- /**
- * Populates a readonly connection combobox instance with system connections which have subsystems
- * owned by a subsystem factory of the given subsystem factory id.
- * <p>
- * @param connectionCombo composite to populate
- * @param defaultConnection the default system connection to preselect.
- * @param subsystemFactoryId the subsystem factory id to restrict the connection list by.
- * @return true if given default connection was found and selected
- */
- protected boolean populateConnectionCombo(Combo combo, String ssFactoryId, IHost defaultConnection)
- {
- connections = RSEUIPlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationId(ssFactoryId);
- return addConnections(combo, connections, defaultConnection);
- }
-
- /**
- * Populates a readonly connection combobox instance with system connections which have subsystems
- * owned by a subsystem factory of the given subsystem factory category.
- * <p>
- * @param connectionCombo composite to populate
- * @param defaultConnection the default system connection to preselect.
- * @param subsystemFactoryCategory the subsystem factory category to restrict the connection list by.
- * @return true if given default connection was found and selected
- */
- protected boolean populateConnectionCombo(Combo combo, IHost defaultConnection, String ssFactoryCategory)
- {
- connections = RSEUIPlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(ssFactoryCategory);
- return addConnections(combo, connections, defaultConnection);
- }
- /**
- * An attempt to get some abstraction
- */
- private boolean addConnections(Combo combo, IHost[] connections, IHost defaultConnection)
- {
- boolean matchFound = false;
- if (connections != null)
- {
- String[] connectionNames = new String[connections.length];
- int selectionIndex = -1;
- for (int idx=0; idx<connectionNames.length; idx++)
- {
- connectionNames[idx] = getConnectionName(connections[idx]);
- if ((defaultConnection!=null) && (connections[idx] == defaultConnection))
- selectionIndex = idx;
- }
- combo.setItems(connectionNames);
- if (selectionIndex >=0)
- {
- //combo.select(selectionIndex);
- select(selectionIndex);
- matchFound = true;
- }
- else if (combo.getItemCount()>0)
- //combo.select(0);
- select(0);
- }
- return matchFound;
- }
-
- /**
- * Do string variable substitution. Using you are replacing %1 (say) with a string
- * @param message containing substitution variable. Eg "Connect failed with return code &1"
- * @param substitution variable. Eg "%1"
- * @param substitution data. Eg "001"
- * @return message with all occurrences of variable substituted with data.
- */
- protected static String sub(String msg, String subOld, String subNew)
- {
- StringBuffer temp = new StringBuffer();
- int lastHit = 0;
- int newHit = 0;
- for (newHit = msg.indexOf(subOld,lastHit); newHit != -1;
- lastHit = newHit, newHit = msg.indexOf(subOld,lastHit))
- {
- if (newHit >= 0)
- temp.append(msg.substring(lastHit,newHit));
- temp.append(subNew);
- newHit += subOld.length();
- }
- if (lastHit >= 0)
- temp.append(msg.substring(lastHit));
- return temp.toString();
- }
-
- /**
- * Return the connection name to display in the combo, given the connection
- */
- private String getConnectionName(IHost conn)
- {
- //String connectionName = sub(nameString,"%1",conn.getAliasName());
- //connectionName = sub(connectionName,"%2",conn.getSystemProfileName());
- //return connectionName;
- if (showQualifiedNames)
- return conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$
- else
- return conn.getAliasName();
- }
-
-
- /**
- * Refresh the list of connections
- */
- public void refreshConnections()
- {
- connections = null;
- connectionCombo.removeAll();
-
- if ( populateSystemType != null )
- {
- populateConnectionCombo(connectionCombo, populateSystemType, null, false);
- }
- else if ( populateSystemTypes != null )
- {
- populateConnectionCombo(connectionCombo, populateSystemTypes, null);
- }
- else if ( populateSSFactory != null )
- {
- populateConnectionCombo(connectionCombo, populateSSFactory, null);
- }
- else if ( populateSSFactoryId != null )
- {
- populateConnectionCombo(connectionCombo, populateSSFactoryId, null);
- }
- else if ( populateSSFactoryCategory != null )
- {
- populateConnectionCombo(connectionCombo, null, populateSSFactoryCategory);
- }
- }
-
- /**
- * This is the method in your class that will be called when a
- * system resource changes. We want to listen to connection changes.
- * @see ISystemResourceChangeEvent
- */
- public void systemResourceChanged(ISystemResourceChangeEvent event)
- {
- int type = event.getType();
- Object src = event.getSource();
- //Object parent = event.getParent();
- switch ( type )
- {
- case EVENT_ADD:
- case EVENT_ADD_RELATIVE:
- case EVENT_DELETE_MANY:
- case EVENT_RENAME:
- if ( src instanceof IHost )
- {
- // if RENAME, update showQualifiedNames in case it changed
- if ( type == EVENT_RENAME )
- showQualifiedNames = SystemPreferencesManager.getPreferencesManager().getQualifyConnectionNames();
-
- refreshConnections();
- }
- break;
- }
- }
-
- /**
- * Have the SystemConnectionCombo listen to add/delete/rename events on connections
- * and automatically update it's list of connections
- */
- public void listenToConnectionEvents(boolean start)
- {
- if ( start )
- {
- // ----------------------------------------
- // register with system registry for events
- // ----------------------------------------
- listeningForConnectionEvents = true;
- RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
- }
- else
- {
- // ----------------------------------------
- // remove register with system registry for events
- // ----------------------------------------
- listeningForConnectionEvents = false;
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- }
- }
- /**
- * We are going away. De-Register ourselves as a listener for system resource change events
- */
- public void widgetDisposed(DisposeEvent e)
- {
- if (listeningForConnectionEvents)
- {
- listeningForConnectionEvents = false;
- RSEUIPlugin.getTheSystemRegistry().removeSystemResourceChangeListener(this);
- }
- }
-
- protected void addOurButtonSelectionListener()
- {
- // Add the button listener
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- setBusyCursor(true);
- newConnectionAction.run();
- setBusyCursor(false);
- IHost newConnection = (IHost)newConnectionAction.getValue();
- //System.out.println("newConnection == " + newConnection);
- if (newConnection != null )
- {
-
- // if listening for events, combo box will be updated automatically
- if ( listeningForConnectionEvents )
- {
- select(newConnection); // it should be added by now
- }
- // if not listening for events, add new connection
- else
- {
- if (connections == null)
- {
- connections = new IHost[1];
- connections[0] = newConnection;
- addConnections(connectionCombo,connections,newConnection);
- //connectionCombo.select(0);
- }
- else
- {
- IHost[] totalConnections = new IHost[connections.length+1];
- int totalIdx = 0;
- for (int idx=0; idx<connections.length; idx++)
- totalConnections[totalIdx++] = connections[idx];
- totalConnections[totalIdx] = newConnection;
- connections = totalConnections;
- addConnections(connectionCombo,connections,newConnection);
- //connectionCombo.select(totalIdx);
- }
- }
- }
- }
- };
- newButton.addSelectionListener(selectionListener);
- }
-
- protected void addOurConnectionSelectionListener()
- {
- // Add the combo listener
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- setConnectionToolTipText();
- }
- };
- connectionCombo.addSelectionListener(selectionListener);
- }
-
- protected void setConnectionToolTipText()
- {
- String tooltipText = ""; //$NON-NLS-1$
- IHost currConn = getHost();
- if (currConn != null)
- tooltipText = currConn.getHostName();
- connectionCombo.setToolTipText(tooltipText);
- }
-
- protected static Button createPushButton(Composite group, String label)
- {
- Button button = new Button(group, SWT.PUSH);
- button.setText(label);
- GridData data = new GridData();
- //data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- button.setLayoutData(data);
- return button;
- }
-
- protected static Button createPushButton(Composite group, String label, String tooltip)
- {
- Button button = createPushButton(group,label);
- button.setToolTipText(tooltip);
- return button;
- }
-
- // -----------------------------
- // ISelectionProvider methods...
- // -----------------------------
- /**
- * Register a listener interested in an item is selected in the combo box
- * @see #removeSelectionChangedListener(ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- //connectionCombo.addSelectionChangedListener(listener);
- }
- /**
- * Remove a previously set combo box selection listener.
- * @see #addSelectionChangedListener(ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- //connectionCombo.removeSelectionChangedListener(listener);
- }
-
- public ISelection getSelection()
- {
- ISelection selection = StructuredSelection.EMPTY;
- IHost connection = getHost();
- if (connection != null)
- selection = new StructuredSelection(connection);
- return selection;
- }
- public void setSelection(ISelection selection)
- {
- }
-
- public IHost[] getConnections()
- {
- return connections;
- }
-
- public void setConnections(IHost[] input)
- {
- connections = input;
- }
-
- /**
- * <i>Helper method.</i><br>
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- protected void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), waitCursor);
- }
- else
- {
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemPortPrompt.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemPortPrompt.java
deleted file mode 100644
index dfdcc6e75..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemPortPrompt.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemPropertyResources;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.SystemNumericVerifyListener;
-import org.eclipse.rse.ui.validators.ValidatorPortInput;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-
-/**
- * A composite encapsulating the GUI widgets for prompting for a port. Used in the core SubSystem property
- * page but also be instantiated and used anywhere.
- */
-public class SystemPortPrompt
- //extends Composite
- implements SelectionListener
-{
-
- private Composite composite_prompts;
- //private Label labelPortPrompt;
- private Label labelPort;
- private InheritableEntryField textPort;
- protected SystemMessage errorMessage;
-
- protected boolean portEditable=true;
- protected boolean portApplicable=true;
- protected int existingPortValue;
- // validators
- protected ISystemValidator portValidator;
- // Inputs from caller
- protected ISystemMessageLine msgLine;
-
- /**
- * A listener for state changes to the port entry inheritable field.
- */
- private class PortFieldStateChangeListener implements IInheritableEntryFieldStateChangeListener {
-
- private SystemNumericVerifyListener verifyListener;
-
- /**
- * Constructor.
- * @param verifyListener the verify listener for the port field.
- */
- private PortFieldStateChangeListener(SystemNumericVerifyListener verifyListener) {
- this.verifyListener = verifyListener;
- }
-
- /**
- * Turns the verifier off if the state of the inheritable entry field is not local, turns it on otherwise.
- * @see org.eclipse.rse.ui.widgets.IInheritableEntryFieldStateChangeListener#stateChanged(org.eclipse.rse.ui.widgets.InheritableEntryField)
- */
- public void stateChanged(InheritableEntryField field) {
-
- if (field.isLocal()) {
- verifyListener.setOff(false);
- }
- else {
- verifyListener.setOff(true);
- }
- }
- }
-
- /**
- * Constructor when you want a new composite to hold the child controls
- */
- public SystemPortPrompt(Composite parent, int style, ISystemMessageLine msgLine,
- boolean wantLabel, boolean isPortEditable,
- int existingPortValue, ISystemValidator portValidator)
- {
- //super(parent, style);
- //composite_prompts = this;
- composite_prompts = new Composite(parent, style);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = wantLabel ? 2 : 1;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- composite_prompts.setLayout(gridLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = false;
- composite_prompts.setLayoutData(gridData);
-
- init(composite_prompts, msgLine, wantLabel, isPortEditable, existingPortValue, portValidator);
-
- composite_prompts.pack();
- }
- /**
- * Constructor when you have an existing composite to hold the child controls
- */
- public SystemPortPrompt(Composite composite_prompts, ISystemMessageLine msgLine,
- boolean wantLabel, boolean isPortEditable,
- int existingPortValue, ISystemValidator portValidator)
- {
- this.composite_prompts = composite_prompts;
-
- init(composite_prompts, msgLine, wantLabel, isPortEditable, existingPortValue, portValidator);
- }
-
- /**
- * Get user-entered Port number.
- */
- public int getPort()
- {
- if (isEditable())
- {
- String port = textPort.getLocalText(); // will be "" if !textPort.getIsLocal(), which results in wiping out local override
- Integer portInteger = null;
- if (textPort.isLocal() && (port.length()>0))
- portInteger = new Integer(port);
- else
- portInteger = new Integer(0);
- return portInteger.intValue();
- }
- else
- return existingPortValue;
- }
- /**
- * Return user-enter Port number as a string
- */
- public String getPortString()
- {
- return internalGetPort();
- }
-
- /**
- * Return true if port is user-editable
- */
- public boolean isEditable()
- {
- return (portEditable && portApplicable);
- }
-
- /**
- * Return true if current port value is without error
- */
- public boolean isComplete()
- {
- if (!isEditable())
- return true;
- else
- return ((errorMessage==null) && (internalGetPort().length()>0));
- }
-
- /**
- * Set the initial port value
- */
- public void setPort(int port)
- {
- // port
- if (portEditable || portApplicable)
- {
- String localPort = null;
-
- localPort = "" + port;
- int iPort = port;
- if (!portEditable) // applicable but not editable
- labelPort.setText(localPort);
- else // editable
- {
- textPort.setLocalText(localPort);
- textPort.setInheritedText("0 "+SystemPropertyResources.RESID_PORT_DYNAMICSELECT);
- textPort.setLocal(iPort != 0);
- }
- }
- }
-
- /**
- * Set the focus
- */
- public boolean setFocus()
- {
- if (textPort != null)
- {
- textPort.getTextField().setFocus();
- return true;
- }
- else
- return composite_prompts.setFocus();
- }
-
- /**
- * Reset to original value
- */
- public void setDefault()
- {
- setPort(existingPortValue);
- }
-
- /**
- * Return the entry field or label for the port prompt
- */
- public Control getPortField()
- {
- if (textPort != null)
- return textPort.getTextField();
- else
- return labelPort;
- }
-
- /**
- * Validate port value per keystroke
- */
- public SystemMessage validatePortInput()
- {
- boolean wasInError = (errorMessage != null);
- errorMessage= null;
- if (textPort!=null)
- {
- if (!textPort.isLocal())
- {
- if (wasInError)
- clearErrorMessage();
- return null;
- }
- if (portValidator != null)
- errorMessage= portValidator.validate(textPort.getText().trim());
- else if (internalGetPort().equals(""))
- errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY);
- }
- if (errorMessage == null)
- {
- if (wasInError)
- clearErrorMessage();
- }
- else
- setErrorMessage(errorMessage);
- //setPageComplete();
- return errorMessage;
- }
-
- // -------------------
- // INTERNAL METHODS...
- // -------------------
- /**
- * Initialize vars, create and init prompts
- */
- protected void init(Composite composite_prompts, ISystemMessageLine msgLine,
- boolean wantLabel, boolean isPortEditable,
- int existingPortValue, ISystemValidator portValidator)
- {
- this.msgLine = msgLine;
- this.portEditable = isPortEditable;
- this.existingPortValue = existingPortValue;
- if (portValidator == null)
- portValidator = new ValidatorPortInput();
- this.portValidator = portValidator;
-
- createPortPrompt(composite_prompts, wantLabel);
- setPort(existingPortValue);
-
- if (textPort != null)
- {
- textPort.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- //System.out.println("in modify text '"+internalGetPort()+"'");
- validatePortInput();
- }
- });
-
- SystemNumericVerifyListener verifyListener = new SystemNumericVerifyListener();
- textPort.getTextField().addVerifyListener(verifyListener);
- textPort.addStateChangeListener(new PortFieldStateChangeListener(verifyListener));
- }
- }
-
- /**
- * Return user-entered Port number.
- */
- protected String internalGetPort()
- {
- if (textPort != null)
- return textPort.getText().trim();
- else
- return labelPort.getText();
- }
-
- /**
- * Create GUI widgets
- */
- protected void createPortPrompt(Composite composite_prompts, boolean wantLabel)
- {
- // Port prompt
- String portRange = " (1-" + ValidatorPortInput.MAXIMUM_PORT_NUMBER + ")";
- if (wantLabel) {
- String labelText = SystemWidgetHelpers.appendColon(SystemResources.RESID_SUBSYSTEM_PORT_LABEL + portRange);
- /*labelPortPrompt =*/ SystemWidgetHelpers.createLabel(composite_prompts, labelText);
- }
- portApplicable = isPortApplicable();
- portEditable = isPortEditable();
- if (isEditable())
- {
- textPort = SystemWidgetHelpers.createInheritableTextField(
- composite_prompts,SystemResources.RESID_SUBSYSTEM_PORT_INHERITBUTTON_TIP,SystemResources.RESID_SUBSYSTEM_PORT_TIP);
- textPort.setFocus();
- }
- else
- {
- String labelValue = " ";
- if (!portApplicable)
- labelValue = getTranslatedNotApplicable();
- labelPort = SystemWidgetHelpers.createLabel(composite_prompts, labelValue);
- }
- }
-
- /**
- * Return true if the port is applicable.
- * For this to be false, the caller must state the port is not editable,
- * and the port value must be null or Integer(-1).
- */
- protected boolean isPortApplicable()
- {
- if (!isPortEditable() && (existingPortValue==-1))
- return false;
- else
- return true;
- }
- /**
- * Return true if the port is editable for this subsystem
- */
- protected boolean isPortEditable()
- {
- return portEditable;
- }
-
- /**
- * Return "Not applicable" translated
- */
- private String getTranslatedNotApplicable()
- {
- return SystemPropertyResources.RESID_TERM_NOTAPPLICABLE;
- }
-
- protected void setErrorMessage(SystemMessage msg)
- {
- if (msgLine != null)
- msgLine.setErrorMessage(msg);
- }
- protected void clearErrorMessage()
- {
- if (msgLine != null)
- msgLine.clearErrorMessage();
- }
-
-
- // SELECTIONLISTENER...
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- public void widgetSelected(SelectionEvent event)
- {
- //System.out.println("Inside widgetSelected. textPort.isLocal(): " + textPort.isLocal());
- if (textPort.isLocal()) // from local to non-local
- {
- /* I don't know why I did this! Phil. Removed for defect 44132
- if (errorMessage != null)
- {
- errorMessage = null;
- clearErrorMessage();
- } */
- }
- else
- {
- //validatePortInput(); doesn't work because it is called before the toggle
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemSelectConnectionForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemSelectConnectionForm.java
deleted file mode 100644
index 33e2e7e6f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemSelectConnectionForm.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.SystemPropertySheetForm;
-import org.eclipse.rse.ui.view.SystemViewConnectionSelectionInputProvider;
-import org.eclipse.rse.ui.view.SystemViewForm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-
-/**
- * A reusable form for prompting for a connection. Unlike {@link org.eclipse.rse.ui.widgets.SystemHostCombo},
- * this form uses a list box to show the available connections.
- * <p>
- * This form may be used to populate a dialog or a wizard page.
- * <p>
- * To configure the functionality, call these methods:
- * <ul>
- * <li>{@link #setShowNewConnectionPrompt(boolean)}
- * <li>{@link #setDefaultConnection(IHost)}
- * <li>{@link #setSystemTypes(String[])}
- * <li>{@link #setShowPropertySheet(boolean)}
- * <li>{@link #setMultipleSelectionMode(boolean)}
- * </ul>
- * <p>
- * To configure the text on the dialog, call these methods:
- * <ul>
- * <li>{@link #setMessage(String)}
- * </ul>
- * <p>
- * After running, call these methods to get the output:
- * <ul>
- * <li>{@link #getSelectedConnection()}
- * </ul>
- */
-public class SystemSelectConnectionForm extends SystemBaseForm
- implements ISelectionChangedListener
-{
- protected static final int PROMPT_WIDTH = 200; // The maximum width of the dialog's prompt, in pixels.
-
- // GUI widgets
- protected Label verbageLabel, spacer1, spacer2;
- protected Text nameEntryValue;
- protected SystemViewForm tree;
- protected SystemPropertySheetForm ps;
- //protected ISystemMessageLine msgLine;
- protected Composite outerParent, ps_composite;
- // inputs
- protected String verbage = null;
- protected String[] systemTypes = null;
- protected IHost defaultConn;
- protected boolean allowNew = true;
- protected boolean multipleSelectionMode;
- protected boolean showPropertySheet = false;
- protected Vector listeners = new Vector();
-
- // outputs
- protected IHost[] outputConnections = null;
- protected IHost outputConnection = null;
- // state
- //protected ResourceBundle rb;
- protected boolean initDone;
- protected boolean contentsCreated;
-
- //protected String errorMessage;
- //protected Object caller;
- //protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog;
- protected int autoExpandDepth = 0;
-
- protected Object previousSelection = null;
-
- /**
- * Constructor
- * @param shell The shell hosting this form
- * @param msgLine A GUI widget capable of writing error messages to.
- *
- * @see #setShowNewConnectionPrompt(boolean)
- * @see #setSystemTypes(String[])
- */
- public SystemSelectConnectionForm(Shell shell, ISystemMessageLine msgLine)
- {
- super(shell, msgLine);
- //this.caller = caller;
- //callerInstanceOfWizardPage = (caller instanceof WizardPage);
- //callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
-
- // set default GUI
- verbage = SystemResources.RESID_SELECTCONNECTION_VERBAGE;
- }
-
- // ---------------------------------
- // INPUT OR CONFIGURATION METHODS...
- // ---------------------------------
- /**
- * Set the connection to default the selection to
- */
- public void setDefaultConnection(IHost conn)
- {
- defaultConn = conn;
- }
-
- /**
- * Set to true if we are to allow users to create a new connection. Default is true.
- */
- public void setShowNewConnectionPrompt(boolean show)
- {
- allowNew = show;
- }
- /**
- * Restrict to certain system types
- * @param systemTypes the system types to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemTypes(String[] systemTypes)
- {
- this.systemTypes = systemTypes;
- }
- /**
- * Restrict to one system type
- * @param systemType the system type to restrict what connections are shown and what types of connections
- * the user can create
- * @see org.eclipse.rse.core.IRSESystemType
- */
- public void setSystemType(String systemType)
- {
- systemTypes = new String[1];
- systemTypes[0] = systemType;
- }
- /**
- * Set the message shown as the text at the top of the form. Default is "Select a connection"
- */
- public void setMessage(String message)
- {
- this.verbage = message;
- if (verbageLabel != null)
- verbageLabel.setText(message);
- }
- /**
- * Show the property sheet on the right hand side, to show the properties of the
- * selected connection.
- * <p>
- * Default is false
- */
- public void setShowPropertySheet(boolean show)
- {
- this.showPropertySheet = show;
- }
-
- /**
- * Set multiple selection mode. Default is single selection mode
- * <p>
- * If you turn on multiple selection mode, you must use the getSelectedConnections()
- * method to retrieve the list of selected connections.
- *
- * @see #getSelectedConnections()
- */
- public void setMultipleSelectionMode(boolean multiple)
- {
- this.multipleSelectionMode = multiple;
- }
-
- /**
- * Add a listener to selection change events in the list
- */
- public void addSelectionChangedListener(ISelectionChangedListener l)
- {
- if (tree != null)
- tree.addSelectionChangedListener(l);
- else
- listeners.addElement(l);
- }
- /**
- * Remove a listener for selection change events in the list
- */
- public void removeSelectionChangedListener(ISelectionChangedListener l)
- {
- if (tree != null)
- tree.removeSelectionChangedListener(l);
- else
- listeners.removeElement(l);
- }
-
-
- // ---------------------------------
- // OUTPUT METHODS...
- // ---------------------------------
- /**
- * Return all selected connections.
- * @see #setMultipleSelectionMode(boolean)
- */
- public IHost[] getSelectedConnections()
- {
- return outputConnections;
- }
- /**
- * Return selected connection
- */
- public IHost getSelectedConnection()
- {
- return outputConnection;
- }
-
- /**
- * Return the multiple selection mode current setting
- */
- public boolean getMultipleSelectionMode()
- {
- return multipleSelectionMode;
- }
-
- // -----------------------------------------------------
- // SEMI-PRIVATE METHODS USED BY CALLING DIALOG/WIZARD...
- // -----------------------------------------------------
-
- /**
- * Return control to recieve initial focus
- */
- public Control getInitialFocusControl()
- {
- return tree.getTreeControl();
- }
-
- /**
- * Show or hide the property sheet. This is called after the contents are created when the user
- * toggles the Details button.
- * @param shell Use getShell() in your dialog or wizard page
- * @param contents Use getContents() in your dialog or wizard page
- * @return new state -> true if showing, false if hiding
- */
- public boolean toggleShowPropertySheet(Shell shell, Control contents)
- {
- Point windowSize = shell.getSize();
- Point oldSize = contents.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (showPropertySheet) // hiding?
- {
- ps.dispose();
- spacer1.dispose();
- spacer2.dispose();
- ps_composite.dispose();
- ps = null; spacer1 = spacer2 = null; ps_composite = null;
- ((GridLayout)outerParent.getLayout()).numColumns = 1;
- }
- else // showing?
- {
- //createPropertySheet((Composite)contents, shell);
- ((GridLayout)outerParent.getLayout()).numColumns = 2;
- createPropertySheet(outerParent, shell);
- }
-
- Point newSize = contents.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- shell.setSize(new Point(windowSize.x + (newSize.x - oldSize.x), windowSize.y));
-
- if (ps != null)
- {
- ISelection s = tree.getSelection();
- if (s != null)
- ps.selectionChanged(s);
- }
-
- showPropertySheet = !showPropertySheet;
- return showPropertySheet;
- }
-
- /**
- * Create the property sheet viewer
- */
- private void createPropertySheet(Composite outerParent, Shell shell)
- {
- ps_composite = SystemWidgetHelpers.createFlushComposite(outerParent, 1);
- ((GridData)ps_composite.getLayoutData()).grabExcessVerticalSpace = true;
- ((GridData)ps_composite.getLayoutData()).verticalAlignment = GridData.FILL;
-
- // SPACER LINES
- spacer1 = SystemWidgetHelpers.createLabel(ps_composite, "", 1); //$NON-NLS-1$
- spacer2 = SystemWidgetHelpers.createLabel(ps_composite, "", 1); //$NON-NLS-1$
- // PROPERTY SHEET VIEWER
- ps = new SystemPropertySheetForm(shell, ps_composite, SWT.BORDER, getMessageLine());
- }
-
- public void dispose()
- {
- if (tree != null)
- {
- tree.removeSelectionChangedListener(this);
- for (int i = 0; i < listeners.size(); i++)
- {
- tree.removeSelectionChangedListener((ISelectionChangedListener)listeners.get(i));
- }
- }
- }
- /**
- * In this method, we populate the given SWT container with widgets and return the container
- * to the caller.
- * @param parent The parent composite
- */
- public Control createContents(Composite parent)
- {
- contentsCreated = true;
-
- outerParent = parent;
- // OUTER COMPOSITE
- //if (showPropertySheet)
- {
- outerParent = SystemWidgetHelpers.createComposite(parent, showPropertySheet ? 2 : 1);
- }
-
- // INNER COMPOSITE
- int gridColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createFlushComposite(outerParent, gridColumns);
-
- // PROPERTY SHEET COMPOSITE
- if (showPropertySheet)
- {
- createPropertySheet(outerParent, getShell());
- }
- else
- {
- //((GridLayout)composite_prompts.getLayout()).margin...
- }
-
- // MESSAGE/VERBAGE TEXT AT TOP
- verbageLabel = SystemWidgetHelpers.createVerbiage(composite_prompts, verbage, gridColumns, false, PROMPT_WIDTH);
- //verbageLabel = SystemWidgetHelpers.createLabel(composite_prompts, verbage, gridColumns);
-
- // SPACER LINE
- SystemWidgetHelpers.createLabel(composite_prompts, "", gridColumns); //$NON-NLS-1$
-
- // SELECT OBJECT READONLY TEXT FIELD
- Composite nameComposite = composite_prompts;
- int nameSpan = gridColumns;
- nameEntryValue = SystemWidgetHelpers.createReadonlyTextField(nameComposite);
- ((GridData)nameEntryValue.getLayoutData()).horizontalSpan = nameSpan;
-
- // TREE
- SystemViewConnectionSelectionInputProvider inputProvider = new SystemViewConnectionSelectionInputProvider();
- inputProvider.setShowNewConnectionPrompt(allowNew);
- inputProvider.setSystemTypes(systemTypes);
- tree = new SystemViewForm(getShell(), composite_prompts, SWT.NULL, inputProvider, !multipleSelectionMode, getMessageLine(), gridColumns, 1);
- ((GridData)tree.getLayoutData()).widthHint = PROMPT_WIDTH; // normally its 300
-
- // initialize fields
- if (!initDone)
- doInitializeFields();
-
- // add selection listeners
- tree.addSelectionChangedListener(this);
- if (listeners.size() > 0)
- for (int idx=0; idx<listeners.size(); idx++)
- tree.addSelectionChangedListener((ISelectionChangedListener)listeners.elementAt(idx));
-
- // pre-select default connection...
- if (defaultConn != null)
- {
- tree.select(defaultConn, true);
- }
-
- return composite_prompts;
- }
-
- /**
- * Completes processing of the wizard page or dialog. If this
- * method returns true, the wizard/dialog will close;
- * otherwise, it will stay active.
- *
- * @return true if no errors
- */
- public boolean verify()
- {
- getMessageLine().clearErrorMessage();
- outputConnection = internalGetConnection();
- return true;
- }
-
-
- // -----------------------------------------------------
- // PRIVATE METHODS USED BY US...
- // -----------------------------------------------------
-
- /**
- * Return the current connection
- */
- private IHost internalGetConnection()
- {
- Object o = tree.getSystemView().getRootParent();
- if (o instanceof IHost)
- return ((IHost)o);
- else
- return null;
- }
-
- protected void setNameText(String text)
- {
- nameEntryValue.setText(text);
- }
- private void doInitializeFields()
- {
- //setPageComplete();
- initDone = true;
- return;
- }
-
- // ---------------------------------------------------
- // METHODS FOR SELECTION CHANGED LISTENER INTERFACE...
- // ---------------------------------------------------
- /**
- * User selected something in the tree.
- */
- public void selectionChanged(SelectionChangedEvent e)
- {
- ISelection selection = e.getSelection();
- if (ps != null)
- ps.selectionChanged(selection);
-
- outputConnections = null;
-
- Object[] outputObjects = getSelections(selection);
- if ((outputObjects!=null) && (outputObjects.length>0) && (outputObjects[0] instanceof IHost))
- {
- outputConnections = new IHost[outputObjects.length];
- for (int idx=0; idx<outputConnections.length; idx++)
- outputConnections[idx] = (IHost)outputObjects[idx];
- }
-
- if ((outputConnections != null) && (outputConnections.length>0))
- {
- setNameText(outputConnections[0].getAliasName());
- setPageComplete(true);
- }
- else
- {
- setNameText(""); //$NON-NLS-1$
- setPageComplete(false);
- }
- }
-
- /**
- * Return first item currently selected.
- */
- protected Object getFirstSelection(ISelection selection)
- {
- IStructuredSelection sSelection = (IStructuredSelection)selection;
- if (sSelection != null)
- {
- Iterator selectionIterator = sSelection.iterator();
- if (selectionIterator.hasNext())
- return selectionIterator.next();
- else
- return null;
- }
- return null;
- }
- /**
- * Return all items currently selected.
- */
- protected Object[] getSelections(ISelection selection)
- {
- IStructuredSelection sSelection = (IStructuredSelection)selection;
- if (sSelection != null)
- {
- Object[] selectedObjects = new Object[sSelection.size()];
- Iterator selectionIterator = sSelection.iterator();
- int idx = 0;
- while (selectionIterator.hasNext())
- selectedObjects[idx++] = selectionIterator.next();
- return selectedObjects;
- }
- return null;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServiceElement.java
deleted file mode 100644
index d6acc6b36..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServiceElement.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-
-
-
-
-public class ConnectorServiceElement extends RSEModelServiceElement
-{
-
- private IConnectorService _connectorService;
- private ImageDescriptor _imageDescriptor;
- private ServiceElement[] _children;
-
- public ConnectorServiceElement(IHost host, ServiceElement parent, IConnectorService connectorService)
- {
- super(host, parent, connectorService);
- _connectorService = connectorService;
-
- }
-
- public IConnectorService getConnectorService()
- {
- return _connectorService;
- }
-
- public Image getImage()
- {
- if (_imageDescriptor == null)
- {
- _imageDescriptor= RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE_ID);
- }
- return _imageDescriptor.createImage();
- }
-
- public String getName()
- {
- return _connectorService.getName();
- }
-
- public boolean internalHasChildren()
- {
- return _connectorService.hasRemoteServerLauncherProperties();
- }
-
- public ServiceElement[] internalGetChildren()
- {
- if (_children == null)
- {
- IServerLauncherProperties properties = _connectorService.getRemoteServerLauncherProperties();
- ServiceElement child = new ServerLauncherPropertiesServiceElement(getHost(), this, properties);
- return new ServiceElement[] { child};
- }
- return _children;
- }
-
- public void commit()
- {
- super.commit();
- ServiceElement[] children = getChildren();
- if (children != null)
- {
- for (int i = 0; i < children.length; i++)
- {
- ServiceElement child = children[i];
- child.commit();
- }
- }
- _connectorService.commit();
- }
-
- public void revert()
- {
- super.revert();
- ServiceElement[] children = getChildren();
- if (children != null)
- {
- for (int i = 0; i < children.length; i++)
- {
- ServiceElement child = children[i];
- child.revert();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServicesForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServicesForm.java
deleted file mode 100644
index 0175fb6cc..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ConnectorServicesForm.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.SystemPropertySheetForm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-
-
-
-public class ConnectorServicesForm extends SystemBaseForm
-{
- private TreeViewer _serviceViewer;
- private SystemPropertySheetForm _propertiesViewer;
- private Text _descriptionVerbage;
-
- private String _serviceTooltip = SystemResources.RESID_SERVICESFORM_CONNECTORSERVICES_TOOLTIP;
- private String _propertiesTooltip = SystemResources.RESID_SERVICESFORM_PROPERTIES_TOOLTIP;
-
-
- public ConnectorServicesForm(ISystemMessageLine msgLine)
- {
- super(msgLine);
- }
-
- public Control createContents(Composite parent)
- {
-
- SashForm sashComposite = new SashForm(parent, SWT.VERTICAL);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- sashComposite.setLayoutData(data);
-
-
- // connector service composite
- Composite serviceViewerComposite = new Composite(sashComposite, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- serviceViewerComposite.setLayout(layout);
- serviceViewerComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- //serviceViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Label servicesLabel = new Label(serviceViewerComposite, SWT.NONE);
- servicesLabel.setText(SystemResources.RESID_PROPERTIES_SERVICES_LABEL);
- createServiceViewer(serviceViewerComposite);
-
- // properties composite
- Composite servicePropertiesComposite = new Composite(sashComposite, SWT.NONE);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- servicePropertiesComposite.setLayout(layout);
- servicePropertiesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- //setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Label propertiesLabel = new Label(servicePropertiesComposite, SWT.NONE);
- propertiesLabel.setText(SystemResources.RESID_PROPERTIES_PROPERTIES_LABEL);
- createPropertiesViewer(servicePropertiesComposite);
-
- // description composite
- Composite descriptionComposite = new Composite(sashComposite, SWT.NONE);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- descriptionComposite.setLayout(layout);
- descriptionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- Label descriptionLabel = new Label(descriptionComposite, SWT.NONE);
- descriptionLabel.setText(SystemResources.RESID_PROPERTIES_DESCRIPTION_LABEL);
- _descriptionVerbage = new Text(descriptionComposite, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP);
- _descriptionVerbage.setText(getCurrentVerbage());
- _descriptionVerbage.setEditable(false);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.widthHint = 150;
- gridData.verticalAlignment = GridData.BEGINNING;
- _descriptionVerbage.setLayoutData(data);
-
- sashComposite.setWeights(new int[] { 20, 30, 10 });
-
-
- _serviceViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- _propertiesViewer.selectionChanged(selection);
- _descriptionVerbage.setText(getCurrentVerbage());
- }
- });
-
- return _serviceViewer.getControl();
- }
-
-
- private void createServiceViewer(Composite parent)
- {
- // Create the table viewer.
- _serviceViewer = new TreeViewer(parent, SWT.BORDER);
- // Create the table control.
- Tree tableTree = _serviceViewer.getTree();
-
- tableTree.setLayout(new FillLayout());
- tableTree.setToolTipText(_serviceTooltip);
- _serviceViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
- _serviceViewer.setContentProvider(new ServiceTableContentProvider());
- _serviceViewer.setLabelProvider(new ServiceTableLabelProvider());
-
- }
-
- private void createPropertiesViewer(Composite parent)
- {
- _propertiesViewer = new SystemPropertySheetForm(getShell(),parent, SWT.BORDER, getMessageLine(), 1, 1);
- _propertiesViewer.setToolTipText(_propertiesTooltip);
- }
-
- public void init(ServiceElement root)
- {
- _serviceViewer.setInput(root);
- }
-
- public boolean performOk()
- {
- return true;
- }
-
- protected String getCurrentVerbage()
- {
- if (_serviceViewer == null)
- return ""; //$NON-NLS-1$
- else
- {
- IStructuredSelection serviceSelection = (IStructuredSelection)_serviceViewer.getSelection();
- if (serviceSelection == null || serviceSelection.isEmpty())
- {
- return ""; //$NON-NLS-1$
- }
- else
- {
- String description = ((ServiceElement)serviceSelection.getFirstElement()).getDescription();
- return description!=null ? description : ""; //$NON-NLS-1$
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/FactoryServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/FactoryServiceElement.java
deleted file mode 100644
index 4e7ba0335..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/FactoryServiceElement.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
-import org.eclipse.rse.model.DummyHost;
-import org.eclipse.rse.services.IService;
-
-
-
-
-public class FactoryServiceElement extends ServiceElement
-{
-
- private IServiceSubSystemConfiguration _factory;
- private ServiceElement[] _children;
-
-
- public FactoryServiceElement(IHost host, IServiceSubSystemConfiguration factory)
- {
- super(host, null);
- _factory = factory;
- }
-
- public String getName()
- {
- return _factory.getId();
- }
-
- public String getDescription()
- {
- return _factory.getDescription();
- }
-
- public IServiceSubSystemConfiguration getFactory()
- {
- return _factory;
- }
-
- public IConnectorService getConnectorService()
- {
- IHost host = getHost();
- IConnectorService connectorService = _factory.getConnectorService(host);
- return connectorService;
- }
-
- public IService getService()
- {
- IHost host = getHost();
- IService service = _factory.getService(host);
- return service;
- }
-
- public ServiceElement[] getChildren()
- {
- if (_children == null)
- {
- IHost host = getHost();
- _children = new ServiceElement[2];
- _children[0] = new ServiceServiceElement(host, this, getService());
-
- IConnectorService connectorService = getConnectorService();
- _children[1] = new ConnectorServiceElement(host, this, connectorService);
- if (host instanceof DummyHost)
- {
- IServerLauncherProperties sl = connectorService.getRemoteServerLauncherProperties();
- if (sl == null)
- {
- sl = _factory.createServerLauncher(connectorService);
- connectorService.setRemoteServerLauncherProperties(sl);
- }
- }
- }
- return _children;
-
- }
-
- public boolean hasChildren()
- {
- return true;
- }
-
- public boolean hasPropertySets()
- {
- return false;
- }
-
- public PropertySetServiceElement[] getPropertySets()
- {
- return null;
- }
-
- public boolean hasProperties()
- {
- return false;
- }
-
- public PropertyElement[] getProperties()
- {
- return null;
- }
-
- public void commit()
- {
- ServiceElement[] children = getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].commit();
- }
- }
-
- public void revert()
- {
- ServiceElement[] children = getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].revert();
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertyElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertyElement.java
deleted file mode 100644
index 7b5653f70..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertyElement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.rse.core.model.IProperty;
-import org.eclipse.rse.core.model.IPropertyType;
-import org.eclipse.rse.core.model.Property;
-import org.eclipse.rse.ui.view.SystemComboBoxPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-
-
-public class PropertyElement
-{
- private IPropertyDescriptor _propertyDescriptor;
- private IProperty _property;
- private IProperty _originalProperty;
- private String _value;
-
- public PropertyElement(ServiceElement parent, IProperty property)
- {
- _property = property;
- _originalProperty = new Property(_property);
- _value = _property.getValue();
- }
-
- public IPropertyType getType()
- {
- return _property.getType();
- }
-
- public String getKey()
- {
- return _property.getKey();
- }
-
- public String getName()
- {
- return getLabel();
- }
-
- public String getLabel()
- {
- return _property.getLabel();
- }
-
- public String getValue()
- {
- return _value;
- }
-
-
- public void setValue(String value)
- {
- _value = value;
- _property.setValue(_value);
- }
-
- public IPropertyDescriptor getPropertyDescriptor()
- {
- if (_propertyDescriptor == null)
- {
- switch (_property.getType().getType())
- {
- case IPropertyType.TYPE_INTEGER:
- _propertyDescriptor = new TextPropertyDescriptor(getKey(), getLabel());
- break;
- case IPropertyType.TYPE_ENUM:
- SystemComboBoxPropertyDescriptor comboDescriptor = new SystemComboBoxPropertyDescriptor(getKey(), getLabel(), _property.getType().getEnumValues());
- _propertyDescriptor = comboDescriptor;
- break;
- case IPropertyType.TYPE_STRING:
- default:
- _propertyDescriptor = new TextPropertyDescriptor(getKey(), getLabel());
- break;
- }
- }
- return _propertyDescriptor;
- }
-
- public void commit()
- {
- /* already committed
- if (_value != _property.getValue())
- {
- _property.setValue(_value);
- }
- */
-
- }
-
- public void revert()
- {
- if (_originalProperty.getValue() != _property.getValue())
- {
- _property.setValue(_originalProperty.getValue());
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertySetServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertySetServiceElement.java
deleted file mode 100644
index a5b885334..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/PropertySetServiceElement.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.IProperty;
-import org.eclipse.rse.core.model.IPropertySet;
-import org.eclipse.rse.core.model.IPropertyType;
-import org.eclipse.rse.core.model.PropertySet;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-
-public class PropertySetServiceElement extends ServiceElement
-implements IPropertySource
-{
- protected PropertyElement[] _properties;
- protected IPropertySet _propertySet;
- protected IPropertySet _originalPropertySet;
-
- public PropertySetServiceElement(IHost host, ServiceElement parent, IPropertySet propertySet)
- {
- super(host, parent);
- _propertySet = propertySet;
- _originalPropertySet = new PropertySet(_propertySet);
- }
-
- public IPropertySet getOriginalProperySet()
- {
- return _originalPropertySet;
- }
-
- public IPropertySet getPropertySet()
- {
- return _propertySet;
- }
-
- public Image getImage()
- {
- return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_PROPERTIES_ID);
- }
-
- public String getName()
- {
- return _propertySet.getName();
- }
-
- public String getDescription()
- {
- return _propertySet.getDescription();
- }
-
- public boolean hasChildren()
- {
- return false;
- }
-
- public ServiceElement[] getChildren()
- {
- return null;
- }
-
- public void refreshProperties()
- {
- _properties = null;
-
- }
-
- public boolean hasProperties()
- {
- return _propertySet.getPropertyKeys().length > 0;
- }
-
- public PropertyElement[] getProperties()
- {
- if (_properties == null)
- {
- String[] keys = _propertySet.getPropertyKeys();
- List enabledProperties = new ArrayList();
-
- for (int i = 0; i < keys.length; i++)
- {
- String key = keys[i];
- IProperty property = _propertySet.getProperty(key);
- if (property.isEnabled())
- {
- enabledProperties.add(new PropertyElement(this, property));
- }
- }
- _properties =(PropertyElement[])enabledProperties.toArray(new PropertyElement[enabledProperties.size()]);
- }
- return _properties;
- }
-
-
- public IPropertyDescriptor[] getPropertyDescriptors()
- {
- PropertyElement[] properties = getProperties();
- IPropertyDescriptor[] descriptors = new IPropertyDescriptor[properties.length];
- for (int i = 0; i < properties.length; i++)
- {
- descriptors[i] = properties[i].getPropertyDescriptor();
- }
- return descriptors;
- }
-
- private PropertyElement getPropertyElement(String id)
- {
- PropertyElement[] elements = getProperties();
- for (int i = 0; i < elements.length; i++)
- {
- PropertyElement element = elements[i];
- if (element.getKey().equals(id))
- {
- return element;
- }
- }
- return null;
- }
-
- public Object getPropertyValue(Object id)
- {
- return getPropertyElement((String)id).getValue();
- }
-
- public boolean isPropertySet(Object id)
- {
- return getPropertyElement((String)id) != null;
- }
-
- public void resetPropertyValue(Object id)
- {
- // update ui object
- PropertyElement element = getPropertyElement((String)id);
- if (element.getKey().equals(id))
- {
- element.setValue(_propertySet.getPropertyValue((String)id));
- }
- }
-
- public void setPropertyValue(Object id, Object value)
- {
- PropertyElement element = getPropertyElement((String)id);
- String strValue = null;
- if (value instanceof Integer)
- {
- Integer intValue = (Integer)value;
-
- IPropertyType type = element.getType();
- if (type.isEnum())
- {
- strValue = type.getEnumValues()[intValue.intValue()];
- }
- else if (type.isInteger())
- {
- strValue = intValue.toString();
- }
- }
- else
- {
- strValue = (String)value;
- }
-
-
-
- if (element.getKey().equals(id))
- {
- element.setValue(strValue);
- }
-
- refreshProperties();
- childChanged(this);
- }
-
- public Object getEditableValue()
- {
- return this;
- }
-
- public void commit()
- {
- PropertyElement[] properties = getProperties();
- for (int i = 0; i < properties.length; i++)
- {
- properties[i].commit();
- }
- }
-
- public void revert()
- {
- PropertyElement[] properties = getProperties();
- for (int i = 0; i < properties.length; i++)
- {
- properties[i].revert();
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java
deleted file mode 100644
index 4562ff20b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.IPropertySet;
-import org.eclipse.rse.core.model.IRSEModelObject;
-
-
-public abstract class RSEModelServiceElement extends ServiceElement
-{
- protected IRSEModelObject _modelObject;
- protected IPropertySet[] _propertySets;
- protected PropertySetServiceElement[] _propertySetElements;
- protected ServiceElement[] _allChildren;
-
- public RSEModelServiceElement(IHost host, ServiceElement parent, IRSEModelObject modelObject)
- {
- super(host, parent);
- _modelObject = modelObject;
- _propertySets = _modelObject.getPropertySets();
- }
-
-
-
- public boolean hasPropertySets()
- {
- return _propertySets != null && _propertySets.length > 0;
- }
-
- public PropertySetServiceElement[] getPropertySets()
- {
- if (_propertySetElements == null)
- {
- _propertySetElements = new PropertySetServiceElement[_propertySets.length];
- for (int i = 0; i < _propertySets.length; i++)
- {
- _propertySetElements[i] = new PropertySetServiceElement(getHost(), this, _propertySets[i]);
- }
- }
- return _propertySetElements;
- }
-
- public String getName()
- {
- return _modelObject.getName();
- }
-
- public String getDescription()
- {
- return _modelObject.getDescription();
- }
-
- public final boolean hasChildren()
- {
- return internalHasChildren() || hasPropertySets();
- }
-
- public final ServiceElement[] getChildren()
- {
- if (_allChildren == null)
- {
- List all = new ArrayList();
-
- if (internalHasChildren())
- {
- ServiceElement[] children = internalGetChildren();
- for (int i = 0; i < children.length; i++)
- {
- all.add(children[i]);
- }
- }
-
- if (hasPropertySets())
- {
- PropertySetServiceElement[] properties = getPropertySets();
- for (int p = 0; p < properties.length; p++)
- {
- all.add(properties[p]);
- }
- }
- _allChildren = (ServiceElement[])all.toArray(new ServiceElement[all.size()]);
- }
- return _allChildren;
- }
-
- public boolean hasProperties()
- {
- return false;
- }
-
-
- public PropertyElement[] getProperties()
- {
- return null;
- }
-
- public void commit()
- {
- PropertySetServiceElement[] sets = getPropertySets();
- for (int i = 0; i < sets.length; i++)
- {
- sets[i].commit();
- }
- }
-
- public void revert()
- {
- PropertySetServiceElement[] sets = getPropertySets();
- for (int i = 0; i < sets.length; i++)
- {
- IPropertySet newSet = sets[i].getPropertySet();
- IPropertySet originalSet = sets[i].getOriginalProperySet();
- _modelObject.removePropertySet(newSet.getName());
- _modelObject.addPropertySet(originalSet);
- }
- }
-
- public void refreshProperties()
- {
- PropertySetServiceElement[] propertySets = getPropertySets();
- for (int i = 0; i < propertySets.length; i++)
- {
- propertySets[i].refreshProperties();
- }
- }
-
- protected abstract ServiceElement[] internalGetChildren();
- protected abstract boolean internalHasChildren();
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RootServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RootServiceElement.java
deleted file mode 100644
index 8e9db9ff3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RootServiceElement.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.rse.ui.SystemResources;
-
-
-public class RootServiceElement extends ServiceElement
-{
- private ServiceElement[] _children;
-
- public RootServiceElement()
- {
- super(null, null);
- }
-
- public RootServiceElement(ServiceElement[] children)
- {
- super(null, null);
- _children = children;
- for (int i = 0; i < _children.length; i++)
- {
- _children[i].setParent(this);
- }
- }
-
- public void setChildren(ServiceElement[] children)
- {
- _children = children;
- }
-
- public String getName()
- {
- return SystemResources.RESID_PROPERTIES_SERVICES_NAME;
- }
-
- public String getDescription()
- {
- return SystemResources.RESID_PROPERTIES_SERVICES_TOOLTIP;
- }
-
- public boolean hasChildren()
- {
- return true;
- }
-
- public ServiceElement[] getChildren()
- {
- return _children;
- }
-
- public boolean hasPropertySets()
- {
- return false;
- }
-
- public PropertySetServiceElement[] getPropertySets()
- {
- return null;
- }
-
- public boolean hasProperties()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public PropertyElement[] getProperties()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void commit()
- {
- ServiceElement[] children = getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].commit();
- }
- }
-
- public void revert()
- {
- ServiceElement[] children = getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].revert();
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java
deleted file mode 100644
index cf1e8e870..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-
-
-public class ServerLauncherPropertiesServiceElement extends RSEModelServiceElement
-{
- protected IServerLauncherProperties _launcherProperties;
-
- public ServerLauncherPropertiesServiceElement(IHost host, ServiceElement parent, IServerLauncherProperties launcherProperties)
- {
- super(host, parent, launcherProperties);
- _launcherProperties = launcherProperties;
- }
-
- public String getName()
- {
- return _launcherProperties.getName();
- }
-
- public Image getImage()
- {
- return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID);
- }
-
- protected ServiceElement[] internalGetChildren()
- {
- return null;
- }
-
-
- protected boolean internalHasChildren()
- {
- return false;
- }
-
- public void childChanged(ServiceElement element)
- {
- _launcherProperties.restoreFromProperties();
- _launcherProperties.commit();
- getParent().childChanged(element);
- }
-
- public void commit()
- {
- super.commit();
-
- }
-
- public void revert()
- {
- super.revert();
- }
-
- public IServerLauncherProperties getServerLauncherProperties()
- {
- return _launcherProperties;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceElement.java
deleted file mode 100644
index b768166be..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceElement.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.swt.graphics.Image;
-
-
-
-
-public abstract class ServiceElement
-{
- protected IHost _host;
- protected ServiceElement _parent;
- protected boolean _isSelected = false;
-
- public ServiceElement(IHost host, ServiceElement parent)
- {
- _host = host;
- _parent = parent;
- }
-
- public Image getImage()
- {
- return null;
- }
-
- public IHost getHost()
- {
- if (_host == null)
- {
- ServiceElement[] elements = getChildren();
- if (elements != null)
- {
- for (int i = 0; i < elements.length; i++)
- {
- ServiceElement el = elements[i];
- if (el.isSelected())
- {
- return el.getHost();
- }
- }
- }
- }
- return _host;
- }
-
- public void childChanged(ServiceElement element)
- {
- if (_parent != null)
- {
- _parent.childChanged(element);
- }
- }
-
- public void setParent(ServiceElement parent)
- {
- _parent = parent;
- }
-
- public ServiceElement getParent()
- {
- return _parent;
- }
-
- public void setSelected(boolean flag)
- {
- _isSelected = flag;
- }
-
- public boolean isSelected()
- {
- return _isSelected;
- }
-
- public String toString()
- {
- return getName();
- }
-
- public abstract boolean hasProperties();
- public abstract PropertyElement[] getProperties();
- public abstract String getName();
- public abstract String getDescription();
- public abstract boolean hasChildren();
- public abstract ServiceElement[] getChildren();
- public abstract void commit();
- public abstract void revert();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceServiceElement.java
deleted file mode 100644
index 334a2b552..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceServiceElement.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.services.IService;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-
-
-
-
-public class ServiceServiceElement extends ServiceElement
-{
- private IService _service;
- private ImageDescriptor _imageDescriptor;
-
- public ServiceServiceElement(IHost host, ServiceElement parent, IService service)
- {
- super(host, parent);
- _service = service;
- }
-
- public Image getImage()
- {
- if (_imageDescriptor == null)
- {
- _imageDescriptor= RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_SERVICE_ID);
- }
- return _imageDescriptor.createImage();
- }
-
- public IService getService()
- {
- return _service;
- }
-
- public String getName()
- {
- return _service.getName();
- }
-
- public String getDescription()
- {
- return _service.getDescription();
- }
-
- public boolean hasChildren()
- {
- return false;
- }
-
- public ServiceElement[] getChildren()
- {
- return null;
- }
-
- public boolean hasPropertySets()
- {
- return false;
- }
-
- public PropertySetServiceElement[] getPropertySets()
- {
- return null;
- }
-
- public boolean hasProperties()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public PropertyElement[] getProperties()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void commit()
- {
- }
-
- public void revert()
- {
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableContentProvider.java
deleted file mode 100644
index 9ce9d79b7..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableContentProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class ServiceTableContentProvider implements ITreeContentProvider
-{
- /**
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object element) {
- if (element instanceof ArrayList)
- return ((ArrayList)element).toArray();
-
- return getChildren(element);
- }
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- }
- /**
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public Object[] getChildren(Object element)
- {
- return getServiceElement(element).getChildren();
- }
-
- public Object getParent(Object element)
- {
- return getServiceElement(element).getParent();
- }
-
- public boolean hasChildren(Object element)
- {
- return getServiceElement(element).hasChildren();
- }
-
- protected ServiceElement getServiceElement(Object element)
- {
- return (ServiceElement)element;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableLabelProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableLabelProvider.java
deleted file mode 100644
index 1473520e2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServiceTableLabelProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-
-
-
-public class ServiceTableLabelProvider
- extends LabelProvider
- implements ITableLabelProvider
- {
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- if (columnIndex == 0)
- {
- return getImage(element);
- }
- return null;
- }
-
-
-
- public Image getImage(Object element)
- {
- ServiceElement serviceElement = getServiceElement(element);
- return serviceElement.getImage();
- }
-
-
-
- public String getText(Object element)
- {
- return getColumnText(element, 0);
- }
-
- public ServiceElement getServiceElement(Object element)
- {
- return (ServiceElement)element;
- }
-
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex)
- {
- if (element instanceof ServiceElement)
- {
- ServiceElement serviceElement = (ServiceElement)element;
-
- switch (columnIndex)
- {
- case 0: // name
- {
- return serviceElement.getName();
- }
-
- default:
- {
- return "";
- }
- }
- }
- return "";
- }
-
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServicesForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServicesForm.java
deleted file mode 100644
index aaa1fc881..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServicesForm.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.widgets.services;
-
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.rse.ui.SystemBaseForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.view.SystemPropertySheetForm;
-import org.eclipse.rse.ui.widgets.GridUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-
-
-
-public class ServicesForm extends SystemBaseForm implements ICheckStateListener
-{
- private CheckboxTableViewer _factoryViewer;
- private TreeViewer _serviceViewer;
- private SystemPropertySheetForm _propertiesViewer;
-
- private String _configurationTooltip = SystemResources.RESID_SERVICESFORM_CONFIGURATION_TOOLTIP;
- private String _serviceTooltip = SystemResources.RESID_SERVICESFORM_SERVICES_TOOLTIP;
- private String _propertiesTooltip = SystemResources.RESID_SERVICESFORM_PROPERTIES_TOOLTIP;
-
- private Text _descriptionVerbage;
-
- public ServicesForm(ISystemMessageLine msgLine)
- {
- super(msgLine);
- //_factoryTooltip =
- }
-
- public Control createContents(Composite parent)
- {
-
- SashForm sashCompositeParent = new SashForm(parent, SWT.HORIZONTAL);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- sashCompositeParent.setLayoutData(data);
-
- SashForm sashCompositeLeft = new SashForm(sashCompositeParent, SWT.VERTICAL);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- sashCompositeLeft.setLayoutData(data);
-
- // factory composite
- Composite factoryViewerComposite = new Composite(sashCompositeLeft, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- factoryViewerComposite.setLayout(layout);
- factoryViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- Label factoryLabel = new Label(factoryViewerComposite, SWT.NONE);
- factoryLabel.setText(SystemResources.RESID_PROPERTIES_FACTORIES_LABEL);
- createFactoryViewer(factoryViewerComposite);
-
-
- // service composite
- Composite serviceViewerComposite = new Composite(sashCompositeLeft, SWT.NONE);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- serviceViewerComposite.setLayout(layout);
- serviceViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- Label servicesLabel = new Label(serviceViewerComposite, SWT.NONE);
- servicesLabel.setText(SystemResources.RESID_PROPERTIES_SERVICES_LABEL);
- createServiceViewer(serviceViewerComposite);
-
- sashCompositeLeft.setWeights(new int[] { 50, 50 });
-
- // properties composite
- Composite servicePropertiesComposite = new Composite(sashCompositeParent, SWT.NONE);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- servicePropertiesComposite.setLayout(layout);
- servicePropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- Label propertiesLabel = new Label(servicePropertiesComposite, SWT.NONE);
- propertiesLabel.setText(SystemResources.RESID_PROPERTIES_PROPERTIES_LABEL);
- createPropertiesViewer(servicePropertiesComposite);
-
- sashCompositeParent.setWeights(new int[] { 40, 60 });
-
- // description composite
- Composite descriptionComposite = new Composite(parent, SWT.NONE);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- descriptionComposite.setLayout(layout);
- descriptionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- Label descriptionLabel = new Label(descriptionComposite, SWT.NONE);
- descriptionLabel.setText(SystemResources.RESID_PROPERTIES_DESCRIPTION_LABEL);
- _descriptionVerbage = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP);
- _descriptionVerbage.setText(getCurrentVerbage());
- _descriptionVerbage.setEditable(false);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.widthHint = 150;
- gridData.verticalAlignment = GridData.BEGINNING;
- data.grabExcessVerticalSpace = true;
- _descriptionVerbage.setLayoutData(data);
-
- _factoryViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection ss = (StructuredSelection)selection;
- _factoryViewer.setChecked(ss.getFirstElement(), true);
- unCheckOthers((ServiceElement) ss.getFirstElement());
- _serviceViewer.setInput(ss.getFirstElement());
- _descriptionVerbage.setText(getCurrentVerbage());
- }
- }
- });
-
- _serviceViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- _propertiesViewer.selectionChanged(selection);
- _descriptionVerbage.setText(getCurrentVerbage());
- }
- });
-
- return _factoryViewer.getControl();
- }
-
- private void createFactoryViewer(Composite parent)
- {
- // Create the table viewer.
- _factoryViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.READ_ONLY);
- _factoryViewer.addCheckStateListener(this);
-
- // Create the table control.
- Table table = _factoryViewer.getTable();
- table.setHeaderVisible(false);
- table.setLinesVisible(false);
- GridData data = GridUtil.createFill();
- data.heightHint = 20;
- data.widthHint = 30;
- table.setLayoutData(data);
- table.setToolTipText(_configurationTooltip);
-
-
-
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
-
- _factoryViewer.setContentProvider(new ServiceTableContentProvider());
- _factoryViewer.setLabelProvider(new ServiceTableLabelProvider());
- }
-
- private void createServiceViewer(Composite parent)
- {
- // Create the table viewer.
- _serviceViewer = new TreeViewer(parent, SWT.BORDER);
-
-
- // Create the table control.
- Tree tableTree = _serviceViewer.getTree();
- GridData data = GridUtil.createFill();
- data.heightHint = 20;
- data.widthHint = 30;
- tableTree.setLayoutData(data);
- tableTree.setLayout(new GridLayout());
- tableTree.setToolTipText(_serviceTooltip);
-
-
-/*
- TableLayout tableLayout = new TableLayout();
-
- TreeColumn factoryColumn = new TreeColumn(tableTree, SWT.LEFT);
- factoryColumn.setText("Property");
- tableLayout.addColumnData(new ColumnPixelData(100));
- tableTree.setLayout(tableLayout);
-
- TreeColumn fileServiceColumn = new TreeColumn(tableTree, SWT.LEFT);
- fileServiceColumn.setText("Value");
- tableLayout.addColumnData(new ColumnPixelData(120));
- */
- _serviceViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
-
- // Adjust the table viewer.
- //String[] properties = new String[] {"STRING", "STRING"};
- //_serviceViewer.setColumnProperties(properties);
-
- _serviceViewer.setContentProvider(new ServiceTableContentProvider());
- _serviceViewer.setLabelProvider(new ServiceTableLabelProvider());
-
- }
-
- private void createPropertiesViewer(Composite parent)
- {
-
- _propertiesViewer = new SystemPropertySheetForm(getShell(),parent, SWT.BORDER, getMessageLine());
- _propertiesViewer.setToolTipText(_propertiesTooltip);
-
-
- }
-
- public void init(ServiceElement root)
- {
- _factoryViewer.setInput(root);
- TableItem[] items = _factoryViewer.getTable().getItems();
- for (int i = 0; i < items.length; i++)
- {
- TableItem item = items[i];
- ServiceElement element = (ServiceElement)item.getData();
- if (element.isSelected())
- {
- item.setChecked(true);
- _factoryViewer.setSelection(new StructuredSelection(element));
- }
- }
- }
-
-
- public void checkStateChanged(CheckStateChangedEvent event)
- {
- ServiceElement element = (ServiceElement)event.getElement();
- element.setSelected(event.getChecked());
- _factoryViewer.setSelection(new StructuredSelection(element));
-
- unCheckOthers(element);
- _descriptionVerbage.setText(getCurrentVerbage());
- }
-
- protected void unCheckOthers(ServiceElement checkedElement)
- {
- // uncheck the others now
- Object[] checked = _factoryViewer.getCheckedElements();
- for (int i = 0; i < checked.length; i++)
- {
- ServiceElement oldChecked = (ServiceElement)checked[i];
- if (oldChecked != checkedElement)
- {
- oldChecked.setSelected(false);
- _factoryViewer.setChecked(oldChecked, false);
- }
- }
- }
-
- public ServiceElement getSelectedService()
- {
- return (ServiceElement)_factoryViewer.getCheckedElements()[0];
- }
-
- public boolean verify()
- {
- return _factoryViewer.getCheckedElements().length > 0;
- }
-
- protected String getCurrentVerbage()
- {
- String description = null;
- if (_serviceViewer != null)
- {
- IStructuredSelection serviceSelection = (IStructuredSelection)_serviceViewer.getSelection();
- if (serviceSelection != null && !serviceSelection.isEmpty())
- {
- description = ((ServiceElement)serviceSelection.getFirstElement()).getDescription();
- }
- else if (_factoryViewer != null)
- {
- IStructuredSelection factorySelection = (IStructuredSelection) _factoryViewer.getSelection();
- if (factorySelection != null && !factorySelection.isEmpty())
- {
- description = ((ServiceElement)factorySelection.getFirstElement()).getDescription();
- }
- }
- }
- return description != null ? description : ""; //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java
deleted file mode 100644
index 85a04960f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * A base class for additional pages that are to be appended to the New Connection wizard.
- * @see org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter#getNewConnectionWizardPages(ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard)
- */
-public abstract class AbstractSystemNewConnectionWizardPage extends AbstractSystemWizardPage
- implements ISystemNewConnectionWizardPage, IWizardPage
-{
- protected ISubSystemConfiguration parentFactory;
-
- /**
- * Constructor that takes everything
- */
- public AbstractSystemNewConnectionWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageName, String pageTitle, String pageDescription)
- {
- super(wizard, pageName, pageTitle, pageDescription);
- this.parentFactory = parentFactory;
- }
- /**
- * Constructor that defaults:
- * <ul>
- * <li>the page name to the parent factory's id
- * <li>the page title to the parent factory's name
- * </ul>
- */
- public AbstractSystemNewConnectionWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageDescription)
- {
- super(wizard, parentFactory.getId(), parentFactory.getName(), pageDescription);
- this.parentFactory = parentFactory;
- }
- /**
- * Constructor that defaults:
- * <ul>
- * <li>the page name to the parent factory's id
- * <li>the page title to the parent factory's name
- * <li>the page description to RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION
- * </ul>
- */
- public AbstractSystemNewConnectionWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory)
- {
- super(wizard, parentFactory.getId(), parentFactory.getName(), SystemResources.RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION);
- this.parentFactory = parentFactory;
- }
-
- /**
- * Return the subsystem factory that supplied this page
- */
- public ISubSystemConfiguration getSubSystemConfiguration()
- {
- return parentFactory;
- }
-
- /**
- * @see AbstractSystemWizardPage#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return null;
- }
-
- /**
- * @see AbstractSystemWizardPage#createContents(Composite)
- */
- public abstract Control createContents(Composite parent);
-
- /**
- * @see ISystemWizardPage#performFinish()
- */
- public boolean performFinish()
- {
- return true;
- }
-
- /**
- * Get the parent wizard typed as the SystemNewConnectionWizard
- */
- public RSENewConnectionWizard getNewConnectionWizard()
- {
- return (RSENewConnectionWizard)getWizard();
- }
-
- /**
- * Get the main page of SystemNewConnectionWizard, which contains all user enter connection attributes
- */
- public ISystemNewConnectionWizardMainPage getMainPage()
- {
- RSENewConnectionWizard ourWizard = getNewConnectionWizard();
- if (ourWizard != null) {
- //String[] systemTypes = parentFactory.getSystemTypes();
- //IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[0]);
- IWizardPage wizardPage = ourWizard.getDelegate().getMainPage();
-
- if (wizardPage instanceof ISystemNewConnectionWizardMainPage) {
- return (ISystemNewConnectionWizardMainPage)wizardPage;
- }
- else {
- return null;
- }
- }
- else {
- return null;
- }
- }
-
- /**
- * Get the SystemConnectionForm of the main page of SystemNewConnectionWizard, which
- * contains all user enter connection attributes
- */
- public SystemConnectionForm getMainPageForm()
- {
- RSENewConnectionWizard ourWizard = getNewConnectionWizard();
- if (ourWizard != null) {
- //String[] systemTypes = parentFactory.getSystemTypes();
- //IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[0]);
- IWizardPage wizardPage = ourWizard.getDelegate().getMainPage();
-
- if (wizardPage instanceof RSENewConnectionWizardDefaultDelegateMainPage) {
- return ((RSENewConnectionWizardDefaultDelegateMainPage)wizardPage).getForm();
- }
- else {
- return null;
- }
- }
- else {
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizard.java
deleted file mode 100644
index 7fdfbeebf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizard.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.rse.ui.view.ISystemTree;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-
-
-/**
- * Base class for all RSE wizards. This class is more beneficial when using in conjunction with
- * {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage}, and
- * {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction}.
- * <p>A wizard is a multi-page UI, that prompts users for information and then uses that information
- * to create something (typically). The wizard has an overall title that shows for each page, and
- * a wizard page title that can be unique per page, but typically is not. Typically, the overall title
- * is a verb, such as "New", while the page title expands on the verb, as in "File". There is also a
- * description per page, which is unique and explains the purpose of that page. Further, there is a
- * wizard image that is always the same per wizard page.
- * </p>
- * <p> Using this base class for wizards offers the following advantages over just using the
- * eclipse Wizard class:
- * </p>
- * <ul>
- * <li>Designed to work in conjunction with the {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction},
- * and {@link org.eclipse.rse.ui.dialogs.SystemWizardDialog} classes, propogating settings
- * from these to the wizard, and further propogating those to the individual wizard pages.
- * <li>The overall wizard title and image can be set via the constructor or setter methods.
- * <li>Supports setting an input object, and getting an output object. This is exploited by the
- * {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction} class, when
- * this wizard is launched from a subclass of that action class.
- * <li>Supports setting a wizard page title via {@link #setWizardPageTitle(String)}, that all
- * {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage} pages will use by default for
- * their title, if the non-title constructor is used for that page.
- * <li>If being hosted by a {@link org.eclipse.rse.ui.dialogs.SystemWizardDialog}, supports dynamically
- * updating the wizard size via {@link #updateSize()}, if dynamic content is added to a wizard page, causing the page to grow beyond its initial size.
- * <li>Supports a {@link #setHelp(String)} method to set the overall wizard's contextual help. This is propogated to each
- * {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage} as it is added.
- * <li>Supports setting the viewer that launched this wizard, as wizards often need to know this so they can update the UI upon Finish.
- * <li>Supports a {@link #wasCancelled()} method so callers can easily test if the wizard was cancelled/dismissed by the user.
- * <li>Supports a {@link #setMinimumPageSize(int, int)} method to set the minimum width and height of the wizard.
- * <li>Supports a {@link #setPageError(IWizardPage)} method that can be called in performFinish when an error is detected on a
- * non-current page. This issues a message telling the user there is an error on another page.
- * <li>Supports a simple {@link #setBusyCursor(boolean)} method to toggle the cursor between busy and normal
- * </ul>
- * <p>To use this class, :</p>
- * <ol>
- * <li>Subclass it.
- * <li>In your constructor, call {@link #setHelp(String)} to set the overall help, if desired.
- * <li>In your constructor, call {@link #setWizardPageTitle(String)} to set the title to use for all pages, if desired.
- * <li>Override {@link #addPages()} to add your {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage pages} via calls to addPage(IWizardPage).
- * <li>Override {@link #performFinish()} to do the wizard's main task when Finish is pressed. Cycle through each of your pages calling
- * performFinish() on each of them. If performFinish() returns false from any page, call {@link #setPageError(IWizardPage)} and
- * return false from your performFinish() method to cancel the Finish operation.
- * </ol>
- *
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage
- * @see org.eclipse.rse.ui.dialogs.SystemWizardDialog
- * @see org.eclipse.rse.ui.actions.SystemBaseWizardAction
- */
-public abstract class AbstractSystemWizard
- extends Wizard implements ISystemWizard
-{
- protected boolean finishPressed = true; // most accurate guess
- protected boolean cancelled = false;
- protected Object input = null;
- protected Object output = null;
- protected IStructuredSelection selection = null;
- protected int minPageWidth, minPageHeight;
- protected String helpId;
- protected Viewer viewer = null;
- protected String pageTitle;
- protected SystemWizardDialog owningDialog;
- private Cursor waitCursor;
-
- /**
- * Default constructor.
- *
- * @see #setWizardTitle(String)
- * @see #setWizardImage(ImageDescriptor)
- * @see #setWizardPageTitle(String)
- */
- public AbstractSystemWizard()
- {
- super();
-
- }
-
- /**
- * Constructor when wizard title is known.
- * Alternatively, you can call {@link #setWizardTitle(String)}
- *
- * @see #setWizardImage(ImageDescriptor)
- * @see #setWizardPageTitle(String)
- */
- public AbstractSystemWizard(String title)
- {
- super();
- setWindowTitle(title);
- }
-
- /**
- * Constructor when you both a title and an image for this wizard.
- * Alternatively, you can call {@link #setWizardTitle(String)} or {@link #setWizardImage(ImageDescriptor)}
- *
- * @see #setWizardPageTitle(String)
- */
- public AbstractSystemWizard(String title, ImageDescriptor wizardImage)
- {
- super();
- setWindowTitle(title);
- setDefaultPageImageDescriptor(wizardImage);
- }
-
- /**
- * Called from {@link org.eclipse.rse.ui.dialogs.SystemWizardDialog} when it is used as the hosting dialog
- */
- public void setSystemWizardDialog(SystemWizardDialog dlg)
- {
- this.owningDialog = dlg;
- }
- /**
- * Return the result of {@link #setSystemWizardDialog(SystemWizardDialog)}
- */
- public SystemWizardDialog getSystemWizardDialog()
- {
- return owningDialog;
- }
- /**
- * Exposes this nice new 2.0 capability to the public.
- * Only does anything if being hosted by SystemWizardDialog.
- */
- public void updateSize()
- {
- if (owningDialog != null)
- owningDialog.updateSize(getContainer().getCurrentPage());
- }
- /**
- * Set the wizard title. Using this makes it possible to avoid subclassing.
- * Typically the wizard title is the same for all pages... eg "New"
- */
- public void setWizardTitle(String title)
- {
- setWindowTitle(title);
- }
- /**
- * Set the wizard page title. Using this makes it possible to avoid subclassing.
- * The page title goes below the wizard title, and can be unique per page. However,
- * typically the wizard page title is the same for all pages... eg "Filter".
- * <p>
- * This is not used by default, but can be queried via getPageTitle() when constructing
- * pages.
- */
- public void setWizardPageTitle(String pageTitle)
- {
- this.pageTitle = pageTitle;
- }
- /**
- * Return the page title as set via setWizardPageTitle
- */
- public String getWizardPageTitle()
- {
- return pageTitle;
- }
-
- /**
- * Set the wizard image. Using this makes it possible to avoid subclassing
- */
- public void setWizardImage(ImageDescriptor wizardImage)
- {
- super.setDefaultPageImageDescriptor(wizardImage);
- }
- /**
- * Set the help context Id (infoPop) for this wizard. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelp(String id)
- {
- this.helpId = id;
- }
- /**
- * Return the help Id as set in setHelp(String)
- */
- public String getHelpContextId()
- {
- return helpId;
- }
- /**
- * Intercept of parent method so we can percolate the help id
- */
- public void addPage(IWizardPage page)
- {
- super.addPage(page);
- if ((helpId!=null) && (page instanceof ISystemWizardPage))
- {
- // tweak by Phil 10/19/2002 ... this was overriding page-specific help
- // on secondary pages. To reduce regression I only test if help is already
- // specified if this is not the first page... hence one-page wizards are
- // not affected...
- ISystemWizardPage swPage = (ISystemWizardPage)page;
- if ((super.getPageCount() == 1) || (swPage.getHelpContextId() == null))
- swPage.setHelp(helpId);
- }
- }
-
- /**
- * Set the Viewer that called this wizard. It is good practice for actions to call this
- * so wizard can directly access the originating viewer if needed.
- * <p>
- * This is called for you if using a subclass of {@link org.eclipse.rse.ui.actions.SystemBaseWizardAction}.
- */
- public void setViewer(Viewer v)
- {
- this.viewer = v;
- }
- /**
- * Get the Viewer that called this wizard. This will be null unless set by the action that started this wizard.
- */
- public Viewer getViewer()
- {
- return viewer;
- }
- /**
- * Return the current viewer as an ISystemTree if it is one, or null otherwise
- */
- protected ISystemTree getCurrentTreeView()
- {
- Viewer v = getViewer();
- if (v instanceof ISystemTree)
- return (ISystemTree)v;
- else
- return null;
- }
-
- /**
- * For explicitly setting input object
- */
- public void setInputObject(Object inputObject)
- {
- this.input = inputObject;
- //System.out.println("Inside AbstractSystemWizard#setInputObject: " + inputObject + ", class = " + inputObject.getClass().getName());
- }
- /**
- * For explicitly getting input object
- */
- public Object getInputObject()
- {
- return input;
- }
-
- /**
- * For explicitly getting output object after wizard is dismissed. Set by the
- * wizard's processFinish method.
- */
- public Object getOutputObject()
- {
- return output;
- }
-
- /**
- * For explicitly setting output object after wizard is dismissed. Called in the
- * wizard's processFinish method, typically.
- */
- public void setOutputObject(Object outputObject)
- {
- output = outputObject;
- }
-
- /**
- * Allow caller to determine if wizard was cancelled or not.
- */
- public boolean wasCancelled()
- {
- if (cancelled) // most reliable
- return true;
- else
- return !finishPressed;
- }
- /**
- * You must call this in your performFinish method.
- */
- protected void setWasCancelled(boolean cancelled)
- {
- finishPressed = !cancelled;
- }
- /**
- * Override of parent so we can record the fact the wizard was cancelled.
- */
- public boolean performCancel()
- {
- //System.out.println("inside performCancel");
- cancelled = true;
- setWasCancelled(true);
- return super.performCancel();
- }
-
- /**
- * Required by INewWizard interface. It is called by the framework for wizards
- * that are launched file the File->New interface. Otherwise we don't use it.
- * If you need it, the selection is stored in protected variable "selection".
- */
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- this.selection = selection;
- }
-
- /**
- * Set the wizard's min page width and height.
- * If you pass 0 for either one, the Eclipse default value will be used.
- */
- public void setMinimumPageSize(int width, int height)
- {
- if (width <= 0)
- width = 300; // found this number in WizardDialog code
- if (height <= 0)
- height = 225; // found this number in WizardDialog code
- this.minPageWidth = width;
- this.minPageHeight = height;
- }
-
- /**
- * Return the minimum page width. If zero, it has not been explicitly set, so the default is to be used.
- */
- public int getMinimumPageWidth()
- {
- return minPageWidth;
- }
- /**
- * Return the minimum page height. If zero, it has not been explicitly set, so the default is to be used.
- */
- public int getMinimumPageHeight()
- {
- return minPageHeight;
- }
-
- /**
- * If in the processing of performFinish an error is detected on another page of the
- * wizard, the best we can do is tell the user this via an error message on their own
- * page. It seems there is no way in JFace to successfully switch focus to another page.
- * <p>
- * To simplify processing, simply call this method in your wizard's performFinish if any
- * page's performFinish returned false. Pass the failing page. If it is not the current
- * page, this code will issue msg RSEG1240 "Error on another page" to the user.
- */
- public void setPageError(IWizardPage pageInError)
- {
- IWizardPage currentPage = getContainer().getCurrentPage();
- if (currentPage != pageInError)
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_WIZARD_PAGE_ERROR);
- if (currentPage instanceof AbstractSystemWizardPage)
- ((AbstractSystemWizardPage)currentPage).setErrorMessage(msg);
- else if (pageInError instanceof WizardPage)
- ((WizardPage)currentPage).setErrorMessage(msg.getLevelOneText());
- }
- }
-
- /**
- * Expose inherited protected method convertWidthInCharsToPixels as a publicly
- * excessible method
- * <p>
- * Requires setOwningDialog to have been called, else returns -1
- */
- public int publicConvertWidthInCharsToPixels(int chars)
- {
- if (owningDialog != null)
- return owningDialog.publicConvertWidthInCharsToPixels(chars);
- else
- return -1;
- }
- /**
- * Expose inherited protected method convertHeightInCharsToPixels as a publicly
- * excessible method
- * <p>
- * Requires setOwningDialog to have been called, else returns -1
- */
- public int publicConvertHeightInCharsToPixels(int chars)
- {
- if (owningDialog != null)
- return owningDialog.publicConvertHeightInCharsToPixels(chars);
- else
- return -1;
- }
- /**
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- public void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), waitCursor);
- }
- else
- {
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
-
- // ----------------------------
- // METHODS YOU MUST OVERRIDE...
- // ----------------------------
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class, but is made abstract here to ensure child classes override it.
- */
- public abstract void addPages();
-
- /**
- * Called when finish pressed.
- * <p>
- * Return true if no errors, false to cancel the finish operation.
- * <p>
- * Typically, you walk through each wizard page calling performFinish on it, and only return true if they all return true.
- * If one of the pages returns false, you should call setPageError(IWizardPage), which shows a message to the user about an
- * error pending on another page, if the given page is not the current page.
- */
- public abstract boolean performFinish();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizardPage.java
deleted file mode 100644
index ac15c10de..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemWizardPage.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.Mnemonics;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.messages.SystemMessageLine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-
-
-
-/**
- * Abstract class for system wizards pages. Using this class is most effective when used in
- * conjunction with {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard}.
- * <p> Using this base class for wizards offers the following advantages over just using the
- * eclipse WizardPage class:
- * <ul>
- * <li>Designed to work in conjunction with {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard},
- * propogating settings from the wizard to the individual wizard pages.
- * <li>Supports using the overall wizard page title as set by {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard#setWizardPageTitle(String)},
- * if no title specified in the constructor.
- * <li>Supports a {@link #setHelp(String)} method to set the wizard page's overall contextual help
- * <li>Implements {@link org.eclipse.rse.ui.messages.ISystemMessageLine} so supports setting error messages as
- * either strings or, preferably, {@link org.eclipse.rse.ui.messages.SystemMessage} objects.
- * <li>Supports an {@link #setInputObject(Object) input-object}, as passed from the wizard, which in turn is passed from the action.
- * <li>Supports automatic assignment of unique mnemonics for all input-capable controls on the page, to add in accessibility.
- * <li>Supports setting a default-focus control, which gets initial focus when the page is shown.
- * <li>Supports helper methods to aid in population of the client area: {@link #addSeparatorLine(Composite,int)},
- * {@link #addFillerLine(Composite,int)} and {@link #addGrowableFillerLine(Composite,int)}.
- * <li>Supports a simple {@link #setBusyCursor(boolean)} method to toggle the cursor between busy and normal
- * </ul>
- *
- * <p>To use this class, :</p>
- * <ol>
- * <li>Subclass it.
- * <li>Decide whether to use the overall wizard default pages title or have a unique title for this page. Use the appropriate constructor.
- * <li>If desired, in your constructor call {@link #setHelp(String)} to set the contextual help for this page. Or, just use the default help
- * set via {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard#setHelp(String)} in the wizard itself.
- * <li>Override {@link #createContents(Composite)} to populate the client area. You may find it useful to use the static methods in {@link org.eclipse.rse.ui.SystemWidgetHelpers}.
- * <li>Override {@link #getInitialFocusControl()} to return the control to gain initial focus on this page, or null if there are no input controls.
- * <li>Override {@link #performFinish()} to perform input validation when Finish is pressed. Return true if validated ok, false if not.
- * <li>You may also wish to override {@link #isPageComplete()} to return false if any required inputs are not given. Typically, this also is coded to
- * return false if there is an error message showing, which you detect by maintaining a SystemMessage instance variable, set or cleared by your
- * keystroke validator methods, and performFinish validation routine.
- * <li>Typically you will also supply protected getter methods to get the user-entered data, for use by your wizard class.
- * </ol>
- *
- * <p>For error validation when there are multiple input fields on the page, there are two different approaches you can take:</p>
- * <ol>
- * <li>Just validate each field as data is entered. In the event processor for that field, you clear the message, then set it if an error is
- * detected in the input data, and also call setPageComplete(errorMessage == null), where errorMessage is your instance variable for the current error.
- * In performFinish, you then call the validation methods for each of the fields on the page, and if an error is found, position the cursor, set the
- * error message and then call setPageComplete. <br>
- * In this approach, only errors in the current field in focus are caught, and errors in other fields are not caught until Finish is pressed.
- * <li>Same as in step 1, but if the error checking for the current field finds no errors, then an overall validation method is called to check
- * the other fields, passing a parameter identifying the current field so it is skipped for efficiency. The overall validation method calls all
- * the individual validation methods, except for the one that was asked to be skipped. The performFinish method calls the overall validation method,
- * passing null so nothing is skipped, and if an error is detected positions the cursor. <br>
- * In this approach, which is more rigorous, the error checking is always complete for the whole page, so Finish theoretically will never catch an
- * error, and the page enablement is always completely accurate.
- * </ol>
- * <p>There is no consensus on the approach, although clearly the second one is preferable when it is possible.
- *
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizard
- * @see org.eclipse.rse.ui.dialogs.SystemWizardDialog
- * @see org.eclipse.rse.ui.actions.SystemBaseWizardAction
- */
-public abstract class AbstractSystemWizardPage
- extends WizardPage
- implements ISystemWizardPage, ISystemMessageLine
-{
- // state
- private Object input;
- private SystemMessageLine msgLine;
- private String helpId;
- private Composite parentComposite;
- private SystemMessage pendingMessage, pendingErrorMessage;
- //private Hashtable helpIdPerControl;
- private Cursor waitCursor;
-
- /**
- * Constructor when a unique page title is desired.
- * @param wizard - the page wizard.
- * @param pageName - the untranslated ID of this page. Not really used.
- * @param pageTitle - the translated title of this page. Appears below the overall wizard title.
- * @param pageDescription - the translated description of this page. Appears to the right of the page title.
- */
- public AbstractSystemWizardPage(IWizard wizard,
- String pageName, String pageTitle, String pageDescription)
- {
- super(pageName);
- setWizard(wizard);
- if (pageTitle != null)
- setTitle(pageTitle);
- else if (wizard instanceof AbstractSystemWizard)
- setTitle(((AbstractSystemWizard)wizard).getWizardPageTitle());
- setDescription(pageDescription);
- }
- /**
- * Constructor when the overall wizard page title is desired, as specified in
- * {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard#setWizardPageTitle(String)}.
- * <p>It is a somewhat common design pattern to use the same title for all pages in a wizard, and
- * this makes it easy to do that.
- * <p>
- * Your wizard must extend AbstractSystemWizard, and you must have called setWizardPageTitle.
- * @param wizard - the page's wizard.
- * @param pageName - the untranslated ID of this page. Not really used.
- * @param pageDescription - the translated description of this page. Appears to the right of the page title.
- */
- public AbstractSystemWizardPage(ISystemWizard wizard,
- String pageName, String pageDescription)
- {
- this(wizard, pageName, null, pageDescription);
- }
-
- // ------------------------
- // CONFIGURATION METHODS...
- // ------------------------
-
- /**
- * Configuration method. <br>
- * For setting the overall help for the wizard page.
- * <p>
- * This id is stored, and then applied to each of the input-capable
- * controls in the main composite returned from createContents.
- * <p>
- * Call this first to set the default help, then call {@link #setHelp(Control, String)} per individual
- * control if control-unique help is desired.
- */
- public void setHelp(String helpId)
- {
- if (parentComposite != null)
- SystemWidgetHelpers.setHelp(parentComposite, helpId);
- //SystemWidgetHelpers.setCompositeHelp(parentComposite, helpId, helpIdPerControl);
- //System.out.println("Setting help to " + helpId);
- this.helpId = helpId;
- }
- /**
- * Configuration method. <br>
- * For setting control-specific help for a control on the wizard page.
- * <p>
- * This overrides the default set in the call to {@link #setHelp(String)}.
- */
- public void setHelp(Control c, String helpId)
- {
- SystemWidgetHelpers.setHelp(c, helpId);
- //if (helpIdPerControl == null)
- // helpIdPerControl = new Hashtable();
- //helpIdPerControl.put(c, helpId);
- }
-
- /**
- * Configuration method. <br>
- * For explicitly setting input object. Automatically propogated by the parent wizard.
- */
- public void setInputObject(Object inputObject)
- {
- this.input = inputObject;
- }
-
- // ------------------------
- // GETTER METHODS...
- // ------------------------
- /**
- * Getter method. <br>
- * For explicitly getting input object.
- */
- public Object getInputObject()
- {
- return input;
- }
- /**
- * Getter method. <br>
- * Return the help Id as set in {@link #setHelp(String)}
- */
- public String getHelpContextId()
- {
- return helpId;
- }
- /**
- * Getter method. <br>
- * Return this page's message line so it can be passed to re-usable widgets that need it
- */
- public ISystemMessageLine getMessageLine()
- {
- //return msgLine;
- return this;
- }
-
- // ----------------
- // ABSTRACT METHODS
- // ----------------
- /**
- * Abstract method. <br>
- * Create the page contents here.
- * <p>
- * You may find it useful to use the static methods in {@link org.eclipse.rse.ui.SystemWidgetHelpers}.
- * If you do keystroke validation, you should call {@link #setErrorMessage(SystemMessage)} if you detect errors, and also
- * {@link #setPageComplete(boolean)} to affect the enablement of the next and finish buttons.
- *
- * @see org.eclipse.rse.ui.SystemWidgetHelpers
- */
- public abstract Control createContents(Composite parent);
-
- /**
- * Abstract method. <br>
- * Return the Control to be given initial focus.
- * <p>
- * Child classes must override this, but can return null.
- */
- protected abstract Control getInitialFocusControl();
-
- /**
- * Abstract method. <br>
- * Perform error checking of the page contents, returning true only if there are no errors.
- * <p>Called by the main wizard when the user presses Finish. The operation will be cancelled if
- * this method returns false for any page.
- */
- public abstract boolean performFinish();
-
- // -----------------------
- // PARENT-OVERRIDE METHODS
- // -----------------------
- /**
- * Parent override. <br>
- * Creates the wizard's UI component.
- * We set mnemonics. Child classes should NOT USE THIS.
- * Child classes should override {@link #createContents(Composite)}, which this calls.
- */
- public void createControl(Composite parent)
- {
-// dwd parentComposite = parent;
- Composite myComposite = new Composite(parent, SWT.NONE);
- myComposite.setLayout(new GridLayout(1, false));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_BEGINNING, true, true);
- myComposite.setLayoutData(gd);
- parentComposite = myComposite;
- Control c = createContents(myComposite);
- if (c instanceof Composite)
- {
- applyMnemonics((Composite)c);
- parentComposite = (Composite)c;
- if (helpId != null)
- SystemWidgetHelpers.setHelp(parentComposite, helpId);
- // SystemWidgetHelpers.setCompositeHelp((Composite)c, helpId, helpIdPerControl);
- }
- else if (c instanceof Button)
- {
- Mnemonics ms = new Mnemonics();
- ms.setMnemonic((Button)c);
- }
-// dwd configureMessageLine();
- msgLine = new SystemMessageLine(myComposite);
- msgLine.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- if (pendingMessage!=null)
- setMessage(pendingMessage);
- if (pendingErrorMessage!=null)
- setErrorMessage(pendingErrorMessage);
-// dwd setControl(c);
- setControl(myComposite);
- }
-
- /**
- * Apply mnemonic to the content composite.
- * @param c the composite.
- */
- protected void applyMnemonics(Composite c) {
- SystemWidgetHelpers.setWizardPageMnemonics(c);
- }
-
- /**
- * Parent override. <br>
- * We intercept to give the initial-focus-control focus.
- */
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
- if (visible)
- {
- Control c = getInitialFocusControl();
- if (c != null)
- c.setFocus();
- }
- }
-
- // -----------------------------
- // ISystemMessageLine methods...
- // -----------------------------
-
- /**
- * ISystemMessageLine method. <br>
- * Clears the currently displayed error message and redisplayes
- * the message which was active before the error message was set.
- */
- public void clearErrorMessage()
- {
- if (msgLine!=null)
- msgLine.clearErrorMessage();
- }
-
- /**
- * ISystemMessageLine method. <br>
- * Clears the currently displayed message.
- */
- public void clearMessage()
- {
- if (msgLine!=null)
- msgLine.clearMessage();
- }
-
- /**
- * ISystemMessageLine method. <br>
- * Get the currently displayed error text.
- * @return The error message. If no error message is displayed <code>null</code> is returned.
- */
- public SystemMessage getSystemErrorMessage()
- {
- if (msgLine!=null)
- return msgLine.getSystemErrorMessage();
- else
- return null;
- }
-
- /**
- * ISystemMessageLine method. <br>
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(SystemMessage message)
- {
- if (msgLine!=null)
- {
- if (message != null)
- msgLine.setErrorMessage(message);
- else
- msgLine.clearErrorMessage();
- }
- else // not configured yet
- pendingErrorMessage = message;
- }
- /**
- * ISystemMessageLine method. <br>
- * Convenience method to set an error message from an exception
- */
- public void setErrorMessage(Throwable exc)
- {
- if (msgLine != null)
- msgLine.setErrorMessage(exc);
- else
- {
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_ERROR_UNEXPECTED);
- msg.makeSubstitution(exc);
- pendingErrorMessage = msg;
- }
- }
- /**
- * ISystemMessageLine method. <br>
- * Display the given error message. A currently displayed message
- * is saved and will be redisplayed when the error message is cleared.
- */
- public void setErrorMessage(String message)
- {
- if (msgLine != null)
- msgLine.setErrorMessage(message);
-// super.setErrorMessage(message);
-// if (msgLine != null)
-// ((SystemDialogPageMessageLine)msgLine).internalSetErrorMessage(message);
- }
-
- /**
- * ISystemMessageLine method. <br>
- * If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(SystemMessage message)
- {
- if (msgLine!=null)
- msgLine.setMessage(message);
- else // not configured yet
- pendingMessage = message;
- }
- /**
- * ISystemMessageLine method. <br>
- * Set the non-error message text. If the message line currently displays an error,
- * the message is stored and will be shown after a call to clearErrorMessage
- */
- public void setMessage(String message)
- {
- if (msgLine!=null)
- msgLine.setMessage(message);
-// super.setMessage(message);
-// if (msgLine!=null)
-// ((SystemDialogPageMessageLine)msgLine).internalSetMessage(message);
- }
-
- // ---------------
- // HELPER METHODS
- // ---------------
- /**
- * Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
- */
- public void setBusyCursor(boolean setBusy)
- {
- if (setBusy)
- {
- // Set the busy cursor to all shells.
- Display d = getShell().getDisplay();
- waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), waitCursor);
- }
- else
- {
- org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(getShell(), null);
- if (waitCursor != null)
- waitCursor.dispose();
- waitCursor = null;
- }
- }
-
- /**
- * Helper method <br>
- * Add a separator line. This is a physically visible line.
- */
- protected void addSeparatorLine(Composite parent, int nbrColumns)
- {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- separator.setLayoutData(data);
- }
- /**
- * Helper method <br>
- * Add a spacer line
- */
- protected void addFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- filler.setLayoutData(data);
- }
- /**
- * Helper method <br>
- * Add a spacer line that grows in height to absorb extra space
- */
- protected void addGrowableFillerLine(Composite parent, int nbrColumns)
- {
- Label filler = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalSpan = nbrColumns;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- filler.setLayoutData(data);
- }
-
- // ----------------
- // INTERNAL METHODS
- // ----------------
- /**
- * Internal method <br>
- * Configure the message line
- */
-// private void configureMessageLine()
-// {
-// msgLine = SystemDialogPageMessageLine.createWizardMsgLine(this);
-// if (msgLine!=null)
-// {
-// if (pendingMessage!=null)
-// setMessage(pendingMessage);
-// if (pendingErrorMessage!=null)
-// setErrorMessage(pendingErrorMessage);
-// }
-// }
-
- /**
- * Internal method <br>
- * On Finish, when an error is detected, position to the given
- * control. The trick though is to give this page focus if it
- * doesn't have it.
- */
- protected void setFocus(Control control)
- {
- if (this != getContainer().getCurrentPage())
- getContainer().showPage(this);
- if ((control!=null) && !control.isDisposed())
- control.setFocus();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java
deleted file mode 100644
index 0907a973c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizard.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.ui.INewWizard;
-
-public interface IRSENewConnectionWizard extends INewWizard {
-
- public static final String NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_POINT_ID = "org.eclipse.rse.ui.newConnectionWizardDelegates"; //$NON-NLS-1$
- public static final String NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_NAME = "newConnectionWizardDelegate"; //$NON-NLS-1$
- public static final String NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_ATTRIBUTE_SYSTEMTYPE = "systemType"; //$NON-NLS-1$
- public static final String NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_ATTRIBUTE_CLASS = "class"; //$NON-NLS-1$
-
- public IRSENewConnectionWizardDelegate getDelegate();
-
- /**
- * Restrict system types. Users will only be able to choose from the given system types.
- * @param systemTypes the system types to restrict to.
- */
- public void restrictToSystemTypes(IRSESystemType[] systemTypes);
-
- /**
- * Restrict to a single system type. Users will not be shown the system type selection page in
- * the wizard.
- * @param systemType the system type to restrict to.
- */
- public void restrictToSystemType(IRSESystemType systemType);
-
- /**
- * Sets the system type that was selected in the wizard. This will only be called if the wizard
- * shows the system type selection page, i.e. if the wizard is not restricted to a single system type.
- * @param systemType the system type.
- */
- public void setSelectedSystemType(IRSESystemType systemType);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java
deleted file mode 100644
index bfa1ac97b..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/IRSENewConnectionWizardDelegate.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.model.IHost;
-
-/**
- * Interface for RSE new connection wizard delegate.
- */
-public interface IRSENewConnectionWizardDelegate {
-
- public void init(RSENewConnectionWizard wizard, IRSESystemType systemType);
-
- public boolean isInitialized();
-
- public void systemTypeChanged(IRSESystemType systemType);
-
- public RSENewConnectionWizard getWizard();
-
- public IRSESystemType getSystemType();
-
- public void addPages();
-
- public boolean performFinish();
-
- public boolean canFinish();
-
- public IWizardPage getMainPage();
-
- public IWizardPage getNextPage(IWizardPage page);
-
- public IWizardPage getPreviousPage(IWizardPage page);
-
- public IHost getDummyHost();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISubSystemPropertiesWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISubSystemPropertiesWizardPage.java
deleted file mode 100644
index 8baf5043f..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISubSystemPropertiesWizardPage.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import org.eclipse.rse.core.subsystems.ISubSystem;
-
-public interface ISubSystemPropertiesWizardPage
-{
- public boolean applyValues(ISubSystem ss);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemNewConnectionWizardMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemNewConnectionWizardMainPage.java
deleted file mode 100644
index 7ef2c1e7e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemNewConnectionWizardMainPage.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-
-
-
-
-/**
- * Interface for new Connection (ie Definition) wizard main page classes
- */
-public interface ISystemNewConnectionWizardMainPage extends ISystemWizardPage
-{
-
- public String getSystemType();
- public String getConnectionName();
- public String getHostName();
- public String getConnectionDescription();
- public String getDefaultUserId();
- public int getDefaultUserIdLocation();
- public String getProfileName();
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType);
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes);
-
- /**
- * Call this to specify a validator for the connection name. It will be called per keystroke.
- */
- public void setConnectionNameValidators(ISystemValidator[] v);
- /**
- * Call this to specify a validator for the hostname. It will be called per keystroke.
- */
- public void setHostNameValidator(ISystemValidator v);
- /**
- * Call this to specify a validator for the userId. It will be called per keystroke.
- */
- public void setUserIdValidator(ISystemValidator v);
- /**
- * This method allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId);
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name);
- /**
- * Preset the host name
- */
- public void setHostName(String name);
- /**
- * Set the profile names to show in the combo
- */
- public void setProfileNames(String[] names);
- /**
- * Set the profile name to preselect
- */
- public void setProfileNamePreSelection(String name);
- /**
- * Set the currently selected connection so as to better initialize input fields
- */
- public void setCurrentlySelectedConnection(IHost connection);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizard.java
deleted file mode 100644
index 6ad2d5273..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizard.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.rse.ui.dialogs.ISystemPromptDialog;
-import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
-import org.eclipse.ui.INewWizard;
-
-
-/**
- * Suggested interface for wizards launchable via remote system explorer.
- */
-public interface ISystemWizard extends INewWizard, ISystemPromptDialog
-{
- /**
- * Called when wizard to be used for update vs create.
- * This is the input object to be updated. Automatically sets input mode to update.
- */
- //public void setUpdateInput(Object input);
- /**
- * Retrieve update mode
- */
- //public boolean getUpdateMode();
- /**
- * Retrieve input object used in update mode.
- */
- //public Object getUpdateInput();
- /**
- * Set current selection of viewer, at time wizard launched
- */
- //public void setSelection(IStructuredSelection selection);
- /**
- * Get current selection of viewer, at time wizard launched, as set
- * by setSelection(IStructuredSelection selection)
- */
- //public IStructuredSelection getSelection();
-
- public void setMinimumPageSize(int width, int height);
- public int getMinimumPageWidth();
- public int getMinimumPageHeight();
-
- /**
- * Set the help context Id (infoPop) for this wizard. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelp(String id);
- /**
- * Return the help Id as set in setHelp(String)
- */
- public String getHelpContextId();
-
- /**
- * Set the Viewer that called this wizard. It is good practice for actions to call this
- * so wizard can directly access the originating viewer if needed.
- */
- public void setViewer(Viewer v);
- /**
- * Get the Viewer that called this wizard. This will be null unless set by the action that started this wizard.
- */
- public Viewer getViewer();
-
- /**
- * Set the wizard page title. Using this makes it possible to avoid subclassing.
- * The page title goes below the wizard title, and can be unique per page. However,
- * typically the wizard page title is the same for all pages... eg "Filter".
- * <p>
- * This is not used by default, but can be queried via getPageTitle() when constructing
- * pages.
- */
- public void setWizardPageTitle(String pageTitle);
- /**
- * Return the page title as set via setWizardPageTitle
- */
- public String getWizardPageTitle();
- /**
- * Called from SystemWizardDialog when it is used as the hosting dialog
- */
- public void setSystemWizardDialog(SystemWizardDialog dlg);
- /**
- * Return the result of setSystemWizardDialog
- */
- public SystemWizardDialog getSystemWizardDialog();
- /**
- * Exposes this nice new 2.0 capability to the public.
- * Only does anything if being hosted by SystemWizardDialog.
- */
- public void updateSize();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizardPage.java
deleted file mode 100644
index 8d98d1a62..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/ISystemWizardPage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-/**
- * Interface for wizard pages
- */
-public interface ISystemWizardPage
-{
- /**
- * For explicitly setting input object for update mode wizards
- */
- public void setInputObject(Object inputObject);
-
- /**
- * For explicitly getting input object.
- */
- public Object getInputObject();
-
- /**
- * Perform error checking of the page contents, returning true only if there are no errors.
- * <p>Called by the main wizard when the user presses Finish. The operation will be cancelled if
- * this method returns false for any page.
- */
- public boolean performFinish();
-
- /**
- * Set the help context Id (infoPop) for this wizard. This must be fully qualified by
- * plugin ID.
- * <p>
- * Same as {@link org.eclipse.rse.ui.actions.SystemBaseAction #setHelp(String)}
- * @see org.eclipse.rse.ui.actions.SystemBaseAction #getHelpContextId()
- */
- public void setHelp(String id);
- /**
- * Return the help Id as set in setHelp(String)
- */
- public String getHelpContextId();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java
deleted file mode 100644
index d9b63fccf..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSEDefaultNewConnectionWizardDelegate.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPerspectiveHelpers;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.model.DummyHost;
-import org.eclipse.rse.model.SystemStartHere;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-
-
-/**
- *
- */
-public class RSEDefaultNewConnectionWizardDelegate extends RSENewConnectionWizardDelegate {
-
- private RSENewConnectionWizardDefaultDelegateMainPage mainPage;
- private SystemNewConnectionWizardRenameProfilePage rnmProfilePage;
- private ISystemNewConnectionWizardPage[] subsystemFactorySuppliedWizardPages;
- private Hashtable ssfWizardPagesPerSystemType = new Hashtable();
- private String defaultUserId;
- private String defaultConnectionName;
- private String defaultHostName;
- private String[] activeProfileNames = null;
- private int privateProfileIndex = -1;
- private ISystemProfile privateProfile = null;
- private IHost currentlySelectedConnection = null;
- private String[] restrictSystemTypesTo;
- private static String lastProfile = null;
- private boolean showProfilePageInitially = true;
- private IHost _dummyHost;
-
- /**
- * Constructor.
- */
- public RSEDefaultNewConnectionWizardDelegate() {
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.RSENewConnectionWizardDelegate#init(org.eclipse.rse.ui.wizards.RSENewConnectionWizard, org.eclipse.rse.core.IRSESystemType)
- */
- public void init(RSENewConnectionWizard wizard, IRSESystemType systemType) {
- super.init(wizard, systemType);
- restrictSystemType(systemType.getName());
- activeProfileNames = SystemStartHere.getSystemProfileManager().getActiveSystemProfileNames();
- systemTypeSelected(systemType.getName(), true);
- }
-
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- if (mainPage != null)
- mainPage.restrictSystemTypes(restrictSystemTypesTo);
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- this.restrictSystemTypesTo = systemTypes;
- if (mainPage != null)
- mainPage.restrictSystemTypes(systemTypes);
- }
-
- public IHost getDummyHost()
- {
- if (_dummyHost == null)
- {
- _dummyHost = new DummyHost(mainPage.getHostName(), mainPage.getSystemType());
- }
- return _dummyHost;
- }
-
-
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class.
- */
- public void addPages()
- {
- try {
- mainPage = createMainPage(restrictSystemTypesTo);
- mainPage.setConnectionNameValidators(SystemConnectionForm.getConnectionNameValidators());
- mainPage.setCurrentlySelectedConnection(currentlySelectedConnection);
- if (defaultUserId != null)
- mainPage.setUserId(defaultUserId);
- if (defaultConnectionName != null)
- mainPage.setConnectionName(defaultConnectionName);
- if (defaultHostName != null)
- mainPage.setHostName(defaultHostName);
-
- if (restrictSystemTypesTo != null)
- mainPage.restrictSystemTypes(restrictSystemTypesTo);
-
- ISystemProfile defaultProfile = SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile();
-
- showProfilePageInitially = RSEUIPlugin.getDefault().getShowProfilePageInitially();
- /* DKM - I don't think we should force profiles into the faces of users
- * we no longer default to "private" so hopefully this would never be
- * desirable
- *
- // if there is a default private profile, we might want to show the rename profile page
- if (defaultProfile != null)
- {
- // make private profile equal to default profile
- privateProfile = defaultProfile;
-
- // get the private profile index in the list of active profiles
- for (int idx=0; (privateProfileIndex<0) && (idx<activeProfileNames.length); idx++)
- if (activeProfileNames[idx].equals(defaultProfile.getName()))
- privateProfileIndex = idx;
-
- // if profile page is to be shown initially, then add the page
- if (showProfilePageInitially) {
- rnmProfilePage = new SystemNewConnectionWizardRenameProfilePage(this) ;
- addPage(rnmProfilePage);
- }
- // otherwise, do not add profile page
- // and set the new private profile name to be the local machine name
- else {
- rnmProfilePage = null;
-
- String initProfileName = RSEUIPlugin.getLocalMachineName();
- int dotIndex = initProfileName.indexOf('.');
-
- if (dotIndex != -1) {
- initProfileName = initProfileName.substring(0, dotIndex);
- }
-
- setNewPrivateProfileName(initProfileName);
- }
- }
- else
- */
- {
- mainPage.setProfileNames(activeProfileNames);
- // if there is no connection currently selected, default the profile to
- // place the new connection into to be the first of:
- // 1. the profile the last connection was created in, in this session
- // 2. the team profile.
- if (currentlySelectedConnection == null)
- {
- if ((lastProfile == null) && (activeProfileNames!=null))
- {
- String defaultTeamName = ISystemPreferencesConstants.DEFAULT_TEAMPROFILE;
- for (int idx=0; (lastProfile==null)&&(idx<activeProfileNames.length); idx++)
- {
- if (!activeProfileNames[idx].equals(defaultTeamName))
- lastProfile = activeProfileNames[idx];
- }
- if ((lastProfile == null) && (activeProfileNames.length>0))
- lastProfile = activeProfileNames[0];
- }
- if (lastProfile != null)
- mainPage.setProfileNamePreSelection(lastProfile);
- }
- }
-
- // getWizard().addPage((WizardPage)mainPage);
-
- } catch (Exception exc)
- {
- SystemBasePlugin.logError("New connection: Error in createPages: ",exc);
- }
- }
-
- /**
- * Creates the wizard's main page.
- * This method is an override from the parent class.
- */
- protected RSENewConnectionWizardDefaultDelegateMainPage createMainPage(String[] restrictSystemTypesTo)
- {
- String pageTitle = getPageTitle();
- mainPage = new RSENewConnectionWizardDefaultDelegateMainPage(getWizard(),
- pageTitle,
- SystemResources.RESID_NEWCONN_PAGE1_DESCRIPTION);
- getWizard().setOutputObject(null);
- return mainPage;
- }
-
- public String getPageTitle() {
-
- String pageTitle = null;
-
- if ((restrictSystemTypesTo == null) || (restrictSystemTypesTo.length != 1)) {
- pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE;
- }
- else {
- String onlySystemType = restrictSystemTypesTo[0];
-
- if (onlySystemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL)) {
- pageTitle = SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE;
- }
- else {
- pageTitle = SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE;
- pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType);
- }
- }
-
- return pageTitle;
- }
-
- /**
- * Set the currently selected connection. Used to better default entry fields.
- */
- public void setCurrentlySelectedConnection(IHost conn)
- {
- this.currentlySelectedConnection = conn;
- }
-
- /**
- * For "new" mode, allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId)
- {
- defaultUserId = userId;
- if (mainPage != null)
- mainPage.setUserId(userId);
- }
-
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- defaultConnectionName = name;
- if (mainPage != null)
- mainPage.setConnectionName(name);
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- defaultHostName = name;
- if (mainPage != null)
- mainPage.setHostName(name);
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- boolean ok = mainPage.performFinish();
- if (!ok)
- getWizard().setPageError(mainPage);
- else if (ok && hasAdditionalPages())
- {
- for (int idx=0; ok && (idx<subsystemFactorySuppliedWizardPages.length); idx++)
- {
- ok = subsystemFactorySuppliedWizardPages[idx].performFinish();
- if (!ok)
- getWizard().setPageError((IWizardPage)subsystemFactorySuppliedWizardPages[idx]);
- }
- }
- if (ok)
- {
- boolean cursorSet = true;
- getWizard().setBusyCursor(true);
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
-
- // if private profile is not null, then we have to rename the private profile
- // with the new profile name
- if (privateProfile != null)
- {
- try
- {
- String newName = activeProfileNames[privateProfileIndex];
- sr.renameSystemProfile(privateProfile, newName);
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayMessage(getWizard().getShell(), exc);
-
- ok = false;
- }
- catch (Exception exc)
- {
- getWizard().setBusyCursor(false);
- cursorSet = false;
- String msg = "Exception renaming profile ";
- SystemBasePlugin.logError(msg, exc);
- SystemMessageDialog.displayExceptionMessage(getWizard().getShell(),exc);
- ok = false;
- }
- }
-
- if (ok)
- {
- try
- {
- String sysType = mainPage.getSystemType();
- IHost conn =
- sr.createHost(mainPage.getProfileName(), sysType,
- mainPage.getConnectionName(), mainPage.getHostName(),
- mainPage.getConnectionDescription(), mainPage.getDefaultUserId(),
- mainPage.getDefaultUserIdLocation(), subsystemFactorySuppliedWizardPages);
-
- getWizard().setBusyCursor(false);
- cursorSet = false;
-
- // a tweak that is the result of UCD feedback. Phil
- if ((conn!=null) && SystemPerspectiveHelpers.isRSEPerspectiveActive())
- {
- if (sysType.equals(IRSESystemType.SYSTEMTYPE_ISERIES))
- {
- ISubSystem[] objSubSystems = sr.getSubSystemsBySubSystemConfigurationCategory("nativefiles", conn); //$NON-NLS-1$
- if ((objSubSystems != null)
- && (objSubSystems.length>0))// might be in product that doesn't have iSeries plugins
- sr.expandSubSystem(objSubSystems[0]);
- else
- sr.expandHost(conn);
- }
- else
- sr.expandHost(conn);
- }
-
- lastProfile = mainPage.getProfileName();
- getWizard().setOutputObject(conn);
- } catch (Exception exc)
- {
- if (cursorSet)
- getWizard().setBusyCursor(false);
- cursorSet = false;
- String msg = "Exception creating connection ";
- SystemBasePlugin.logError(msg, exc);
- SystemMessageDialog.displayExceptionMessage(getWizard().getShell(),exc);
- ok = false;
- }
- }
- //getShell().setCursor(null);
- //busyCursor.dispose();
- if (cursorSet)
- getWizard().setBusyCursor(false);
- return ok;
- }
- return ok;
- }
-
- // callbacks from rename page
-
- /**
- * Set the new profile name specified on the rename profile page...
- */
- protected void setNewPrivateProfileName(String newName)
- {
- activeProfileNames[privateProfileIndex] = newName;
- if (mainPage != null)
- {
- mainPage.setProfileNames(activeProfileNames);
- mainPage.setProfileNamePreSelection(newName);
- }
- }
-
- /**
- * Return the main page of this wizard
- */
- public IWizardPage getMainPage()
- {
- if (mainPage == null) {
- addPages();
- }
-
- return mainPage;
- }
-
- /**
- * Return the form of the main page of this wizard
- */
- public SystemConnectionForm getMainPageForm()
- {
- return (mainPage).getForm();
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION PAGE...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- subsystemFactorySuppliedWizardPages = getAdditionalWizardPages(systemType);
- if (!duringInitialization)
- getWizard().getContainer().updateButtons();
- }
-
- /*
- * Private method to get all the wizard pages from all the subsystem factories, given a
- * system type.
- */
- protected ISystemNewConnectionWizardPage[] getAdditionalWizardPages(String systemType)
- {
- // this query is expensive, so only do it once...
- subsystemFactorySuppliedWizardPages = (ISystemNewConnectionWizardPage[])ssfWizardPagesPerSystemType.get(systemType);
- if (subsystemFactorySuppliedWizardPages == null)
- {
- // query all affected subsystems for their list of additional wizard pages...
- Vector additionalPages = new Vector();
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, true);
- for (int idx=0; idx<factories.length; idx++)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factories[idx].getAdapter(ISubSystemConfigurationAdapter.class);
-
- ISystemNewConnectionWizardPage[] pages = adapter.getNewConnectionWizardPages(factories[idx], getWizard());
- if (pages != null)
- {
- for (int widx=0; widx<pages.length; widx++)
- additionalPages.addElement(pages[widx]);
- }
- }
- subsystemFactorySuppliedWizardPages = new ISystemNewConnectionWizardPage[additionalPages.size()];
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- subsystemFactorySuppliedWizardPages[idx] = (ISystemNewConnectionWizardPage)additionalPages.elementAt(idx);
- ssfWizardPagesPerSystemType.put(systemType, subsystemFactorySuppliedWizardPages);
- }
- return subsystemFactorySuppliedWizardPages;
- }
-
- /**
- * Return true if there are additional pages. This decides whether to enable the Next button
- * on the main page
- */
- protected boolean hasAdditionalPages()
- {
- return (subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length>0);
- }
-
- /**
- * Return the first additional page to show when user presses Next on the main page
- */
- protected ISystemNewConnectionWizardPage getFirstAdditionalPage()
- {
- if ((subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length>0))
- {
- IWizardPage previousPage = mainPage;
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- {
- ((IWizardPage)subsystemFactorySuppliedWizardPages[idx]).setPreviousPage(previousPage);
- previousPage = (IWizardPage)subsystemFactorySuppliedWizardPages[idx];
- }
- return subsystemFactorySuppliedWizardPages[0];
- }
- else
- return null;
- }
-
- // --------------------
- // PARENT INTERCEPTS...
- // --------------------
-
- /**
- * Intercept of Wizard method so we can get the Next button behaviour to work right for the
- * dynamically managed additional wizard pages.
- */
- public IWizardPage getNextPage(IWizardPage page)
- {
- if (!hasAdditionalPages() || (page==rnmProfilePage))
- return null;
- else
- {
- int index = getAdditionalPageIndex(page);
- if ((index == (subsystemFactorySuppliedWizardPages.length - 1)))
- // last page or page not found
- return null;
- return (IWizardPage)subsystemFactorySuppliedWizardPages[index + 1];
- }
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.RSENewConnectionWizardDelegate#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getPreviousPage(IWizardPage page) {
- return null;
- }
-
- private int getAdditionalPageIndex(IWizardPage page)
- {
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- {
- if (page == subsystemFactorySuppliedWizardPages[idx])
- return idx;
- }
- return -1;
- }
-
- /**
- * Intercept of Wizard method so we can take into account our additional pages
- */
- public boolean canFinish()
- {
- boolean ok = mainPage.isPageComplete();
-
- if (ok && hasAdditionalPages())
- {
- for (int idx=0; ok && (idx<subsystemFactorySuppliedWizardPages.length); idx++)
- ok = subsystemFactorySuppliedWizardPages[idx].isPageComplete();
- }
- return ok;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.RSENewConnectionWizardDelegate#systemTypeChanged(org.eclipse.rse.core.IRSESystemType)
- */
- public void systemTypeChanged(IRSESystemType systemType) {
- setSystemType(systemType);
- restrictSystemType(systemType.getName());
- getMainPage().setTitle(getPageTitle());
- subsystemFactorySuppliedWizardPages = getAdditionalWizardPages(systemType.getName());
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizard.java
deleted file mode 100644
index 240cfb4b0..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizard.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and Symbian Software Ltd. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Javier Montalvo Orús (Symbian) - Bug 158555 - newConnectionWizardDelegates can only be used once
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-
-/**
- * The New Connection wizard. This wizard allows users to create new RSE connections.
- */
-public class RSENewConnectionWizard extends AbstractSystemWizard implements IRSENewConnectionWizard {
-
- private HashMap map;
- //private IRSESystemType systemType;
- private IRSENewConnectionWizardDelegate delegate;
- private RSENewConnectionWizardMainPage mainPage;
- private IRSESystemType[] restrictedSystemTypes;
- private boolean onlySystemType;
- private IRSENewConnectionWizardDelegate defaultDelegate;
- private boolean defaultDelegateCreated;
-
- /**
- * Constructor.
- */
- public RSENewConnectionWizard() {
- super(SystemResources.RESID_NEWCONN_TITLE, RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD_ID));
- readWizardDelegateExtensions();
- setForcePreviousAndNextButtons(true);
- setNeedsProgressMonitor(true);
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizard#restrictToSystemType(org.eclipse.rse.core.IRSESystemType)
- */
- public void restrictToSystemType(IRSESystemType systemType) {
- IRSESystemType[] types = new IRSESystemType[1];
- types[0] = systemType;
- restrictToSystemTypes(types);
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizard#restrictToSystemTypes(org.eclipse.rse.core.IRSESystemType[])
- */
- public void restrictToSystemTypes(IRSESystemType[] systemTypes) {
- this.restrictedSystemTypes = systemTypes;
-
- if (systemTypes.length == 1) {
- this.onlySystemType = true;
- }
- else {
- this.onlySystemType = false;
- }
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizard#setSelectedSystemType(org.eclipse.rse.core.IRSESystemType)
- */
- public void setSelectedSystemType(IRSESystemType systemType) {
- //this.systemType = systemType;
- setDelegate(systemType);
- }
-
- /**
- *
- */
- private void readWizardDelegateExtensions() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] elements = registry.getConfigurationElementsFor(NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_POINT_ID);
-
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
-
- if (element.getName().equals(NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_NAME)) {
- String systemTypeID = element.getAttribute(NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_ATTRIBUTE_SYSTEMTYPE);
- Object obj = null;
-
- try {
- obj = element.createExecutableExtension(NEW_CONNECTION_WIZARD_DELEGATE_EXTENSION_CONFIG_ATTRIBUTE_CLASS);
-
- if (obj instanceof IRSENewConnectionWizardDelegate) {
-
- if (map == null) {
- map = new HashMap();
- }
-
- if (!map.containsKey(systemTypeID)) {
- map.put(systemTypeID, obj);
- }
- }
- else {
- continue;
- }
- }
- catch (CoreException e) {
- SystemBasePlugin.logError("Class " + obj + " is not executable extension", e);
- continue;
- }
- }
- }
- }
-
- /**
- * Get the new connection wizard delegate for the system type.
- * @param systemType the system type for which we need the delegate.
- */
- private IRSENewConnectionWizardDelegate setDelegate(IRSESystemType systemType) {
-
- if (map != null) {
- delegate = (IRSENewConnectionWizardDelegate)(map.get(systemType.getId()));
- }
-
- if (delegate == null) {
-
- if (!defaultDelegateCreated) {
- defaultDelegate = new RSEDefaultNewConnectionWizardDelegate();
- defaultDelegateCreated = true;
- }
-
- delegate = defaultDelegate;
- }
-
- // initialize with wizard and system type if not initialized before
- if (!delegate.isInitialized()) {
- delegate.init(this, systemType);
- }
- else {
- delegate.systemTypeChanged(systemType);
- }
-
- return delegate;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizard#getDelegate()
- */
- public IRSENewConnectionWizardDelegate getDelegate() {
- return delegate;
- }
-
- /**
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
-
- if (!onlySystemType) {
- mainPage = new RSENewConnectionWizardMainPage(this, "Select System Type", "Select a system type");
-
- if (restrictedSystemTypes != null) {
- mainPage.restrictToSystemTypes(restrictedSystemTypes);
- }
-
- addPage(mainPage);
- }
- else {
- setDelegate(restrictedSystemTypes[0]);
- addPage(delegate.getMainPage());
- }
- }
-
- /**
- * @see org.eclipse.jface.wizard.Wizard#canFinish()
- */
- public boolean canFinish() {
-
- boolean result = true;
-
- if (mainPage != null) {
- result = mainPage.isPageComplete();
- }
-
- if (result) {
-
- if (delegate != null) {
- result = delegate.canFinish();
- }
- // we do not allow wizard to complete if the delegate is not yet available
- else {
- result = false;
- }
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getNextPage(IWizardPage page) {
-
- if (mainPage != null && page == mainPage) {
- return super.getNextPage(page);
- }
- else {
-
- if (delegate != null) {
-
- IWizardPage nextPage = delegate.getNextPage(page);
-
- if (nextPage == null) {
- return super.getNextPage(page);
- }
- else {
- return nextPage;
- }
- }
- else {
- return super.getNextPage(page);
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.wizard.Wizard#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getPreviousPage(IWizardPage page) {
-
- if (mainPage != null && page == mainPage) {
- return super.getPreviousPage(page);
- }
- else {
-
- if (delegate != null) {
- IWizardPage prevPage = delegate.getPreviousPage(page);
-
- if (prevPage == null) {
- return super.getPreviousPage(page);
- }
- else {
- return prevPage;
- }
- }
- else {
- return super.getPreviousPage(page);
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish() {
-
- boolean result = true;
-
- if (mainPage != null) {
- result = mainPage.performFinish();
- }
-
- if (result) {
-
- if (delegate != null) {
- result = delegate.performFinish();
- }
- }
-
- return result;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDefaultDelegateMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDefaultDelegateMainPage.java
deleted file mode 100644
index a5b53d9eb..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDefaultDelegateMainPage.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.ISystemConnectionFormCaller;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-
-/**
- * Default main page of the "New Connection" wizard.
- * This page asks for the primary information, including:
- * <ul>
- * <li>Connection Name
- * <li>Hostname/IP-address
- * <li>UserId
- * <li>Description
- * </ul>
- */
-
-public class RSENewConnectionWizardDefaultDelegateMainPage
- //extends WizardPage
- extends AbstractSystemWizardPage
- implements ISystemNewConnectionWizardMainPage,
- ISystemMessageLine, ISystemConnectionFormCaller
-{
- protected String[] restrictSystemTypesTo;
- protected SystemConnectionForm form;
- protected String parentHelpId;
- protected RSEDefaultNewConnectionWizardDelegate delegate;
-
- /**
- * Constructor. Use this when you want to supply your own title and
- * description strings.
- */
- public RSENewConnectionWizardDefaultDelegateMainPage(Wizard wizard,
- String title,
- String description)
- {
- super(wizard, "NewConnection", title, description);
- parentHelpId = RSEUIPlugin.HELPPREFIX + "wncc0000"; //$NON-NLS-1$
- setHelp(parentHelpId);
- this.delegate = delegate;
- form = getForm();
- }
-
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- form.restrictSystemTypes(restrictSystemTypesTo);
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- restrictSystemTypesTo = systemTypes;
- form.restrictSystemTypes(restrictSystemTypesTo);
- }
-
- /**
- * Return the main wizard typed
- */
- private RSEDefaultNewConnectionWizardDelegate getOurWizardDelegate() {
- IWizard wizard = getWizard();
-
- if (wizard instanceof RSENewConnectionWizard) {
- IRSENewConnectionWizardDelegate delegate = ((RSENewConnectionWizard)wizard).getDelegate();
-
- if (delegate instanceof RSEDefaultNewConnectionWizardDelegate) {
- return (RSEDefaultNewConnectionWizardDelegate)delegate;
- }
- else {
- return null;
- }
- }
- else {
- return null;
- }
- }
-
-
- /**
- * Overrride this if you want to supply your own form. This may be called
- * multiple times so please only instantatiate if the form instance variable
- * is null, and then return the form instance variable.
- * @see org.eclipse.rse.ui.SystemConnectionForm
- */
- protected SystemConnectionForm getForm()
- {
- if (form == null)
- form = new SystemConnectionForm(this,this);
- return form;
- }
- /**
- * Call this to specify a validator for the connection name. It will be called per keystroke.
- */
- public void setConnectionNameValidators(ISystemValidator[] v)
- {
- form.setConnectionNameValidators(v);
- }
- /**
- * Call this to specify a validator for the hostname. It will be called per keystroke.
- */
- public void setHostNameValidator(ISystemValidator v)
- {
- form.setHostNameValidator(v);
- }
- /**
- * Call this to specify a validator for the userId. It will be called per keystroke.
- */
- public void setUserIdValidator(ISystemValidator v)
- {
- form.setUserIdValidator(v);
- }
-
- /**
- * This method allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId)
- {
- form.setUserId(userId);
- }
-
- /**
- * Set the profile names to show in the combo
- */
- public void setProfileNames(String[] names)
- {
- form.setProfileNames(names);
- }
- /**
- * Set the profile name to preselect
- */
- public void setProfileNamePreSelection(String name)
- {
- form.setProfileNamePreSelection(name);
- }
-
- /**
- * Set the currently selected connection so as to better initialize input fields
- */
- public void setCurrentlySelectedConnection(IHost connection)
- {
- form.setCurrentlySelectedConnection(connection);
- }
-
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- form.setConnectionName(name);
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- form.setHostName(name);
- }
-
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- */
- public Control createContents(Composite parent)
- {
- return form.createContents(parent, SystemConnectionForm.CREATE_MODE, parentHelpId);
- }
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return form.getInitialFocusControl();
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- return form.verify(true);
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return user-entered System Type.
- * Call this after finish ends successfully.
- */
-/* public String getSystemType()
- {
- return form.getSystemType();
- } */
- /**
- * Return user-entered Connection Name.
- * Call this after finish ends successfully.
- */
- public String getConnectionName()
- {
- return form.getConnectionName();
- }
- /**
- * Return user-entered Host Name.
- * Call this after finish ends successfully.
- */
- public String getHostName()
- {
- return form.getHostName();
- }
- /**
- * Return user-entered Default User Id.
- * Call this after finish ends successfully.
- */
- public String getDefaultUserId()
- {
- return form.getDefaultUserId();
- }
- /**
- * Return location where default user id is to be set.
- * @see org.eclipse.rse.core.ISystemUserIdConstants
- */
- public int getDefaultUserIdLocation()
- {
- return form.getUserIdLocation();
- }
- /**
- * Return user-entered Description.
- * Call this after finish ends successfully.
- */
- public String getConnectionDescription()
- {
- return form.getConnectionDescription();
- }
- /**
- * Return name of profile to contain new connection.
- * Call this after finish ends successfully.
- */
- public String getProfileName()
- {
- return form.getProfileName();
- }
-
- // ISystemMessageLine methods
-// public void clearMessage()
-// {
-// setMessage(null);
-// }
- //public void clearErrorMessage()
- //{
- //setErrorMessage(null);
- //}
-
- public Object getLayoutData()
- {
- return null;
- }
-
- public void setLayoutData(Object gridData)
- {
- }
-
-
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- */
- public boolean isPageComplete()
- {
- //System.out.println("Inside isPageComplete. " + form.isPageComplete());
- if (form!=null)
- return form.isPageComplete() && form.isConnectionUnique();
- else
- return false;
- }
-
- /**
- * Intercept of WizardPage so we know when Next is pressed
- */
- public IWizardPage getNextPage()
- {
- //if (wizard == null)
- //return null;
- //return wizard.getNextPage(this);
-
- RSEDefaultNewConnectionWizardDelegate newConnWizardDelegate = getOurWizardDelegate();
- if (newConnWizardDelegate != null)
- {
- return (IWizardPage)newConnWizardDelegate.getFirstAdditionalPage();
- }
- else
- return super.getNextPage();
- }
- /**
- * Intercept of WizardPge so we know when the wizard framework is deciding whether
- * to enable next or not.
- */
- public boolean canFlipToNextPage()
- {
- //return isPageComplete() && getNextPage() != null;
-
- RSEDefaultNewConnectionWizardDelegate newConnWizardDelegate = getOurWizardDelegate();
- if (newConnWizardDelegate != null)
- {
- return (isPageComplete() && newConnWizardDelegate.hasAdditionalPages() && form.isConnectionUnique());
- }
- else
- return super.canFlipToNextPage();
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION FORM...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- RSEDefaultNewConnectionWizardDelegate newConnWizardDelegate = getOurWizardDelegate();
- if (newConnWizardDelegate != null)
- {
- newConnWizardDelegate.systemTypeSelected(systemType, duringInitialization);
- }
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.ISystemNewConnectionWizardMainPage#getSystemType()
- */
- public String getSystemType() {
- RSEDefaultNewConnectionWizardDelegate newConnWizardDelegate = getOurWizardDelegate();
- return newConnWizardDelegate.getSystemType().getName();
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDelegate.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDelegate.java
deleted file mode 100644
index dcd3b4e3c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardDelegate.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-
-/**
- *
- */
-public abstract class RSENewConnectionWizardDelegate implements IRSENewConnectionWizardDelegate {
-
- private RSENewConnectionWizard wizard;
- private IRSESystemType systemType;
- private boolean isInitialized;
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#init(org.eclipse.rse.ui.wizards.RSENewConnectionWizard, org.eclipse.rse.core.IRSESystemType)
- */
- public void init(RSENewConnectionWizard wizard, IRSESystemType systemType) {
- setWizard(wizard);
- setSystemType(systemType);
- setInitialized(true);
- }
-
- protected void setWizard(RSENewConnectionWizard wizard) {
- this.wizard = wizard;
- }
-
- protected void setSystemType(IRSESystemType systemType) {
- this.systemType = systemType;
- }
-
- protected void setInitialized(boolean isInitialized) {
- this.isInitialized = true;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#getWizard()
- */
- public RSENewConnectionWizard getWizard() {
- return wizard;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#getSystemType()
- */
- public IRSESystemType getSystemType() {
- return systemType;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#isInitialized()
- */
- public boolean isInitialized() {
- return isInitialized;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#addPages()
- */
- public void addPages() {
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#canFinish()
- */
- public boolean canFinish() {
- return false;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#getNextPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getNextPage(IWizardPage page) {
- return null;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getPreviousPage(IWizardPage page) {
- return wizard.getStartingPage();
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#systemTypeChanged(org.eclipse.rse.core.IRSESystemType)
- */
- public void systemTypeChanged(IRSESystemType systemType) {
-
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardMainPage.java
deleted file mode 100644
index 43f4b2bc3..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/RSENewConnectionWizardMainPage.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * Javier Montalvo Orús (Symbian) - Bug 149151: New Connection first page should use a Listbox for systemtype
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The New Connection Wizard main page that allows selection of system type.
- */
-public class RSENewConnectionWizardMainPage extends AbstractSystemWizardPage implements Listener {
-
- protected String parentHelpId;
- protected List textSystemType;
- protected Text descriptionSystemType;
- protected IWizardPage nextPage;
- protected IRSESystemType[] restrictedSystemTypes;
-
- /**
- * Constructor.
- * @param wizard the wizard.
- * @param title the title of the wizard page.
- * @param description the description of the wizard page.
- */
- public RSENewConnectionWizardMainPage(IRSENewConnectionWizard wizard, String title, String description) {
- super(wizard, "NewConnectionSystemType", title, description);
- parentHelpId = RSEUIPlugin.HELPPREFIX + "wncc0000";
- setHelp(parentHelpId);
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage#createContents(org.eclipse.swt.widgets.Composite)
- */
- public Control createContents(Composite parent) {
-
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
- SystemWidgetHelpers.setCompositeHelp(composite_prompts, parentHelpId);
-
- String temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
-
- Label labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
- labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
-
- if (restrictedSystemTypes == null) {
- textSystemType = SystemWidgetHelpers.createSystemTypeListBox(parent, null);
- }
- else {
- String[] systemTypeNames = new String[restrictedSystemTypes.length];
-
- for (int i = 0; i < restrictedSystemTypes.length; i++) {
- systemTypeNames[i] = restrictedSystemTypes[i].getName();
- }
-
- textSystemType = SystemWidgetHelpers.createSystemTypeListBox(parent, null, systemTypeNames);
- }
-
- textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
- SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003");
-
- textSystemType.addListener(SWT.Selection, this);
-
- descriptionSystemType = SystemWidgetHelpers.createMultiLineTextField(parent,null,30);
- descriptionSystemType.setEditable(false);
-
- IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(textSystemType.getSelection()[0]);
-
- if(systemType!=null) {
- descriptionSystemType.setText(systemType.getDescription());
- }
-
- return composite_prompts;
- }
-
- public void restrictToSystemTypes(IRSESystemType[] systemTypes) {
- this.restrictedSystemTypes = systemTypes;
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage#getInitialFocusControl()
- */
- protected Control getInitialFocusControl() {
-
- if (textSystemType != null) {
- return textSystemType;
- }
- else {
- return null;
- }
- }
-
- /**
- * @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage#performFinish()
- */
- public boolean performFinish() {
- return true;
- }
-
- /**
- * @see org.eclipse.jface.wizard.WizardPage#getNextPage()
- */
- public IWizardPage getNextPage() {
-
- IWizard wizard = getWizard();
-
- // if the wizard is a new connection wizard, which should always be the case,
- // get the new connection wizard delegate for the selected system type and
- // ask for the main page
- if (wizard instanceof IRSENewConnectionWizard) {
- String systemTypeStr = textSystemType.getSelection()[0];
- IRSENewConnectionWizard newConnWizard = (IRSENewConnectionWizard)wizard;
- newConnWizard.setSelectedSystemType(RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeStr));
- return newConnWizard.getDelegate().getMainPage();
- }
- else {
- return super.getNextPage();
- }
- }
-
- /**
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
-
- if (event.type == SWT.Selection && event.widget == textSystemType) {
-
- IWizard wizard = getWizard();
-
- if (wizard instanceof IRSENewConnectionWizard) {
- String systemTypeStr = textSystemType.getSelection()[0];
- IRSENewConnectionWizard newConnWizard = (IRSENewConnectionWizard)wizard;
-
- IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeStr);
- newConnWizard.setSelectedSystemType(systemType);
- descriptionSystemType.setText(systemType.getDescription());
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java
deleted file mode 100644
index 14e0d8c47..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
-import org.eclipse.rse.core.subsystems.IServiceSubSystem;
-import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.widgets.services.ConnectorServiceElement;
-import org.eclipse.rse.ui.widgets.services.FactoryServiceElement;
-import org.eclipse.rse.ui.widgets.services.RootServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServerLauncherPropertiesServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServiceElement;
-import org.eclipse.rse.ui.widgets.services.ServicesForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizardPage implements ISubSystemPropertiesWizardPage
-{
- private ServicesForm _form;
- private IServiceSubSystemConfiguration _selectedFactory;
- private ServiceElement _root;
- private ServiceElement[] _serviceElements;
-
- public SubSystemServiceWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageName, String pageTitle, String pageDescription)
- {
- super(wizard, parentFactory, pageName, pageTitle, pageDescription);
- }
-
- public SubSystemServiceWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageDescription)
- {
- super(wizard, parentFactory, pageDescription);
- }
-
- public SubSystemServiceWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory)
- {
- super(wizard, parentFactory);
- }
-
- public Control createContents(Composite parent)
- {
- _form = new ServicesForm(getMessageLine());
- Control control = _form.createContents(parent);
-
- ServiceElement[] elements = getServiceElements();
- _root = new RootServiceElement(elements);
- _form.init(_root);
-
- return control;
- }
-
- protected ServiceElement[] getServiceElements()
- {
- if (_serviceElements == null)
- {
-
-
- IServiceSubSystemConfiguration currentFactory = (IServiceSubSystemConfiguration)getSubSystemConfiguration();
-
- String systemTypeStr = getMainPage().getSystemType();
- //IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeStr);
-
- IServiceSubSystemConfiguration[] factories = getServiceSubSystemFactories(systemTypeStr, currentFactory.getServiceType());
-
- IHost dummyHost = null;
- if (getWizard() instanceof RSENewConnectionWizard)
- {
- dummyHost = ((RSENewConnectionWizard)getWizard()).getDelegate().getDummyHost();
- }
-
- // create elements for each
- _serviceElements = new ServiceElement[factories.length];
- for (int i = 0; i < factories.length; i++)
- {
- IServiceSubSystemConfiguration factory = factories[i];
- _serviceElements[i] = new FactoryServiceElement(dummyHost, factory);
-
-
- if (factory == currentFactory)
- {
- _serviceElements[i].setSelected(true);
- }
- }
- }
- return _serviceElements;
- }
-
- protected IServiceSubSystemConfiguration[] getServiceSubSystemFactories(String systemType, Class serviceType)
- {
- List results = new ArrayList();
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType);
-
- for (int i = 0; i < factories.length; i++)
- {
- ISubSystemConfiguration factory = factories[i];
- if (factory instanceof IServiceSubSystemConfiguration)
- {
- IServiceSubSystemConfiguration sfactory = (IServiceSubSystemConfiguration)factory;
- if (sfactory.getServiceType() == serviceType)
- {
-
- results.add(sfactory);
- }
- }
- }
-
- return (IServiceSubSystemConfiguration[])results.toArray(new IServiceSubSystemConfiguration[results.size()]);
- }
-
- public boolean isPageComplete()
- {
- return true;
- }
-
- public boolean performFinish()
- {
- if (_root != null)
- {
- _root.commit();
-
- _selectedFactory = ((FactoryServiceElement)_form.getSelectedService()).getFactory();
- }
- return true;
- }
-
- protected ServerLauncherPropertiesServiceElement[] getPropertiesServiceElement()
- {
- List results = new ArrayList();
- for (int i = 0; i < _serviceElements.length; i++)
- {
- {
- ServiceElement el = _serviceElements[i];
- ServiceElement[] children = el.getChildren();
- if (children != null)
- {
- for (int c = 0; c < children.length; c++)
- {
- ServiceElement child = children[c];
- if (child instanceof ConnectorServiceElement)
- {
- ServiceElement[] cch = child.getChildren();
- if (cch != null && cch.length > 0)
- {
- ServerLauncherPropertiesServiceElement result = (ServerLauncherPropertiesServiceElement)cch[0];
- results.add(result);
- }
- }
- }
- }
- }
- }
- return (ServerLauncherPropertiesServiceElement[])results.toArray(new ServerLauncherPropertiesServiceElement[results.size()]);
- }
-
- public boolean applyValues(ISubSystem ss)
- {
- if (_selectedFactory != null)
- {
- IServiceSubSystemConfiguration currentFactory = (IServiceSubSystemConfiguration)ss.getSubSystemConfiguration();
- if (currentFactory != null)
- {
- if (_selectedFactory != currentFactory)
- {
- ((IServiceSubSystem)ss).switchServiceFactory(_selectedFactory);
- }
- //IHost realHost = ss.getHost();
- if (_root != null)
- {
- {
- ServerLauncherPropertiesServiceElement[] elements = getPropertiesServiceElement();
- if (elements.length > 0)
- {
- IServerLauncherProperties properties = elements[0].getServerLauncherProperties();
-
- IConnectorService rserv = ss.getConnectorService();
- properties.saveToProperties();
- rserv.setRemoteServerLauncherProperties(properties);
- /*
- PropertyElement[] properties = elements[i].getProperties();
- for (int p = 0; p < properties.length; p++)
- {
- PropertyElement pel = properties[p];
-
- }
- */
- //rserv.addPropertySets(sets);
-
- }
- }
- }
-
- }
- }
- return true;
- }
-
- protected IConnectorService getCustomConnectorService(IServiceSubSystemConfiguration config)
- {
- ServiceElement[] children = _root.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- ServiceElement child = children[i];
- if (child instanceof FactoryServiceElement)
- {
- FactoryServiceElement fchild = (FactoryServiceElement)child;
- if (fchild.getFactory() == config)
- {
- return fchild.getConnectorService();
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void handleVerifyComplete()
- {
- boolean complete = isPageComplete();
- clearErrorMessage();
- setPageComplete(complete);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizard.java
deleted file mode 100644
index b8ca7618e..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizard.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.SystemPerspectiveHelpers;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
-import org.eclipse.rse.core.model.ISystemProfile;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
-import org.eclipse.rse.model.DummyHost;
-import org.eclipse.rse.model.SystemStartHere;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.ui.INewWizard;
-
-/**
- * Wizard for creating a new remote systems connection.
- */
-public class SystemNewConnectionWizard
- extends AbstractSystemWizard implements INewWizard
-
-{
-
- private ISystemNewConnectionWizardMainPage mainPage;
- private SystemNewConnectionWizardRenameProfilePage rnmProfilePage;
- private ISystemNewConnectionWizardPage[] subsystemFactorySuppliedWizardPages;
- private Hashtable ssfWizardPagesPerSystemType = new Hashtable();
- private String defaultUserId;
- private String defaultConnectionName;
- private String defaultHostName;
- private String[] activeProfileNames = null;
- private int privateProfileIndex = -1;
- private ISystemProfile privateProfile = null;
- private IHost currentlySelectedConnection = null;
- private String[] restrictSystemTypesTo;
- private static String lastProfile = null;
- private boolean showProfilePageInitially = true;
- private IHost _dummyHost;
-
- /**
- * Constructor
- */
- public SystemNewConnectionWizard()
- {
- super(SystemResources.RESID_NEWCONN_TITLE,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD_ID));
- activeProfileNames = SystemStartHere.getSystemProfileManager().getActiveSystemProfileNames();
- super.setForcePreviousAndNextButtons(true);
- super.setNeedsProgressMonitor(true);
- }
-
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- if (mainPage != null)
- mainPage.restrictSystemTypes(restrictSystemTypesTo);
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- this.restrictSystemTypesTo = systemTypes;
- if (mainPage != null)
- mainPage.restrictSystemTypes(systemTypes);
- }
-
- public IHost getDummyHost()
- {
- if (_dummyHost == null)
- {
- _dummyHost = new DummyHost(mainPage.getHostName(), mainPage.getSystemType());
- }
- return _dummyHost;
- }
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class.
- */
- public void addPages()
- {
- try {
- mainPage = createMainPage(restrictSystemTypesTo);
- mainPage.setConnectionNameValidators(SystemConnectionForm.getConnectionNameValidators());
- mainPage.setCurrentlySelectedConnection(currentlySelectedConnection);
- if (defaultUserId != null)
- mainPage.setUserId(defaultUserId);
- if (defaultConnectionName != null)
- mainPage.setConnectionName(defaultConnectionName);
- if (defaultHostName != null)
- mainPage.setHostName(defaultHostName);
-
- if (restrictSystemTypesTo != null)
- mainPage.restrictSystemTypes(restrictSystemTypesTo);
-
- ISystemProfile defaultProfile = SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile();
-
- showProfilePageInitially = RSEUIPlugin.getDefault().getShowProfilePageInitially();
- /* DKM - I don't think we should force profiles into the faces of users
- * we no longer default to "private" so hopefully this would never be
- * desirable
- *
- // if there is a default private profile, we might want to show the rename profile page
- if (defaultProfile != null)
- {
- // make private profile equal to default profile
- privateProfile = defaultProfile;
-
- // get the private profile index in the list of active profiles
- for (int idx=0; (privateProfileIndex<0) && (idx<activeProfileNames.length); idx++)
- if (activeProfileNames[idx].equals(defaultProfile.getName()))
- privateProfileIndex = idx;
-
- // if profile page is to be shown initially, then add the page
- if (showProfilePageInitially) {
- rnmProfilePage = new SystemNewConnectionWizardRenameProfilePage(this) ;
- addPage(rnmProfilePage);
- }
- // otherwise, do not add profile page
- // and set the new private profile name to be the local machine name
- else {
- rnmProfilePage = null;
-
- String initProfileName = RSEUIPlugin.getLocalMachineName();
- int dotIndex = initProfileName.indexOf('.');
-
- if (dotIndex != -1) {
- initProfileName = initProfileName.substring(0, dotIndex);
- }
-
- setNewPrivateProfileName(initProfileName);
- }
- }
- else
- */
- {
- mainPage.setProfileNames(activeProfileNames);
- // if there is no connection currently selected, default the profile to
- // place the new connection into to be the first of:
- // 1. the profile the last connection was created in, in this session
- // 2. the team profile.
- if (currentlySelectedConnection == null)
- {
- if ((lastProfile == null) && (activeProfileNames!=null))
- {
- String defaultTeamName = ISystemPreferencesConstants.DEFAULT_TEAMPROFILE;
- for (int idx=0; (lastProfile==null)&&(idx<activeProfileNames.length); idx++)
- {
- if (!activeProfileNames[idx].equals(defaultTeamName))
- lastProfile = activeProfileNames[idx];
- }
- if ((lastProfile == null) && (activeProfileNames.length>0))
- lastProfile = activeProfileNames[0];
- }
- if (lastProfile != null)
- mainPage.setProfileNamePreSelection(lastProfile);
- }
- }
-
- addPage((WizardPage)mainPage);
-
- } catch (Exception exc)
- {
- SystemBasePlugin.logError("New connection: Error in createPages: ",exc);
- }
- }
-
- /**
- * Creates the wizard's main page.
- * This method is an override from the parent class.
- */
- protected ISystemNewConnectionWizardMainPage createMainPage(String[] restrictSystemTypesTo)
- {
- String pageTitle = null;
- if ((restrictSystemTypesTo==null) || (restrictSystemTypesTo.length != 1))
- pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE;
- else
- {
- String onlySystemType = restrictSystemTypesTo[0];
- if (onlySystemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL))
- pageTitle =SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE;
- else
- {
- pageTitle =SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE;
- pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType);
- }
- }
- mainPage = new SystemNewConnectionWizardDefaultMainPage(this,
- pageTitle,
- SystemResources.RESID_NEWCONN_PAGE1_DESCRIPTION);
- setOutputObject(null);
- return mainPage;
- }
- /**
- * Set the currently selected connection. Used to better default entry fields.
- */
- public void setCurrentlySelectedConnection(IHost conn)
- {
- this.currentlySelectedConnection = conn;
- }
-
- /**
- * For "new" mode, allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId)
- {
- defaultUserId = userId;
- if (mainPage != null)
- mainPage.setUserId(userId);
- }
-
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- defaultConnectionName = name;
- if (mainPage != null)
- mainPage.setConnectionName(name);
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- defaultHostName = name;
- if (mainPage != null)
- mainPage.setHostName(name);
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- boolean ok = mainPage.performFinish();
- if (!ok)
- setPageError((IWizardPage)mainPage);
- else if (ok && hasAdditionalPages())
- {
- for (int idx=0; ok && (idx<subsystemFactorySuppliedWizardPages.length); idx++)
- {
- ok = subsystemFactorySuppliedWizardPages[idx].performFinish();
- if (!ok)
- setPageError((IWizardPage)subsystemFactorySuppliedWizardPages[idx]);
- }
- }
- if (ok)
- {
- boolean cursorSet = true;
- setBusyCursor(true);
- ISystemRegistry sr = RSEUIPlugin.getDefault().getSystemRegistry();
-
- // if private profile is not null, then we have to rename the private profile
- // with the new profile name
- if (privateProfile != null)
- {
- try
- {
- String newName = activeProfileNames[privateProfileIndex];
- sr.renameSystemProfile(privateProfile, newName);
- }
- catch (SystemMessageException exc)
- {
- SystemMessageDialog.displayMessage(getShell(), exc);
-
- ok = false;
- }
- catch (Exception exc)
- {
- setBusyCursor(false);
- cursorSet = false;
- String msg = "Exception renaming profile ";
- SystemBasePlugin.logError(msg, exc);
- SystemMessageDialog.displayExceptionMessage(getShell(),exc);
- ok = false;
- }
- }
-
- if (ok)
- {
- try
- {
- String sysType = mainPage.getSystemType();
- IHost conn =
- sr.createHost(mainPage.getProfileName(), sysType,
- mainPage.getConnectionName(), mainPage.getHostName(),
- mainPage.getConnectionDescription(), mainPage.getDefaultUserId(),
- mainPage.getDefaultUserIdLocation(), subsystemFactorySuppliedWizardPages);
-
- setBusyCursor(false);
- cursorSet = false;
-
- // a tweak that is the result of UCD feedback. Phil
- if ((conn!=null) && SystemPerspectiveHelpers.isRSEPerspectiveActive())
- {
- if (sysType.equals(IRSESystemType.SYSTEMTYPE_ISERIES))
- {
- ISubSystem[] objSubSystems = sr.getSubSystemsBySubSystemConfigurationCategory("nativefiles", conn); //$NON-NLS-1$
- if ((objSubSystems != null)
- && (objSubSystems.length>0))// might be in product that doesn't have iSeries plugins
- sr.expandSubSystem(objSubSystems[0]);
- else
- sr.expandHost(conn);
- }
- else
- sr.expandHost(conn);
- }
-
- lastProfile = mainPage.getProfileName();
- setOutputObject(conn);
- } catch (Exception exc)
- {
- if (cursorSet)
- setBusyCursor(false);
- cursorSet = false;
- String msg = "Exception creating connection ";
- SystemBasePlugin.logError(msg, exc);
- SystemMessageDialog.displayExceptionMessage(getShell(),exc);
- ok = false;
- }
- }
- //getShell().setCursor(null);
- //busyCursor.dispose();
- if (cursorSet)
- setBusyCursor(false);
- return ok;
- }
- return ok;
- }
-
- // callbacks from rename page
-
- /**
- * Set the new profile name specified on the rename profile page...
- */
- protected void setNewPrivateProfileName(String newName)
- {
- activeProfileNames[privateProfileIndex] = newName;
- if (mainPage != null)
- {
- mainPage.setProfileNames(activeProfileNames);
- mainPage.setProfileNamePreSelection(newName);
- }
- }
-
- /**
- * Return the main page of this wizard
- */
- public ISystemNewConnectionWizardMainPage getMainPage()
- {
- return mainPage;
- }
- /**
- * Return the form of the main page of this wizard
- */
- public SystemConnectionForm getMainPageForm()
- {
- return ((SystemNewConnectionWizardDefaultMainPage)mainPage).getForm();
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION PAGE...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- subsystemFactorySuppliedWizardPages = getAdditionalWizardPages(systemType);
- if (!duringInitialization)
- getContainer().updateButtons();
- }
-
- /*
- * Private method to get all the wizard pages from all the subsystem factories, given a
- * system type.
- */
- protected ISystemNewConnectionWizardPage[] getAdditionalWizardPages(String systemType)
- {
- // this query is expensive, so only do it once...
- subsystemFactorySuppliedWizardPages = (ISystemNewConnectionWizardPage[])ssfWizardPagesPerSystemType.get(systemType);
- if (subsystemFactorySuppliedWizardPages == null)
- {
- // query all affected subsystems for their list of additional wizard pages...
- Vector additionalPages = new Vector();
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, true);
- for (int idx=0; idx<factories.length; idx++)
- {
- ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factories[idx].getAdapter(ISubSystemConfigurationAdapter.class);
-
- ISystemNewConnectionWizardPage[] pages = adapter.getNewConnectionWizardPages(factories[idx], this);
- if (pages != null)
- {
- for (int widx=0; widx<pages.length; widx++)
- additionalPages.addElement(pages[widx]);
- }
- }
- subsystemFactorySuppliedWizardPages = new ISystemNewConnectionWizardPage[additionalPages.size()];
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- subsystemFactorySuppliedWizardPages[idx] = (ISystemNewConnectionWizardPage)additionalPages.elementAt(idx);
- ssfWizardPagesPerSystemType.put(systemType, subsystemFactorySuppliedWizardPages);
- }
- return subsystemFactorySuppliedWizardPages;
- }
-
- /**
- * Return true if there are additional pages. This decides whether to enable the Next button
- * on the main page
- */
- protected boolean hasAdditionalPages()
- {
- return (subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length>0);
- }
-
- /**
- * Return the first additional page to show when user presses Next on the main page
- */
- protected IWizardPage getFirstAdditionalPage()
- {
- if ((subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length>0))
- {
- IWizardPage previousPage = (IWizardPage)mainPage;
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- {
- ((IWizardPage)subsystemFactorySuppliedWizardPages[idx]).setPreviousPage(previousPage);
- previousPage = (IWizardPage)subsystemFactorySuppliedWizardPages[idx];
- }
- return (IWizardPage)subsystemFactorySuppliedWizardPages[0];
- }
- else
- return null;
- }
-
- // --------------------
- // PARENT INTERCEPTS...
- // --------------------
-
- /**
- * Intercept of Wizard method so we can get the Next button behaviour to work right for the
- * dynamically managed additional wizard pages.
- */
- public IWizardPage getNextPage(IWizardPage page)
- {
- if (!hasAdditionalPages() || (page==rnmProfilePage))
- return super.getNextPage(page);
- else
- {
- int index = getAdditionalPageIndex(page);
- if ((index == (subsystemFactorySuppliedWizardPages.length - 1)))
- // last page or page not found
- return null;
- return (IWizardPage)subsystemFactorySuppliedWizardPages[index + 1];
- }
- }
-
- private int getAdditionalPageIndex(IWizardPage page)
- {
- for (int idx=0; idx<subsystemFactorySuppliedWizardPages.length; idx++)
- {
- if (page == subsystemFactorySuppliedWizardPages[idx])
- return idx;
- }
- return -1;
- }
-
- /**
- * Intercept of Wizard method so we can take into account our additional pages
- */
- public boolean canFinish()
- {
- boolean ok = super.canFinish();
- if (ok && hasAdditionalPages())
- {
- for (int idx=0; ok && (idx<subsystemFactorySuppliedWizardPages.length); idx++)
- ok = subsystemFactorySuppliedWizardPages[idx].isPageComplete();
- }
- return ok;
- }
-} // end class \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardDefaultMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardDefaultMainPage.java
deleted file mode 100644
index 3ef0e1e58..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardDefaultMainPage.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.ui.ISystemConnectionFormCaller;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemConnectionForm;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-
-/**
- * Default main page of the "New Connection" wizard.
- * This page asks for the primary information, including:
- * <ul>
- * <li>Connection Name
- * <li>Hostname/IP-address
- * <li>UserId
- * <li>Description
- * </ul>
- */
-
-public class SystemNewConnectionWizardDefaultMainPage
- //extends WizardPage
- extends AbstractSystemWizardPage
- implements ISystemNewConnectionWizardMainPage,
- ISystemMessageLine, ISystemConnectionFormCaller
-{
- protected String[] restrictSystemTypesTo;
- protected SystemConnectionForm form;
- protected String parentHelpId;
-
- /**
- * Constructor. Use this when you want to supply your own title and
- * description strings.
- */
- public SystemNewConnectionWizardDefaultMainPage(Wizard wizard,
- String title,
- String description)
- {
- super(wizard, "NewConnection", title, description);
- parentHelpId = RSEUIPlugin.HELPPREFIX + "wncc0000"; //$NON-NLS-1$
- setHelp(parentHelpId);
- form = getForm();
- }
-
- /**
- * Call this to restrict the system type that the user is allowed to choose
- */
- public void restrictSystemType(String systemType)
- {
- restrictSystemTypesTo = new String[1];
- restrictSystemTypesTo[0] = systemType;
- form.restrictSystemTypes(restrictSystemTypesTo);
- }
- /**
- * Call this to restrict the system types that the user is allowed to choose
- */
- public void restrictSystemTypes(String[] systemTypes)
- {
- restrictSystemTypesTo = systemTypes;
- form.restrictSystemTypes(restrictSystemTypesTo);
- }
-
- /**
- * Return the main wizard typed
- */
- private SystemNewConnectionWizard getOurWizard()
- {
- IWizard wizard = getWizard();
- if (wizard instanceof SystemNewConnectionWizard)
- return (SystemNewConnectionWizard)wizard;
- else
- return null;
- }
-
-
- /**
- * Overrride this if you want to supply your own form. This may be called
- * multiple times so please only instantatiate if the form instance variable
- * is null, and then return the form instance variable.
- * @see org.eclipse.rse.ui.SystemConnectionForm
- */
- protected SystemConnectionForm getForm()
- {
- if (form == null)
- form = new SystemConnectionForm(this,this);
- return form;
- }
- /**
- * Call this to specify a validator for the connection name. It will be called per keystroke.
- */
- public void setConnectionNameValidators(ISystemValidator[] v)
- {
- form.setConnectionNameValidators(v);
- }
- /**
- * Call this to specify a validator for the hostname. It will be called per keystroke.
- */
- public void setHostNameValidator(ISystemValidator v)
- {
- form.setHostNameValidator(v);
- }
- /**
- * Call this to specify a validator for the userId. It will be called per keystroke.
- */
- public void setUserIdValidator(ISystemValidator v)
- {
- form.setUserIdValidator(v);
- }
-
- /**
- * This method allows setting of the initial user Id. Sometimes subsystems
- * like to have their own default userId preference page option. If so, query
- * it and set it here by calling this.
- */
- public void setUserId(String userId)
- {
- form.setUserId(userId);
- }
-
- /**
- * Set the profile names to show in the combo
- */
- public void setProfileNames(String[] names)
- {
- form.setProfileNames(names);
- }
- /**
- * Set the profile name to preselect
- */
- public void setProfileNamePreSelection(String name)
- {
- form.setProfileNamePreSelection(name);
- }
-
- /**
- * Set the currently selected connection so as to better initialize input fields
- */
- public void setCurrentlySelectedConnection(IHost connection)
- {
- form.setCurrentlySelectedConnection(connection);
- }
-
- /**
- * Preset the connection name
- */
- public void setConnectionName(String name)
- {
- form.setConnectionName(name);
- }
- /**
- * Preset the host name
- */
- public void setHostName(String name)
- {
- form.setHostName(name);
- }
-
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- */
- public Control createContents(Composite parent)
- {
- return form.createContents(parent, SystemConnectionForm.CREATE_MODE, parentHelpId);
- }
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return form.getInitialFocusControl();
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- return form.verify(true);
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return user-entered System Type.
- * Call this after finish ends successfully.
- */
- public String getSystemType()
- {
- return form.getSystemType();
- }
- /**
- * Return user-entered Connection Name.
- * Call this after finish ends successfully.
- */
- public String getConnectionName()
- {
- return form.getConnectionName();
- }
- /**
- * Return user-entered Host Name.
- * Call this after finish ends successfully.
- */
- public String getHostName()
- {
- return form.getHostName();
- }
- /**
- * Return user-entered Default User Id.
- * Call this after finish ends successfully.
- */
- public String getDefaultUserId()
- {
- return form.getDefaultUserId();
- }
- /**
- * Return location where default user id is to be set.
- * @see org.eclipse.rse.core.ISystemUserIdConstants
- */
- public int getDefaultUserIdLocation()
- {
- return form.getUserIdLocation();
- }
- /**
- * Return user-entered Description.
- * Call this after finish ends successfully.
- */
- public String getConnectionDescription()
- {
- return form.getConnectionDescription();
- }
- /**
- * Return name of profile to contain new connection.
- * Call this after finish ends successfully.
- */
- public String getProfileName()
- {
- return form.getProfileName();
- }
-
- // ISystemMessageLine methods
-// public void clearMessage()
-// {
-// setMessage(null);
-// }
- //public void clearErrorMessage()
- //{
- //setErrorMessage(null);
- //}
-
- public Object getLayoutData()
- {
- return null;
- }
-
- public void setLayoutData(Object gridData)
- {
- }
-
-
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- */
- public boolean isPageComplete()
- {
- //System.out.println("Inside isPageComplete. " + form.isPageComplete());
- if (form!=null)
- return form.isPageComplete() && form.isConnectionUnique();
- else
- return false;
- }
-
- /**
- * Intercept of WizardPage so we know when Next is pressed
- */
- public IWizardPage getNextPage()
- {
- //if (wizard == null)
- //return null;
- //return wizard.getNextPage(this);
-
- SystemNewConnectionWizard newConnWizard = getOurWizard();
- if (newConnWizard != null)
- {
- return newConnWizard.getFirstAdditionalPage();
- }
- else
- return super.getNextPage();
- }
- /**
- * Intercept of WizardPge so we know when the wizard framework is deciding whether
- * to enable next or not.
- */
- public boolean canFlipToNextPage()
- {
- //return isPageComplete() && getNextPage() != null;
-
- SystemNewConnectionWizard newConnWizard = getOurWizard();
- if (newConnWizard != null)
- {
- return (isPageComplete() && newConnWizard.hasAdditionalPages() && form.isConnectionUnique());
- }
- else
- return super.canFlipToNextPage();
- }
-
- // ----------------------------------------
- // CALLBACKS FROM SYSTEM CONNECTION FORM...
- // ----------------------------------------
- /**
- * Event: the user has selected a system type.
- */
- public void systemTypeSelected(String systemType, boolean duringInitialization)
- {
- SystemNewConnectionWizard newConnWizard = getOurWizard();
- if (newConnWizard != null)
- {
- newConnWizard.systemTypeSelected(systemType, duringInitialization);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java
deleted file mode 100644
index f423a463c..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.internal.model.SystemProfileManager;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemProfileForm;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * First page of the New Connection wizard when creating
- * the very first connection.
- * <p>
- * This page asks for a unique personal name for the private profile.
- */
-
-public class SystemNewConnectionWizardRenameProfilePage
- extends AbstractSystemWizardPage
- implements
- ISystemMessageLine
-{
-
- protected SystemProfileForm form;
-
- /**
- * Constructor.
- */
- public SystemNewConnectionWizardRenameProfilePage(Wizard wizard)
- {
- super(wizard, "RenamePrivateProfile",
- SystemResources.RESID_RENAMEDEFAULTPROFILE_PAGE1_TITLE,
- SystemResources.RESID_RENAMEDEFAULTPROFILE_PAGE1_DESCRIPTION);
- form = getForm();
- setHelp(RSEUIPlugin.HELPPREFIX + "wncp0000");
- }
-
- /**
- * Return our hosting wizard
- */
- protected SystemNewConnectionWizard getOurWizard()
- {
- return (SystemNewConnectionWizard)getWizard();
- }
-
- /**
- * Overrride this if you want to supply your own form. This may be called
- * multiple times so please only instantatiate if the form instance variable
- * is null, and then return the form instance variable.
- * @see org.eclipse.rse.ui.SystemProfileForm
- */
- protected SystemProfileForm getForm()
- {
- if (form == null)
- form = new SystemProfileForm(this,this,null, true);
- //SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile());
- return form;
- }
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- */
- public Control createContents(Composite parent)
- {
- Control c = form.createContents(parent);
- form.getInitialFocusControl().setFocus();
- String initProfileName = SystemProfileManager.getDefaultPrivateSystemProfileName();
- form.setProfileName(initProfileName);
- return c;
- }
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return form.getInitialFocusControl();
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- return form.verify();
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return name of profile to contain new connection.
- * Call this after finish ends successfully.
- */
- public String getProfileName()
- {
- return form.getProfileName();
- }
-
- // ISystemMessageLine methods
-// public void clearMessage()
-// {
-// setMessage(null);
-// }
- //public void clearErrorMessage()
- //{
- //setErrorMessage(null);
- //}
-
- public Object getLayoutData()
- {
- return null;
- }
-
- public void setLayoutData(Object gridData)
- {
- }
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- */
- public boolean isPageComplete()
- {
- boolean ok = false;
- if (form!=null)
- {
- ok = form.isPageComplete();
- if (ok
- && isCurrentPage()) // defect 41831
- getOurWizard().setNewPrivateProfileName(form.getProfileName());
- }
- return ok;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizard.java
deleted file mode 100644
index 2e0b5f4b2..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizard.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.rse.core.SystemBasePlugin;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-
-/**
- * Wizard for creating a new remote system profile.
- */
-public class SystemNewProfileWizard
- extends AbstractSystemWizard
-
-{
-
- private SystemNewProfileWizardMainPage mainPage;
-
- /**
- * Constructor
- */
- public SystemNewProfileWizard()
- {
- super(SystemResources.RESID_NEWPROFILE_TITLE,
- RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD_ID));
- }
-
- /**
- * Creates the wizard pages.
- * This method is an override from the parent Wizard class.
- */
- public void addPages()
- {
- try {
- mainPage = createMainPage();
- addPage(mainPage);
- //super.addPages();
- } catch (Exception exc)
- {
- SystemBasePlugin.logError("New connection: Error in createPages: ",exc);
- }
- }
-
- /**
- * Creates the wizard's main page.
- * This method is an override from the parent class.
- */
- protected SystemNewProfileWizardMainPage createMainPage()
- {
- mainPage = new SystemNewProfileWizardMainPage(this);
- return mainPage;
- }
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- boolean ok = true;
- if (mainPage.performFinish())
- {
- //SystemMessage.showInformationMessage(getShell(),"Finish pressed.");
- ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
- String name = mainPage.getProfileName();
- boolean makeActive = mainPage.getMakeActive();
- try
- {
- sr.createSystemProfile(name,makeActive);
- } catch (Exception exc)
- {
- String msg = "Exception creating profile ";
- SystemBasePlugin.logError(msg,exc);
- //System.out.println(msg + exc.getMessage() + ": " + exc.getClass().getName());
- SystemMessageDialog.displayExceptionMessage(getShell(),exc);
- }
- return ok;
- }
- else
- ok = false;
- return ok;
- }
-
-} // end class \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java
deleted file mode 100644
index 760e11a31..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.messages.ISystemMessageLine;
-import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorProfileName;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Default main page of the "New Profile" wizard.
- * This page asks for the following information:
- * <ul>
- * <li>Profile name
- * </ul>
- */
-
-public class SystemNewProfileWizardMainPage
- extends AbstractSystemWizardPage
- implements
- ISystemMessageLine
-{
-
- private String profileName;
- private Text textName;
- private Button makeActiveCB;
- private boolean makeActive;
- private SystemMessage errorMessage;
- protected ISystemValidator nameValidator;
- private static final String HELPID_PREFIX = RSEUIPlugin.HELPPREFIX + "wnpr";
-
- /**
- * Constructor.
- */
- public SystemNewProfileWizardMainPage(Wizard wizard)
- {
- super(wizard, "NewProfile",
- SystemResources.RESID_NEWPROFILE_PAGE1_TITLE,
- SystemResources.RESID_NEWPROFILE_PAGE1_DESCRIPTION);
- nameValidator = new ValidatorProfileName(RSEUIPlugin.getTheSystemRegistry().getAllSystemProfileNamesVector());
- setHelp(HELPID_PREFIX+"0000");
- }
-
- /**
- * CreateContents is the one method that must be overridden from the parent class.
- * In this method, we populate an SWT container with widgets and return the container
- * to the caller (JFace). This is used as the contents of this page.
- */
- public Control createContents(Composite parent)
- {
- // Inner composite
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
-
- // Name
- textName = SystemWidgetHelpers.createLabeledTextField(
- composite_prompts, null, SystemResources.RESID_NEWPROFILE_NAME_LABEL, SystemResources.RESID_NEWPROFILE_NAME_TOOLTIP);
- textName.setTextLimit(ValidatorProfileName.MAX_PROFILENAME_LENGTH); // defect 41816
- //SystemWidgetHelpers.setHelp(textName, HELPID_PREFIX+"0001", HELPID_PREFIX+"0000");
- SystemWidgetHelpers.setHelp(textName, HELPID_PREFIX+"0001");
-
- // Make active
- makeActiveCB = SystemWidgetHelpers.createCheckBox(
- composite_prompts, nbrColumns, null, SystemResources.RESID_NEWPROFILE_MAKEACTIVE_LABEL, SystemResources.RESID_NEWPROFILE_MAKEACTIVE_TOOLTIP);
- makeActiveCB.setSelection(true);
- //SystemWidgetHelpers.setHelp(makeActiveCB, HELPID_PREFIX+"0002", HELPID_PREFIX+"0000");
- SystemWidgetHelpers.setHelp(makeActiveCB, HELPID_PREFIX+"0002");
-
- // Verbage
- addGrowableFillerLine(composite_prompts, nbrColumns);
- addSeparatorLine(composite_prompts, nbrColumns);
- SystemWidgetHelpers.createVerbiage(composite_prompts, SystemResources.RESID_NEWPROFILE_VERBAGE, nbrColumns, false, 200);
-
- textName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateNameInput();
- }
- }
- );
-
- // SET CONTEXT HELP IDS...
- //SystemWidgetHelpers.setHelp(textName, HELPID_PREFIX + "0001", HELPID_PREFIX + "0000");
- //SystemWidgetHelpers.setHelp(makeActiveCB, HELPID_PREFIX + "0002", HELPID_PREFIX + "0000");
-
- return composite_prompts;
- }
- /**
- * Return the Control to be given initial focus.
- * Override from parent. Return control to be given initial focus.
- */
- protected Control getInitialFocusControl()
- {
- return textName;
- }
-
- /**
- * This hook method is called whenever the text changes in the input field.
- * The default implementation delegates the request to an <code>ISystemValidator</code> object.
- * If the <code>ISystemValidator</code> reports an error the error message is displayed
- * in the Dialog's message line.
- */
- protected SystemMessage validateNameInput()
- {
- errorMessage= nameValidator.validate(textName.getText());
- if (errorMessage != null)
- setErrorMessage(errorMessage);
- else
- clearErrorMessage();
- setPageComplete(errorMessage==null);
- return errorMessage;
- }
-
- /**
- * Completes processing of the wizard. If this
- * method returns true, the wizard will close;
- * otherwise, it will stay active.
- * This method is an override from the parent Wizard class.
- *
- * @return whether the wizard finished successfully
- */
- public boolean performFinish()
- {
- boolean ok = (validateNameInput()==null);
- if (ok)
- {
- profileName = textName.getText().trim();
- makeActive = makeActiveCB.getSelection();
- }
- return ok;
- }
-
- // --------------------------------- //
- // METHODS FOR EXTRACTING USER DATA ...
- // --------------------------------- //
- /**
- * Return user-entered profile name.
- * Call this after finish ends successfully.
- */
- public String getProfileName()
- {
- return profileName;
- }
- /**
- * Return user-entered decision to make the new profile active.
- * Call this after finish ends successfully.
- */
- public boolean getMakeActive()
- {
- return makeActive;
- }
-
-
- // ISystemMessageLine methods
-// public void clearMessage()
-// {
-// setMessage(null);
-// }
- //public void clearErrorMessage()
- //{
- //setErrorMessage(null);
- //}
-
- public Object getLayoutData()
- {
- return null;
- }
-
- public void setLayoutData(Object gridData)
- {
- }
-
- /**
- * Return true if the page is complete, so to enable Finish.
- * Called by wizard framework.
- */
- public boolean isPageComplete()
- {
- return (textName.getText().trim().length()>0);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java
deleted file mode 100644
index cf9280a70..000000000
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.wizards;
-
-import java.util.List;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
-import org.eclipse.rse.ui.ISystemVerifyListener;
-import org.eclipse.rse.ui.SystemResources;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater;
-import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardPropertyPage;
-import org.eclipse.rse.ui.view.monitor.TabFolderLayout;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-
-/**
- * Wizard page that display the property pages for a given subsystem in the
- * connection
- *
- */
-public class SystemSubSystemsPropertiesWizardPage
- extends AbstractSystemNewConnectionWizardPage
- implements ISystemVerifyListener, ISubSystemPropertiesWizardPage
-{
- private ISystemConnectionWizardPropertyPage _thePage; // only if there's one page
- private CTabFolder _folder;
- private List _propertyPages;
- private String _lastHostName;
- /**
- * Constructor
- */
- public SystemSubSystemsPropertiesWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, List propertyPages)
- {
- //super(wizard, parentFactory); todo: use this when we enable port
- // selection
- super(
- wizard,
- parentFactory,
- parentFactory.getId(),
- // removed subsystem append since not correct for some languages
- parentFactory.getName(),
- //+ " " + SystemResources.RESID_SUBSYSTEM_TYPE_VALUE),
- //" SubSystem Properties", //TODO create
- // message for
- // this
- //"Configure properties of this subsystem"
- SystemResources.RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION
- );
- _propertyPages = propertyPages;
- }
-
- /**
- * @see AbstractSystemWizardPage#getInitialFocusControl()
- */
- protected Control getInitialFocusControl()
- {
- return getControl();
- }
-
- /*
- * Updates wiard property pages with new hostname
- */
- protected void hostNameUpdated(String hostName)
- {
- if (_folder != null)
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- ISystemConnectionWizardPropertyPage page =
- (ISystemConnectionWizardPropertyPage) _folder.getItem(i).getData();
- page.setHostname(hostName);
- }
- }
-
- }
-
- /**
- * @see AbstractSystemWizardPage#createContents(Composite)
- */
- public Control createContents(Composite parent)
- {
- int nbrColumns = 2;
- Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
- int numAdded = 0;
- if (_propertyPages.size() == 1)
- {
- PropertyPage page = (PropertyPage)_propertyPages.get(0);
- if (page != null && page instanceof ISystemConnectionWizardPropertyPage)
- {
- ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page;
- cpage.setSubSystemConfiguration(parentFactory);
- page.createControl(composite_prompts);
- _thePage = cpage;
-
- //set the hostname for the page in case it's required
- cpage.setHostname(getMainPage().getHostName());
-
- numAdded++;
- }
- }
- else
- {
- _folder = new CTabFolder(composite_prompts, SWT.NONE);
- _folder.setLayout(new TabFolderLayout());
-
-
- for (int i = 0; i < _propertyPages.size(); i++)
- {
- PropertyPage page = (PropertyPage)_propertyPages.get(i);
- if (page != null && page instanceof ISystemConnectionWizardPropertyPage)
- {
- ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page;
- cpage.setSubSystemConfiguration(parentFactory);
-
-
- CTabItem titem = new CTabItem(_folder, SWT.NULL, numAdded);
- titem.setData(page);
- page.createControl(_folder);
- titem.setText(page.getTitle());
- try
- {
- titem.setControl(page.getControl());
-
- }
- catch (Exception e)
- {
- // TODO why does the tabfolder hit exception the
- // first tiem setcontrol is called?
- }
-
- //set the hostname for the page in case it's required
- cpage.setHostname(getMainPage().getHostName());
-
- numAdded++;
- }
- }
- }
- if (numAdded == 0)
- {
-
- }
- addVerifyListener();
-
- return composite_prompts;
- }
-
- /**
- * @see ISystemWizardPage#performFinish()
- */
- public boolean performFinish()
- {
- return true;
- }
-
- public boolean applyValues(ISubSystem ss)
- {
- boolean result = true;
- if (_folder != null)
- {
- for (int i = 0; i < _folder.getItemCount() && result; i++)
- {
- ISystemConnectionWizardPropertyPage page =
- (ISystemConnectionWizardPropertyPage) _folder.getItem(i).getData();
- result = page.applyValues(ss.getConnectorService());
- }
- }
- else if (_thePage != null)
- {
- _thePage.applyValues(ss.getConnectorService());
- }
- return result;
- }
-
- /**
- * Return true if the page is complete, so to enable Finish. Called by
- * wizard framework.
- */
- public boolean isPageComplete()
- {
- String hostName = getMainPage().getHostName();
- if (!hostName.equals(_lastHostName))
- {
- hostNameUpdated(hostName);
- _lastHostName = hostName;
- }
- boolean result = true;
- if (_folder != null)
- {
- for (int i = 0; i < _folder.getItemCount() && result; i++)
- {
- if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater)
- {
- ISystemConnectionWizardErrorUpdater page =
- (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData();
- result = page.isPageComplete();
- }
- }
- }
- else if (_thePage != null)
- {
- if (_thePage instanceof ISystemConnectionWizardErrorUpdater)
- {
- result = ((ISystemConnectionWizardErrorUpdater)_thePage).isPageComplete();
- }
- }
- return result;
-
- }
-
- protected void addVerifyListener()
- {
- if (_folder != null)
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater)
- {
- ISystemConnectionWizardErrorUpdater page =
- (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData();
- page.addVerifyListener(this);
- }
- }
- }
- else if (_thePage != null)
- {
- if (_thePage instanceof ISystemConnectionWizardErrorUpdater)
- {
- ((ISystemConnectionWizardErrorUpdater)_thePage).addVerifyListener(this);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void handleVerifyComplete()
- {
- boolean complete = isPageComplete();
- if (!complete)
- {
- if (_folder != null)
- {
- for (int i = 0; i < _folder.getItemCount(); i++)
- {
- if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater)
- {
- ISystemConnectionWizardErrorUpdater page =
- (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData();
- String error = page.getTheErrorMessage();
- if (error != null && !error.equals(""))
- {
- setErrorMessage(_folder.getItem(i).getText() + ": " + page.getTheErrorMessage());
- }
- }
- }
- }
- else if (_thePage != null)
- {
- if (_thePage instanceof ISystemConnectionWizardErrorUpdater)
- {
- ((ISystemConnectionWizardErrorUpdater)_thePage).getTheErrorMessage();
- }
- }
- }
- else
- {
- clearErrorMessage();
- }
- setPageComplete(complete);
- }
-} \ No newline at end of file

Back to the top