ip insert field

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

ip insert field

Postby orome » Thu Mar 23, 2006 1:25 am

Hi,
Provieds JIDE a IP field? I mean something like the fields of the windows-network settings gui. Looks like this: [ . . . ] the field should also validate the input.

Orome
orome
 
Posts: 13
Joined: Thu Dec 15, 2005 8:13 am

Postby JIDE Support » Thu Mar 23, 2006 9:36 am

We don't have one but we will consider adding it. I'll update this thread when we do it.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby JIDE Support » Mon Apr 10, 2006 12:08 pm

Just so you know, we added IPTextField in 1.9.1 release. Please give it a try and let us know if you have any suggestions.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby orome » Mon May 08, 2006 1:47 am

Thanks a lot, just tried it out and it looks fine. Just the kind of stuff ive looked for
orome
 
Posts: 13
Joined: Thu Dec 15, 2005 8:13 am

Postby jmerrin » Mon May 15, 2006 2:50 pm

Does anyone know if it is possible to use the IPTextField in the JIDE Property so that it can be used in the PropertyTableModel? The Property constructor doesn't seem to recognize com.jidesoft.field.IPTextField classtype as anything special and treats it as a String type.

Thanks, Joel
jmerrin
 
Posts: 2
Joined: Mon May 15, 2006 2:19 pm

Postby JIDE Support » Mon May 15, 2006 3:14 pm

You will have to create a IPTextFieldCellEditor and register it with CellEditorManager. The type of it should be the data type, not editor class type. You can refer to PropertyPane demo to see how to register a new editor/renderer with a type.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby jmerrin » Mon May 15, 2006 4:00 pm

OK, that makes sense. Looking at the example code in the property pane demo each CellEditor create instantiates a CellEditor that is provided in the JIDE software libraries. I notice there is no IPTextFieldCellEditor. Is there a pattern for this?
Thanks, Joel.
jmerrin
 
Posts: 2
Joined: Mon May 15, 2006 2:19 pm

Postby JIDE Support » Mon May 15, 2006 4:04 pm

We didn't create IPTextFieldCellEditor. You can use the code below as template. Just replace MultilineStringComboBox with IPTextField and change other code accordingly.

Code: Select all
package com.jidesoft.grid;

import com.jidesoft.combobox.MultilineStringComboBox;
import com.jidesoft.swing.JideSwingUtilities;

import javax.swing.*;
import javax.swing.table.TableCellEditor;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

/**
 * A multiple line text cell editor.
 */
public class MultilineStringCellEditor extends ContextSensitiveCellEditor implements TableCellEditor, ItemListener {

    public final static EditorContext CONTEXT = new EditorContext("MultilineString");

    private MultilineStringComboBox _comboBox;

    /**
     * Creates a FileNameCellEditor.
     */
    public MultilineStringCellEditor() {
        _comboBox = createMultilineStringComboBox();
        _comboBox.setBorder(BorderFactory.createEmptyBorder());
    }

    /**
     * Creates the MultilineStringComboBox used by this cell editor.
     * @return a MultilineStringComboBox.
     */
    protected MultilineStringComboBox createMultilineStringComboBox() {
        return new MultilineStringComboBox();
    }

    /**
     * Gets the value of the cell editor.
     *
     * @return the value in this cell editor.
     */
    public Object getCellEditorValue() {
        _comboBox.setSelectedItem(_comboBox.getEditor().getItem());
        return _comboBox.getSelectedItem();
    }

    public Component getTableCellEditorComponent(JTable table, Object value,
                                                 boolean isSelected,
                                                 int row, int column) {
        if (table != null) {
            JideSwingUtilities.installColorsAndFont(_comboBox, table.getBackground(), table.getForeground(), table.getFont());
        }
        _comboBox.setSelectedItem(value, false);
        _comboBox.setConverterContext(getConverterContext());
        _comboBox.addItemListener(this);
        return _comboBox;
    }

    public boolean stopCellEditing() {
        _comboBox.setPopupVisible(false);
        return super.stopCellEditing();
    }

    public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
            _comboBox.removeItemListener(this);
            stopCellEditing();
        }
    }
}


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby csantora » Wed Oct 26, 2011 8:13 am

Yes! This example is exactly what I needed.

