[izpack-devel] UserInputPanel / type 'search'
Michael Hagedorn
michael.hagedorn at gmx.de
Fri Feb 16 11:05:05 CET 2007
How the things are going?
Will someone commit this?
Michael
Michael Hagedorn wrote:
> Hello Dev,
>
> I guess no feedback means silent acceptance of this improvement :)
>
> I've checked behavior on XP and Suse 10, it works. NextButton will be
> enabled if and only if an existing directory or file is chosen, typed or
> pasted by user.
> Please can someone double check and apply attached patches?
>
> Thanks,
> Michael
>
>
> Michael Hagedorn wrote:
>
>> Hello Dev,
>>
>> my favorite missed feature is to force users to select an existing
>> directory or file within UserInputPanel. At least this is what I expect.
>> But this is not the way UserInputPanel works.
>> I will patch my own UserInputPanel to lock/unlock <Next> button to get this.
>>
>> Is there a public interest concerning this?
>> Should I supply this patch?
>> (Depending on feedback my implementation will be more or less carefully...)
>>
>> Thanks,
>> Michael
>> _______________________________________________
>> izpack-devel mailing list
>> izpack-devel at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/izpack-devel
>>
>>
>> ------------------------------------------------------------------------
>>
>> 1365a1366,1374
>>
>>> unlockNextButton(true);
>>> }
>>>
>>> /**
>>> * Unlocks the 'next' button.
>>> * @param requestFocus if <code>true</code> focus goes to <code>nextButton</code>
>>> */
>>> public void unlockNextButton(boolean requestFocus)
>>> {
>>>
>> 1367c1376,1377
>> < nextButton.requestFocus();
>> ---
>>
>>> if (requestFocus)
>>> nextButton.requestFocus();
>>>
>>> ------------------------------------------------------------------------
>>>
>>> 47a48,51
>>>
>>>> import javax.swing.event.DocumentEvent;
>>>> import javax.swing.event.DocumentListener;
>>>> import javax.swing.text.BadLocationException;
>>>> import javax.swing.text.Document;
>>>>
>>> 2684a2689,2717
>>>
>>>> /*
>>>> * add DocumentListener to manage nextButton if user enters input
>>>> */
>>>> ((JTextField)this.pathComboBox.getEditor().getEditorComponent()).getDocument().addDocumentListener(new DocumentListener()
>>>> {
>>>> public void changedUpdate(DocumentEvent e)
>>>> {
>>>> checkNextButtonState();
>>>> }
>>>> public void insertUpdate(DocumentEvent e)
>>>> {
>>>> checkNextButtonState();
>>>> }
>>>> public void removeUpdate(DocumentEvent e)
>>>> {
>>>> checkNextButtonState();
>>>> }
>>>> private void checkNextButtonState()
>>>> {
>>>> Document doc = ((JTextField)pathComboBox.getEditor().getEditorComponent()).getDocument();
>>>> try {
>>>> if (pathMatches(doc.getText(0, doc.getLength())))
>>>> getInstallerFrame().unlockNextButton(false);
>>>> else
>>>> getInstallerFrame().lockNextButton();
>>>> } catch (BadLocationException e) {/*ignore, it not happens*/}
>>>> }
>>>> });
>>>>
>>>>
>>> 2686a2720,2726
>>>
>>>>
>>>> /**
>>>> * convenient method
>>>> */
>>>> private InstallerFrame getInstallerFrame() {
>>>> return parent;
>>>> }
>>>>
>>> 2745c2785,2788
>>> < if (selected == null) { return false; }
>>> ---
>>>
>>>> if (selected == null) {
>>>> parent.lockNextButton();
>>>> return false;
>>>> }
>>>>
>>> 2813a2857
>>>
>>>> parent.unlockNextButton();
>>>>
>>> 2820,2821c2864,2869
>>> < return this.pathMatches((String) this.pathComboBox.getSelectedItem());
>>> <
>>> ---
>>>
>>>> if (this.pathMatches((String) this.pathComboBox.getSelectedItem())) {
>>>> parent.unlockNextButton();
>>>> return true;
>>>> }
>>>> parent.lockNextButton();
>>>> return false;
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> izpack-devel mailing list
>>>> izpack-devel at lists.berlios.de
>>>> https://lists.berlios.de/mailman/listinfo/izpack-devel
>>>>
More information about the izpack-devel
mailing list