Skip to content

Commit

Permalink
Merge branch 'netbeans73dev' into netbeans73
Browse files Browse the repository at this point in the history
  • Loading branch information
junichi11 committed Aug 27, 2013
2 parents 5bcf941 + bd8587b commit 1bfc4b2
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 12 deletions.
2 changes: 1 addition & 1 deletion manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Manifest-Version: 1.0
OpenIDE-Module: org.cakephp.netbeans
OpenIDE-Module-Layer: org/cakephp/netbeans/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: org/cakephp/netbeans/resources/Bundle.properties
OpenIDE-Module-Specification-Version: 0.9.2
OpenIDE-Module-Specification-Version: 0.9.3
9 changes: 9 additions & 0 deletions src/org/cakephp/netbeans/CakePhpModuleExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ public Set<FileObject> extend(PhpModule phpModule) throws ExtendingException {
CakePhpFileUtils.chmodTmpDirectory(tmp);
}

// set default configurations
setIgnoreTmpDirectory(phpModule);
setAutoCreateViewFile(phpModule);

CakePhpModule module = CakePhpModule.forPhpModule(phpModule);
FileObject config = module.getConfigFile();
Expand Down Expand Up @@ -429,6 +431,13 @@ private void setIgnoreTmpDirectory(PhpModule phpModule) {
}
}

private void setAutoCreateViewFile(PhpModule phpModule) {
boolean isAutoCreate = CakePhpOptions.getInstance().isAutoCreateView();
if (isAutoCreate) {
CakePreferences.setAutoCreateView(phpModule, isAutoCreate);
}
}