(I'm mostly adding this post just to get some more keywords in there so people doing similar things will find this sample code)

I have been trying to create an AbstractComboBoxCellEditor that, like MultilineStringCellEditor, uses a ComboBox to facilitate the opening of an editor dialog. But it is a generic dialog box for editing data that does not correspond to any concept of item selection (which is central to AbstractComboBox).

And I expect this would apply to ExComboBoxCellEditor and ExComboBox as well, but I went with AbstractComboBox because it supports centering the dialog over the appropriate parent, which does not seem to be the case with ExComboBox.
csantora
 
Posts: 47
Joined: Wed Mar 02, 2011 10:06 am

Re: ip insert field

Postby JIDE Support » Wed Oct 26, 2011 9:55 am

May I ask which JIDE release you are using? Just tried ExComboBoxDemo in 3.2.4. The dialog does popup at the center of the parent JFrame. A test case would help us speed up the bug fix process if there is one.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby csantora » Wed Oct 26, 2011 10:14 am

3.0.4, I believe.
csantora
 
Posts: 47
Joined: Wed Mar 02, 2011 10:06 am

Re: ip insert field

Postby JIDE Support » Wed Oct 26, 2011 10:41 am

Just tried ComboBoxDemo and ExComboBoxDemo in 3.0.4. However, I could not observe any different behavior regarding the dialog location. Can you please post some images to demonstrate the issue you stated?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby csantora » Wed Oct 26, 2011 12:40 pm

An additional point to note is that I am running with dual monitors and the application was in the secondary monitor. An my ExComboBox dialog showed up on the primary monitor, and after I converted my class to be an AbstractComboBox, it showed up over the application in the secondary monitor as one would expect.
csantora
 
Posts: 47
Joined: Wed Mar 02, 2011 10:06 am

Re: ip insert field

Postby JIDE Support » Wed Oct 26, 2011 4:11 pm

Thanks for the hint. Will fix it in next regular release. Please give the pre-release at http://www.jidesoft.com/downloads/archives/jide.3.3.0-pre.lib.debug.zip a try to verify.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby jfouche » Mon Oct 31, 2011 5:43 am

Hi,

I use your IpTextField, but I would like to know if you can add another field (maybe IpAndMaskTextField or NetworkTextField) to allow the following editor :
192.168.1.0 / 24

where the last number is the net mask (from 0 to 32).

Thanks
--
Jérémie
jfouche
 
Posts: 6
Joined: Tue May 03, 2011 2:13 am

Re: ip insert field

Postby JIDE Support » Mon Oct 31, 2011 9:12 am

Is it okay to add an extra JTextField as the mast field after the IPTextField?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby jfouche » Mon Oct 31, 2011 10:27 am

Will the slash (/) be visible (as the dots are) ?
Moreover, as for ip text fields, could you decrease the mask value to 32 (or better : use a property to define min and max mask values, like setMaskRange() ) if the user write something which is greater than 32 ?

If you're interrested to implement this request, I would be very happy.
jfouche
 
Posts: 6
Joined: Tue May 03, 2011 2:13 am

Re: ip insert field

Postby JIDE Support » Mon Oct 31, 2011 10:38 am

No, sorry, I actually suggest you add a JTextField yourself to implement the feature you want. The IPTextField's implementation is not very elegant (as we didn't come up with a better way) so we prefer not to enhance it on top of it.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby jfouche » Mon Oct 31, 2011 11:07 am

Sorry, I didn't understand you
What you suggest is to create my own IPNetworkTextField (which inherit JPanel), based on the IPTextfield and a Textfield for the mask ? And I suppose I have to create my own IPNetworkCellEditor class too. If that's all, I'll try to do so.
jfouche
 
Posts: 6
Joined: Tue May 03, 2011 2:13 am

Re: ip insert field

Postby JIDE Support » Mon Oct 31, 2011 11:10 am

Yes. That's what I mean.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby jfouche » Mon Oct 31, 2011 11:20 am

Thanks for your answer.
Are you interrested by this or not ? I mean, do you want me to give you my code when I finish it ?
jfouche
 
Posts: 6
Joined: Tue May 03, 2011 2:13 am

Re: ip insert field

Postby JIDE Support » Mon Oct 31, 2011 11:28 am

Sure. That'll be great. We always appreciate people willing to share the code. We will take a look and see if we can integrate it into future jide releases.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: ip insert field

Postby JIDE Support » Tue Nov 22, 2011 6:49 pm

Just so you know, the ExComboBox popup issue is fixed in 3.3.0 just released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 5 guests

cron