当前位置: 首页>>代码示例>>Java>>正文


Java I18n类代码示例

本文整理汇总了Java中org.netbeans.modeler.locale.I18n的典型用法代码示例。如果您正苦于以下问题:Java I18n类的具体用法?Java I18n怎么用?Java I18n使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


I18n类属于org.netbeans.modeler.locale包,在下文中一共展示了I18n类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GenericDialog

import org.netbeans.modeler.locale.I18n; //导入依赖的package包/类
public GenericDialog(java.awt.Frame parent, String title, boolean modal) {
        super(parent, title, modal);

        KeyStroke escape = KeyStroke.getKeyStroke(VK_ESCAPE, 0, false);
        Action escapeAction = new AbstractAction() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                cancelActionPerformed(e);
            }
        };

        getRootPane().getInputMap(WHEN_IN_FOCUSED_WINDOW).put(escape, I18n.getString("Global.Pane.Escape"));
        getRootPane().getActionMap().put(I18n.getString("Global.Pane.Escape"), escapeAction);
//        getRootPane().registerKeyboardAction(e -> cancelActionPerformed(e), KeyStroke.getKeyStroke(VK_ESCAPE, 0), WHEN_IN_FOCUSED_WINDOW);
        setModal(modal);
        addWindowListener(new java.awt.event.WindowAdapter() {
            @Override
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:24,代码来源:GenericDialog.java

示例2: DynamicEntityComponent

import org.netbeans.modeler.locale.I18n; //导入依赖的package包/类
public DynamicEntityComponent(NAttributeEntity attributeEntity, java.awt.Frame parent, boolean modal) {
    super(parent, modal);
    this.attributeEntity = attributeEntity;
    row = new Object[attributeEntity.getColumns().size()];

    javax.swing.KeyStroke escape = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0, false);
    javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            cancelActionPerformed(e);
        }
    };

    getRootPane().getInputMap(javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, I18n.getString("Global.Pane.Escape"));
    getRootPane().getActionMap().put(I18n.getString("Global.Pane.Escape"), escapeAction);

    setModal(true);
    addWindowListener(new java.awt.event.WindowAdapter() {
        @Override
        public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
        }
    });
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:25,代码来源:DynamicEntityComponent.java

示例3: CustomAttributeDialog

import org.netbeans.modeler.locale.I18n; //导入依赖的package包/类
public CustomAttributeDialog(java.awt.Frame parent, boolean modal) {
    super(parent, modal);
    initComponents();

    javax.swing.KeyStroke escape = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0, false);
    javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            jButtonCancelActionPerformed(e);
        }
    };

    getRootPane().getInputMap(javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, I18n.getString("Global.Pane.Escape"));
    getRootPane().getActionMap().put(I18n.getString("Global.Pane.Escape"), escapeAction);

    getRootPane().setDefaultButton(this.jButtonOK);
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:18,代码来源:CustomAttributeDialog.java

示例4: GenericDialog

import org.netbeans.modeler.locale.I18n; //导入依赖的package包/类
public GenericDialog() {
    super(new javax.swing.JFrame(), true);

    javax.swing.KeyStroke escape = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0, false);
    javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            cancelActionPerformed(e);
        }
    };

    getRootPane().getInputMap(javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, I18n.getString("Global.Pane.Escape"));
    getRootPane().getActionMap().put(I18n.getString("Global.Pane.Escape"), escapeAction);

    setModal(true);
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
        }
    });
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:22,代码来源:GenericDialog.java

示例5: jButtonOKActionPerformed

import org.netbeans.modeler.locale.I18n; //导入依赖的package包/类
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed

        if (this.jTextFieldName.getText().trim().length() <= 0 || Pattern.compile("[^\\w-]").matcher(this.jTextFieldName.getText().trim()).find()) {
            javax.swing.JOptionPane.showMessageDialog(this,
                    I18n.getString(CustomAttributeDialog.class, "ModelerElement.AttributeDialog.Message.Warning"), I18n.getString(CustomAttributeDialog.class, "ModelerElement.AttributeDialog.Message.Warning2"),
                    javax.swing.JOptionPane.WARNING_MESSAGE);
            return;
        }

        // check if the name is valid...
        if (getProperties() != null) {
            String name = jTextFieldName.getText().trim();
            for (GenericProperty prop : getProperties()) {
                if (prop.getKey().equals(name) && (originalName == null
                        || !originalName.equals(name))) {

                    javax.swing.JOptionPane.showMessageDialog(this,
                            I18n.getString(CustomAttributeDialog.class, "ModelerElement.AttributeDialog.Message.warning3"), I18n.getString(CustomAttributeDialog.class, "ModelerElement.AttributeDialog.Warning4"),
                            javax.swing.JOptionPane.WARNING_MESSAGE);
                    return;
                }
            }
        }
        if (tmpField == null) {
            tmpField = new GenericProperty();
        }
        tmpField.setKey(jTextFieldName.getText().trim());
        tmpField.setValue(this.jTextAreaDescription.getText());

        setVisible(false);
        this.setDialogResult(javax.swing.JOptionPane.OK_OPTION);
        dispose();
    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:34,代码来源:CustomAttributeDialog.java


注:本文中的org.netbeans.modeler.locale.I18n类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。