use of com.cubrid.common.ui.query.editor.QueryEditorPart in project cubrid-manager by CUBRID.
the class SqlFormatAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IEditorPart editor = window.getActivePage().getActiveEditor();
if (editor instanceof QueryEditorPart) {
QueryEditorPart queryEditor = (QueryEditorPart) editor;
queryEditor.format();
}
}
use of com.cubrid.common.ui.query.editor.QueryEditorPart in project cubrid-manager by CUBRID.
the class AssignEditorNameAction method menuAboutToShow.
/**
* When menu show, update the action's status.
*
* @param manager IMenuManager
*/
public void menuAboutToShow(IMenuManager manager) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
manager.remove(ID);
return;
}
IEditorPart editor = window.getActivePage().getActiveEditor();
if (editor instanceof QueryEditorPart) {
if (manager.find(ID) == null) {
manager.add(this);
}
} else {
manager.remove(ID);
}
}
use of com.cubrid.common.ui.query.editor.QueryEditorPart in project cubrid-manager by CUBRID.
the class AssignEditorNameAction method run.
public void run() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
IEditorPart editor = window.getActivePage().getActiveEditor();
if (editor != null && editor instanceof QueryEditorPart) {
QueryEditorPart queryEditorPart = (QueryEditorPart) editor;
AssignEditorNameDialog dialog = new AssignEditorNameDialog(Display.getCurrent().getActiveShell(), queryEditorPart);
dialog.open();
}
}
use of com.cubrid.common.ui.query.editor.QueryEditorPart in project cubrid-manager by CUBRID.
the class CopyQueryEditorAction method menuAboutToShow.
/**
* When menu show, update the action's status.
*
* @param manager IMenuManager
*/
public void menuAboutToShow(IMenuManager manager) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
manager.remove(ID);
return;
}
IEditorPart editor = window.getActivePage().getActiveEditor();
if (editor instanceof QueryEditorPart) {
if (manager.find(ID) == null) {
manager.add(this);
}
} else {
manager.remove(ID);
}
}
use of com.cubrid.common.ui.query.editor.QueryEditorPart in project cubrid-manager by CUBRID.
the class ParseSqlmapQueryAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Control control = getFocusProvider();
if (!(control instanceof StyledText)) {
showNoSelectionQueryError();
return;
}
StyledText stext = (StyledText) control;
String data = stext.getSelectionText();
if (StringUtil.isEmpty(data)) {
showNoSelectionQueryError();
return;
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
showNoSelectionQueryError();
return;
}
IEditorPart editor = window.getActivePage().getActiveEditor();
if (editor == null || !(editor instanceof QueryEditorPart)) {
showNoSelectionQueryError();
return;
}
((QueryEditorPart) editor).parseSqlmapQuery();
}
Aggregations