Example usage for java.util ResourceBundle getString

List of usage examples for java.util ResourceBundle getString

Introduction

In this page you can find the example usage for java.util ResourceBundle getString.

Prototype

public final String getString(String key) 

Source Link

Document

Gets a string for the given key from this resource bundle or one of its parents.

Usage

From source file:cz.incad.kramerius.pdf.impl.FirstPagePDFServiceImpl.java

void pagesInSelectiontPdf(PreparedDocument rdoc, ResourceBundle resourceBundle, List<DetailItem> details) {
    // tistene stranky
    List<AbstractPage> pages = rdoc.getPages();
    if (pages.size() == 1) {
        details.add(new DetailItem(resourceBundle.getString("pdf.fp.page"), pages.get(0).getPageNumber()));
    } else if (pages.size() > 1) {
        StringTemplate template = new StringTemplate("$data:{page|$page.pageNumber$};separator=\", \"$");
        template.setAttribute("data", pages);
        details.add(new DetailItem(resourceBundle.getString("pdf.fp.pages"), template.toString()));
    }//from   w  w w .  java  2 s .  co  m
}

From source file:be.fgov.minfin.webForm.backing.DeposInvoCdcBean.java

public void checkDigit(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    Application app = FacesContext.getCurrentInstance().getApplication();
    ResourceBundle bundle = app.getResourceBundle(FacesContext.getCurrentInstance(), "CdcMessages");
    IBANCheckDigit ibancheck = new IBANCheckDigit();
    String numComptAValider = (String) value;
    if (ibancheck.isValid(numComptAValider) == false) {
        throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
                bundle.getString("deposInvo.numcompte.error"), ""));
    }//from   ww w  .  j  av a  2s.  co  m
}

From source file:be.fgov.minfin.webForm.backing.SqueezeCdcBean.java

public void checkDigit(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    Application app = FacesContext.getCurrentInstance().getApplication();
    ResourceBundle bundle = app.getResourceBundle(FacesContext.getCurrentInstance(), "CdcMessages");
    IBANCheckDigit ibancheck = new IBANCheckDigit();
    String numComptAValider = (String) value;
    if (ibancheck.isValid(numComptAValider) == false) {
        throw new ValidatorException(
                new FacesMessage(FacesMessage.SEVERITY_ERROR, bundle.getString("squeeze.numcompte.error"), ""));
    }/* w  ww. j  a v  a  2 s .c o m*/
}

