mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
update ui
echo checkbox move input to bottom like a normal console
This commit is contained in:
parent
e1af08c4e7
commit
22fd520fb5
4 changed files with 110 additions and 96 deletions
BIN
tutorials/java/dist/phpdbg-ui.jar
vendored
BIN
tutorials/java/dist/phpdbg-ui.jar
vendored
Binary file not shown.
|
@ -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());
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue