Added glsl syntax highlighting to the generated shader view in the ShaderNode editor.Worksif text/x-glsl mime type is recognized by any installed syntax highlighting plugin.
This commit is contained in:
parent
b0995bcf55
commit
539dcf9c82
@ -36,11 +36,14 @@ import com.jme3.gde.materialdefinition.EditableMatDefFile;
|
||||
import com.jme3.gde.materialdefinition.MatDefDataObject;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.text.EditorKit;
|
||||
import org.netbeans.core.spi.multiview.CloseOperationState;
|
||||
import org.netbeans.core.spi.multiview.MultiViewElement;
|
||||
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
|
||||
import org.openide.awt.UndoRedo;
|
||||
import org.openide.text.CloneableEditorSupport;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.windows.TopComponent;
|
||||
@ -65,6 +68,11 @@ public final class MatDefShaderElement extends JPanel implements MultiViewElemen
|
||||
initComponents();
|
||||
toolbar.setParent(this);
|
||||
refresh();
|
||||
|
||||
String mime = "text/x-glsl";
|
||||
EditorKit ek = CloneableEditorSupport.getEditorKit(mime);
|
||||
jEditorPane1.setEditorKit(ek);
|
||||
jEditorPane1.setContentType(mime);
|
||||
}
|
||||
|
||||
public final void refresh() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user