File filter in jdeveloper

hi Forum
plz help me write a file filter in jdeveloper.i need to filter *.class and *.jar.
divya

Hi,
in your code you can:
boolean designtimeChecked = false;
boolean isDesigntime = false;
if (!designtimeChecked){
//prevent this code being executed in designtime
FacesContext fctx = FacesContext.getCurrentInstance();
HttpServletRequest rq = (HttpServletRequest)fctx.getExternalContext().getRequest();
isDesigntime = rq.getServerPort()==-1;
designtimeChecked=true;
later on you just call if (!isDesigntime){
// execute code
Frank

Similar Messages

  • How to RUN a XML file directly in JDeveloper

    Can any one please suggest me for running a XML file directly in Jdeveloper?
    I need the step how to do it

    actually I am calling xsl inside my xml....
    the XMl code
    =================
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?xml-stylesheet type="text/xsl" href="SfATranslation.xsl"?>
    <SfAForm>
    <SfAFormHeader>
    <Name>ACM Maintain Code Table</Name>
    <Notes></Notes>
    <HeaderText>ACM Maintain Transaction Code Table</HeaderText>
    <ItemID></ItemID>
    <LogoImage>cpfb.gif</LogoImage>
    <SubmitTo>FormAction.asp</SubmitTo>
    <Title>Account Management</Title>
    <TranslationRule>SfATranslation</TranslationRule>
    </SfAFormHeader>
    <SfASection>
    <VisibilityRule></VisibilityRule>
    <SfASectionHeader>
    <Name>ACM - Maintain Transaction Code Table</Name>
    <Notes>ACM Maintain Transaction Code Table</Notes>
    <ItemID>TX Code</ItemID>
    </SfASectionHeader>
    <SfAComponent>
    <VisibilityRule></VisibilityRule>
    <SfAComponentHeader>
    <Name>Code Table Information</Name>
    <ItemID>A1</ItemID>
    </SfAComponentHeader>
    <SfAItem>
    <Name>Scheme Code</Name>
    <Type>SfA_Select</Type>
    <VisibilityRule></VisibilityRule>
    <Information>Select Scheme</Information>
    <ItemID></ItemID>
    <Required>*</Required>
    <Value></Value>
    <SfA_SelectOptions>
    <Name>Education</Name>
    <ItemID>EDN</ItemID>
    <Multiple>Y</Multiple>
    <Selected></Selected>
    </SfA_SelectOptions>
    <SfA_SelectOptions>
    <Name>Housing</Name>
    <ItemID>HU</ItemID>
    <Multiple>Y</Multiple>
    <Selected></Selected>
    </SfA_SelectOptions>
    <SfA_SelectOptions>
    <Name>Investment</Name>
    <ItemID>INV</ItemID>
    <Multiple>Y</Multiple>
    <Selected></Selected>
    </SfA_SelectOptions>
    </SfAItem>
    <SfAItem>
    <Name>Transaction Code</Name>
    <Type>SfA_Text</Type>
    <VisibilityRule></VisibilityRule>
    <Information>Enter Transaction Code</Information>
    <ItemID>TXCode</ItemID>
    <Required>*</Required>
    <Value></Value>
    </SfAItem>
    <SfAItem>
    <Name>Reason Code</Name>
    <Type>SfA_Text</Type>
    <VisibilityRule></VisibilityRule>
    <Information>Enter Reason</Information>
    <ItemID>Reason</ItemID>
    <Required>*</Required>
    <Value></Value>
    <ItemError>
    <Name>Error Test</Name>
    <ItemID>ER001</ItemID>
    <Message>Please enter valid data . . .</Message>
    <SupportLink>http://www.google.co.nz/</SupportLink>
    </ItemError>
    </SfAItem>
    <SfAItem>
    <Name>Description</Name>
    <Type>SfA_Textarea</Type>
    <VisibilityRule></VisibilityRule>
    <Cols>60</Cols>
    <Information>Enter Description</Information>
    <ItemID>Description</ItemID>
    <Required>*</Required>
    <Rows>5</Rows>
    <Value></Value>
    </SfAItem>
    <SfAItem>
    <Name>Interest Computation</Name>
    <Type>SfA_Checkbox</Type>
    <VisibilityRule></VisibilityRule>
    <Information></Information>
    <ItemID>Interest</ItemID>
    <Required></Required>
    <Value></Value>
    <SfA_CheckboxOptions>
    <Name>Interest</Name>
    <ItemID>IDInterest</ItemID>
    <Multiple>Y</Multiple>
    <Selected></Selected>
    </SfA_CheckboxOptions>
    </SfAItem>
    <SfAItem>
    <Name>Interest Information</Name>
    <Type>SfA_Information</Type>
    <VisibilityRule>IDInterest!='IDInterest'</VisibilityRule>
    <BeginText>For information</BeginText>
    <EndText>or look up admin manual</EndText>
    <ItemID></ItemID>
    <Link>http://www.google.co.nz/</Link>
    <LinkLabel>see sss</LinkLabel>
    </SfAItem>
    </SfAComponent>
    <SfAComponent>
    <VisibilityRule>IDInterest!='IDInterest'</VisibilityRule>
    <SfAComponentHeader>
    <Name>Interest Calculation Applicable Dates</Name>
    <ItemID>A2</ItemID>
    </SfAComponentHeader>
    <SfAItem>
    <Name>Effective Start Date</Name>
    <Type>SfA_Text</Type>
    <VisibilityRule></VisibilityRule>
    <Information>dd/mm/yyyy</Information>
    <ItemID></ItemID>
    <Required></Required>
    <Value></Value>
    </SfAItem>
    <SfAItem>
    <Name>Effective End Date</Name>
    <Type>SfA_Text</Type>
    <VisibilityRule></VisibilityRule>
    <Information>dd/mm/yyyy</Information>
    <ItemID></ItemID>
    <Required></Required>
    <Value></Value>
    </SfAItem>
    </SfAComponent>
    </SfASection>
    <SfAMenuHeader>
    <MenuItem>
    <Name>Account Management</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    <MenuItem>
    <Name>Asset Enhancement</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    <MenuItem>
    <Name>Common Biz Services</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    <MenuItem>
    <Name>Common Sys Services</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    <MenuItem>
    <Name>Operations</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    <MenuItem>
    <Name>System Messages</Name>
    <Href>Form.xml</Href>
    <Image></Image>
    <ItemID></ItemID>
    <Target>_self</Target>
    </MenuItem>
    </SfAMenuHeader>
    <SfAButtonHeader>
    <ButtonItem>
    <Name>Save</Name>
    <ItemID></ItemID>
    </ButtonItem>
    <ButtonItem>
    <Name>Update</Name>
    <ItemID></ItemID>
    </ButtonItem>
    <ButtonItem>
    <Name>Deactivate</Name>
    <ItemID></ItemID>
    </ButtonItem>
    <ButtonItem>
    <Name>Help</Name>
    <ItemID></ItemID>
    </ButtonItem>
    <ButtonItem>
    <Name>Cancel</Name>
    <ItemID></ItemID>
    </ButtonItem>
    </SfAButtonHeader>
    </SfAForm>
    The Xsl code
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="SfAForm">
    <html>
    <head>
    <title>HP Smart Forms Demo</title>
              <link rel="stylesheet" href="../shared/css/useragentmanExample.css" type="text/css" media="all" />
              <link rel="stylesheet" href="../shared/css/visibleIf.css" type="text/css" media="all" />
              <link rel="stylesheet" href="../shared/css/style.css" type="text/css" media="all" />
              <script type="text/javascript" src="../shared/js/EventHelpers.js"></script>
              <script type="text/javascript" src="../shared/js/visibleIf.js"></script>
    </head>
    <body>
    <xsl:apply-templates select="SfAFormHeader"/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="SfAFormHeader">
    <xsl:variable name="tmpformID"><xsl:value-of select="ItemID"/></xsl:variable>
    <xsl:variable name="tmpformName"><xsl:value-of select="Name"/></xsl:variable>
    <xsl:variable name="tmpformAction"><xsl:value-of select="SubmitTo"/></xsl:variable>
    <xsl:variable name="tmpformImage"><xsl:value-of select="LogoImage"/></xsl:variable>
    <div id="stylized" class="myform">
    <form id="{$tmpformID}" name="{$tmpformName}" method="post" action="{$tmpformAction}" class="visibleIf-disableIfInvisible">
    <table>
    <tr>
    <td valign="top"><IMG src="{$tmpformImage}" ALT=""/></td>
    <td valign="top" rowspan="1">
         <h1> <xsl:value-of select="Title"/> </h1>
         <p>
    <xsl:call-template name="PreserveLineBreaks">
    <xsl:with-param name="text" select="Notes"/>
    </xsl:call-template>
    </p>
         <!-- <xsl:apply-templates select="//SfASection"/> -->
    </td>
    </tr>
    <tr>
         <td valign="top">
         <xsl:apply-templates select="//SfAMenuHeader"/>
         </td>
         <td valign="top">
         <xsl:apply-templates select="//SfASection"/>
         </td>
    </tr>
    <tr>
    <td></td> <!--Blank cell below the menu-->
    <td>
    <p></p>
         <xsl:apply-templates select="//SfAButtonHeader"/>
    </td>
    </tr>
    </table>
    </form>
    </div>
    </xsl:template>
    <xsl:template match="SfAMenuHeader">
    <xsl:apply-templates select="MenuItem"/>
    </xsl:template>
    <xsl:template match="MenuItem">
    <xsl:variable name="tmpappMenuHref"><xsl:value-of select="Href"/></xsl:variable>
    <xsl:variable name="tmpappMenuTarget"><xsl:value-of select="Target"/></xsl:variable>
    <xsl:variable name="tmpappMenuImage"><xsl:value-of select="Image"/></xsl:variable>
    <a class="menulink" href="{$tmpappMenuHref}" target="{$tmpappMenuTarget}"> <xsl:value-of select="Name"/> </a>
    <xsl:choose>
    <xsl:when test="$tmpappMenuImage=''">
    </xsl:when>
    <xsl:otherwise>
    <IMG src="{$tmpappMenuImage}" ALT=""/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfAButtonHeader">
    <xsl:apply-templates select="ButtonItem"/>
    </xsl:template>
    <xsl:template match="ButtonItem">
    <button type="submit"><xsl:value-of select="Name"/></button>
    </xsl:template>
    <xsl:template match="SfASection">
    <xsl:variable name="tmpSectionVisibleRule"><xsl:value-of select="VisibilityRule"/></xsl:variable>
    <xsl:choose>
    <xsl:when test="$tmpSectionVisibleRule=''">
    <xsl:apply-templates select="SfASectionHeader"/>
    <xsl:apply-templates select="SfAComponent"/>
    </xsl:when>
    <xsl:otherwise>
    <span class="visibleIf" data-visibleif-rule="{$tmpSectionVisibleRule}"> <!--&&=AND ||==OR -->
    <xsl:apply-templates select="SfASectionHeader"/>
    <xsl:apply-templates select="SfAComponent"/>
    </span>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfAComponent">
    <xsl:variable name="tmpComponentVisibleRule"><xsl:value-of select="VisibilityRule"/></xsl:variable>
    <xsl:choose>
    <xsl:when test="$tmpComponentVisibleRule=''">
    <xsl:apply-templates select="SfAComponentHeader"/>
    <xsl:apply-templates select="SfAItem"/>
    </xsl:when>
    <xsl:otherwise>
    <span class="visibleIf" data-visibleif-rule="{$tmpComponentVisibleRule}"> <!--&&=AND ||==OR -->
    <xsl:apply-templates select="SfAComponentHeader"/>
    <xsl:apply-templates select="SfAItem"/>
    </span>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfASectionHeader">
    <h3 class="sectionID"> <xsl:value-of select="ItemID"/> </h3>
    <h2 class ="sectionTitle"> <xsl:value-of select="Name"/> </h2>
    <!-- <p> <xsl:value-of select="Notes"/></p> -->
    <p>
    <xsl:call-template name="PreserveLineBreaks">
    <xsl:with-param name="text" select="Notes"/>
    </xsl:call-template>
    </p>
    </xsl:template>
    <xsl:template match="SfAComponentHeader">
    <h3 class="questionCode"> <xsl:value-of select="ItemID"/> </h3>
    <h3 class ="questionTitle"> <xsl:value-of select="Name"/> </h3>
    </xsl:template>
    <xsl:template match="SfAItem">
    <xsl:variable name="tmpItemVisibleRule"><xsl:value-of select="VisibilityRule"/></xsl:variable>
    <xsl:choose>
    <xsl:when test="$tmpItemVisibleRule=''">
    <xsl:call-template name="processItem">
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <span class="visibleIf" data-visibleif-rule="{$tmpItemVisibleRule}"> <!--&&=AND ||==OR -->
    <xsl:call-template name="processItem">
    </xsl:call-template>
    </span>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="processItem">
    <xsl:variable name="tmpID"><xsl:value-of select="ItemID"/></xsl:variable>
    <xsl:variable name="tmpItemValue"><xsl:value-of select="Value"/></xsl:variable>
    <xsl:variable name="tmpItemType"><xsl:value-of select="Type"/></xsl:variable>
    <xsl:apply-templates select="ItemError"/>
    <xsl:choose>
    <xsl:when test="$tmpItemType='SfA_Select'">
    <label>
    <xsl:value-of select="Name"/><b><font color="red"><xsl:value-of select="Required"/></font></b>
    <span class="small"> <xsl:value-of select="Information"/> </span>
    </label>
              <select class="dropdown" name="{$tmpID}" value="{$tmpItemValue}">
              <xsl:apply-templates select="SfA_SelectOptions"/>
              </select>
    </xsl:when>
    <xsl:when test="$tmpItemType='SfA_Checkbox'">
    <label>
    <xsl:value-of select="Name"/><b><font color="red"><xsl:value-of select="Required"/></font></b>
    <span class="small"> <xsl:value-of select="Information"/> </span>
    </label>
    <div>
    <xsl:apply-templates select="SfA_CheckboxOptions"/>
    </div>
    </xsl:when>
    <xsl:when test="$tmpItemType='SfA_Radio'">
    <label>
    <xsl:value-of select="Name"/><b><font color="red"><xsl:value-of select="Required"/></font></b>
    <span class="small"> <xsl:value-of select="Information"/> </span>
    </label>
    <div>
    <xsl:apply-templates select="SfA_RadioOptions"/>
    </div>
    </xsl:when>
    <xsl:when test="$tmpItemType='SfA_Information'">
              <xsl:variable name="tmpLink"><xsl:value-of select="Link"/></xsl:variable>
              <span class="para">
              <xsl:value-of select="BeginText"/>
              <xsl:if test="$tmpLink!=''">
                   <xsl:text> </xsl:text>
         <xsl:value-of select="LinkLabel"/>
         </xsl:if>
              <xsl:text> </xsl:text>
              <xsl:value-of select="EndText"/>
              </span>
    </xsl:when>
    <xsl:when test="$tmpItemType='SfA_Textarea'">
         <xsl:variable name="tmpRows"><xsl:value-of select="Rows"/></xsl:variable>
    <xsl:variable name="tmpCols"><xsl:value-of select="Cols"/></xsl:variable>
    <label>
    <xsl:value-of select="Name"/><b><font color="red"><xsl:value-of select="Required"/></font></b>
    <span class="small"> <xsl:value-of select="Information"/> </span>
    </label>
    <textarea class="text" rows="{$tmpRows}" cols="{$tmpCols}" name="{$tmpID}"><xsl:value-of select="Value"/></textarea>
    </xsl:when>
    <xsl:otherwise>
    <label>
    <xsl:value-of select="Name"/><b><font color="red"><xsl:value-of select="Required"/></font></b>
    <span class="small"> <xsl:value-of select="Information"/> </span>
    </label>
              <input class="text" type="text" name="{$tmpID}" id="{$tmpID}" value="{$tmpItemValue}"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="ItemError">
    <xsl:variable name="tmpSupportLink"><xsl:value-of select="SupportLink"/></xsl:variable>
    <!--Add error message if it exists. Add below the data entry -->
    <!-- <label><xsl:text>Error: </xsl:text><xsl:value-of select="ItemID"/></label> -->
    <label></label>
    <xsl:choose>
    <xsl:when test="$tmpSupportLink=''">
    <span class="error"><xsl:value-of select="Message"/></span>
    </xsl:when>
    <xsl:otherwise>
    <a class="error" href="{$tmpSupportLink}" target="_blank"><xsl:value-of select="Message"/></a>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfA_CheckboxOptions">
    <xsl:variable name="tmpItemOptionID"><xsl:value-of select="ItemID"/></xsl:variable>
    <xsl:variable name="tmpItemOptionValue"><xsl:value-of select="Value"/></xsl:variable>
    <xsl:variable name="tmpItemOptionSelected"><xsl:value-of select="Selected"/></xsl:variable>
    <xsl:variable name="tmpItemOptionMultiple"><xsl:value-of select="Multiple"/></xsl:variable>
    <input type="checkbox" name="{$tmpItemOptionID}" value="{$tmpItemOptionID}">
    <xsl:if test="$tmpItemOptionSelected='Y'">
    <xsl:attribute name="checked">checked</xsl:attribute>
    </xsl:if>
    </input>
    <xsl:choose>
    <xsl:when test="$tmpItemOptionMultiple='Y'">
    <span class="checklabelMultiple"><xsl:value-of select="Name"/></span>
    </xsl:when>
    <xsl:otherwise>
    <span class="checklabelSingle"><xsl:value-of select="Name"/></span>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfA_RadioOptions">
    <xsl:variable name="tmpItemOptionID"><xsl:value-of select="ItemID"/></xsl:variable>
    <xsl:variable name="tmpItemOptionValue"><xsl:value-of select="Value"/></xsl:variable>
    <xsl:variable name="tmpItemOptionSelected"><xsl:value-of select="Selected"/></xsl:variable>
    <xsl:variable name="tmpItemOptionMultiple"><xsl:value-of select="Multiple"/></xsl:variable>
    <input type="radio" name="{$tmpItemOptionID}" value="{$tmpItemOptionValue}">
    <xsl:if test="$tmpItemOptionSelected='Y'">
    <xsl:attribute name="checked">checked</xsl:attribute>
    </xsl:if>
    </input>
    <xsl:choose>
    <xsl:when test="$tmpItemOptionMultiple='Y'">
    <span class="checklabelMultiple"><xsl:value-of select="Name"/></span>
    </xsl:when>
    <xsl:otherwise>
    <span class="checklabelSingle"><xsl:value-of select="Name"/></span>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="SfA_SelectOptions">
    <xsl:variable name="tmpItemOptionValue"><xsl:value-of select="ItemID"/></xsl:variable>
    <xsl:variable name="tmpItemOptionSelected"><xsl:value-of select="Selected"/></xsl:variable>
    <xsl:choose>
    <xsl:when test="$tmpItemOptionSelected=''">
              <option value="{$tmpItemOptionValue}"><xsl:value-of select="Name"/></option>
    </xsl:when>
    <xsl:otherwise>
    <option value="{$tmpItemOptionValue}" selected="{$tmpItemOptionSelected}"><xsl:value-of select="Name"/></option>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="PreserveLineBreaks">
    <xsl:param name="text"/>
    <xsl:choose>
    <xsl:when test="contains($text,'&#xA;')">
    <xsl:value-of select="substring-before($text,'&#xA;')"/>
    <xsl:call-template name="PreserveLineBreaks">
    <xsl:with-param name="text">
    <xsl:value-of select="substring-after($text,'&#xA;')"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$text"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

  • File Filter in AWT

    The FileDialog class in AWT does not include a file filter! The FileFilter class doesn't work properly, I tried using it in different ways, but it doesn't filter the files.
    How can this be achieved?
    TECHNOSAM.

    Using setFile("*.txt") works, but it has limitations.
    Once some file is clicked, the Filter effect is lost. There has to be some why by implementing the FilenameFilter interface. It's accept method can be implemented. I tried this method, but doesn't work. Or there could be some mistake in the way I have done it. This is the way i have done it:
    class MyFilter implements FilenameFilter
    public MyFilter() {}          
    public boolean accept(File dir,String name)
    if(name.endsWith("gif") || name.endsWith("jpg"))
    return true;
    return false;
    FileDialog fd = new FileDialog(parent,"File Open...");
    MyFilter f = new MyFilter();
    fd.setFilenameFilter(f);
    Is this alright? This does no good. Does somebody have a solution to this problem?
    Thanks,
    TechnoSam.

  • Obiee upload file filter

    Hi,
    In Obiee 11g, i'am using the new functionnality of file uploading. However, i would kniw if it's possible to do add a file filter? I want only .doc files to uploaded.
    Thanks.

    OK,
    Using firebird, i found the right JS file. I didn't finished the filter yet because i have also to check that i am in the right folder but i think i am in the right way.
    Thanks.
    However, if a new patch is installed, there is a risk to have my customizations delete. There is way to prenvent this ?

  • File filter removing the All Files option

    I am trying to remove the All Files option from the file filter. Someone suggested doing this:
        public FileFilter getAcceptAllFileFilter() {
          return null;
        }but I am unsure how to use it. My filechooser is this:
          final JFileChooser fc = new JFileChooser();
          fc.setFileFilter(new ExtensionFileFilterClass());ExtensionFileFilterClass is used to filter out some extensions and only keep .txt ones. It works except for the All Files part. Can anyone point me in the right direction? Thanks.
    Allyson

    I think my subject is probably misleading. I WANT to remove the All Files option. I only want to have the *.txt option on the filter. And it won't go away. Can I make it go away? I only want the user to have the ability to pick from *.txt files, not any. Thanks.
    Allyson

  • How to set file filter in FileUpload?

    Is there any way to set the file filter on FileUpload? Let's say, I only want the user to see all .xml files. Currently, the default is all files of any extension are displayed.
    Thanks. c",?

    The dialog which appears is solely controlled by the browser. I don't see a way to set the file filter to this dialog.
    You can read more about file upload here.
    http://jakarta.apache.org/commons/fileupload/using.html
    - Winston
    http://blogs.sun.com/winston

  • File Filter

    Hi,
    How Can I create file filter? I Need to show only the specyfic type of file
    in JFileChooser open or save ?
    Best Regards,
    Gutek

    You have to subclass the javax.swing.filechooser.FileFilter abstract class, add your filter object to your JFileChooser user-choosable filters list ( addChoosableFileFilter() method) and make it current ( setFileFilter() method ).
    Look at this:
    /** A simple FileFilter discriminating files by extension
    *  (only regular files allowed)
    *  @author Giorgio Maone
    import java.io.File;
    import javax.swing.filechooser.*;
    import javax.swing.JFileChooser;
    public class ExtensionFileFilter extends FileFilter {
    String[] extensions;
    String desc;
      public ExtensionFileFilter(String desc,String[] extensions) {
      this.extensions=extensions!=null?extensions:new String[]{};
      this.desc=desc==null?extList():desc+" ("+extList()+")";
    private String extList() {
      int len=extensions.length;
      if(len>0) {
       String ret=extensions[0];
       for(int j=1; j<len; ret+=", "+extensions[j++]);
       return ret;
      } else return "";
      public boolean accept(File f) {
      if(f.isFile()) {
       String fname=f.getName().toLowerCase();
        for(int j=extensions.length; j-->0;) {
         if(fname.endsWith(extensions[j])) return true;
      return false;
      public String getDescription() {
        return desc;
    //test main
      public static void main(String[] args) {
      JFileChooser fc=new JFileChooser();
      fc.addChoosableFileFilter(new ExtensionFileFilter("Pictures",new String[]{".gif",".jpg",".jpeg",".png"}));
      fc.addChoosableFileFilter(new ExtensionFileFilter("Audio-clips",new String[]{".au",".aiff",".mp3",".wav"}));
      fc.addChoosableFileFilter(new ExtensionFileFilter("Movies",new String[]{".mpg",".mpeg",".avi"}));
      fc.setAcceptAllFileFilterUsed(false);
      fc.setDialogTitle("Select a multimedia content");
      fc.showOpenDialog(null);
    }

  • JFileChooser: folder disapper for choosing when file filter is set

    I have created a JFileChooser for saving csv file. After I have add .csv as the choosable file filter, all folders disapper even though I have set file selection mode as FILES_AND_DIRECTORIES! It will be shown only when I choose "All files" in the file type. Is there any way to display the folder together with all the csv files together?
    Here is my code sippnet:
    javax.swing.JFileChooser saveDialogBox = new javax.swing.JFileChooser("C:\\");
    saveDialogBox.setDialogTitle("Exporting...");
    saveDialogBox.setDragEnabled(true);
    saveDialogBox.setFileSelectionMode(javax.swing.JFileChooser.FILES_AND_DIRECTORIES);
    FileFiltering fileExtension = new FileFiltering();
    saveDialogBox.addChoosableFileFilter(fileExtension);               
    int retMethod = saveDialogBox.showSaveDialog(this);

    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.filechooser.*;
    public class Test extends JFrame {
        public Test() {
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container content = getContentPane();
         JFileChooser jfc = new JFileChooser();
         jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
         jfc.setFileFilter(new FileFilter() {
             public boolean accept(java.io.File file) {
              return file.isDirectory() || file.getName().endsWith(".txt");
             public String getDescription() { return "*.txt"; }
         jfc.showSaveDialog(this);
         setSize(200,200);
         show();
        public static void main(String[] args) { new Test(); }
    }

  • File filter on F4

    Hi,
    I'm using the method below to allow the user to select a file from their local drive. The file filter *.txt parameter does not work though, all it does is put .txt in the File Type and not allow you choose any other type - but it shows ALL files. I want the user to just see the .txt's in their local drive. Thanks
    Get file specified on selection screen
       CALL METHOD cl_gui_frontend_services=>file_open_dialog
         EXPORTING
           default_extension = 'TXT'
           file_filter       = '*.txt'
         CHANGING
           file_table        = gt_filename_tab
           rc                = g_filerc.

    Hi,
    Try it this way
    DATA : gt_filename_tab type filetable,
           g_filerc type i.
    PARAMETERS : FILE TYPE STRING.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    default_extension = 'TXT'
    file_filter = '(*.txt)|*.txt|'
    CHANGING
    file_table = gt_filename_tab
    rc = g_filerc.
    Regards

  • Setting Self Created File Filter as Default

    Hello Guys,
    I need some help out here. I have created a simple file filter and I have added it to a JFileChooser. Now when the FileChooser Dialog is loaded it shows the All Files Filter whereas I want the mine to be the default filter when the dialog loads. Also I do not want the Default File Filter (All Files) to be disabled. So both the filters should be enabled with my filter loading as default at runtime. Please Help.

    Here is the sample code,
    //=====================================================================
    //Assuming that you have a JFileChooser object created by the reference fileChooser
    JFileChooser fileChooser = new JFileChooser();
    //To disable the default select all FIleFIlter call setAcceptAllFIleFilterUsed(false);
    fileChooser.setAcceptAllFIleFilterUsed(false);
    //set your desired FileFIlter
    //Please note that the last filter is the one selected by default
    //Suppose you have three FileFIlters namely
    //FIleFIlterA, FIleFIlterB,FIleFIlterC
    //fileChooser.setFileFIlter(yourFIlterA);
    //fileChooser.setFileFIlter(yourFIlterB);
    //fileChooser.setFileFIlter(yourFIlterC);
    //Now FIleFIlterC will be shown selected by default
    fileChooser.setFileFIlter(yourFIlter);
    //Call any of the showDialog methods to open a dialog
    fileChooser.showDialog(null, "Select File");
    //===========================================================================
    Hope this will solve your problem
    Best regards,
    MMM

  • Checking a file filter

    I've managed to create a file saver dialog, with some custom file filters, called JpegSave and PPM save.
    I'm trying to check, once a file saver dialog has been created, to check what the current file filter is.
    Is it possible to check, by writing some code, whether the current file saver dialog's file filter is a certain file filter?

    Thanks, but that doesn't seem to work.
    Wouldn't that code just create a new FileFilter and
    set it to the current filter?
    I'm trying to find out what the current filter is and
    check if it is the same as a certain file filter
    getFileFilter() returns to you the file filter that is currently in use by the JFileChooser. If you want to compare it with another file filter to see if it is the same, do:
    if (filter == getFileFilter()) { .. }
    Most likely, though, what you really would want to do is see if it's the same TYPE of file filter. So you'd want to do something like:
    if (fileChooser.getFileFilter() instanceof filter.getClass()) { .. }

  • Error while importing WSDL file created in JDeveloper inside BS

    Hi All,
    I am facing error while importing WSDL of the DBAdapter service created using JDeveloper inside my business service in OSB.
    The error in OSB is 'The Resource Mapped Does not exist'

    Which version of OSB are you using? You need to upload schema (.xsd) files as well. WSDL has references to that schema(s) but they are not uploaded hence this error. On sbconsole, if you click on a WSDL name to see it, a button comes with name "Edit References". Click that to point to the xsd's you uploaded.
    Regards,
    Anuj

  • Could not find multiple file upload in Jdeveloper 11.1.2.3

    Hi,
    I am using Jdeveloper 11.1.2.3, I am trying to use the multiple file upload feature but I could do not find (Rows) propriety in Input file component. so, what I am missing? is there some extra library need to be add to the application?

    Hi,
    its a feature of 12c
    Frank

  • Opening large ant xml build file(70KB+) hangs JDeveloper 11.1.2.1.0

    Hey everyone!
    I've been using JDeveloper for about 6 months and I've loved it from the beginning. Everythings seems to be where it's supposed to be and the visual editor greatly speeds up the development. And it's free - amazing. But the team I work with... all of them use IDEA/Eclipse, that is what people got used to - those monstrous IDE's that I'm not realy into - ...So all my persuasions to migrate to JDeveloper crash on one point: when opening large(70KB+) ant xml build files the JDeveloper seems to be doing some syntax checking and just hangs without saying anything. The strange thing is that these files open OK in IDEA/Eclipse.
    I use the latest version of JDeveloper 11g Release 2 11.1.2.1.0 on Windows7-64 and 1.6.0_30 java. Can I get some help on this one to increase the JDevelper popularity among fellow java developers? :)
    Thanks in advance!
    Edited by: 924380 on 29.03.2012 15:30

    Do you have access to Oracle Support to file an SR?
    Can you post your build.xml file somewhere, and I'd be happy to test?
    Another thing to try: run jdev.exe/jdev64.exe (assuming you're on windows) from jdeveloper\jdev\bin. This will open JDev in a command prompt window, and any stack traces that jdev might throw internally would be displayed in the console window. Not that this would help you fix anything, but might give Oracle a clue as to where the issue lies.
    John

  • File adapter polling and getting the file name 11g Jdeveloper

    I am using JDeveloper 11g. My process is something like;
    A file adapter reads a XML file
    This triggers the BPM process, file content is sent to start activity as message
    I have to get the file name that is read by file adapter.
    How to do that? Any help is appreciated.
    I have seen couple of answers like bellow in forum but did not help me much
    This is a very simple task in JDeveloper 11g, file adapters are linked to the receive activity, here there is a tab called Properties which you can use to extract the file name. Please follow the steps below:
    1. Create a Simple Type variable of string type, call it fileName_var or any name you wish.
    2. Open the Receive activity in your bpel project.
    3. Scroll down to jca.file.FileName and double click on the value column, click on the browse button (...), select Variable, then click the search icon
    4. Locate your recently created variable
    5. Now when your project runs it will assign the file name to this variable, you can use this same approach also to pull the directory, file size, etc.
    *************************/

    hi,
    Like you said.. steps are simple and clearly mentioned in guide.
    1. create a variable of type string
    2. after configuring the file adapter , go to corresponding receive activity , go to properties tab
    3. search for a property with name as jca.file.FileName . This basically keeps track of file name
    4. for this property, give the value as name of variable created in step 1 above
    5. Use this variable anywhere in assign / transform
    HTH,
    Ketan

Maybe you are looking for

  • Getting list of selected Rows of a Table

    Hi Experts, Im having a table with 500 elements, among them i select few of them to process, for exmpl consider my table has 500 rows , where each row represents a Invoice Payment, among them only few i select and process those or reject those. Now m

  • TV Out Card (MS-6957-020)

    I am buying the Mega Barebone PC, anyone have any clue where to get the TV Out Card (MS-6957-020) for it.  I cant find it anywhere!

  • IPhoto 6 Print to PDF Errors

    Please advise: how can I restore the functionality of printing an iPhoto 6 photobook to PDF? I was successful before my upgrade to Leopard in printing to PDF my iPhoto photobooks. However, no matter how I tried, even opening a new instance of iPhoto

  • Daily orders report (show day wise created, shipped, open orders)

    I have to create crystal report for the following Daily  orders - created, shipped, open (not processed till date) for a previous week (last seven days)                                       Created                   Shipped                  Open Tue

  • SNOTE  980690 - HELP NEEDED

    Note 980690 having the status of "cannot be implemented" Wonder the blocking factor of this note 980690 is caused by the transport that we have created or not. This transport was created base on step 20 to 33 of note 980690, well before the snote imp