-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
930 additions
and
1 deletion.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
plugins/org.dslforge.texteditor/src/org/dslforge/texteditor/form/BasicTextFormEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* <copyright> | ||
* | ||
* Copyright (c) 2017 PlugBee. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available | ||
* under the terms of the Eclipse Public License v1.0 which | ||
* accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Amine Lajmi - Initial API and implementation | ||
* | ||
* </copyright> | ||
*/ | ||
package org.dslforge.texteditor.form; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.eclipse.ui.IEditorInput; | ||
import org.eclipse.ui.IEditorSite; | ||
import org.eclipse.ui.PartInitException; | ||
import org.eclipse.ui.forms.editor.FormEditor; | ||
|
||
public class BasicTextFormEditor extends FormEditor{ | ||
|
||
private static final long serialVersionUID = 4934273569844174609L; | ||
|
||
static final Logger logger = Logger.getLogger(BasicTextFormEditor.class); | ||
|
||
public BasicTextFormEditor() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public void init(IEditorSite site, IEditorInput input) throws PartInitException { | ||
super.init(site, input); | ||
} | ||
|
||
@Override | ||
protected void setPageText(int pageIndex, String text) { | ||
super.setPageText(pageIndex, text); | ||
} | ||
|
||
@Override | ||
protected void addPages() { | ||
try { | ||
setActiveEditor(this); | ||
addPage(new TextFormEditorWithCanvasPage(this)); | ||
} catch (PartInitException e) { | ||
logger.error(e.getStackTrace(), e); | ||
} | ||
} | ||
|
||
@Override | ||
public void doSave(IProgressMonitor monitor) { | ||
getActiveEditor().doSave(monitor); | ||
} | ||
|
||
@Override | ||
public void doSaveAs() { | ||
getActiveEditor().doSaveAs(); | ||
} | ||
|
||
@Override | ||
public boolean isSaveAsAllowed() { | ||
return false; | ||
} | ||
} |
Oops, something went wrong.