Java tutorial
/** * Copyright 2013-2015 TIKAL-TECHNOLOGY * *Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package org.nekorp.workflow.desktop.view; import org.nekorp.workflow.desktop.control.WorkflowApp; import org.springframework.beans.factory.annotation.Autowired; /** * * @author Nekorp */ public class EventoExtraGuardar extends ApplicationView { @Autowired private WorkflowApp aplication; /** * Creates new form EventoExtraGuardar */ public EventoExtraGuardar() { super(); } @Override public void iniciaVista() { initComponents(); } @Override public void setEditableStatus(boolean value) { //nada } @Override public ViewValidIndicator getValidInidicator() { return null; } /** * 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. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); guardar = new javax.swing.JButton(); jSeparator1 = new javax.swing.JSeparator(); setBackground(new java.awt.Color(255, 255, 255)); setMaximumSize(new java.awt.Dimension(32767, 36)); jToolBar1.setBackground(new java.awt.Color(255, 255, 255)); jToolBar1.setFloatable(false); jToolBar1.setRollover(true); jToolBar1.add(filler1); guardar.setBackground(new java.awt.Color(255, 255, 255)); guardar.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N guardar.setText("Guardar"); guardar.setFocusable(false); guardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); guardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); guardar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { guardarActionPerformed(evt); } }); jToolBar1.add(guardar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 769, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(jToolBar1, 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() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0))); }// </editor-fold>//GEN-END:initComponents private void guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guardarActionPerformed try { this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); aplication.guardaServicio(); } catch (IllegalArgumentException e) { //no lo guardo sad panda. } finally { this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); } }//GEN-LAST:event_guardarActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.Box.Filler filler1; private javax.swing.JButton guardar; private javax.swing.JSeparator jSeparator1; private javax.swing.JToolBar jToolBar1; // End of variables declaration//GEN-END:variables }