mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 22:25:25 +02:00
[281371] Check box Only create filter in this connection doesn't work
This commit is contained in:
parent
dd742c05ce
commit
acd2ee1a81
1 changed files with 46 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,12 +12,17 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* David McKnight (IBM) - [281371] Check box Only create filter in this connection doesn't work
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.processes.ui.actions;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterPool;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterPoolWrapperInformation;
|
||||
import org.eclipse.rse.core.subsystems.SubSystem;
|
||||
import org.eclipse.rse.internal.processes.ui.SystemProcessesResources;
|
||||
import org.eclipse.rse.processes.ui.SystemProcessFilterStringEditPane;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
|
@ -26,10 +31,9 @@ import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction;
|
|||
import org.eclipse.rse.ui.filters.dialogs.SystemNewFilterWizard;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
public class SystemNewProcessFilterAction extends SystemNewFilterAction
|
||||
{
|
||||
|
||||
private SubSystem _selectedSubSystem;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
@ -69,4 +73,42 @@ public class SystemNewProcessFilterAction extends SystemNewFilterAction
|
|||
wizard.setPage1Description(SystemProcessesResources.RESID_NEWPROCESSFILTER_PAGE1_DESCRIPTION);
|
||||
wizard.setFilterStringEditPane(new SystemProcessFilterStringEditPane(wizard.getShell()));
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
if (_selectedSubSystem != null){
|
||||
setAllowFilterPoolSelection(_selectedSubSystem.getFilterPoolReferenceManager().getReferencedSystemFilterPools());
|
||||
}
|
||||
else {
|
||||
// disallow filter pool select (because this is from a filter pool)
|
||||
setAllowFilterPoolSelection((ISystemFilterPool[])null);
|
||||
setAllowFilterPoolSelection((ISystemFilterPoolWrapperInformation)null);
|
||||
|
||||
callbackConfigurator = null;
|
||||
callbackConfiguratorCalled = false;
|
||||
}
|
||||
super.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the selection changes in the systems view. This determines
|
||||
* the input object for the command and whether to enable or disable
|
||||
* the action.
|
||||
*
|
||||
* @param selection the current seleciton
|
||||
* @return whether to enable or disable the action
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
_selectedSubSystem = null;
|
||||
Iterator e = selection.iterator();
|
||||
Object selected = e.next();
|
||||
|
||||
if (selected != null && selected instanceof SubSystem)
|
||||
{
|
||||
_selectedSubSystem = (SubSystem) selected;
|
||||
}
|
||||
|
||||
return super.updateSelection(selection);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue