FileDialog, how to set filter?

i try to use
setFilenameFilter(FilenameFilter filter)
to set filter for FileDialog, but FilenameFilter is an interface, what is the story?
do u know how to set filter?
thanks in advance

Construct a FileFilter class like:
public class CustomFilter implements FileFilter{
     public CustomFilter(){
public String getFileExtension(File file) {
String ext = null;
String s = file.getName();
int i = s.lastIndexOf(".") + 1;
ext = s.substring(i).toLowerCase();
return ext;
public String doSomething(){
//do Something
//return something
and use the setFileFilter(FileFilter filter) method.

Similar Messages

  • Evolution how to set filter

    Hi.
    How to set evolution to filtr my emails and spam send to folder called "BIN"... I tried to do that but evolution is still not filtering emails.
    This is how my config from filter is looks like:
    http://postimg.org/image/xoecjo55p/full/
    what I'm doing wrong that is not working ?
    Regards,
    siamer

    Re: ALV problem (with filter use)

  • How to set filter for few Setup Objects on Geneneral Foundation?

    Controlling the download of sub-entities:
    By default all sub-entities are downloaded. Pass a non-existing value
    for the parameter (primary key) of the sub-entity if you don't want to
    download a specific sub-entity.
    For example, if you don't want to download the values of a value set,
    then use following input to FLEX_VALUE attribute while setting filter;
    FLEX_VALUE='THIS_IS_A_NON_EXISTING_VALUE_I_DONT_WANT_TO_DOWNLOAD_VALUES'
    VALUE_SET
    Notes:
    - To download '$FLEX$.%' value sets pass '$FLEX$.%' argument.
    - Upload API automatically submits the hierarchy compiler request
    - FLEX_VALUE_SET_NAME is a required argument for download.
    You can find the following parameters in Set Filter screen of Value Set Values.
    VALUE_SET has subenities such as VSET_SECURITY_RULE, VSET_ROLLUP_GROUP and VSET_VALUE.
    Setting value for attribute FLEX_VALUE_SET_NAME downloads all the subentities. If you want
    to restrict the subentities, set appropriate filter at VSET_SECURITY_RULE, VSET_ROLLUP_GROUP
    and VSET_VALUE.
    Parameters:
    VALUE_SET
    | FLEX_VALUE_SET_NAME : Value set name.
    |
    +-VSET_SECURITY_RULE
    | FLEX_VALUE_RULE_NAME : Value set security rule name.
    | PARENT_FLEX_VALUE_LOW : Independent value for the dependent value sets.
    |
    +-VSET_ROLLUP_GROUP
    | HIERARCHY_CODE : Hierarchy (rollup group) code.
    |
    +-VSET_VALUE
    PARENT_FLEX_VALUE_LOW : Independent value for the dependent value sets.
    FLEX_VALUE : Flexfield segment value.
    DESC_FLEX
    Notes:
    - Upload API automatically submits the flexfield compiler request
    - Upload API automatically submits the DFV view generator request
    - APPLICATION_SHORT_NAME is a required argument for download.
    You can find the following parameters in Set Filter screen of Descriptive Flexfields.
    DESC_FLEX has subenities such as DFF_REF_FIELD, DFF_CONTEXT and DFF_SEGMENT.
    Setting value for attributes DESC_FLEX and DESCRIPTIVE_FLEXFIELD_NAME downloads all the subentities.
    If you want to restrict the subentities, set appropriate filter at DFF_REF_FIELD, DFF_CONTEXT
    and DFF_SEGMENT.
    Parameters:
    DESC_FLEX
    | APPLICATION_SHORT_NAME : Application Short Name.
    | DESCRIPTIVE_FLEXFIELD_NAME : Descriptive Flexfield Name.
    |
    +-DFF_REF_FIELD
    | DEFAULT_CONTEXT_FIELD_NAME : BLOCK.FIELD reference field name.
    |
    +-DFF_CONTEXT
    | DESCRIPTIVE_FLEX_CONTEXT_CODE : Context Code
    |
    +-DFF_SEGMENT
    END_USER_COLUMN_NAME : Segment Name
    APPLICATION_COLUMN_NAME : Column Name
    KEY_FLEX
    Notes:
    - Upload API automatically submits the flexfield compiler request
    - Upload API automatically submits the KFV view generator request
    - Upload API automatically submits the structure view generator request
    - APPLICATION_SHORT_NAME is a required argument for download.
    You can find the following parameters in Set Filter screen of Key Flexfields.
    KEY_FLEX has subenities such as DFF_REF_FIELD, DFF_CONTEXT and DFF_SEGMENT.
    Setting value for attributes APPLICATION_SHORT_NAME and ID_FLEX_CODE downloads all the subentities.
    If you want to restrict the subentities, set appropriate filter at KFF_FLEX_QUAL, KFF_SEGMENT_QUAL,
    ,KFF_STRUCTURE,KFF_WF_PROCESS,KFF_SH_ALIAS,KFF_CVR_RULE and KFF_SEGMENT.
    Parameters:
    KEY_FLEX
    | APPLICATION_SHORT_NAME : Application Short Name.
    | ID_FLEX_CODE : Key Flexfield Code.
    |
    +-KFF_FLEX_QUAL
    | | SEGMENT_ATTRIBUTE_TYPE : Flexfield Qualifier Name
    | |
    | +-KFF_SEGMENT_QUAL
    | VALUE_ATTRIBUTE_TYPE : Segment Qualifier Name
    |
    +-KFF_STRUCTURE
    | ID_FLEX_STRUCTURE_CODE : Structure Code
    |
    +-KFF_WF_PROCESS
    | WF_ITEM_TYPE : Workflow Item Type
    |
    +-KFF_SH_ALIAS
    | ALIAS_NAME : Shorthand Alias Name
    |
    +-KFF_CVR_RULE
    | FLEX_VALIDATION_RULE_NAME : Cross Val. Rule Name.
    |
    +-KFF_SEGMENT
    SEGMENT_NAME : Segment Name
    APPLICATION_COLUMN_NAME : Column Name
    MENU
    You can find the following parameters in Set Filter screen of Menus.
    PARENT_MENU_NAME Name of the menu to start downloading at. If this
    parameter is specified on its own, that menu and
    all its children will be downloaded. If specified
    with FUNCTION_NAME and/or SUB_MENU_NAME, then only
    the menu entry with that function and/or submenu name
    immediately under the PARENT_MENU_NAME will be
    downloaded.
    FUNCTION_NAME Function name to limit download to. If this parameter
    is specified then PARENT_MENU_NAME must also be
    specified in order to download menus. Specifies
    the function on a menu entry immediately under
    PARENT_MENU_NAME which will be downloaded; all other
    menu entries under PARENT_MENU_NAME will not be
    downloaded.
    SUB_MENU_NAME Sub Menu name to limit download to. If this parameter
    is specified then PARENT_MENU_NAME must also be
    specified in order to download menus. Specifies
    the Sub Menu on a menu entry immediately under
    PARENT_MENU_NAME which will be downloaded (along with
    all its children); all other menu entries under
    PARENT_MENU_NAME will not be downloaded.
    MENU_APP_SHORT_NAME Application short name of Menu. The menu on the resp
    for this application will be downloaded. If you
    pass this parameter, do not pass any of the other
    parameters; this parameter is only supported on its
    own.

    Oh never mind.... I figured it out myself helps to read up on the manuals. d'oh. sorry for the bandwidth waste...

  • ALV Question : How to set filter condition which contain dummy character?

    Hi,
    I want to set filter condition of ALV dynamicly (In my code),
    for example, set 'X' as filter condition in column "Description",
    I add the code successfully, but I can't get the correct filtered result, Why?

    Please post ur code here.
    U have to get a  handle to the IF_SALV_WD_FILTER interface
    data ref_filter   type ref to IF_SALV_WD_FILTER  .
    ref_filter ?= m_config_model->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD( 'FIELD DESCRIPTION' )
    ref_filter->CREATE_FILTER_RULE( 
                       low_val = 'X'
    Now when u load the ALV tabl;e u should see a X value in the filter row, for the column 'FIELD DESCRIPTION'  and the filter should happen.
    As I said, pls paste ur code here.

  • FileDialog, not JFileChooser, how to set filter? help+help!

    i want to add file filter to the bottom combo box control of FileDialog, but i have no idea.
    1. setFile("*.txt;*.java;") works in a silly style
    2. FilenameFilter doesn't work (return true or false makes no diff from accept function.
    if you used FileDialog before or saw some examples which work well, please give me a hand.
    please don't guess if u never use before.
    many thanks

    setFileNameFilter do not work for Windows 95, 98, or NT 4.0. So better use JFileChooser

  • LR CC, LR6: How To Set Filter Brushes Reliably to ADD ?

    Hi, in the new Lightroom versions, the new filter brush can ADD to or SUBTRACT from the area affected by graduated filter or radial filter.
    But i am not sure how to *reliably* set a brush to ADD or to SUBTRACT. I had assumed:
    - brush "Erase" does subtract (minus sign within cursor)
    - brushes "A" and "B" do add (plus sign within cursor); if you press Alt, brushes switch temporarily to "Erase" brush
    But i had at least one instance where brushes A and B only *subtracted* and there was no way to get them back to *adding* (except by restarting LR with a different language).
    Do you know if there is way to *permanently* set brushes A and B to ADD? Or at least: How to bring brushes A and B back to ADD when for some reason they are fixated on SUBTRACT?
    In Photoshop's raw dialog, the same task is very easy – there are two brushes, one with a plus sign and one with a minus sign, and they always work as expected.
    I searched a lot of sites, but none answers my above question.
    ---snip---
    As we are here already, i have another question regarding the mask overlay for gradual filter etc.: Initially, the mask overlay is red. In Lightroom, I can switch to other colors with Shift-O.
    Can i also
    - change opacity of mask overlay
    - invert mask overlay appearance, so that non-selected areas are overlaid?
    It's possible in Photoshop's ACR, but perhaps not in LR?
      Thanks!

    Hi
    No other component required. WDR_SELECT_OPTIONS uses OVS component internally, you can see the component usage also in WDR_SELECT_OPTIONS.
    Add the seleciton Field
    wd_this->lr_helper->add_selection_field(
                    i_id = 'ATFLV'
                    IT_RESULT = LR_TABLE
                    I_DESCRIPTION = 'Msg'
                    i_obligatory = abap_true
                I_VALUE_HELP_TYPE =
    IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_OVS
                    I_VALUE_HELP_STRUCTURE = 'ZPP_ROUT_PROD'
                    I_VALUE_HELP_STRUCTURE_FIELD = 'MS_FLAG'
    ZPP_ROUT_PROD is a structure created and MS_FLAG is the field in the structure, for which we are developing Value help
    Now,
    WDR_SELECT_OPTIONS has an event int he Interface called ON_OVS, subscribe the event in your view,
    from here onwards it is like Using normal OVS, you have phases put a case statement and code accordingly
    Abhi
    Edited by: Abhimanyu Lagishetti on Jul 25, 2008 7:45 AM

  • How to set filter criteria for month and year using in timestamp input field?

    Hi,
    I am using jdev 11.1.2.3,
    I have one problem with Report generation,,,,,,I have one report table which is in the form of VO(query based) and i want to search this table as month and year basis
    but in this table(query) that field having timestamp based value.. how to search with month name and year only.. Here i am using totally query base VO's for generating
    reports........ Can any one guide me.
    Thank You.

    You can use a inputdate, which allows you to selecte a moth, year and a day. Once the selection is made you convert it to only allow moth and date like
            <af:inputDate label="Label 1" id="id1" autoSubmit="true" value="#{bindings.myMonthYear1.inputValue}">
              <f:convertDateTime pattern="MM/yyyy"/> 
            </af:inputDate>
            <af:outputText value="Selected #{bindings.myMonthYear1.inputValue}" id="ot1" partialTriggers="id1"/>
    then you have a string holding month and year only. This value you split into two variables you or pass it as a whole parameter to the query and split it there.
    Another way is to add two static lovs one for month and one for year and use them to get to the filter values.
    Timo

  • How to set filter to get instances for external variable

    Hi,
    I am trying to get instances based on external variable. Below is my code
    bp.connectTo(url : Fuego.Server.directoryURL, user : "test", password : "test", process : processName);
    fltr.create(processService : bp.processService);
    fltr.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
    //fltr.addAttributeTo(variable : "PREDEFINE_INSTANCE_NUMBER", comparator : Comparison.IS, value : Integer.parseInt(requestId));
    fltr.addAttributeTo(variable : "requestIdExt", comparator : Comparison.IS, value : Integer.parseInt(requestId));
    When I try to set the filter for PREDEFINE_INSTANCE_NUMBER, I am able to get the instance but not for external variable. Is there any other way to get instances based on external variables?
    Thanks in advance

    You can use a inputdate, which allows you to selecte a moth, year and a day. Once the selection is made you convert it to only allow moth and date like
            <af:inputDate label="Label 1" id="id1" autoSubmit="true" value="#{bindings.myMonthYear1.inputValue}">
              <f:convertDateTime pattern="MM/yyyy"/> 
            </af:inputDate>
            <af:outputText value="Selected #{bindings.myMonthYear1.inputValue}" id="ot1" partialTriggers="id1"/>
    then you have a string holding month and year only. This value you split into two variables you or pass it as a whole parameter to the query and split it there.
    Another way is to add two static lovs one for month and one for year and use them to get to the filter values.
    Timo

  • How to set a filter in DTP?

    Dear Gurus,
    I'm trying to load some selective data based on the Sales Order Number from DSrc to a DSO.  I'm trying to set a filter in the DTP.  Can someone please guide me how to set a filter in DTP?
    Thanks & Regards,
    Ashmeel.

    Hi,
    Double Click the DTP. Open the extraction Tab. On this tab you can see Filter Icon click on that. Put the filter as desired in the sales order number. Save and Activate.
    In case the field on which you want to apply the filter is not visible, open the DTP in edit mode click on the FIlter button, now click on change selection button. Here in you can drag the required fields to LHS for them to be visible in filter option.
    Apply required filter value Save & Activate the DTP
    Revert in case of doubt
    Regards
    Raj

  • How to set enviroment variables for Inso Filter

    Hi everyone,
    I want to convert word documents to html using CTX_DOC.Filter.According to the documentation,I know I neednot set the 'Inso Filter'in the preference when creating index,but I must set enviroment variables for Inso Filter.
    I found the following instructions for it in the 8.1.5 documentation,but I can't understand it well.Is there anyone can tell me how to set enviroments variables for Inso Filter on Windows2000 Server?(My DB version is 8.1.7EE)
    Environment Variable Locations
    All environment variables related to Inso filtering must made visible to interMedia Text. Set these variables in the following locations:
    listener.ora file. This makes the environment variables visible to the extproc PL/SQL process.
    The operating system shell from where ctxsrv server is started. This makes the environment variables visible to the ctxsrv process, which does background DML.
    Any suggestions are apreciated
    Reemon
    null

    NSAPI plugins are normally configured using parameters specified in magnus.conf and/or obj.conf. What plugin requires you set an environment variable?

  • How to disable 'set filter' in alv list display

    Hi Friends,
    I am working on alv report and I came across a requirement that I need to disable the 'set filter' to restrict the user from filtering records in output.
    please help on this.
    thanks in advance.

    HI
    check these sample codes
    Here are some code snippets:
    FORM output_report.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = 'ZRRRMPROJSTAT'
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat
    it_sort = gt_sort
    i_save = 'A'
    it_events = gt_events
    TABLES
    t_outtab = i_project
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM. " output_report
    FORM build_fieldcat.
    DATA: s_fieldcat TYPE slis_fieldcat_alv.
    DATA: l_col_count like s_fieldcat-col_pos.
    l_col_count = 1.
    CLEAR s_fieldcat.
    s_fieldcat-col_pos = l_col_count.
    l_col_count = l_col_count + 1.
    s_fieldcat-tabname = i_project.
    s_fieldcat-fieldname = 'PSPID'.
    s_fieldcat-datatype = 'CHAR'.
    s_fieldcat-outputlen = '10'.
    s_fieldcat-seltext_l = 'Project Number'.
    s_fieldcat-seltext_m = 'Project Number'.
    s_fieldcat-seltext_s = 'Project Number'.
    s_fieldcat-key = 'X'.
    s_fieldcat-fix_column = 'X'.
    s_fieldcat-just = 'C'.
    s_fieldcat-no_zero = 'X'.
    APPEND s_fieldcat TO gt_fieldcat.
    * and so on....
    ENDFORM
    FORM sort_layout.
    DATA: ls_sort TYPE slis_sortinfo_alv.
    REFRESH gt_sort.
    CLEAR ls_sort.
    ls_sort-spos = '1'.
    ls_sort-tabname = 'i_project'.
    ls_sort-fieldname = 'PSPID'.
    APPEND ls_sort TO gt_sort.
    CLEAR ls_sort.
    ls_sort-spos = '2'.
    ls_sort-tabname = 'i_project'.
    ls_sort-fieldname = 'POSID'.
    APPEND ls_sort TO gt_sort.
    ENDFORM. " sort_layout
    FORM build_layout.
    CLEAR gs_layout.
    * gs_layout-totals_before_items = 'X'.
    gs_layout-zebra = 'X'.
    gs_layout-numc_sum = 'X'.
    gs_layout-get_selinfos = 'X'.
    gs_layout-box_tabname = 'X'.
    gs_layout-info_fieldname = 'COLOR'.
    ENDFORM. "
    Reward alll helpfull answers
    Regards
    Pavan

  • How can I filter a Sharepoint 2007 libarry list based on current user login?

    Hi all.
    I would like to know how I can filter a SharePoint library list based on current user login.
    Suppose I have created the followings:
    1) A SharePoint form library containing bunch of uploaded InfoPath form data.
    2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.
    I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.
    I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value
    to that of "TargetUser".
    I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.
    I have googled this subject for hours but I have not found any solution.
    It would be greatly appreciated if anyone can help me to create a functional filtered list.
    FYI, my SharePoint 2007 installation is just WSS 3.0 + Form Server. I do not have MOSS 2007 (so no MOSS 2007 web parts or web services).
    Thank you.
    Jason

    Here's what I usually do in order to accomplish this.  Ultimately you'll need to have 2 different fields.  There's the one you already have, with DOMAIN\username stored in it.  Then you'll need an additional field as a "person" column type. 
    Call it "TargetPerson" or something.
    Create a sharepoint designer workflow that runs each time an item is created or changed.  One action:
    Set FIELD to VALUE.
    The first FIELD is "TargetPerson", the VALUE is your "TargetUser" field. 
    Once this is done, then the person value is stored in the person field.  This is the field that you can filter by "TargetPerson" is equal to [Me]
    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura

  • How To Set Parameters in a SOAP-Message for QUERY_VIEW_DATA Web Service

    Hi all,
    I want to use the QUERY_VIEW_DATA Web Service to get data from BI through an existing BEx-query.
    How can I set a navigation status as it is stated in the SAP documentation [Web Service for Accessing Query Data|http://help.sap.com/saphelp_nw04/helpdata/en/d8/3bfc3f8fc2c542e10000000a1550b0/frameset.htm]?
    I am able to set filter values but setting any parameter with the name 'CMD' has no effect to the response.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
      <soapenv:Header/>
      <soapenv:Body>
        <urn:GetQueryViewData>
          <Parameter>
            <!-- This has no effect -->
            <item>
              <Name>CMD</Name>
              <Value>SWITCH_AXIS</Value>
            </item>
            <!-- This works --> 
            <item>
              <Name>FILTER_IOBJNM</Name>
              <Value>0COMP_CODE</Value>
            </item>
            <item>
              <Name>FILTER_VALUE</Name>
              <Value>4020</Value>
            </item>
          </Parameter>
          <Query>Z_MYQUERY</Query>
        </urn:GetQueryViewData>
      </soapenv:Body>
    </soapenv:Envelope>
    We use SAP NetWeaver 7.0 EHP1. The documentation mentioned above belongs to NetWeaver 2004s and I can't find it in the docu for 7.0. Does that mean the QUERY_VIEW_DATA is deprecated?
    Thanks for your help!
    Best regards
    Heiko Braeske

    Dear Heiko,
    did you solve this problem?
    We are facing the same problem. Every parameter that requries "cmd" does not work. I guess we don´t use this paramter the right way.
    Best, Chris

  • How to set HP 4502 to print black only

    How to set my HP4502 to print from Mac in black ink only

    Hi @floraoverst,
    Welcome to the HP Support Forums! I see you would like to print in black ink only on your HP Envy 4502 with your Mac running the Mavericks 10.9 Operating system. Please follow the steps listed below:
    Printing with the Black Print Cartridge Only option
    Click File and then click Print.
    Make sure your printer is selected.
    Verify that the Preset option is set to Standard.
    In the Copies & Pages menu, select Select Paper Type / Quality.
    NOTE:If this option is not available, click ColorSync. Then click the down arrow beside Quartz Filter and change the setting from None to Black & White.
    Select the Paper tab.
    From the Color option menu, select Grayscale.
    Select the Color Options tab.
    Select the Black Print Cartridge Only option.
    If that option is not listed, then it is not available. The printer will print using only the black cartridge, however, printing with one cartridge will be slower than printing with both cartridges.
    NOTE:To save the setting, click the arrow next to Preset and select Save As. Save the Preset option as Black Cartridge Only and then click OK. Then, the next time you want to print with just the black cartridge, select the Black Cartridge Only Preset.    -Source
    I hope this helps!
    HevnLgh
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • How to set password complexity

    How to set password
    complexity on windows server 2012
    but fulfills 4 features Inglés
    uppercase characters (A through
    Z) Inglés lowercase characters
    (a through z) Base 10
    digits (0 through 9) Non-alphabetic
    characters (for example,!, $,
    #,%), currently only 3 of the 4
    options.
    thanks
    Guillermo Ledesma

    Windows has only one complexity filter built in and that is not configurable.
    You could develop your own or check for existing third party software.
    http://technet.microsoft.com/en-us/library/hh994562(v=ws.10).aspx
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms721766(v=vs.85).aspx
    MCP/MCSA/MCTS/MCITP

Maybe you are looking for