/**
* Set app name.
*
Expand Down
2 changes: 2 additions & 0 deletions src/org/cakephp/netbeans/options/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ CakePhpPanel.localFilePathTextField.text=
CakePhpPanel.browseButton.text=Browse...
CakePhpPanel.resetButton.text=Reset
CakePhpPanel.ignoreTempDirectoryCheckBox.text=Ignore tmp directory
CakePhpPanel.defaultLabel.text=default
CakePhpPanel.autoCreateViewCheckBox.text=Auto create a view file when go to view action is run.
9 changes: 9 additions & 0 deletions src/org/cakephp/netbeans/options/CakePhpOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class CakePhpOptions {
private static final String NEW_PROJECT = "new-project"; // NOI18N
private static final String LOCAL_ZIP_FILE_PATH = "local-zip-file-path"; // NOI18N
private static final String IGNORE_TMP = "ignore-tmp"; // NOI18N
private static final String AUTO_CREATE_VIEW = "auto-create-view"; // NOI18N
private static CakePhpOptions INSTANCE = new CakePhpOptions();

private CakePhpOptions() {
Expand Down Expand Up @@ -122,6 +123,14 @@ public void setIgnoreTmpDirectory(boolean isIgnore) {
getPreferences().putBoolean(IGNORE_TMP, isIgnore);
}

public boolean isAutoCreateView() {
return getPreferences().getBoolean(AUTO_CREATE_VIEW, false);
}

public void setAutoCreateView(boolean isAuto) {
getPreferences().putBoolean(AUTO_CREATE_VIEW, isAuto);
}

public Preferences getPreferences() {
return NbPreferences.forModule(CakePhpOptions.class);
}
Expand Down
42 changes: 38 additions & 4 deletions src/org/cakephp/netbeans/options/CakePhpPanel.form
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,24 @@
<Group type="102" alignment="1" attributes="0">
<Component id="localFilePathLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="localFilePathTextField" pref="484" max="32767" attributes="0"/>
<Component id="localFilePathTextField" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="browseButton" max="32767" attributes="0"/>
<Component id="resetButton" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ignoreTempDirectoryCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="defaultLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="defaultSeparator" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="ignoreTempDirectoryCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="autoCreateViewCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="295" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
Expand All @@ -77,9 +85,16 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="resetButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="defaultLabel" min="-2" max="-2" attributes="0"/>
<Component id="defaultSeparator" min="-2" pref="10" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="ignoreTempDirectoryCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="304" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="autoCreateViewCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="238" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -129,6 +144,25 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ignoreTempDirectoryCheckBoxActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="defaultLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/cakephp/netbeans/options/Bundle.properties" key="CakePhpPanel.defaultLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="defaultSeparator">
</Component>
<Component class="javax.swing.JCheckBox" name="autoCreateViewCheckBox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/cakephp/netbeans/options/Bundle.properties" key="CakePhpPanel.autoCreateViewCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="autoCreateViewCheckBoxActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pluginsPanel">
Expand Down
41 changes: 37 additions & 4 deletions src/org/cakephp/netbeans/options/CakePhpPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ private void initComponents() {
browseButton = new javax.swing.JButton();
resetButton = new javax.swing.JButton();
ignoreTempDirectoryCheckBox = new javax.swing.JCheckBox();
defaultLabel = new javax.swing.JLabel();
defaultSeparator = new javax.swing.JSeparator();
autoCreateViewCheckBox = new javax.swing.JCheckBox();
pluginsPanel = new javax.swing.JPanel();
pluginListLabel = new javax.swing.JLabel();
messageLabel = new javax.swing.JLabel();
Expand Down Expand Up @@ -131,6 +134,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

org.openide.awt.Mnemonics.setLocalizedText(defaultLabel, org.openide.util.NbBundle.getMessage(CakePhpPanel.class, "CakePhpPanel.defaultLabel.text")); // NOI18N

org.openide.awt.Mnemonics.setLocalizedText(autoCreateViewCheckBox, org.openide.util.NbBundle.getMessage(CakePhpPanel.class, "CakePhpPanel.autoCreateViewCheckBox.text")); // NOI18N
autoCreateViewCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
autoCreateViewCheckBoxActionPerformed(evt);
}
});

javax.swing.GroupLayout newProjectPanelLayout = new javax.swing.GroupLayout(newProjectPanel);
newProjectPanel.setLayout(newProjectPanelLayout);
newProjectPanelLayout.setHorizontalGroup(
Expand All @@ -141,14 +153,20 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, newProjectPanelLayout.createSequentialGroup()
.addComponent(localFilePathLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(localFilePathTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
.addComponent(localFilePathTextField)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(newProjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(browseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(resetButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(newProjectPanelLayout.createSequentialGroup()
.addComponent(ignoreTempDirectoryCheckBox)
.addGap(0, 0, Short.MAX_VALUE)))
.addComponent(defaultLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(defaultSeparator))
.addGroup(newProjectPanelLayout.createSequentialGroup()
.addGroup(newProjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ignoreTempDirectoryCheckBox)
.addComponent(autoCreateViewCheckBox))
.addGap(0, 295, Short.MAX_VALUE)))
.addContainerGap())
);
newProjectPanelLayout.setVerticalGroup(
Expand All @@ -161,9 +179,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(browseButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(resetButton)
.addGap(18, 18, 18)
.addGroup(newProjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(defaultLabel)
.addComponent(defaultSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(ignoreTempDirectoryCheckBox)
.addContainerGap(304, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(autoCreateViewCheckBox)
.addContainerGap(238, Short.MAX_VALUE))
);

optionsTabbedPane.addTab(org.openide.util.NbBundle.getMessage(CakePhpPanel.class, "CakePhpPanel.newProjectPanel.TabConstraints.tabTitle"), newProjectPanel); // NOI18N
Expand Down Expand Up @@ -329,6 +353,10 @@ private void ignoreTempDirectoryCheckBoxActionPerformed(java.awt.event.ActionEve
controller.changed();
}//GEN-LAST:event_ignoreTempDirectoryCheckBoxActionPerformed

private void autoCreateViewCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autoCreateViewCheckBoxActionPerformed
controller.changed();
}//GEN-LAST:event_autoCreateViewCheckBoxActionPerformed

private void setLocalPath(String path) {
localFilePathTextField.setText(path);
}
Expand All @@ -355,6 +383,7 @@ void load() {
model.setPlugins(options.getPlugins());
localFilePathTextField.setText(options.getLocalZipFilePath());
ignoreTempDirectoryCheckBox.setSelected(options.isIgnoreTmpDirectory());
autoCreateViewCheckBox.setSelected(options.isAutoCreateView());
}

void store() {
Expand All @@ -363,6 +392,7 @@ void store() {
options.setPlugins(model.getPlugins());
options.setLocalZipFilePath(localFilePathTextField.getText());
options.setIgnoreTmpDirectory(ignoreTempDirectoryCheckBox.isSelected());
options.setAutoCreateView(autoCreateViewCheckBox.isSelected());
}
}

Expand Down Expand Up @@ -438,7 +468,10 @@ public void removePlugin(int index) {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addButton;
private javax.swing.JCheckBox autoCreateViewCheckBox;
private javax.swing.JButton browseButton;
private javax.swing.JLabel defaultLabel;
private javax.swing.JSeparator defaultSeparator;
private javax.swing.JButton deleteButton;
private javax.swing.JButton editButton;
private javax.swing.JCheckBox ignoreTempDirectoryCheckBox;
Expand Down
6 changes: 3 additions & 3 deletions src/org/cakephp/netbeans/ui/CakePhpStatusLineElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,23 @@ public Dimension getPreferredSize() {
* @return debug level
*/
public String getDebugLevel(FileObject config) {
String debubLv = ""; // NOI18N
String debugLv = ""; // NOI18N
Pattern pattern = Pattern.compile(DEBUG_REGEX);

try {
List<String> lines = config.asLines("UTF-8"); // NOI18N
for (String line : lines) {
Matcher matcher = pattern.matcher(line);
if (matcher.find()) {
debubLv = matcher.group(1);
debugLv = matcher.group(1);
break;
}
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}

return debubLv;
return debugLv;
}

/**
Expand Down

0 comments on commit 1bfc4b2

Please sign in to comment.