mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 08:50:47 +00:00
const editing warning as message
This commit is contained in:
@@ -42,16 +42,14 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
|
||||
public JEditorPane slotConstEditor;
|
||||
private ABC abc;
|
||||
private TraitSlotConst trait;
|
||||
private JTextPane warnLabel;
|
||||
|
||||
private boolean showWarning=false;
|
||||
|
||||
public SlotConstTraitDetailPanel() {
|
||||
slotConstEditor = new JEditorPane();
|
||||
setLayout(new BorderLayout());
|
||||
add(new JLabel(translate("abc.detail.slotconst.typevalue")), BorderLayout.NORTH);
|
||||
add(new JScrollPane(slotConstEditor), BorderLayout.CENTER);
|
||||
warnLabel = new JTextPane();
|
||||
warnLabel.setText(translate("warning.initializers"));
|
||||
StyledDocument doc = warnLabel.getStyledDocument();
|
||||
/*StyledDocument doc = warnLabel.getStyledDocument();
|
||||
SimpleAttributeSet center = new SimpleAttributeSet();
|
||||
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
|
||||
doc.setParagraphAttributes(0, doc.getLength(), center, false);
|
||||
@@ -60,7 +58,7 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
|
||||
//warnLabel.setWrapStyleWord(true);
|
||||
//warnLabel.setLineWrap(true);
|
||||
warnLabel.setFont(new JLabel().getFont().deriveFont(Font.BOLD));
|
||||
add(warnLabel, BorderLayout.SOUTH);
|
||||
add(warnLabel, BorderLayout.SOUTH);*/
|
||||
slotConstEditor.setContentType("text/flasm3_methodinfo");
|
||||
Flasm3MethodInfoSyntaxKit sk = (Flasm3MethodInfoSyntaxKit) slotConstEditor.getEditorKit();
|
||||
sk.deinstallComponent(slotConstEditor, "jsyntaxpane.components.LineNumbersRuler");
|
||||
@@ -83,7 +81,8 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
|
||||
|
||||
s = typeStr + valueStr;
|
||||
|
||||
warnLabel.setVisible(trait.isConst() || isStatic);
|
||||
showWarning = trait.isConst()||isStatic;
|
||||
//warnLabel.setVisible(trait.isConst() || isStatic);
|
||||
slotConstEditor.setText(s);
|
||||
}
|
||||
|
||||
@@ -102,6 +101,9 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
|
||||
|
||||
@Override
|
||||
public void setEditMode(boolean val) {
|
||||
if(val){
|
||||
JOptionPane.showMessageDialog(null, translate("warning.initializers"), translate("message.warning"), JOptionPane.WARNING_MESSAGE);
|
||||
}
|
||||
slotConstEditor.setEditable(val);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user