mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
[api][171530] Add a setEditable to the SystemFilterStringEditPane hierarchy.
This commit is contained in:
parent
9710d904bf
commit
3a0efdabdc
6 changed files with 95 additions and 16 deletions
|
@ -99,6 +99,7 @@ public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
setEditable(editable);
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +135,17 @@ public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane {
|
||||||
textDevr.setText(inputFilterString.substring(idx+1));
|
textDevr.setText(inputFilterString.substring(idx+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.rse.ui.filters.SystemFilterStringEditPane#setEditable(boolean)
|
||||||
|
*/
|
||||||
|
public void setEditable(boolean editable) {
|
||||||
|
super.setEditable(editable);
|
||||||
|
enable(textDevr, editable);
|
||||||
|
enable(textTeam, editable);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* This is called in the change filter dialog when the user selects "new", or selects another string.
|
* This is called in the change filter dialog when the user selects "new", or selects another string.
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.eclipse.rse.files.ui;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
||||||
import org.eclipse.rse.core.SystemBasePlugin;
|
import org.eclipse.rse.core.SystemBasePlugin;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
|
import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
|
||||||
|
@ -64,11 +65,13 @@ public class SystemFileFilterStringEditPane
|
||||||
{
|
{
|
||||||
// GUI widgets
|
// GUI widgets
|
||||||
protected Button filesOnlyCheckBox;
|
protected Button filesOnlyCheckBox;
|
||||||
//protected Button testButton;
|
protected Button subsetByFileNameRadioButton;
|
||||||
protected Button subsetByFileNameRadioButton, subsetByFileTypesRadioButton;
|
protected Button subsetByFileTypesRadioButton;
|
||||||
protected Button selectTypesButton;
|
protected Button selectTypesButton;
|
||||||
protected Label labelFile, labelTypes;
|
protected Label labelFile;
|
||||||
protected Text textFile, textTypes;
|
protected Label labelTypes;
|
||||||
|
protected Text textFile;
|
||||||
|
protected Text textTypes;
|
||||||
protected SystemRemoteFolderCombo folderCombo;
|
protected SystemRemoteFolderCombo folderCombo;
|
||||||
// limits
|
// limits
|
||||||
protected int filterFileLength = 256;
|
protected int filterFileLength = 256;
|
||||||
|
@ -150,6 +153,23 @@ public class SystemFileFilterStringEditPane
|
||||||
if (folderCombo != null)
|
if (folderCombo != null)
|
||||||
folderCombo.setTextLimit(max);
|
folderCombo.setTextLimit(max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.rse.ui.filters.SystemFilterStringEditPane#setEditable(boolean)
|
||||||
|
*/
|
||||||
|
public void setEditable(boolean editable) {
|
||||||
|
super.setEditable(editable);
|
||||||
|
enable(filesOnlyCheckBox, editable);
|
||||||
|
enable(subsetByFileNameRadioButton, editable);
|
||||||
|
enable(selectTypesButton, editable);
|
||||||
|
enable(labelFile, editable);
|
||||||
|
enable(textFile, editable);
|
||||||
|
enable(folderCombo, editable);
|
||||||
|
enable(subsetByFileTypesRadioButton, editable);
|
||||||
|
enable(labelTypes, editable);
|
||||||
|
enable(textTypes, editable);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Existing strings are used to aid in uniqueness validation.
|
* Existing strings are used to aid in uniqueness validation.
|
||||||
*/
|
*/
|
||||||
|
@ -304,6 +324,7 @@ public class SystemFileFilterStringEditPane
|
||||||
selectTypesButton.addSelectionListener(this);
|
selectTypesButton.addSelectionListener(this);
|
||||||
filesOnlyCheckBox.addSelectionListener(this);
|
filesOnlyCheckBox.addSelectionListener(this);
|
||||||
|
|
||||||
|
setEditable(editable);
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}
|
}
|
||||||
private void updateGridData(Control widget, int gridColumns)
|
private void updateGridData(Control widget, int gridColumns)
|
||||||
|
|
|
@ -271,6 +271,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo
|
||||||
*/
|
*/
|
||||||
public void setEnabled(boolean enabled)
|
public void setEnabled(boolean enabled)
|
||||||
{
|
{
|
||||||
|
folderLabel.setEnabled(enabled);
|
||||||
folderCombo.setEnabled(enabled);
|
folderCombo.setEnabled(enabled);
|
||||||
browseButton.setEnabled(enabled);
|
browseButton.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,25 @@ public class SystemProcessFilterStringEditPane extends
|
||||||
// INPUT/CONFIGURATION METHODS...
|
// INPUT/CONFIGURATION METHODS...
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.rse.ui.filters.SystemFilterStringEditPane#setEditable(boolean)
|
||||||
|
*/
|
||||||
|
public void setEditable(boolean editable) {
|
||||||
|
super.setEditable(editable);
|
||||||
|
enable(lblStatus, editable);
|
||||||
|
enable(lblExeName, editable);
|
||||||
|
enable(lblUserName, editable);
|
||||||
|
enable(lblGid, editable);
|
||||||
|
enable(txtExeName, editable);
|
||||||
|
enable(txtUserName, editable);
|
||||||
|
enable(txtGid, editable);
|
||||||
|
enable(lblMinVM, editable);
|
||||||
|
enable(lblMaxVM, editable);
|
||||||
|
enable(txtMinVM, editable);
|
||||||
|
enable(txtMaxVM, editable);
|
||||||
|
enable(chkBoxUnlimitedVM, editable);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call this to override the text limit for the filter name, from the default of 256.
|
* Call this to override the text limit for the filter name, from the default of 256.
|
||||||
*/
|
*/
|
||||||
|
@ -289,6 +308,7 @@ public class SystemProcessFilterStringEditPane extends
|
||||||
|
|
||||||
chkBoxUnlimitedVM.addSelectionListener(this);
|
chkBoxUnlimitedVM.addSelectionListener(this);
|
||||||
|
|
||||||
|
setEditable(editable);
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,8 +565,8 @@ public class SystemChangeFilterPane extends SystemBaseForm
|
||||||
listView.setEnabled(false);
|
listView.setEnabled(false);
|
||||||
if (strings.length > 0)
|
if (strings.length > 0)
|
||||||
editpane.setFilterString(strings[0], 0);
|
editpane.setFilterString(strings[0], 0);
|
||||||
editPaneComposite.setEnabled(false);
|
// editPaneComposite.setEnabled(false);
|
||||||
//editpane.setEditable(false);
|
editpane.setEditable(false);
|
||||||
setPageComplete(true);
|
setPageComplete(true);
|
||||||
}
|
}
|
||||||
else if (!getSupportsMultipleStrings())
|
else if (!getSupportsMultipleStrings())
|
||||||
|
|
|
@ -83,16 +83,18 @@ public class SystemFilterStringEditPane implements SelectionListener
|
||||||
protected boolean newMode = true;
|
protected boolean newMode = true;
|
||||||
protected boolean changeFilterMode = false;
|
protected boolean changeFilterMode = false;
|
||||||
protected boolean ignoreChanges;
|
protected boolean ignoreChanges;
|
||||||
//protected boolean editable = true;
|
protected boolean editable = true;
|
||||||
|
|
||||||
// default GUI
|
// default GUI
|
||||||
protected Label labelString;
|
protected Label labelString;
|
||||||
protected Text textString;
|
protected Text textString;
|
||||||
protected Button dlgTestButton;
|
protected Button dlgTestButton;
|
||||||
|
|
||||||
// state
|
// state
|
||||||
protected SystemMessage errorMessage;
|
protected SystemMessage errorMessage;
|
||||||
protected boolean skipEventFiring;
|
protected boolean skipEventFiring;
|
||||||
protected int currentSelectionIndex;
|
protected int currentSelectionIndex;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for SystemFilterStringEditPane.
|
* Constructor for SystemFilterStringEditPane.
|
||||||
|
@ -328,20 +330,43 @@ public class SystemFilterStringEditPane implements SelectionListener
|
||||||
System.out.println("Someone forgot to override processTest in SystemFilterStringEditPane!"); //$NON-NLS-1$
|
System.out.println("Someone forgot to override processTest in SystemFilterStringEditPane!"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Set if the edit pane is not to be editable
|
* Sets whether or not the edit pane is not to be editable. May be invoked
|
||||||
*
|
* atany time prior or after the creation of the controls.
|
||||||
public void setEditable(boolean editable)
|
* Subclasses should override and enable their own controls appropriately.
|
||||||
{
|
* <p>
|
||||||
|
* Subclasses should call super to ensure that the "editable" flag is
|
||||||
|
* set properly. Controls which are not instantiated in this call will be ignored.
|
||||||
|
* @param editable true if the controls in this pane are to be editable.
|
||||||
|
* Usually set to true, but if the filter is not modifiable it will be
|
||||||
|
* set to false.
|
||||||
|
*/
|
||||||
|
public void setEditable(boolean editable) {
|
||||||
this.editable = editable;
|
this.editable = editable;
|
||||||
}*/
|
enable(labelString, editable);
|
||||||
|
enable(textString, editable);
|
||||||
|
enable(dlgTestButton, editable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the enabled state of a particular control.
|
||||||
|
* @param control the control of which to set the state
|
||||||
|
* @param enabled the enabled state
|
||||||
|
*/
|
||||||
|
protected void enable(Control control, boolean enabled) {
|
||||||
|
if (!(control == null || control.isDisposed())) {
|
||||||
|
control.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return whether the edit pane is editable, as set by {@link #setEditable(boolean)}
|
* Return whether the edit pane is editable, as set by {@link #setEditable(boolean)}
|
||||||
*
|
*
|
||||||
|
*/
|
||||||
public boolean getEditable()
|
public boolean getEditable()
|
||||||
{
|
{
|
||||||
return editable;
|
return editable;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
// DATA EXTRACTION METHODS
|
// DATA EXTRACTION METHODS
|
||||||
|
@ -447,7 +472,8 @@ public class SystemFilterStringEditPane implements SelectionListener
|
||||||
validateStringInput();
|
validateStringInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
setEditable(editable);
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue