/* (non-Javadoc) * @see org.eclipse.swt.widgets.Control#setEnabled(boolean) */ public void setEnabled(boolean enabled) { fTree.getControl().setEnabled(enabled); if (enabled) { updateButtons(); } else { fSelectButton.setEnabled(false); fSelectAllButton.setEnabled(false); fDeselectButton.setEnabled(false); fDeselectAllButton.setEnabled(false); fSelectRequiredButton.setEnabled(false); fCountLabel.setText(""); // $NON-NLS-1$ } fModeLabel.setEnabled(enabled); fPluginModeButton.setEnabled(enabled); fFeaureModeButton.setEnabled(enabled); fShowLabel.setEnabled(enabled); fShowPluginsButton.setEnabled(enabled); fShowSourceButton.setEnabled(enabled); boolean isPluginMode = !fFeaureModeButton.getSelection(); fGroupLabel.setEnabled(enabled && isPluginMode); if (fGroupCombo != null) { fGroupCombo.setEnabled(enabled && isPluginMode); } else { fGroupComboPart.setEnabled(enabled && isPluginMode); } }
/** * Set the container to display in the tree or <code>null</code> to disable the tree * * @param input bundle container or <code>null</code> */ public void setInput(ITargetDefinition input) { fTargetDefinition = input; // Update the cached data fFileBundleMapping = null; fAllBundles.clear(); if (input == null || !input.isResolved()) { fTree.setInput(Messages.TargetContentsGroup_10); setEnabled(false); return; } IResolvedBundle[] allResolvedBundles = input.getAllBundles(); if (allResolvedBundles == null || allResolvedBundles.length == 0) { fTree.setInput(Messages.TargetContentsGroup_11); setEnabled(false); return; } for (int i = 0; i < allResolvedBundles.length; i++) { fAllBundles.add(allResolvedBundles[i]); } boolean isFeatureMode = ((TargetDefinition) fTargetDefinition).getUIMode() == TargetDefinition.MODE_FEATURE; fFeaureModeButton.setSelection(isFeatureMode); fPluginModeButton.setSelection(!isFeatureMode); fGroupLabel.setEnabled(!isFeatureMode); fTree.getControl().setRedraw(false); fTree.setInput(fTargetDefinition); fTree.expandAll(); updateCheckState(); updateButtons(); setEnabled(true); fTree.getControl().setRedraw(true); }