Syntax highlight , Urgents please
Hi all guys,
I'm implementing an editor use JTextPane.
I read many source in this forum and other about
syntax hightlight but all is do for java, c++ ...
I want to do with my own language.
Please give me some idea and give me some source code.
is JDK's Scaner is only use find java keyword?
how can I define my keyword?,
how can I find keyword in my text?
Thanks your helps
HungNguyen
Dear,
See http://syntax.jedit.org/ for an excelent editor for syntax hilighting features. You can customize it according to your needs. It is really wonderful.
Kind regards,
Mohsin Ali
Similar Messages
-
Syntax highlighting not working on PL/SQL developer tool
Hello,
Syntax highlighting is not working on PL/SQL developer tool using the beautifier. When I go set Syntax highlighting parameters (from EDIT>PL/SQL Developer Beautifier Options > User Interface> Editor> Syntax Highlighting ) and click apply, the changes are not reflected in SQL code in the SQL window. Other feautures in the beautifier such as Fonts, Window types are working fine.
Please help me with this issue.
Thanks!!
ShreejitAs this is not an Oracle related question (let alone Oracle SQL or PL/SQL), and as you've been given a link to the relevant website... I'll now lock this thread.
-
Syntax Highlighting and Undo Problem
Hello Guys. I am working ona very simple type of Java Code Editor with syntax highlighting feature. It works fine as far as the syntax highlighting, cut, copy, paste etc are concerned but when I added Undo, Redo feature, it was not working as Undo Redo should. The UndoManager first removes the text attributes and finally the main Undo job. For example if I paste word public , the UndoManager will first remove the attributes and after about third or fouth click on the Undo button removes the pasted word.
Please Help.Here's the complete demo code.
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.text.rtf.*;
import javax.swing.undo.*;
class ColorTextInTextPane extends JFrame implements UndoableEditListener
private Hashtable keywords,impclasses;
JEditorPane edit;
UndoManager undo;
JButton undoIt, redoIt;
JPanel southButtonPanel;
MyDocument doc = new MyDocument();
public ColorTextInTextPane()
super("ColorTextInTextPane");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
edit = new JEditorPane();
edit.setEditorKit(new StyledEditorKit());
edit.setEditable(true);
doc.addUndoableEditListener(this);
edit.setDocument(doc);
JScrollPane scroll=new JScrollPane(edit);
undo = new UndoManager();
undoIt = new JButton("Undo");
undoIt.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
undoAction(ae);
redoIt = new JButton("Redo");
redoIt.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
redoAction(ae);
southButtonPanel = new JPanel();
southButtonPanel.add(undoIt);
southButtonPanel.add(redoIt);
getContentPane().add(scroll);
getContentPane().add(southButtonPanel, BorderLayout.SOUTH);
setSize(300,300);
setVisible(true);
Object dummyObject = new Object();
keywords = new Hashtable();
keywords.put( "abstract", dummyObject );
keywords.put( "boolean", dummyObject );
keywords.put( "break", dummyObject );
keywords.put( "byte", dummyObject );
keywords.put( "byvalue", dummyObject );
keywords.put( "case", dummyObject );
keywords.put( "cast", dummyObject );
keywords.put( "catch", dummyObject );
keywords.put( "char", dummyObject );
keywords.put( "class", dummyObject );
keywords.put( "const", dummyObject );
keywords.put( "continue", dummyObject );
keywords.put( "default", dummyObject );
keywords.put( "do", dummyObject );
keywords.put( "double", dummyObject );
keywords.put( "else", dummyObject );
keywords.put( "extends", dummyObject );
keywords.put( "false", dummyObject );
keywords.put( "final", dummyObject );
keywords.put( "finally", dummyObject );
keywords.put( "float", dummyObject );
keywords.put( "for", dummyObject );
keywords.put( "future", dummyObject );
keywords.put( "generic", dummyObject );
keywords.put( "goto", dummyObject );
keywords.put( "if", dummyObject );
keywords.put( "implements", dummyObject );
keywords.put( "import", dummyObject );
keywords.put( "inner", dummyObject );
keywords.put( "instanceof", dummyObject );
keywords.put( "int", dummyObject );
keywords.put( "interface", dummyObject );
keywords.put( "long", dummyObject );
keywords.put( "native", dummyObject );
keywords.put( "new", dummyObject );
keywords.put( "null", dummyObject );
keywords.put( "operator", dummyObject );
keywords.put( "outer", dummyObject );
keywords.put( "package", dummyObject );
keywords.put( "private", dummyObject );
keywords.put( "protected", dummyObject );
keywords.put( "public", dummyObject );
keywords.put( "rest", dummyObject );
keywords.put( "return", dummyObject );
keywords.put( "short", dummyObject );
keywords.put( "static", dummyObject );
keywords.put( "super", dummyObject );
keywords.put( "switch", dummyObject );
keywords.put( "synchronized", dummyObject );
keywords.put( "this", dummyObject );
keywords.put( "throw", dummyObject );
keywords.put( "throws", dummyObject );
keywords.put( "transient", dummyObject );
keywords.put( "true", dummyObject );
keywords.put( "try", dummyObject );
keywords.put( "var", dummyObject );
keywords.put( "void", dummyObject );
keywords.put( "volatile", dummyObject );
keywords.put( "while", dummyObject );
Object dummyObject1 = new Object();
impclasses = new Hashtable();
impclasses.put( "JFrame", dummyObject1);
impclasses.put( "Applet", dummyObject1);
impclasses.put( "JApplet", dummyObject1);
impclasses.put( "JTextField", dummyObject1);
impclasses.put( "JLabel", dummyObject1);
impclasses.put( "JPanel", dummyObject1);
impclasses.put( "JButton", dummyObject1);
public void undoableEditHappened(UndoableEditEvent ev) {
undo.addEdit(ev.getEdit());
updateMenu();
void undoAction(ActionEvent e) {
try {
if (undo.canUndo())
undo.undo();
updateMenu();
catch (CannotRedoException cre) {
void redoAction(ActionEvent e)
try {
if (undo.canRedo())
undo.redo();
updateMenu();
catch (CannotRedoException cre) {
public void updateMenu()
undoIt.setEnabled(undo.canUndo());
redoIt.setEnabled(undo.canRedo());
public static void main(String a[])
new ColorTextInTextPane();
class MyDocument extends DefaultStyledDocument
DefaultStyledDocument doc;
MutableAttributeSet normal;
MutableAttributeSet keyword;
MutableAttributeSet comment;
MutableAttributeSet quote;
MutableAttributeSet impclasses1;
public MyDocument()
doc = this;
putProperty( DefaultEditorKit.EndOfLineStringProperty, "\n" );
normal = new SimpleAttributeSet();
StyleConstants.setForeground(normal, Color.black);
comment = new SimpleAttributeSet();
StyleConstants.setForeground(comment, Color.green);
StyleConstants.setItalic(comment, true);
keyword = new SimpleAttributeSet();
StyleConstants.setForeground(keyword, Color.blue);
StyleConstants.setBold(keyword, true);
quote = new SimpleAttributeSet();
StyleConstants.setForeground(quote, Color.red);
StyleConstants.setBold(quote, true);
impclasses1 = new SimpleAttributeSet();
StyleConstants.setForeground(impclasses1, Color.magenta);
StyleConstants.setBold(impclasses1, true);
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException
super.insertString(offset, str, a);
processChangedLines(offset, str.length());
public void remove(int offset, int length) throws BadLocationException
super.remove(offset, length);
processChangedLines(offset, 0);
public void processChangedLines(int offset, int length) throws BadLocationException
String content = doc.getText(0, doc.getLength());
Element root = doc.getDefaultRootElement();
int startLine = root.getElementIndex( offset );
int endLine = root.getElementIndex( offset + length );
for (int i = startLine; i <= endLine; i++)
int startOffset = root.getElement( i ).getStartOffset();
int endOffset = root.getElement( i ).getEndOffset();
applyHighlighting(content, startOffset, endOffset - 1);
public void applyHighlighting(String content, int startOffset, int endOffset)
throws BadLocationException
int index;
int lineLength = endOffset - startOffset;
int contentLength = content.length();
if (endOffset >= contentLength)
endOffset = contentLength - 1;
// set normal attributes for the line
doc.setCharacterAttributes(startOffset, lineLength, normal, true);
// check for multi line comment
String multiLineStartDelimiter = "/*";
String multiLineEndDelimiter = "*/";
index = content.lastIndexOf( multiLineStartDelimiter, endOffset );
if (index > -1)
int index2 = content.indexOf( multiLineEndDelimiter, index );
if ( (index2 == -1) || (index2 > endOffset) )
doc.setCharacterAttributes(index, endOffset - index + 1, comment, false);
return;
else
if (index2 >= startOffset)
doc.setCharacterAttributes(index, index2 + 2 - index, comment, false);
return;
// check for single line comment
String singleLineDelimiter = "//";
index = content.indexOf( singleLineDelimiter, startOffset );
if ( (index > -1) && (index < endOffset) )
doc.setCharacterAttributes(index, endOffset - index + 1, comment, false);
endOffset = index - 1;
// check for tokens
checkForTokens(content, startOffset, endOffset);
private void checkForTokens(String content, int startOffset, int endOffset)
while (startOffset <= endOffset)
// find the start of a new token
while ( isDelimiter( content.substring(startOffset, startOffset + 1) ) )
if (startOffset < endOffset)
startOffset++;
else
return;
if ( isQuoteDelimiter( content.substring(startOffset, startOffset + 1) ) )
startOffset = getQuoteToken(content, startOffset, endOffset);
else
startOffset = getOtherToken(content, startOffset, endOffset);
private boolean isDelimiter(String character)
String operands = ";:{}()[]+-/%<=>!&|^~*";
if (Character.isWhitespace( character.charAt(0) ) ||
operands.indexOf(character) != -1 )
return true;
else
return false;
private boolean isQuoteDelimiter(String character)
String quoteDelimiters = "\"'";
if (quoteDelimiters.indexOf(character) == -1)
return false;
else
return true;
private boolean isKeyword(String token)
Object o = keywords.get( token );
return o == null ? false : true;
private boolean isimpclasses1(String token)
Object o = impclasses.get( token );
return o == null ? false : true;
private int getQuoteToken(String content, int startOffset, int endOffset)
String quoteDelimiter = content.substring(startOffset, startOffset + 1);
String escapedDelimiter = "\\" + quoteDelimiter;
int index;
int endOfQuote = startOffset;
// skip over the escaped quotes in this quote
index = content.indexOf(escapedDelimiter, endOfQuote + 1);
while ( (index > -1) && (index < endOffset) )
endOfQuote = index + 1;
index = content.indexOf(escapedDelimiter, endOfQuote);
// now find the matching delimiter
index = content.indexOf(quoteDelimiter, endOfQuote + 1);
if ( (index == -1) || (index > endOffset) )
endOfQuote = endOffset;
else
endOfQuote = index;
doc.setCharacterAttributes(startOffset, endOfQuote - startOffset + 1, quote, false);
//String token = content.substring(startOffset, endOfQuote + 1);
//System.out.println( "quote: " + token );
return endOfQuote + 1;
private int getOtherToken(String content, int startOffset, int endOffset)
int endOfToken = startOffset + 1;
while ( endOfToken <= endOffset )
if ( isDelimiter( content.substring(endOfToken, endOfToken + 1) ) )
break;
endOfToken++;
String token = content.substring(startOffset, endOfToken);
//System.out.println( "found: " + token );
if ( isKeyword( token ) )
doc.setCharacterAttributes(startOffset, endOfToken - startOffset, keyword, false);
if(isimpclasses1 ( token) )
doc.setCharacterAttributes(startOffset, endOfToken - startOffset, impclasses1, false);
return endOfToken + 1;
} -
Syntax Highlighting w/ Swing Text Package
I have a question for you that I hope ever so much that you could answer just in the most abstract sense, I will figure out the code from what you have said hopefully. Any relavent parts that you think I should know, please point out.
My question is, I'm trying to implement Syntax Highlighting for a code editor in Java (yes I know, like everyone else. It would REALLY be helpful if you did an updated Demo of a SyntaxEditor for JDK 1.4 BTW) anyway, I have already implemented Syntax Highlighting by overriding the PlainView and changing its drawLine method to parse the line, find the key words then draw them accordingly. However I cannot get over the sinking feeling that there is a better way to do this in JDK 1.4, I'm not worried about backward compatability. I'm only interested in the "sexiest" way to do this with Java. I started looking into the GlyphView, and that seems more of what I want, it has more control over the text elements and strong drawing abilities, I also noticed the GlyphPainter1 and GlyphPainter2, I tried to extend GlyphPainter2 and use it with my extended GlyphView and just change its paint method to parse the lines, but the class complains about not being public, even though in the source its class definition is "public class GlyphPainer2 extends GlyphView.GlyphPainter" which confused me.
But at any rate, my basic question is how would YOU, implement Syntax Highlighting (code coloring) if you could do it from scratch with all the facilities of the 1.4 JDK. ALso, should I look into the Java2D API or is this over kill for what I'm doing? I just need a basic code color'er, nothing fancy. But I need the fonts and styles to be able to change, that's all. And international support would be nice.
The type of answer I'm hoping for is something like "Create a new editor kit and then extend the GlyphView class and override its XYZ method to do your line parsing and then override the ABC method to do the actual painting of the line, this is the best way to do this in java"
Best wishes,
-rsk123I am searching for text highlighting code in java during 7 days.
And I also agree with Mr. rsk123 's thought.
I want to make editor to highlight code using java's general text package.
But I can't find good source or class to satisfy me.
Some code run well but it's not use the original java text package.
Some code was made by using java text package but have a bug and not run pefectly.
Now, I must choice a code for text highlighting.
But until now I can't find a free code or comecial code for it.
Anyway, I summarize my suffing result until now.
** I have stuied,
. About java's text package in Swing Connection site.
It's useful a little to understand the text package structure.
(http://java.sun.com/products/jfc/tsc/articles/index.html)
. How to make own EditorKit in 'Java Swing' book chapter 24.
I think it's good. But difficult to read.
(published by O'REILLY. Robert Eckstein)
** I have found program and have tested.
1) JEdit (http://www.jedit.org)
2) Jext(http://www.jext.org)
3) Sun's sample using the JavaEditorKit
(http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html)
4) Ostermiller's Syntax editor (http://ostermiller.org/syntax/editor.html)
5) j (http://armedbear-j.sourceforge.net/)
6) je 1.66 (http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/je/)
*** Detail descriptions of the test
1. May be run well but not use java text package.
==> JEdit (http://www.jedit.org), Jext(http://www.jext.org)
- I executed JEdit and Jext program. it works very well.
I think It's greate programs.
- The editor class for these programs are
org.gjt.sp.jedit.textarea.JEditTextArea class.
The JEditTextArea class extends JComponent, not java text component.
- JEditTextArea class started from 'jedit syntax package project'.
You can download the syntax package if you only use syntax highlighting
from http://syntax.jedit.org/ .
- JEdit and Jext use for editor 'jedit syntax package' but have upgrade that
package their own effort(may be)
- For me, It's an only product run well without error.
But unfortunately it's not use java text component.
So I hesitane to use it.
Because I should make almost code to support general editor function which
supported in JTextComponent.
2. Provided by Sun's developer site.
==> JavaEditorKit (http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html)
- It's made using JEditorPane. Great!!
And have a good architecture. (I think)
- But It use Scanner class which located in tools.jar package and
have a bug which not supporting well comment syntax /* */.
(Refer to http://developer.java.sun.com/developer/bugParade/bugs/4323090.html)
Futhermore it display terrible exception message when typed "/*" string
in the end position of java file. (I tested it)
- I heard in the forum, someone made the own scanner class.
(http://forum.java.sun.com/thread.jsp?thread=120564&forum=57&message=316083)
He said,(he = rofshi)
I wrote for my purposes a scanner based on the StreamTokenizer
cl*** and set a corresponding object in the JavaView cl*** of
the JavaKitTest.
Then I placed the method of my Scanner cl*** that parses the
given string and paints tokens in the method drawUnselected
Text (instead of previous code).
Of course, I erased all of the previous code related to the
java Scanner.
- For me, I like this style code and want to use it.
But Scanner class have some bug and I can't cure that bug. Terrible...
3. using JTextPane
==> http://ostermiller.org/syntax/editor.html
- At first it's too slow.
My computer is PentiumIII 350MHz Ram:256M Windows2000Por
But when I press pgDown key quickly the display couldn't follow it.
- And may be not support unicode.
When I typed international code, exceptions displayed.
(too much exceptios. may be caused repeating by thread.)
(ArrayIndexOutOfBoundsException in JavaLexer.java 1022 ?)
- For me, supporting international code is essential.
So I can't use it.
4. Do work well. But it use not understandable code for me.
(not use general java text package)
1)http://armedbear-j.sourceforge.net/
2)http://www.rene-grothmann.de
*** Finally, I have plan to make my own code using Mr rsk123's idea.
(using GlyphView in jdk1.3 or jdk1.4)
*** If you have a good information for text highliting of free code or
comecial code pleas notify me.
My address is [email protected] -
How to apply Syntax Highlighting in JTextArea
Hi folks.
At the moment my program does this:
The user can drag and drop images into an environment which corresponds creates a Java file.
So there is a panel that the user can drag images from and drop them to another panel. This in turn creates a Java file which is displayed at run time in a JTextArea.
I would like to use syntax highlighting here. I have come across a couple of similar questions in this forum but so far haven't found a great example.
Can anyone please point me to a good tutorial/example?
Many thanks.lobrien9 wrote:
I am already using NewtBeans. I had a look at that link but I can't seem to find any information regarding using the NetBeans editor in my own application.You're probably using the NetBeans IDE as your development environment. But this IDE has been developed in a modular way, so you can reuse parts of it to build your own application. Such a framework is call a RPC (rich client platform). The NetBeans IDE itself is build on this NetBeans Platform. I just started to read about it myself, but I think it's worth a try. Of course it's not a simple task to get to know this framework, but if your building Swing GUIs frequently it might be worth the effort. There are some books around about this topic. Search the NetBeans homepage for book references.
-Puce -
Hi,
Can you please guide me for resources how to highlight java syntax code in a debugger editor.
ThanksSearch the forum. Use your topics as the keywords - "+syntax +highlighting". And I would search the Swing forum.
-
How to install Syntax highlighting
Okay, so I'm trying to get syntax highlighting for my jscrollpane, which I have been lead to use: http://ostermiller.org/syntax/
I downloaded the jar file, but I was wondering what do I have to do to start using the classes, I'm completely losses, I don't even know where to put it.Well I don't know if this is the right way, but it seems to be at least going somewhere. I extracted the files of the jar file and put the all the extracted folder into the class folder of my current program. Then I tried to import the package with
import com.Ostermiller.Syntax.*;and when I complied it, it works so far.
but when I try to create an object it can not access it:
ToHTML toHTML = new ToHTML(); gets this error message,
--------------------Configuration: TEV3 - j2sdh1.4.2_13 <Default> - <Default>--------------------
C:\Program Files\Xinox Software\JCreatorV4LE\MyProjects\TEV3\src\TEV3.java:22: cannot access com.Ostermiller.Syntax.ToHTML
bad class file: C:\Program Files\Xinox Software\JCreatorV4LE\MyProjects\TEV3\classes\com\Ostermiller\Syntax\ToHTML.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
ToHTML toHTML = new ToHTML(); -
Repainting question for my syntax highlighter
Hello there,
I have a syntax highlighter which reuses much of the very useful code developed by Claude Dugauy, which can be found at http://www.fawcette.com/javapro/2003_07/magazine/columns/visualcomponents/default_pf.aspx
. The syntax highlighting uses regular expressions, so its easily extendable to meet your needs.
However, there is one problem: whenever the user presses a key, the whole of the TextPane containing the highlighted text, is repainted in its entirety. This is fine for small amounts of text to be highlighted, but is very slow when it comes to 1000+ lines.
Please could someone be so excellent as to tell me how to go about addressing this problem, so that only a small amount of text is repainted whenever the user types something into the TextPane e.g. that inside the current viewport, or just the last typed word - thus removing this problem of inefficiency.
Thanks in advance,
Edd.I don't think it's going to be that easy. Every time a change is made, the default style is applied to the whole document, then the whole document is copied into a String so it can be reparsed and have the syntax styles applied again. Even if you could limit what actually gets painted, you'd still have all that unnecessary work going on.
You could try forcing the highlighter to only reparse a portion of the document--like,say, a hundred lines before and after the point where the edit occurred--but deciding exactly where to start and stop can be pretty tricky. -
Syntax highlighting not working with label on if statement in fortran in Visual studio 2010
I am having a difficult time in figuring out the syntax highlighting in Visual studio. I am using fortran code and there are labels in if statements as follows:
if_2003: IF (FRAC_PBED(NNSED,L).LT.0.0.AND.
+ FRAC_PBED(NNSED,L).GT.SMALL_NEG_NO) THEN
FRAC_PBED(NNSED,L) = 0.0
TSED_PBED(1,NNSED,L) = 0.0
END IF if_2003
So the problem I am having is when I click on the `if` next to label `if_2003`, then I cannot use `CTRL + ]` to move to the ending `if`. If there is no label before `if`, then the shortcut is working fine. I don't know what I could do so that it would start
behaving as it is supposed to.
In the contrary, when I have do loop as follows:
do_410: DO NNSED=1,NSTD
D50AVG(L) = D50AVG(L) +
+ FRAC_ALAY_SURF(NNSED,L)*D50(NNSED)/10000. ! BASED ON BED COMPOSITION
C
TSED_ALAY_SURF(2,NNSED,L)=TSED_ALAY_SURF(1,NNSED,L)
TSED_ALAY_BUFF(2,NNSED,L)=TSED_ALAY_BUFF(1,NNSED,L)
TSED_PBED(2,NNSED,L)=TSED_PBED(1,NNSED,L)
END DO do_410
I can move to the end/start of `do` loop using the keyboard shortcut `CTRL + ]`. Any suggestions is appreciated.
Regards, JdbabaHello Jdbaba,
Based on my research, your post is related to use fortran in Visual Studio:https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-for-windows-build-intel-mkl-program-with-intel-fortran-in-microsoft-visual-studio This
technology is provided by Intel. So the question should be consulted on Intel fortran related forum. Not Visual Studio Setup forum, setup forum is about install/uninstall Visual Studio.
Best regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
urgent please: I have a new iphone 4S and while sync with itunes, it was not done using the data of my old iphone but with a new virgin iphone. how can I retrieve and sync with my old datas? through icloud? or have I lost everything? please help
to be more precise
I have saved all my datas of my old iphone on itunes and icloud. I got a new phone 4s that I connected to itunes in order to load it and sync with my old datas. but I don't konw how but when itunes sync my new iphone i did not take my old datas. at the end of the sync process, I got an iphone totally virgin, but none of my previous apps, neither contact neither calendar neither anything. what happened? did itunes erased all my previous datas?? i hope not but if it's the case, can I recuperate my old datas through icloud? please help because as a lot of us, all my life is in this iphone.. (contacts, photos of my 18months girl, etc etc)
thank you very much -
Kernel panics, message saying "You need to restart your computer.Hold down the Power..." I am in the middle of HSC very URGENT please help!! Mac keeps needing to restart!!
I looked in console and its saying that it may be because of Sophos Anti-Virus, i deleted and uninstalled all traces of Sophos but looked in console and this is some of the lines coming up:
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.intercheck[6460]) posix_spawn("/Library/Sophos Anti-Virus/InterCheck.app/Contents/MacOS/InterCheck", ...): No such file or directory
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.autoupdate[6461]) posix_spawn("/Library/Sophos Anti-Virus/SophosAutoUpdate.app/Contents/MacOS/SophosAutoUpdate", ...): No such file or directory
26/09/13 10:11:17.945 PM com.apple.launchd: (com.sophos.notification[6462]) posix_spawn("/Library/Sophos Anti-Virus/SophosAntiVirus.app/Contents/MacOS/SophosAntiVirus", ...): No such file or directory
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.intercheck[6460]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.intercheck) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.autoupdate[6461]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.autoupdate) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.notification[6462]) Exited with code: 1
26/09/13 10:11:17.946 PM com.apple.launchd: (com.sophos.notification) Throttling respawn: Will start in 10 seconds
26/09/13 10:11:18.291 PM Safari: self <TabContentView: 0x7f8d5dd1aa50>
26/09/13 10:11:22.617 PM Safari: self <TabContentView: 0x7f8d5db7bb00>
26/09/13 10:11:27.866 PM Safari: self <TabContentView: 0x7f8d5c331a70>
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver[6487]) posix_spawn("/Library/Sophos Anti-Virus/SophosUIServer.app/Contents/MacOS/SophosUIServer", ...): No such file or directory
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver[6487]) Exited with code: 1
26/09/13 10:12:19.939 PM com.apple.launchd.peruser.501: (com.sophos.uiserver) Throttling respawn: Will start in 10 seconds"
Looked all over computer and cant find anything of Sophos please help very urgent!That was all that there was in the most recent one, how long do you think it could take to fix?
Here is the second most recent:
Wed Sep 25 15:39:39 2013
panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f81757965, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0xffffff81acc397fe, CR3: 0x000000001e2b5025, CR4: 0x00000000000606e0
RAX: 0x000000001d31a000, RBX: 0x0000000000000000, RCX: 0x0000000000000000, RDX: 0x0000000000000000
RSP: 0xffffff80b0dbb710, RBP: 0xffffff80b0dbb820, RSI: 0x0000000000000000, RDI: 0x0000000000000001
R8: 0x000000000000000a, R9: 0x0000000000000378, R10: 0x0000000000000128, R11: 0x0000000000000378
R12: 0xffffff800c626400, R13: 0x0000000000000000, R14: 0x0000000000000000, R15: 0xffffff81acc39802
RFL: 0x0000000000010246, RIP: 0xffffff7f81757965, CS: 0x0000000000000008, SS: 0x0000000000000010
CR2: 0xffffff81acc397fe, Error code: 0x0000000000000000, Faulting CPU: 0x0
Backtrace (CPU 0), Frame : Return Address
0xffffff80b0dbb3c0 : 0xffffff8000220792
0xffffff80b0dbb440 : 0xffffff80002c4794
0xffffff80b0dbb5f0 : 0xffffff80002da55d
0xffffff80b0dbb610 : 0xffffff7f81757965
0xffffff80b0dbb820 : 0xffffff7f817667a0
0xffffff80b0dbb840 : 0xffffff7f8173a58e
0xffffff80b0dbb870 : 0xffffff7f8177fb6f
0xffffff80b0dbb8a0 : 0xffffff7f81779632
0xffffff80b0dbb8d0 : 0xffffff7f8177d7d5
0xffffff80b0dbb900 : 0xffffff7f8177c6db
0xffffff80b0dbb9e0 : 0xffffff7f817412b8
0xffffff80b0dbba10 : 0xffffff7f81778684
0xffffff80b0dbba30 : 0xffffff7f817449ce
0xffffff80b0dbbb60 : 0xffffff7f81741a4c
0xffffff80b0dbbbc0 : 0xffffff8000655f3e
0xffffff80b0dbbbe0 : 0xffffff800065681a
0xffffff80b0dbbc40 : 0xffffff8000656fbb
0xffffff80b0dbbd80 : 0xffffff80002a3f08
0xffffff80b0dbbe80 : 0xffffff8000223096
0xffffff80b0dbbeb0 : 0xffffff80002148a9
0xffffff80b0dbbf10 : 0xffffff800021bbd8
0xffffff80b0dbbf70 : 0xffffff80002aef10
0xffffff80b0dbbfb0 : 0xffffff80002daec3
Kernel Extensions in backtrace:
com.apple.driver.AppleIntelHD3000Graphics(7.3.2)[A2328231-E577-32FF-B20F-D08BDC FE9C51]@0xffffff7f81738000->0xffffff7f8179bfff
dependency: com.apple.iokit.IOPCIFamily(2.7)[5C23D598-58B2-3204-BC03-BC3C0F00BD32]@0xffffff 7f80889000
dependency: com.apple.iokit.IONDRVSupport(2.3.4)[7C8672C4-8B0D-3CCF-A79A-23C62E90F895]@0xff ffff7f80d2e000
dependency: com.apple.iokit.IOGraphicsFamily(2.3.4)[D0A1F6BD-E66E-3DD8-9913-A3AB8746F422]@0 xffffff7f80cf5000
BSD process name corresponding to current thread: WindowServer
Mac OS version:
11G63b
Kernel version:
Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64
Kernel UUID: FF3BB088-60A4-349C-92EA-CA649C698CE5
System model name: MacBookPro8,1 (Mac-94245B3640C91C81)
System uptime in nanoseconds: 1866666823698
last loaded kext at 480357661446: com.apple.filesystems.smbfs 1.7.2 (addr 0xffffff7f80795000, size 241664)
last unloaded kext at 303348424187: com.apple.driver.AppleUSBUHCI 5.1.0 (addr 0xffffff7f80af7000, size 65536)
loaded kexts:
com.sophos.kext.sav 8.0.14
org.virtualbox.kext.VBoxNetAdp 4.2.16
org.virtualbox.kext.VBoxNetFlt 4.2.16
org.virtualbox.kext.VBoxUSB 4.2.16
org.virtualbox.kext.VBoxDrv 4.2.16
com.logmein.driver.LogMeInSoundDriver 1.0.2
com.Greatdy.driver.SystemAudioCapture 1.0.0
com.apple.filesystems.smbfs 1.7.2
com.apple.driver.AppleHWSensor 1.9.5d0
com.apple.driver.AppleMikeyHIDDriver 122
com.apple.iokit.IOBluetoothSerialManager 4.0.8f17
com.apple.driver.AudioAUUC 1.59
com.apple.driver.AppleHDA 2.2.5a5
com.apple.driver.AppleMikeyDriver 2.2.5a5
com.apple.driver.AGPM 100.12.75
com.apple.driver.AppleUpstreamUserClient 3.5.9
com.apple.driver.SMCMotionSensor 3.0.2d6
com.apple.driver.AppleSMCPDRC 5.0.0d8
com.apple.iokit.IOUserEthernet 1.0.0d1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AudioIPCDriver 1.2.3
com.apple.driver.AppleSMCLMU 2.0.1d2
com.apple.driver.ApplePolicyControl 3.1.33
com.apple.driver.ACPI_SMC_PlatformPlugin 5.0.0d8
com.apple.driver.AppleIntelHD3000Graphics 7.3.2
com.apple.driver.AppleBacklight 170.2.2
com.apple.driver.AppleLPC 1.6.0
com.apple.driver.AppleMCCSControl 1.0.33
com.apple.filesystems.autofs 3.0
com.apple.driver.AppleUSBTCButtons 227.6
com.apple.driver.BroadcomUSBBluetoothHCIController 4.0.8f17
com.apple.driver.AppleUSBTCKeyboard 227.6
com.apple.driver.AppleIRController 312
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.BootCache 33
com.apple.iokit.SCSITaskUserClient 3.2.1
com.apple.driver.XsanFilter 404
com.apple.iokit.IOAHCISerialATAPI 2.0.3
com.apple.iokit.IOAHCIBlockStorage 2.1.0
com.apple.driver.AppleUSBHub 5.1.0
com.apple.driver.AppleFWOHCI 4.9.0
com.apple.driver.AirPort.Brcm4331 561.7.22
com.apple.driver.AppleSDXC 1.2.2
com.apple.iokit.AppleBCM5701Ethernet 3.2.4b8
com.apple.driver.AppleEFINVRAM 1.6.1
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleAHCIPort 2.3.1
com.apple.driver.AppleUSBEHCI 5.1.0
com.apple.driver.AppleACPIButtons 1.5
com.apple.driver.AppleRTC 1.5
com.apple.driver.AppleHPET 1.7
com.apple.driver.AppleSMBIOS 1.9
com.apple.driver.AppleACPIEC 1.5
com.apple.driver.AppleAPIC 1.6
com.apple.driver.AppleIntelCPUPowerManagementClient 195.0.0
com.apple.nke.applicationfirewall 3.2.30
com.apple.security.quarantine 1.4
com.apple.security.TMSafetyNet 8
com.apple.driver.AppleIntelCPUPowerManagement 195.0.0
com.apple.iokit.IOSerialFamily 10.0.5
com.apple.driver.DspFuncLib 2.2.5a5
com.apple.iokit.IOSurface 80.0.2
com.apple.iokit.IOFireWireIP 2.2.5
com.apple.driver.AppleHDAController 2.2.5a5
com.apple.iokit.IOHDAFamily 2.2.5a5
com.apple.iokit.IOAudioFamily 1.8.6fc18
com.apple.kext.OSvKernDSPLib 1.3
com.apple.driver.AppleGraphicsControl 3.1.33
com.apple.driver.AppleSMC 3.1.3d10
com.apple.driver.IOPlatformPluginLegacy 5.0.0d8
com.apple.driver.AppleSMBusPCI 1.0.10d0
com.apple.driver.AppleBacklightExpert 1.0.4
com.apple.driver.IOPlatformPluginFamily 5.1.1d6
com.apple.iokit.IONDRVSupport 2.3.4
com.apple.driver.AppleSMBusController 1.0.10d0
com.apple.driver.AppleIntelSNBGraphicsFB 7.3.2
com.apple.iokit.IOGraphicsFamily 2.3.4
com.apple.kext.triggers 1.0
com.apple.driver.AppleUSBBluetoothHCIController 4.0.8f17
com.apple.iokit.IOBluetoothFamily 4.0.8f17
com.apple.driver.AppleThunderboltDPInAdapter 1.8.5
com.apple.driver.AppleThunderboltDPAdapterFamily 1.8.5
com.apple.driver.AppleThunderboltPCIDownAdapter 1.2.5
com.apple.driver.AppleUSBMultitouch 230.5
com.apple.iokit.IOUSBHIDDriver 5.0.0
com.apple.driver.AppleUSBMergeNub 5.1.0
com.apple.driver.AppleUSBComposite 5.0.0
com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.2.1
com.apple.iokit.IOBDStorageFamily 1.7
com.apple.iokit.IODVDStorageFamily 1.7.1
com.apple.iokit.IOCDStorageFamily 1.7.1
com.apple.iokit.IOSCSIArchitectureModelFamily 3.2.1
com.apple.driver.AppleThunderboltNHI 1.6.0
com.apple.iokit.IOThunderboltFamily 2.0.3
com.apple.iokit.IOUSBUserClient 5.0.0
com.apple.iokit.IOFireWireFamily 4.4.8
com.apple.iokit.IO80211Family 420.3
com.apple.iokit.IOEthernetAVBController 1.0.1b1
com.apple.iokit.IONetworkingFamily 2.1
com.apple.iokit.IOAHCIFamily 2.0.8
com.apple.iokit.IOUSBFamily 5.1.0
com.apple.driver.AppleEFIRuntime 1.6.1
com.apple.iokit.IOHIDFamily 1.7.1
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 177.11
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.DiskImages 331.7
com.apple.iokit.IOStorageFamily 1.7.2
com.apple.driver.AppleKeyStore 28.18
com.apple.driver.AppleACPIPlatform 1.5
com.apple.iokit.IOPCIFamily 2.7
com.apple.iokit.IOACPIFamily 1.4 -
Different Styles in PlainView - Syntax Highlighting?
Hi,
I've managed to extend PlainView and looking at old JEdit code I have the syntax highlighting working for the most part. However, at certain times while typing the cursor starts to get way ahead of the text it's typing. And as I backspace on the line the cursor eventually gets closer to the character the closer it gets to the start of the line.
I'm overridding the "drawUnselectedText()" method in PlainView to do the coloring.
Here's the code, you can see the call to SyntaxUtilities.paintSyntaxLine() which is JEdit's class to do the drawing.
* Renders the given range in the model as normal unselected text. This
* is implemented to paint colors based upon the token-to-color
* translations. To reduce the number of calls to the Graphics object,
* text is batched up until a color change is detected or the entire
* requested range has been reached.
* @param g
* the graphics context
* @param x
* the starting X coordinate
* @param y
* the starting Y coordinate
* @param p0
* the beginning position in the model
* @param p1
* the ending position in the model
* @returns the location of the end of the range
* @exception BadLocationException
* if the range is invalid
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException {
System.out.println("p0: " + p0 + " p1: " + p1 + " x: " + x + " y: " + y);
// Get the start of the element
int lineIndex = doc.getDefaultRootElement().getElementIndex(p0);
// Get the element for the line
Element elem = doc.getDefaultRootElement().getElement(lineIndex);
System.out.println("lineIndex: " + lineIndex + " elemStartIDX: " + elem.getStartOffset() + " elemEndIDX: " + elem.getEndOffset());
// Get the line text
doc.getText(p0, p1 - p0, currentLineText);
// If highlighting, mark the tokens
if (marker != null) {
Token t = marker.markTokens(currentLineText, lineIndex);
x = SyntaxUtilities.paintSyntaxLine(currentLineText, t, styles, this, g, x, y, p0, p1);
System.out.println("Painted line at: " + x);
} else {
// No highlighting requested, draw normal text
Font defaultFont = g.getFont();
Color defaultColor = styles[0].getColor(); // Default color of text
g.setFont(defaultFont);
g.setColor(defaultColor);
x = Utilities.drawTabbedText(currentLineText, x, y, g, this, p0);
// Set the last line processed
lastLine = lineIndex;
return x;
Here is the code from the paintSyntaxLine() method:
* Paints the specified line onto the graphics context. Note that this
* method munges the offset and count values of the segment.
* @param line
* The line segment
* @param tokens
* The token list for the line
* @param styles
* The syntax style list
* @param expander
* The tab expander used to determine tab stops. May be null
* @param gfx
* The graphics context
* @param x
* The x co-ordinate
* @param y
* The y co-ordinate
* @return The x co-ordinate, plus the width of the painted string
public static int paintSyntaxLine(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics gfx, int x, int y, int p0, int p1) {
Font defaultFont = gfx.getFont();
Color defaultColor = Color.black;
FontMetrics fm = gfx.getFontMetrics(defaultFont);
int offset = 0;
while (tokens != null && tokens.id != Token.END) {
int length = tokens.length;
if (tokens.id == Token.NULL) {
if (!defaultColor.equals(gfx.getColor()))
gfx.setColor(defaultColor);
if (!defaultFont.equals(gfx.getFont()))
gfx.setFont(defaultFont);
} else {
styles[tokens.id].setGraphicsFlags(gfx, defaultFont);
// fm = gfx.getFontMetrics();//[tokens.id].getStyledFont(defaultFont);
// FontMetrics dfm = Toolkit.getDefaultToolkit().getFontMetrics(defaultFont);
// System.out.println("Font Info: CharWidth[" + fm.charWidth(line.array[p1])+"], Max Advance[" + fm.getMaxAdvance()+"]");
// System.out.println("Default Font Info: CharWidth[" + dfm.charWidth(line.array[p1])+"], DMax Advance[" + dfm.getMaxAdvance()+"]");
//// x = fm.charsWidth(line.array, p0, length);
line.count = length;
x = Utilities.drawTabbedText(line, x, y, gfx, expander, p0);
line.offset += length;
offset += length;
tokens = tokens.next;
return x;
I'm not sure what the problem is..i thought it might be an issue with the View and drawing multiple font styles. Since plain view only deals with a single font color and size. I tried using LabelView but that seems to need a StyledDocument and I had problems when I tried to use DefaultStyledDocument for my syntaxdocument. I was getting strange offset issues when using the Segment class.
Here's what I posted: http://forum.java.sun.com/thread.jspa?threadID=780801
I am using PlainDocument because that seemed to be what everyone was using for a syntax editor..since the structure of the document in a Plain Document is less complex.
I orginally started out using the setCharacterAttributes() method on the DefaultStyledDocument and letting the views draw the text. That all seemed to work except for the "segment offset" issue. And I wasn't sure where the best spot to get the document to redraw subsequent lines in the case of changing a multiline comment, etc.
So, everything I read about others attempts for syntax highlighters seems to use either StyledEditorKit with a fixed language set with custom parsing and using the setCharacterAttributes method. Or they use the plaindocument approach with a custom view..(which no one seems to share the source) or the project just simply uses the JEditTextArea directly (which we can't do in our product).
We don't need multiple fonts per-line.. The document will always use one font face (Arial, Helvetica, etc) but may use different styles per word (bold, italic, etc).
I thought I'd need to use FontMetrics to get the size of the font and such. But there didn't seem to be a difference in measurements based on the style of the font. (i.,e A bold font has the same charWidth('m') size as a regular style.
At least that's what my test program showed..
The other thing I noticed is that when the document is successfully colored and I use the mouse to select a region of text, the style of the text reverts back to normal. I'm sure that's because I only override the drawUnselectedText() method.
Any ideas? Is there anyone who has successfully done this?
Thanks,
- TimI just tried using a proportional font in my editor, and now I'm seeing your runaway-caret problem. Specifically, the caret remains in sync with the text as long as no bold characters are encountered, but it gets noticeably farther out of whack with each bold character it passes. I suspect that, when you measured the charWidth, your FontMetrics object wasn't really based on a bold font, because bold versions of proportional fonts are larger. And of course, the model/view conversion methods assume that the same style of the same font is used throughout the document. I've never had to deal with that problem, since I've always used monospaced fonts by preference, and bold versions of monospaced fonts really are the same size as the non-bold versions. I suggest you do the same, because getting this to work with proportional fonts look like a major hassle.
-
Syntax Highlighting for custom file extensions
Hi everyone.
I am currently working on a PHP project, and we are using
*.thtml files for templates. The file isn't supported by
Dreamweaver, as it's a fictional file extension. First I couldn't
even open it with Dreamweaver, but after I added it in
settings/file types, it worked.
Now my question - how can I activate syntax highlighting for
this filetype? It contains HTML and PHP, so it should work with the
same highlighter as all the other file types do..
Can someone help me out?
Thanks.
- ChrisGot it
http://alexle.net/archives/119 -
Hi All,Please send me abap-hr material .Its urgent please.
Hi All,Please send me abap-hr material .Its urgent please.
These are the FAQ's that might helps you
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.sapgenie.com/sapfunc/index.htm
http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm
http://www.sap-img.com/hr021.htm
http://www.sap-img.com/human/hr-faq.htm
http://www.sap-img.com/human/finding-the-list-of-hr-module-tables.htm
additional info......
Download the ABAP e-book for HR in the below link under the section 'Free ABAP eBook Download'
http://www.sap-img.com
Also have a look at the following links-
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://planetsap.com/index.htm
http://www.atomhr.com/library_full.htm
http://www.sap-basis-abap.com/saphr.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/60/d8d8c7576311d189270000e8322f96/frameset.htm
http://www.sapfriends.com/sapstuff.html
http://www.atomhr.com/know_preview/Reading_Payroll_Results_with_ABAP.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Payroll
http://www.sap-press.com/product.cfm?account=&product=H967
http://www.sapdevelopment.co.uk/hr/payres_abap.htm
http://www.sapdevelopment.co.uk/hr/payres_tcode.htm
http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
you can see some Standard Program examples in this one..
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification -
Hi All,Where can any send me material on ABAP-HR urgent please
Hi All,Where can any send me material on ABAP-HR urgent please .
Thanks®ards.
Bharat Kumar.Hi,
Here is a good start......
http://www.planetsap.com/hr_abap_main_page.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.
Regards
Maybe you are looking for
-
PI 7.1 Upgrade Mount Point
Hi. Im upgrading a 7.0 PI system to 7.1, and all was going well until the system asked about the mount points. I have tried everything - the cds, the downloaded product. Nothing seems to recognise the 'SAP Kernel DVD Unicode' folders /cds. Its able t
-
Can't get application id "com.apple.ScreenSaver.Engine".
I'm trying to compile the following in AppleScript Editor in OS X 10.6.4 and keep getting the following error message: Can't get application id "com.apple.ScreenSaver.Engine". Any suggestions? try tell application id "com.apple.ScreenSaver.Engine" to
-
Hi, Can any one tell me what are all the possible reasons for this question... "Why do we need Sales area?" Regards, Nalini Ramesh
-
Enhancement of 2LIS_18_I3HDR
Hi Guru's I need some help in writing the ABAP code for enhancing the datasource 2LIS_18_I3HDR. Actually the requirement is enhancing the datasource with the fields Servicing Dealer(ZZSERVDEALER),Owning Dealer(ZZOWNDEALER),End Customer(ZZENDCUST),Cor
-
Adobe application manager not finding updates on PSE11
There should be a camera raw 7.4 update available, but it is not being found and I am not sure what other updates are not being found. In addition I did a manual download of Adobe Patch Installer and when it was launched got the following message in