com php-src: update ui echo checkbox move input t o bottom like a normal console: tutorials/java/di st/phpdbg-ui.jar
tutorials/java/src/phpdbg/ui/DebugSocket .java tutorials/java/src/phpdbg/ui/JConsole.form tutori als/java/src/phpdbg/ui/JConsole.java

From: Date: Fri, 29 Nov 2013 13:20:26 +0000
Subject: com php-src: update ui echo checkbox move input t o bottom like a normal console: tutorials/java/di st/phpdbg-ui.jar
tutorials/java/src/phpdbg/ui/DebugSocket .java tutorials/java/src/phpdbg/ui/JConsole.form tutori als/java/src/phpdbg/ui/JConsole.java
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75362@lists.php.net to get a copy of this message
Commit: 22fd520fb5839e8099d3041bbc0cc6e143d99414 Author: krakjoe <joe.watkins@live.co.uk> Fri, 29 Nov 2013 13:20:26 +0000 Parents: e1af08c4e795009d8a4b80a3d2842e72dfa053cb Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=22fd520fb5839e8099d3041bbc0cc6e143d99414 Log: update ui echo checkbox move input to bottom like a normal console Changed paths: M tutorials/java/dist/phpdbg-ui.jar M tutorials/java/src/phpdbg/ui/DebugSocket.java M tutorials/java/src/phpdbg/ui/JConsole.form M tutorials/java/src/phpdbg/ui/JConsole.java

diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index 9df8806..f317aa4 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ diff --git a/tutorials/java/src/phpdbg/ui/DebugSocket.java b/tutorials/java/src/phpdbg/ui/DebugSocket.java index eb46af0..05db207 100644 --- a/tutorials/java/src/phpdbg/ui/DebugSocket.java +++ b/tutorials/java/src/phpdbg/ui/DebugSocket.java @@ -70,7 +70,12 @@ public class DebugSocket extends Socket implements Runnable { command = main.getInputField().getText(); /* send command to stdin socket */ - if (command != null) { + if (command != null) { + if (main.isEchoing()) { + main.getOutputField().appendANSI("remote> "); + main.getOutputField().appendANSI(command); + main.getOutputField().appendANSI("\n"); + } output.write( command.getBytes()); output.write("\n".getBytes()); diff --git a/tutorials/java/src/phpdbg/ui/JConsole.form b/tutorials/java/src/phpdbg/ui/JConsole.form index 69ab577..224a13a 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.form +++ b/tutorials/java/src/phpdbg/ui/JConsole.form @@ -42,14 +42,14 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> + <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="mainSplit" max="32767" attributes="0"/> - <Group type="102" attributes="0"> + <Component id="outputScrollPane" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> <Component id="hostLabel" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="host" pref="359" max="32767" attributes="0"/> + <Component id="host" pref="345" max="32767" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> <Component id="stdinCheckBox" min="-2" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> @@ -59,7 +59,12 @@ <EmptySpace type="unrelated" max="-2" attributes="0"/> <Component id="stdoutPort" min="-2" pref="60" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="openButton" min="-2" max="-2" attributes="0"/> + <Component id="openButton" min="-2" pref="100" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="input" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="echoCheckBox" min="-2" max="-2" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> @@ -70,18 +75,23 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="mainSplit" pref="428" max="32767" attributes="0"/> + <Component id="outputScrollPane" pref="403" max="32767" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="host" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="openButton" alignment="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="input" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="echoCheckBox" alignment="3" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="3" attributes="0"> <Component id="stdoutPort" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="stdinCheckBox" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="stdoutCheckBox" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="stdinPort" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="hostLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="host" alignment="3" min="-2" max="-2" attributes="0"/> </Group> + <Component id="openButton" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -89,54 +99,6 @@ </DimensionLayout> </Layout> <SubComponents> - <Container class="javax.swing.JSplitPane" name="mainSplit"> - <Properties> - <Property name="orientation" type="int" value="0"/> - <Property name="toolTipText" type="java.lang.String" value=""/> - </Properties> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTextField" name="input"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value=""/> - <Property name="enabled" type="boolean" value="false"/> - </Properties> - <Events> - <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="inputKeyReleased"/> - </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription"> - <JSplitPaneConstraints position="left"/> - </Constraint> - </Constraints> - </Component> - <Container class="javax.swing.JScrollPane" name="outputScrollPane"> - <AuxValues> - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> - </AuxValues> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription"> - <JSplitPaneConstraints position="right"/> - </Constraint> - </Constraints> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="phpdbg.ui.JTerminalPane" name="output"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="DialogInput" size="12" style="0"/> - </Property> - <Property name="componentPopupMenu" type="javax.swing.JPopupMenu" editor="org.netbeans.modules.form.ComponentChooserEditor"> - <ComponentRef name="stdoutPopupMenu"/> - </Property> - </Properties> - </Component> - </SubComponents> - </Container> - </SubComponents> - </Container> <Component class="javax.swing.JTextField" name="host"> <Properties> <Property name="text" type="java.lang.String" value="127.0.0.1"/> @@ -146,7 +108,7 @@ <Component class="javax.swing.JTextField" name="stdoutPort"> <Properties> <Property name="text" type="java.lang.String" value="8000"/> - <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="toolTipText" type="java.lang.String" value="By default, stdin * 2"/> </Properties> </Component> <Component class="javax.swing.JCheckBox" name="stdinCheckBox"> @@ -165,8 +127,8 @@ </Component> <Component class="javax.swing.JButton" name="openButton"> <Properties> + <Property name="text" type="java.lang.String" value="Connect"/> <Property name="actionCommand" type="java.lang.String" value="open"/> - <Property name="label" type="java.lang.String" value="open"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openButtonActionPerformed"/> @@ -175,7 +137,7 @@ <Component class="javax.swing.JTextField" name="stdinPort"> <Properties> <Property name="text" type="java.lang.String" value="4000"/> - <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="toolTipText" type="java.lang.String" value="The listen port passed to phpdbg (-l option)"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="hostLabel"> @@ -183,5 +145,41 @@ <Property name="text" type="java.lang.String" value="Hostname:"/> </Properties> </Component> + <Component class="javax.swing.JTextField" name="input"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="Enter phpdbg commands here !"/> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="inputKeyReleased"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="outputScrollPane"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="phpdbg.ui.JTerminalPane" name="output"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="DialogInput" size="12" style="0"/> + </Property> + <Property name="componentPopupMenu" type="javax.swing.JPopupMenu" editor="org.netbeans.modules.form.ComponentChooserEditor"> + <ComponentRef name="stdoutPopupMenu"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JCheckBox" name="echoCheckBox"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="toolTipText" type="java.lang.String" value="Check to echo sent commands in output"/> + <Property name="horizontalAlignment" type="int" value="2"/> + <Property name="label" type="java.lang.String" value="echo"/> + </Properties> + </Component> </SubComponents> </Form> diff --git a/tutorials/java/src/phpdbg/ui/JConsole.java b/tutorials/java/src/phpdbg/ui/JConsole.java index 2958cb9..bf85012 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.java +++ b/tutorials/java/src/phpdbg/ui/JConsole.java @@ -40,10 +40,6 @@ public class JConsole extends javax.swing.JDialog { stdoutPopupMenu = new javax.swing.JPopupMenu(); resetStdout = new javax.swing.JMenuItem(); - mainSplit = new javax.swing.JSplitPane(); - input = new javax.swing.JTextField(); - outputScrollPane = new javax.swing.JScrollPane(); - output = new phpdbg.ui.JTerminalPane(); host = new javax.swing.JTextField(); stdoutPort = new javax.swing.JTextField(); stdinCheckBox = new javax.swing.JCheckBox(); @@ -51,6 +47,10 @@ public class JConsole extends javax.swing.JDialog { openButton = new javax.swing.JButton(); stdinPort = new javax.swing.JTextField(); hostLabel = new javax.swing.JLabel(); + input = new javax.swing.JTextField(); + outputScrollPane = new javax.swing.JScrollPane(); + output = new phpdbg.ui.JTerminalPane(); + echoCheckBox = new javax.swing.JCheckBox(); resetStdout.setText("Clear"); resetStdout.addActionListener(new java.awt.event.ActionListener() { @@ -63,29 +63,11 @@ public class JConsole extends javax.swing.JDialog { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("phpdbg jui"); - mainSplit.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); - mainSplit.setToolTipText(""); - - input.setToolTipText(""); - input.setEnabled(false); - input.addKeyListener(new java.awt.event.KeyAdapter() { - public void keyReleased(java.awt.event.KeyEvent evt) { - inputKeyReleased(evt); - } - }); - mainSplit.setLeftComponent(input); - - output.setFont(new java.awt.Font("DialogInput", 0, 12)); // NOI18N - output.setComponentPopupMenu(stdoutPopupMenu); - outputScrollPane.setViewportView(output); - - mainSplit.setRightComponent(outputScrollPane); - host.setText("127.0.0.1"); host.setToolTipText("Set the hostname, or IPv4 address of the machine running the phpdbg remote console server"); stdoutPort.setText("8000"); - stdoutPort.setToolTipText(""); + stdoutPort.setToolTipText("By default, stdin * 2"); stdinCheckBox.setSelected(true); stdinCheckBox.setText("stdin:"); @@ -95,8 +77,8 @@ public class JConsole extends javax.swing.JDialog { stdoutCheckBox.setText("stdout:"); stdoutCheckBox.setToolTipText("Set the port for stdout, or unset to disable stdout"); + openButton.setText("Connect"); openButton.setActionCommand("open"); - openButton.setLabel("open"); openButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openButtonActionPerformed(evt); @@ -104,10 +86,27 @@ public class JConsole extends javax.swing.JDialog { }); stdinPort.setText("4000"); - stdinPort.setToolTipText(""); + stdinPort.setToolTipText("The listen port passed to phpdbg (-l option)"); hostLabel.setText("Hostname:"); + input.setToolTipText("Enter phpdbg commands here !"); + input.setEnabled(false); + input.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + inputKeyReleased(evt); + } + }); + + output.setFont(new java.awt.Font("DialogInput", 0, 12)); // NOI18N + output.setComponentPopupMenu(stdoutPopupMenu); + outputScrollPane.setViewportView(output); + + echoCheckBox.setSelected(true); + echoCheckBox.setToolTipText("Check to echo sent commands in output"); + echoCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + echoCheckBox.setLabel("echo"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -115,11 +114,11 @@ public class JConsole extends javax.swing.JDialog { .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(mainSplit) - .addGroup(layout.createSequentialGroup() + .addComponent(outputScrollPane) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(hostLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(host, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE) + .addComponent(host, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(stdinCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) @@ -129,24 +128,32 @@ public class JConsole extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(stdoutPort, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(openButton))) + .addComponent(openButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(input) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(echoCheckBox))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(mainSplit, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) + .addComponent(outputScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(openButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(echoCheckBox)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(stdoutPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(stdinCheckBox) .addComponent(stdoutCheckBox) .addComponent(stdinPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(hostLabel))) + .addComponent(hostLabel) + .addComponent(host, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(openButton)) .addContainerGap()) ); @@ -238,6 +245,10 @@ public class JConsole extends javax.swing.JDialog { return connected; } + public Boolean isEchoing() { + return echoCheckBox.isSelected(); + } + public void setConnected(Boolean isConnected) { synchronized(this) { if (isConnected) { @@ -353,10 +364,10 @@ public class JConsole extends javax.swing.JDialog { private static CommandHistory history = new CommandHistory(); // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox echoCheckBox; private javax.swing.JTextField host; private javax.swing.JLabel hostLabel; private javax.swing.JTextField input; - private javax.swing.JSplitPane mainSplit; private javax.swing.JButton openButton; private phpdbg.ui.JTerminalPane output; private javax.swing.JScrollPane outputScrollPane;
« previous php.cvs (#75362) next »