-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new custom dialogs system to fix blank dialogs opening on Mac OS
- Loading branch information
Showing
39 changed files
with
466 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...ava/synfron/reshaper/burp/ui/components/rules/thens/generate/BytesGeneratorComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ain/java/synfron/reshaper/burp/ui/components/rules/thens/generate/GeneratorComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../java/synfron/reshaper/burp/ui/components/rules/thens/transform/TransformerComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nfron/reshaper/burp/ui/components/rules/wizard/vars/CustomVariableTagWizardComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...fron/reshaper/burp/ui/components/rules/wizard/vars/SpecialVariableTagWizardComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...ava/synfron/reshaper/burp/ui/components/rules/wizard/vars/VariableTagWizardComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package synfron.reshaper.burp.ui.components.rules.wizard.vars; | ||
|
||
import synfron.reshaper.burp.core.ProtocolType; | ||
import synfron.reshaper.burp.core.events.IEventListener; | ||
import synfron.reshaper.burp.core.events.PropertyChangedArgs; | ||
import synfron.reshaper.burp.core.vars.VariableSource; | ||
import synfron.reshaper.burp.ui.components.shared.IFormComponent; | ||
import synfron.reshaper.burp.ui.models.rules.wizard.vars.VariableTagWizardModel; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.util.function.Consumer; | ||
|
||
public class VariableTagWizardComponent extends JPanel implements IFormComponent { | ||
|
||
private final VariableTagWizardModel model; | ||
private JComboBox<VariableSource> variableSource; | ||
private final VariableTagWizardContainerComponent container; | ||
private final ProtocolType protocolType; | ||
private final Consumer<Boolean> fieldUpdater; | ||
private final IEventListener<PropertyChangedArgs> modelChangedListener = this::onModelChanged; | ||
|
||
public VariableTagWizardComponent(VariableTagWizardModel model, ProtocolType protocolType, Consumer<Boolean> fieldUpdater) { | ||
this.model = model; | ||
container = new VariableTagWizardContainerComponent(protocolType); | ||
this.protocolType = protocolType; | ||
this.fieldUpdater = fieldUpdater; | ||
initComponent(); | ||
|
||
model.withListener(modelChangedListener); | ||
} | ||
|
||
private void initComponent() { | ||
setLayout(new BorderLayout()); | ||
|
||
variableSource = createComboBox(VariableSource.getAll(protocolType)); | ||
|
||
variableSource.setSelectedItem(model.getVariableSource()); | ||
|
||
variableSource.addActionListener(this::onVariableSourceChanged); | ||
|
||
add(getLabeledField("Tag Type", variableSource), BorderLayout.PAGE_START); | ||
add(container, BorderLayout.CENTER); | ||
|
||
container.setModel(model.getTagModel()); | ||
} | ||
|
||
private void onModelChanged(PropertyChangedArgs propertyChangedArgs) { | ||
switch (propertyChangedArgs.getName()) { | ||
case "invalidated": { | ||
if (model.isInvalidated()) { | ||
JOptionPane.showMessageDialog(this, | ||
String.join("\n", model.validate()), | ||
"Validation Error", | ||
JOptionPane.ERROR_MESSAGE); | ||
} | ||
} | ||
case "dismissed": { | ||
fieldUpdater.accept(!model.isInvalidated()); | ||
} | ||
case "tagModel": { | ||
container.setModel(model.getTagModel()); | ||
} | ||
} | ||
} | ||
|
||
private void onVariableSourceChanged(ActionEvent actionEvent) { | ||
model.setVariableSource((VariableSource)variableSource.getSelectedItem()); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
public <T extends Component & IFormComponent> T getComponent() { | ||
return (T) this; | ||
} | ||
} |
Oops, something went wrong.