You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.8 KiB
101 lines
3.8 KiB
15 years ago
|
//Auto-generated by kalyptus. DO NOT EDIT.
|
||
11 years ago
|
package org.trinitydesktop.koala;
|
||
15 years ago
|
|
||
11 years ago
|
import org.trinitydesktop.qt.Qt;
|
||
|
import org.trinitydesktop.qt.QtSupport;
|
||
15 years ago
|
|
||
|
/**
|
||
|
|
||
|
A graphical editor for regular expressions.
|
||
13 years ago
|
The actual editor is located in tdeutils, with an interface in
|
||
|
tdelibs. This means that it is a bit more complicated to create an
|
||
15 years ago
|
instance of the editor, but only a little bit more complicated.
|
||
13 years ago
|
To check if kregexpeditor in tdeutils is installed and available use this line:
|
||
15 years ago
|
<pre>
|
||
12 years ago
|
boolean installed=!TDETrader.self().query("KRegExpEditor/KRegExpEditor").isEmpty();
|
||
15 years ago
|
</pre>
|
||
|
The following is a template for what you need to do to create an instance of the
|
||
|
regular expression dialog:
|
||
|
<pre>
|
||
13 years ago
|
TQDialog editorDialog = KParts.ComponentFactory.createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor" );
|
||
15 years ago
|
if ( editorDialog ) {
|
||
13 years ago
|
// tdeutils was installed, so the dialog was found fetch the editor interface
|
||
13 years ago
|
KRegExpEditorInterface editor = (KRegExpEditorInterface)( editorDialog.tqt_cast( "KRegExpEditorInterface" ) );
|
||
15 years ago
|
Q_ASSERT( editor ); // This should not fail!
|
||
|
// now use the editor.
|
||
|
editor.setRegExp("^kde$");
|
||
|
// Finally exec the dialog
|
||
|
editorDialog.exec();
|
||
|
}
|
||
|
else {
|
||
|
// Don't offer the dialog.
|
||
|
}
|
||
|
</pre>
|
||
|
Note: signals and slots must be connected to the editorDialog object, not to the editor object:
|
||
|
<pre>
|
||
|
connect( editorDialog, SIGNAL("canUndo( boolean )"), undoBut, SLOT("setEnabled( boolean )") );
|
||
|
</pre>
|
||
|
If you want to create an instance of the editor widget, i.e. not the
|
||
|
dialog, then you must do it in the following way:
|
||
|
<pre>
|
||
13 years ago
|
TQWidget editorWidget =
|
||
11 years ago
|
KParts.ComponentFactory.createInstanceFromQuery<TQWidget>(
|
||
15 years ago
|
"KRegExpEditor/KRegExpEditor", null, parent );
|
||
|
if ( editorWidget ) {
|
||
13 years ago
|
// tdeutils was installed, so the widget was found fetch the editor interface
|
||
13 years ago
|
KRegExpEditorInterface editor = (KRegExpEditorInterface)( editorWidget.tqt_cast( "KRegExpEditorInterface" ) );
|
||
15 years ago
|
Q_ASSERT( editor ); // This should not fail!
|
||
|
// now use the editor.
|
||
|
editor.setRegExp("^kde$");
|
||
|
// Finally insert the widget into the layout of its parent
|
||
|
layout.addWidget( editorWidget );
|
||
|
}
|
||
|
else {
|
||
|
// Don't offer the editor widget.
|
||
|
}
|
||
|
</pre>
|
||
|
@author Jesper K. Pedersen blackie@kde.org
|
||
|
|
||
|
@short A graphical editor for regular expressions.
|
||
|
|
||
|
*/
|
||
|
public class KRegExpEditorInterface implements QtSupport {
|
||
|
private long _qt;
|
||
|
private boolean _allocatedInJavaWorld = true;
|
||
|
protected KRegExpEditorInterface(Class dummy){}
|
||
|
|
||
11 years ago
|
/**
|
||
13 years ago
|
returns the regular expression of the editor in Qt3 TQRegExp
|
||
15 years ago
|
syntax. Note, there is also a 'regexp' Qt property available.
|
||
13 years ago
|
@short returns the regular expression of the editor in Qt3 TQRegExp syntax.
|
||
15 years ago
|
*/
|
||
|
public native String regExp();
|
||
11 years ago
|
/**
|
||
15 years ago
|
Set the regular expression for the editor. The syntax must be Qt3
|
||
13 years ago
|
TQRegExp syntax.
|
||
15 years ago
|
@short Set the regular expression for the editor.
|
||
|
*/
|
||
|
public native void setRegExp(String regexp);
|
||
|
public native void redo();
|
||
|
public native void undo();
|
||
11 years ago
|
/**
|
||
15 years ago
|
Set text to use when showing matches. NOT IMPLEMENTED YET!
|
||
|
This method is not yet implemented. In later version of the widget
|
||
|
this method will be used to give the widget a text to show matches of
|
||
|
the regular expression on.
|
||
|
@short Set text to use when showing matches.
|
||
|
*/
|
||
|
public native void setMatchText(String arg1);
|
||
11 years ago
|
/**
|
||
15 years ago
|
This method allows for future changes that will not break binary
|
||
|
compatibility. DONT USE!
|
||
|
KDE has a policy of keeping binary compatibility for all major
|
||
|
version of KDE. This means that new methods can not be added to this
|
||
|
API before KDE version 4.0.
|
||
|
This method is an escape door for that.
|
||
|
Conclusion: You should not use this method in this version of KDE!
|
||
|
@short This method allows for future changes that will not break binary compatibility.
|
||
|
*/
|
||
13 years ago
|
// void doSomething(TQString arg1,void* arg2); >>>> NOT CONVERTED
|
||
15 years ago
|
}
|