1.1 --- a/php.smarty/manifest.mf Tue Jun 07 11:20:38 2011 +0200
1.2 +++ b/php.smarty/manifest.mf Fri Jun 10 09:46:19 2011 +0200
1.3 @@ -2,5 +2,5 @@
1.4 OpenIDE-Module: org.netbeans.modules.php.smarty
1.5 OpenIDE-Module-Layer: org/netbeans/modules/php/smarty/resources/layer.xml
1.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/smarty/resources/Bundle.properties
1.7 -OpenIDE-Module-Specification-Version: 1.52
1.8 +OpenIDE-Module-Specification-Version: 1.53
1.9
2.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/Bundle.properties Tue Jun 07 11:20:38 2011 +0200
2.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/Bundle.properties Fri Jun 10 09:46:19 2011 +0200
2.3 @@ -42,7 +42,10 @@
2.4 SmartyOptionsPanel.closeDelimiterLabel.text=Close delimiter
2.5 SmartyOptionsPanel.openDelimiterTextField.text=
2.6 SmartyOptionsPanel.closeDelimiterTextField.text=
2.7 +
2.8 WRN_EmptyDelimiterFields=Delimiter text fields can't be blank.
2.9 +WRN_TooDeepScanningLevel=Setup of deeper directory level by scanning for TPL files can cause slowness by working with PHP projects.
2.10 +
2.11 SmartyOptionsPanel.errorLabel.text=Error Message
2.12 SmartyOptionsPanel.AccessibleContext.accessibleDescription=Panel for Smarty options.
2.13 SmartyOptionsPanel.learnMoreLabel.text=<html><font color="#0000FF"><u>Learn more</u></font></html>
3.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/SmartyOptionsPanel.java Tue Jun 07 11:20:38 2011 +0200
3.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/SmartyOptionsPanel.java Fri Jun 10 09:46:19 2011 +0200
3.3 @@ -45,8 +45,11 @@
3.4
3.5 package org.netbeans.modules.php.smarty.ui.options;
3.6
3.7 +import java.awt.Color;
3.8 import java.awt.Component;
3.9 import java.awt.Cursor;
3.10 +import java.awt.event.ActionEvent;
3.11 +import java.awt.event.ActionListener;
3.12 import java.awt.event.MouseAdapter;
3.13 import java.awt.event.MouseEvent;
3.14 import java.net.MalformedURLException;
3.15 @@ -88,24 +91,18 @@
3.16 setCloseDelimiter(SmartyOptions.getInstance().getDefaultCloseDelimiter());
3.17 setDepthOfScanning(SmartyOptions.getInstance().getScanningDepth());
3.18
3.19 - openDelimiterTextField.getDocument().addDocumentListener(new DocumentListener() {
3.20 - public void insertUpdate(DocumentEvent e) {
3.21 - processUpdate();
3.22 - }
3.23 - public void removeUpdate(DocumentEvent e) {
3.24 - processUpdate();
3.25 - }
3.26 - public void changedUpdate(DocumentEvent e) {
3.27 - processUpdate();
3.28 - }
3.29 - private void processUpdate() {
3.30 + openDelimiterTextField.getDocument().addDocumentListener(new SmartyDocumentListener());
3.31 + closeDelimiterTextField.getDocument().addDocumentListener(new SmartyDocumentListener());
3.32 + depthOfScanningComboBox.addActionListener(new ActionListener() {
3.33 + @Override
3.34 + public void actionPerformed(ActionEvent e) {
3.35 fireChange();
3.36 }
3.37 });
3.38 }
3.39
3.40 private void setDepthOfScanningComboBox() {
3.41 - for (int i = 0; i < 5; i++) {
3.42 + for (int i = 0; i < 4; i++) {
3.43 depthOfScanningComboBox.addItem(String.valueOf(i));
3.44 }
3.45 }
3.46 @@ -142,7 +139,7 @@
3.47
3.48 public void setWarning(String message) {
3.49 errorLabel.setText(" "); // NOI18N
3.50 - errorLabel.setForeground(UIManager.getColor("nb.warningForeground")); // NOI18N
3.51 + errorLabel.setForeground(Color.ORANGE); // NOI18N
3.52 errorLabel.setText(message);
3.53 }
3.54
3.55 @@ -292,4 +289,20 @@
3.56 private JTextField openDelimiterTextField;
3.57 // End of variables declaration//GEN-END:variables
3.58
3.59 + private final class SmartyDocumentListener implements DocumentListener {
3.60 +
3.61 + public void insertUpdate(DocumentEvent e) {
3.62 + processUpdate();
3.63 + }
3.64 + public void removeUpdate(DocumentEvent e) {
3.65 + processUpdate();
3.66 + }
3.67 + public void changedUpdate(DocumentEvent e) {
3.68 + processUpdate();
3.69 + }
3.70 + private void processUpdate() {
3.71 + fireChange();
3.72 + }
3.73 + }
3.74 +
3.75 }
4.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/SmartyOptionsPanelController.java Tue Jun 07 11:20:38 2011 +0200
4.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/ui/options/SmartyOptionsPanelController.java Fri Jun 10 09:46:19 2011 +0200
4.3 @@ -98,6 +98,12 @@
4.4 smartyOptionsPanel.setError(NbBundle.getMessage(SmartyOptionsPanel.class, "WRN_EmptyDelimiterFields"));
4.5 return false;
4.6 }
4.7 +
4.8 + // too deep level for scanning
4.9 + if (smartyOptionsPanel.getDepthOfScanning() > 1) {
4.10 + smartyOptionsPanel.setWarning(NbBundle.getMessage(SmartyOptionsPanel.class, "WRN_TooDeepScanningLevel"));
4.11 + return true;
4.12 + }
4.13
4.14 // everything ok
4.15 smartyOptionsPanel.setWarning(" "); // NOI18N