/*
* The contents of this file are subject to the terms of the Common Development
* and Distribution License (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at http://www.netbeans.org/cddl.html
* or http://www.netbeans.org/cddl.txt.
*
* When distributing Covered Code, include this CDDL Header Notice in each file
* and include the License file at http://www.netbeans.org/cddl.txt.
* If applicable, add the following below the CDDL Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.gwt4nb.services.refactoring.ui;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.event.ChangeListener;
import org.netbeans.modules.gwt4nb.services.ServiceClassSet;
import org.netbeans.modules.gwt4nb.services.refactoring.ServiceDeleteRefactoring;
import org.netbeans.modules.refactoring.spi.ui.CustomRefactoringPanel;
import org.openide.util.NbBundle;
/** UI panel for displaying refactoring information.
*
* @author Prem
*/
public class ServiceDeletePanel extends JPanel
implements CustomRefactoringPanel {
private static final long serialVersionUID = 1;
// refactoring this panel provides parameters for
private final ServiceDeleteRefactoring refactoring;
// table model for the table of members
private ServiceClassSet serviceClassSet;
/** Creates new form ServiceDeletePanel
* @param refactoring The refactoring this panel provides parameters for.
* @param serviceClassSet Members that should be pre-selected in the panel
*/
public ServiceDeletePanel(ServiceDeleteRefactoring refactoring, ServiceClassSet serviceClassSet, final ChangeListener parent) {
this.refactoring = refactoring;
this.serviceClassSet = serviceClassSet;
initComponents();
setPreferredSize(new Dimension(420, 380));
}
/** Initialization of the panel (called by the parent window).
*/
public void initialize() {
if(serviceClassSet.getService()!=null){
serviceName.setText(serviceClassSet.getService().getQualifiedName().toString()+
".java"); // NOI18N
}else {
serviceName.setText(NbBundle.getMessage(ServiceDeletePanel.class,
"ClassUnav")); // NOI18N
}
if(serviceClassSet.getServiceAsync()!=null){
serviceAsyncName.setText(serviceClassSet.getServiceAsync().getQualifiedName().toString()+
".java"); // NOI18N
}else {
serviceAsyncName.setText(NbBundle.getMessage(
ServiceDeletePanel.class, "ClassUnav")); // NOI18N
}
if(serviceClassSet.getServiceImpl()!=null){
serviceImplName.setText(serviceClassSet.getServiceImpl().getQualifiedName().toString()+
".java"); // NOI18N
}else {
serviceImplName.setText(
NbBundle.getMessage(ServiceDeletePanel.class,
"ClassUnav")); // NOI18N
}
}
// --- GENERATED CODE ------------------------------------------------------
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
classesChangedMessage = new javax.swing.JLabel();
serviceLbl = new javax.swing.JLabel();
serviceAsyncLbl = new javax.swing.JLabel();
serviceImplLbl = new javax.swing.JLabel();
serviceName = new javax.swing.JLabel();
serviceImplName = new javax.swing.JLabel();
serviceAsyncName = new javax.swing.JLabel();
miscChangesMessage = new javax.swing.JLabel();
setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 11, 11));
org.openide.awt.Mnemonics.setLocalizedText(classesChangedMessage, NbBundle.getMessage(ServiceDeletePanel.class, "FollowCl")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(serviceLbl, NbBundle.getMessage(ServiceDeletePanel.class, "Svc")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(serviceAsyncLbl, NbBundle.getMessage(ServiceDeletePanel.class, "Async")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(serviceImplLbl, NbBundle.getMessage(ServiceDeletePanel.class, "SvcImpl")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(serviceName, " ");
org.openide.awt.Mnemonics.setLocalizedText(serviceImplName, " ");
org.openide.awt.Mnemonics.setLocalizedText(serviceAsyncName, " ");
miscChangesMessage.setFont(new java.awt.Font("Tahoma", 2, 11));
org.openide.awt.Mnemonics.setLocalizedText(miscChangesMessage, NbBundle.getMessage(ServiceDeletePanel.class, "UsageEx")); // NOI18N
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(classesChangedMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 377, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(serviceLbl)
.add(serviceAsyncLbl)
.add(serviceImplLbl))
.add(38, 38, 38)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(serviceImplName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
.add(serviceName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 229, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(serviceAsyncName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 242, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.add(layout.createSequentialGroup()
.add(miscChangesMessage)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(classesChangedMessage)
.add(18, 18, 18)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(serviceLbl)
.add(serviceName))
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(18, 18, 18)
.add(serviceAsyncLbl)
.add(18, 18, 18)
.add(serviceImplLbl))
.add(layout.createSequentialGroup()
.add(18, 18, 18)
.add(serviceAsyncName)
.add(18, 18, 18)
.add(serviceImplName)))
.add(49, 49, 49)
.add(miscChangesMessage)
.addContainerGap(42, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel classesChangedMessage;
private javax.swing.JLabel miscChangesMessage;
private javax.swing.JLabel serviceAsyncLbl;
private javax.swing.JLabel serviceAsyncName;
private javax.swing.JLabel serviceImplLbl;
private javax.swing.JLabel serviceImplName;
private javax.swing.JLabel serviceLbl;
private javax.swing.JLabel serviceName;
// End of variables declaration//GEN-END:variables
public Component getComponent() {
return this;
}
}