From source file:ru.develgame.jflickrorganizer.MainForm.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from w w  w. j a  v a  2 s .co m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabelBackupFolder = new javax.swing.JLabel();
    jTextFieldBackupFolder = new javax.swing.JTextField();
    jButtonChooseBackupFolder = new javax.swing.JButton();
    jButtonBackup = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTreeAlbums = new javax.swing.JTree();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTablePhotos = new JTable() {
        @Override
        public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
            Component component = super.prepareRenderer(renderer, row, column);
            int rendererWidth = component.getPreferredSize().width + 5;
            TableColumn tableColumn = getColumnModel().getColumn(column);
            tableColumn.setPreferredWidth(
                    Math.max(rendererWidth + getIntercellSpacing().width, tableColumn.getPreferredWidth()));
            return component;
        }
    };
    jComboBoxVisibility = new javax.swing.JComboBox<>();
    jPanel1 = new javax.swing.JPanel();
    jLabelAll = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenuItemSetPassword = new javax.swing.JMenuItem();
    jMenuItemExit = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("MainForm"); // NOI18N
    setTitle(bundle.getString("MainForm.title")); // NOI18N
    setMinimumSize(new java.awt.Dimension(1024, 717));
    setName("Form"); // NOI18N

    jLabelBackupFolder.setText(bundle.getString("MainForm.jLabelBackupFolder.text")); // NOI18N
    jLabelBackupFolder.setName("jLabelBackupFolder"); // NOI18N

    jTextFieldBackupFolder.setName("jTextFieldBackupFolder"); // NOI18N

    jButtonChooseBackupFolder.setText(bundle.getString("MainForm.jButtonChooseBackupFolder.text")); // NOI18N
    jButtonChooseBackupFolder.setName("jButtonChooseBackupFolder"); // NOI18N
    jButtonChooseBackupFolder.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonChooseBackupFolderActionPerformed(evt);
        }
    });

    jButtonBackup.setText(bundle.getString("MainForm.jButtonBackup.text")); // NOI18N
    jButtonBackup.setName("jButtonBackup"); // NOI18N
    jButtonBackup.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonBackupActionPerformed(evt);
        }
    });

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    jTreeAlbums.setName("jTreeAlbums"); // NOI18N
    jScrollPane1.setViewportView(jTreeAlbums);

    jScrollPane2.setName("jScrollPane2"); // NOI18N

    jTablePhotos.setAutoCreateRowSorter(true);
    jTablePhotos.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {

    }, new String[] {

    }));
    jTablePhotos.setToolTipText(bundle.getString("MainForm.jTablePhotos.toolTipText")); // NOI18N
    jTablePhotos.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    jTablePhotos.setName("jTablePhotos"); // NOI18N
    jTablePhotos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane2.setViewportView(jTablePhotos);

    jComboBoxVisibility.setName("jComboBoxVisibility"); // NOI18N

    jPanel1.setName("jPanel1"); // NOI18N

    jLabelAll.setText(bundle.getString("MainForm.jLabelAll.text")); // NOI18N
    jLabelAll.setName("jLabelAll"); // NOI18N

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout
            .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel1Layout.createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabelAll).addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE).addComponent(jLabelAll)));

    jMenuBar1.setName("jMenuBar1"); // NOI18N

    jMenu1.setText(bundle.getString("MainForm.jMenu1.text")); // NOI18N
    jMenu1.setName("jMenu1"); // NOI18N

    jMenuItemSetPassword.setText(bundle.getString("MainForm.jMenuItemSetPassword.text")); // NOI18N
    jMenuItemSetPassword.setName("jMenuItemSetPassword"); // NOI18N
    jMenuItemSetPassword.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItemSetPasswordActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItemSetPassword);

    jMenuItemExit.setText(bundle.getString("MainForm.jMenuItemExit.text")); // NOI18N
    jMenuItemExit.setName("jMenuItemExit"); // NOI18N
    jMenuItemExit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItemExitActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItemExit);

    jMenuBar1.add(jMenu1);

    setJMenuBar(jMenuBar1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addComponent(jLabelBackupFolder)
                                    .addGap(68, 68, 68).addComponent(jTextFieldBackupFolder)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jButtonChooseBackupFolder)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jButtonBackup))
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 213,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    784, Short.MAX_VALUE)
                                            .addGroup(layout.createSequentialGroup()
                                                    .addComponent(jComboBoxVisibility,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 271,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(0, 0, Short.MAX_VALUE)))))
                    .addContainerGap())
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldBackupFolder, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonBackup).addComponent(jButtonChooseBackupFolder)
                    .addComponent(jLabelBackupFolder))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(jComboBoxVisibility, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 590,
                                            Short.MAX_VALUE))
                            .addComponent(jScrollPane1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel1,
                            javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));

    pack();
}

From source file:com.google.enterprise.connector.filesystem.FileConnectorTypeTest.java

private void testEscaping(Locale locale, ResourceBundle bundle, String bundleKey, String bundleValue,
        String absentValue, String escapedValue) {
    ConfigureResponse response = type.getConfigForm(locale);
    assertEquals("", response.getMessage());

    // Internal check to make sure the target French translation is still there.
    assertEquals(bundleValue, bundle.getString(bundleKey));

    String snippet = response.getFormSnippet();
    assertFalse("Snippet contains " + absentValue + ": " + snippet, snippet.contains(absentValue));
    assertTrue("Snippet does not contain " + bundleValue + ": " + snippet, snippet.contains(escapedValue));
}

