Исправление ssh, сделал признаком приглашения @
v++
This commit is contained in:
4
.idea/workspace.xml
generated
4
.idea/workspace.xml
generated
@@ -8,8 +8,8 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/FileForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/FileForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/ProjectForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/ProjectForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Validators/ShellParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Validators/ShellParser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ShellParser {
|
||||
public static char c;
|
||||
public static char[] buffer = new char[1];
|
||||
public static Vector<String> lines = new Vector<>();
|
||||
public static boolean bracketOpened = false;
|
||||
// public static boolean bracketOpened = false;
|
||||
public static boolean return_active = false;
|
||||
public static boolean isCommandSymbol() {
|
||||
int code = c;
|
||||
@@ -22,7 +22,7 @@ public class ShellParser {
|
||||
public static void ResetLine() {
|
||||
invitationBuilder = new StringBuilder();
|
||||
lineBuilder = new StringBuilder();
|
||||
bracketOpened = false;
|
||||
// bracketOpened = false;
|
||||
state = ShellParserState.NewLine;
|
||||
return_active = false;
|
||||
}
|
||||
@@ -30,6 +30,10 @@ public class ShellParser {
|
||||
//латиница, цифры,подчеркивания. и -
|
||||
return String.valueOf(c).matches("[\\w\\-]*") || c == '?';
|
||||
}
|
||||
public static boolean isRBracket(){
|
||||
return c=='('||c==')';
|
||||
}
|
||||
|
||||
//false наоборот означать что конец строки ЕСТЬ.
|
||||
public static boolean checkEndLine() {
|
||||
if (return_active) {
|
||||
@@ -59,9 +63,10 @@ public class ShellParser {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
public static void NewLine() {
|
||||
if (c == '[') {//приглашение со скобками.
|
||||
bracketOpened = true;
|
||||
// bracketOpened = true;
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else {
|
||||
@@ -73,10 +78,36 @@ public class ShellParser {
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
}
|
||||
*/
|
||||
public static void NewLine() {
|
||||
if (c=='@'){ //собака, признак приглашения.
|
||||
String test = invitationBuilder.toString();
|
||||
test = test.toLowerCase();
|
||||
state = test.endsWith(userName.toLowerCase()) ? ShellParserState.MachineName : ShellParserState.Skip;
|
||||
invitationBuilder.append(c);
|
||||
}else {
|
||||
invitationBuilder.append(c);
|
||||
}
|
||||
/*
|
||||
if (c == '[') {//приглашение со скобками.
|
||||
// bracketOpened = true;
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else {
|
||||
if (isNameCharacter()) {
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.UserName;
|
||||
} else
|
||||
//не буква и не скобка. значит в этой строке приглашения нет.
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
public static void UserName() {
|
||||
if (c == '@') { //проверить. а тот ли юзернейм.
|
||||
String test = invitationBuilder.toString();
|
||||
if (bracketOpened) test = test.substring(1);
|
||||
// if (bracketOpened) test = test.substring(1);
|
||||
test = test.toLowerCase();
|
||||
state = test.endsWith(userName.toLowerCase()) ? ShellParserState.MachineName : ShellParserState.Skip;
|
||||
invitationBuilder.append(c);
|
||||
@@ -85,6 +116,7 @@ public class ShellParser {
|
||||
else
|
||||
state = ShellParserState.Skip;
|
||||
}
|
||||
*/
|
||||
public static void MachineName() {
|
||||
switch (c) {
|
||||
case ' ':
|
||||
@@ -107,6 +139,7 @@ public class ShellParser {
|
||||
invitationBuilder.append(c);
|
||||
state = ShellParserState.Space; //приглашение завершено. осталось прочитать пробел после него
|
||||
break;
|
||||
/*
|
||||
case ']':
|
||||
if (bracketOpened) {
|
||||
invitationBuilder.append(c);
|
||||
@@ -116,6 +149,7 @@ public class ShellParser {
|
||||
state = ShellParserState.Skip; //непарная скобка, все, привет
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
invitationBuilder.append(c);
|
||||
break;
|
||||
@@ -158,9 +192,9 @@ public class ShellParser {
|
||||
case NewLine:
|
||||
NewLine();
|
||||
break;
|
||||
case UserName:
|
||||
UserName();
|
||||
break;
|
||||
// case UserName:
|
||||
// UserName();
|
||||
// break;
|
||||
case MachineName:
|
||||
MachineName();
|
||||
break;
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||
@Override
|
||||
public void GetVersionInfo() {
|
||||
version = 1081;
|
||||
version = 1082;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
@@ -316,7 +316,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
public void ExpandCredentials() {
|
||||
UI.Clear(credentialsPanel);
|
||||
credentialsPanel.add(SC18);
|
||||
SC71.setDividerLocation(Global.db.splitters.get("SC71").position);
|
||||
SC71.setDividerLocation(200);
|
||||
SC71.setDividerSize(3);
|
||||
credentialsPanel.revalidate();
|
||||
credentialsPanel.repaint();
|
||||
|
||||
Reference in New Issue
Block a user