-
Notifications
You must be signed in to change notification settings - Fork 8
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
12 changed files
with
217 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
41 changes: 41 additions & 0 deletions
41
...clipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/action/FileClearAction.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,41 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 - 2018 by Andre Bossert | ||
* | ||
* 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: | ||
* Andre Bossert - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
|
||
package de.anbos.eclipse.logviewer.plugin.action; | ||
|
||
import org.eclipse.swt.widgets.Shell; | ||
|
||
import de.anbos.eclipse.logviewer.plugin.ILogViewerConstants; | ||
import de.anbos.eclipse.logviewer.plugin.LogViewer; | ||
import de.anbos.eclipse.logviewer.plugin.LogViewerPlugin; | ||
import de.anbos.eclipse.logviewer.plugin.UIImages; | ||
import de.anbos.eclipse.logviewer.plugin.action.delegate.FileClearActionDelegate; | ||
|
||
public class FileClearAction extends AbstractViewAction { | ||
|
||
// Constructor | ||
// ------------------------------------------------------------------ | ||
|
||
public FileClearAction(LogViewer view, Shell shell) { | ||
super(view, shell, new FileClearActionDelegate()); | ||
} | ||
|
||
// Public | ||
// ----------------------------------------------------------------------- | ||
|
||
public void init() { | ||
this.setText(LogViewerPlugin.getResourceString("menu.file.clear.text")); //$NON-NLS-1$ | ||
this.setToolTipText(LogViewerPlugin.getResourceString("menu.file.clear.tooltip")); //$NON-NLS-1$ | ||
this.setImageDescriptor(UIImages.getImageDescriptor(ILogViewerConstants.IMG_FILE_CLEAR_ACTIVE)); | ||
this.setDisabledImageDescriptor(UIImages.getImageDescriptor(ILogViewerConstants.IMG_FILE_CLEAR_PASSIVE)); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...plugin/src/de/anbos/eclipse/logviewer/plugin/action/delegate/FileClearActionDelegate.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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 - 2018 by Andre Bossert | ||
* | ||
* 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: | ||
* Andre Bossert - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
|
||
package de.anbos.eclipse.logviewer.plugin.action.delegate; | ||
|
||
import org.eclipse.jface.dialogs.MessageDialog; | ||
import org.eclipse.swt.widgets.Shell; | ||
import de.anbos.eclipse.logviewer.plugin.LogFile.LogFileType; | ||
import de.anbos.eclipse.logviewer.plugin.LogViewer; | ||
import de.anbos.eclipse.logviewer.plugin.LogViewerPlugin; | ||
|
||
public class FileClearActionDelegate implements ILogViewerActionDelegate { | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* de.anbos.eclipse.logviewer.plugin.action.ILogfileAction#run(de.anbos. | ||
* eclipse.logviewer.plugin.LogViewer, org.eclipse.swt.widgets.Shell) | ||
*/ | ||
public void run(LogViewer view, Shell shell) { | ||
|
||
LogFileType type = view.getCurrentDocument().getFile().getType(); | ||
if (type == LogFileType.LOGFILE_ECLIPSE_CONSOLE) { | ||
view.clearCurrentLogFile(); | ||
} else if (confirmFileClear(shell)) { | ||
view.clearCurrentLogFile(); | ||
} | ||
} | ||
|
||
private boolean confirmFileClear(Shell shell) { | ||
return MessageDialog.openQuestion(shell, LogViewerPlugin.getResourceString("dialog.file.clear.title"), //$NON-NLS-1$ | ||
LogViewerPlugin.getResourceString("dialog.file.clear.text")); //$NON-NLS-1$ | ||
} | ||
} |
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
Oops, something went wrong.