From source file:com.openbravo.pos.admin.RolesViewTree.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from  w  w w . j a  va  2s.c  o  m
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jSpinner1 = new javax.swing.JSpinner();
    jLabel2 = new javax.swing.JLabel();
    m_jName = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jPermissionDesc = new javax.swing.JTextArea();
    jAddEntry = new javax.swing.JButton();
    jDeleteEntry = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jRightsLevel = new javax.swing.JSpinner();

    jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
    jLabel2.setText(AppLocal.getIntString("Label.Name")); // NOI18N

    m_jName.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 10, Short.MAX_VALUE));

    jPermissionDesc.setColumns(20);
    jPermissionDesc.setFont(new java.awt.Font("Tahoma", 3, 12)); // NOI18N
    jPermissionDesc.setLineWrap(true);
    jPermissionDesc.setRows(5);
    jScrollPane2.setViewportView(jPermissionDesc);

    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N
    jAddEntry.setText(bundle.getString("Button.addclass")); // NOI18N
    jAddEntry.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jAddEntryActionPerformed(evt);
        }
    });

    jDeleteEntry.setText(bundle.getString("Button.deleteclass")); // NOI18N
    jDeleteEntry.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jDeleteEntryActionPerformed(evt);
        }
    });

    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
    jLabel1.setText(bundle.getString("label.rightslevel")); // NOI18N

    jRightsLevel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    jRightsLevel.setModel(new javax.swing.SpinnerNumberModel(3, 0, 9, 1));
    jRightsLevel.setMinimumSize(new java.awt.Dimension(35, 28));
    jRightsLevel.setPreferredSize(new java.awt.Dimension(35, 28));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jScrollPane1))
                    .addGroup(layout.createSequentialGroup().addGap(22, 22, 22)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 66,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, 257,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jAddEntry)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jDeleteEntry)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jRightsLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 12, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup().addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1)
                                    .addComponent(jRightsLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jAddEntry).addComponent(jDeleteEntry)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 447,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                    .addContainerGap()));
}

From source file:es.pode.empaquetador.presentacion.archivos.gestor.GestorArchivosControllerImpl.java

/**
 * @see es.pode.empaquetador.presentacion.archivos.gestor.GestorArchivosController#selectAction(org.apache.struts.action.ActionMapping, es.pode.empaquetador.presentacion.archivos.gestor.SelectActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*  w  w w . ja  va2 s. co  m*/
public final java.lang.String selectAction(ActionMapping mapping,
        es.pode.empaquetador.presentacion.archivos.gestor.SelectActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    /*
    * Metodo de decision para el action. Analiza los parametros
    * actionSubmit (value de los botones submit) para redirigir al caso de uso
    * correspondiente. El actionSubmit llegara
    * internacionalizado, por lo que es necesario acceder al ResouceBundle
    * para obtener el valor correcto en la comparacion.
    */

    String result = null;
    String actionSubmit = form.getAction();
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle(APPLICATION_RESOURCES, locale);

    if (form.getAction() == (null)) {
        throw new ValidatorException(ERROR_GENERICO);
    }

    else if (actionSubmit.equals(i18n.getString(COPIAR))) {
        result = COPIAR_STR;
    } else if (actionSubmit.equals(i18n.getString(CORTAR))) {
        result = CORTAR_STR;
    } else if (actionSubmit.equals(i18n.getString(PEGAR))) {
        result = PEGAR_STR;
    } else if (actionSubmit.equals(i18n.getString(ELIMINAR))) {
        result = ELIMINAR_STR;
    } else if (actionSubmit.equals(i18n.getString(CREAR_CARPETA))) {
        result = CREAR_CARPETA_STR;
    } else if (actionSubmit.equals(i18n.getString(CREAR_ARCHIVO))) {
        result = CREAR_ARCHIVO_STR;
    }

    return result;
}