-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
595f3f6
commit f788045
Showing
442 changed files
with
21,702 additions
and
33 deletions.
There are no files selected for viewing
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
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Empty file.
102 changes: 102 additions & 0 deletions
102
.metadata/.plugins/org.eclipse.core.resources/.history/0/606993f3d47f001a1e01ee7e7760191e
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,102 @@ | ||
package com.kmstechnology.todolist.app.parts; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import javax.annotation.PostConstruct; | ||
import javax.inject.Inject; | ||
|
||
import org.eclipse.e4.ui.di.Focus; | ||
import org.eclipse.e4.ui.di.Persist; | ||
import org.eclipse.e4.ui.model.application.ui.MDirtyable; | ||
import org.eclipse.jface.viewers.TableViewer; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.events.ModifyEvent; | ||
import org.eclipse.swt.events.ModifyListener; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Button; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Label; | ||
import org.eclipse.swt.widgets.Text; | ||
|
||
import com.kmstechnology.todolist.app.handlers.TodoEnterListener; | ||
import com.kmstechnology.todolist.core.model.Todo; | ||
import com.kmstechnology.todolist.core.model.TodoList; | ||
|
||
public class TodoAppPart { | ||
|
||
private Text txtInput; | ||
private static List<Todo> todoList = new ArrayList<Todo>(); | ||
private Composite parent; | ||
|
||
public static List<Todo> getTodoList() { | ||
return todoList; | ||
} | ||
|
||
public static void addTodo(String todo) { | ||
todoList.add(new Todo(todo)); | ||
} | ||
|
||
private TableViewer tableViewer; | ||
|
||
@Inject | ||
private MDirtyable dirty; | ||
|
||
@PostConstruct | ||
public void createComposite(Composite parent) { | ||
todoList.add(new Todo("example 1")); | ||
parent.setLayout(new GridLayout(1, false)); | ||
txtInput = new Text(parent, SWT.BORDER); | ||
txtInput.setMessage("Enter new todo..."); | ||
// txtInput.addModifyListener(new ModifyListener() { | ||
// @Override | ||
// public void modifyText(ModifyEvent e) { | ||
// dirty.setDirty(true); | ||
// } | ||
// }); | ||
txtInput.addKeyListener(new TodoEnterListener(txtInput, this)); | ||
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
this.parent = parent; | ||
this.refreshTodoList(parent); | ||
// tableViewer = new TableViewer(parent, SWT.V_SCROLL); | ||
// | ||
// tableViewer.setContentProvider(ArrayContentProvider.getInstance()); | ||
// tableViewer.setInput(createInitialDataModel(parent)); | ||
// tableViewer.getTable().setLayoutData(new | ||
// GridData(GridData.FILL_BOTH)); | ||
} | ||
|
||
@Focus | ||
public void setFocus() { | ||
for (Todo todo : todoList) { | ||
Composite elementRowLayout = new Composite(parent, SWT.BORDER); | ||
elementRowLayout.setLayout(new GridLayout(2, false)); | ||
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Label label = new Label(elementRowLayout, SWT.NONE); | ||
label.setText(todo.getText()); | ||
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Button button = new Button(elementRowLayout, SWT.NONE); | ||
button.setText("Delete"); | ||
} | ||
} | ||
|
||
// @Persist | ||
// public void save() { | ||
// dirty.setDirty(false); | ||
// } | ||
|
||
private void refreshTodoList(Composite parent) { | ||
for (Todo todo : todoList) { | ||
Composite elementRowLayout = new Composite(parent, SWT.BORDER); | ||
elementRowLayout.setLayout(new GridLayout(2, false)); | ||
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
|
||
Label label = new Label(elementRowLayout, SWT.NONE); | ||
label.setText(todo.getText()); | ||
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Button button = new Button(elementRowLayout, SWT.NONE); | ||
button.setText("Delete"); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
.metadata/.plugins/org.eclipse.core.resources/.history/1/c02a406b3980001a141dda9bba7a9411
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmi:id="_6wlLcMgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.application" bindingContexts="_6wlLecgZEeSyMNYR5xypkQ"> | ||
<children xsi:type="basic:TrimmedWindow" xmi:id="_6wlLccgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.window.main" label="Eclipse 4 RCP Application" width="500" height="400"> | ||
<children xsi:type="basic:PartSashContainer" xmi:id="_6wlLksgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.partsashcontainer.sample"> | ||
<children xsi:type="basic:PartStack" xmi:id="_6wlLk8gZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.partstack.sample"> | ||
<children xsi:type="basic:Part" xmi:id="_6wlLlMgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.part.sample" contributionURI="bundleclass://com.kmstechnology.todolist.app/com.kmstechnology.todolist.app.parts.TodoAppPart" label="Sample Part"/> | ||
</children> | ||
</children> | ||
<trimBars xmi:id="_6wlLlcgZEeSyMNYR5xypkQ" elementId="com.kmstechnology.todolist.app.trimbar.top"/> | ||
</children> | ||
<rootContext xmi:id="_6wlLecgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows"> | ||
<children xmi:id="_6wlLesgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.window" name="In Windows"/> | ||
<children xmi:id="_6wlLe8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/> | ||
</rootContext> | ||
<commands xmi:id="_6wlLfMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/> | ||
<commands xmi:id="_6wlLgMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.open" commandName="openCommand"/> | ||
<commands xmi:id="_6wlLg8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.save" commandName="saveCommand"/> | ||
<commands xmi:id="_6wlLhsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/> | ||
<addons xmi:id="_6wlLcsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/> | ||
<addons xmi:id="_6wlLc8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/> | ||
<addons xmi:id="_6wlLdMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/> | ||
<addons xmi:id="_6wlLdcgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/> | ||
<addons xmi:id="_6wlLdsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/> | ||
<addons xmi:id="_6wlLd8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/> | ||
<addons xmi:id="_6wlLeMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/> | ||
</application:Application> |
41 changes: 41 additions & 0 deletions
41
.metadata/.plugins/org.eclipse.core.resources/.history/10/b0b94e1ad57f001a1e01ee7e7760191e
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 @@ | ||
package com.kmstechnology.todolist.app.handlers; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.events.KeyEvent; | ||
import org.eclipse.swt.events.KeyListener; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Button; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Label; | ||
import org.eclipse.swt.widgets.Text; | ||
|
||
import com.kmstechnology.todolist.app.parts.TodoAppPart; | ||
|
||
public class TodoEnterListener implements KeyListener { | ||
private final TodoAppPart todoAppPart; | ||
private final Text txtTodo; | ||
|
||
public TodoEnterListener(Text textTodo, TodoAppPart todoAppPart) { | ||
super(); | ||
this.txtTodo = textTodo; | ||
this.todoAppPart = todoAppPart; | ||
} | ||
|
||
@Override | ||
public void keyPressed(KeyEvent e) { | ||
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) { | ||
TodoAppPart.addTodo(this.txtTodo.getText()); | ||
} | ||
} | ||
|
||
@Override | ||
public void keyReleased(KeyEvent e) { | ||
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) { | ||
todoAppPart.setFocus(); | ||
} | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
.metadata/.plugins/org.eclipse.core.resources/.history/12/706ea9f64180001a141dda9bba7a9411
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,25 @@ | ||
package com.kmstechnology.todolist.core.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.eclipse.swt.widgets.Composite; | ||
|
||
public class TodoList { | ||
private List<Todo> todoList; | ||
|
||
public TodoList() { | ||
super(); | ||
this.todoList = new ArrayList<Todo>(); | ||
} | ||
|
||
public Todo add(int ID, String todo) { | ||
Todo newTodo = new Todo(ID, todo); | ||
this.todoList.add(newTodo); | ||
return newTodo; | ||
} | ||
|
||
public List<Todo> get() { | ||
return this.todoList; | ||
} | ||
} |
Empty file.
117 changes: 117 additions & 0 deletions
117
.metadata/.plugins/org.eclipse.core.resources/.history/13/d0c38a15e77f001a192887746f210950
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,117 @@ | ||
package com.kmstechnology.todolist.app.parts; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.inject.Inject; | ||
|
||
import org.eclipse.e4.ui.di.Focus; | ||
import org.eclipse.e4.ui.model.application.ui.MDirtyable; | ||
import org.eclipse.jface.viewers.TableViewer; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Button; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Label; | ||
import org.eclipse.swt.widgets.Text; | ||
|
||
import com.kmstechnology.todolist.app.handlers.TodoEnterListener; | ||
import com.kmstechnology.todolist.core.model.Todo; | ||
|
||
public class TodoAppPart { | ||
|
||
private Text txtInput; | ||
private List<Todo> todoList = new ArrayList<Todo>(); | ||
private Composite parent; | ||
|
||
public List<Todo> getTodoList() { | ||
return todoList; | ||
} | ||
|
||
public void addTodo(String todo) { | ||
todoList.add(new Todo(todo)); | ||
} | ||
|
||
public void handleAddTodo(String todo) { | ||
addTodo(todo); | ||
refreshTodoList(todo); | ||
txtInput.setText(""); | ||
} | ||
|
||
private TableViewer tableViewer; | ||
|
||
@Inject | ||
private MDirtyable dirty; | ||
|
||
@PostConstruct | ||
public void createComposite(Composite parent) { | ||
this.parent = parent; | ||
parent.setLayout(new GridLayout(1, false)); | ||
txtInput = new Text(parent, SWT.BORDER); | ||
txtInput.setMessage("Enter new todo..."); | ||
// txtInput.addModifyListener(new ModifyListener() { | ||
// @Override | ||
// public void modifyText(ModifyEvent e) { | ||
// dirty.setDirty(true); | ||
// } | ||
// }); | ||
|
||
txtInput.addKeyListener(new TodoEnterListener(txtInput, this)); | ||
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
for (Todo todo : todoList) { | ||
Composite elementRowLayout = new Composite(parent, SWT.BORDER); | ||
elementRowLayout.setLayout(new GridLayout(2, false)); | ||
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Label label = new Label(elementRowLayout, SWT.NONE); | ||
label.setText(todo.getText()); | ||
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Button button = new Button(elementRowLayout, SWT.NONE); | ||
button.setText("Delete"); | ||
} | ||
|
||
// tableViewer = new TableViewer(parent, SWT.V_SCROLL); | ||
// | ||
// tableViewer.setContentProvider(ArrayContentProvider.getInstance()); | ||
// tableViewer.setInput(createInitialDataModel(parent)); | ||
// tableViewer.getTable().setLayoutData(new | ||
// GridData(GridData.FILL_BOTH)); | ||
} | ||
|
||
@Focus | ||
public void setFocus() { | ||
// for (Todo todo : todoList) { | ||
// Composite elementRowLayout = new Composite(parent, SWT.BORDER); | ||
// elementRowLayout.setLayout(new GridLayout(2, false)); | ||
// elementRowLayout.setLayoutData(new | ||
// GridData(GridData.FILL_HORIZONTAL)); | ||
// Label label = new Label(elementRowLayout, SWT.NONE); | ||
// label.setText(todo.getText()); | ||
// label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
// Button button = new Button(elementRowLayout, SWT.NONE); | ||
// button.setText("Delete"); | ||
// } | ||
} | ||
|
||
public void refreshTodoList(String todo) { | ||
if (parent.getChildren().length > 1 && parent.getChildren()[1] != null | ||
&& !parent.getChildren()[1].isDisposed()) { | ||
parent.getChildren()[1].dispose(); | ||
} | ||
|
||
Composite elementRowLayout = new Composite(parent, SWT.BORDER); | ||
elementRowLayout.setLayout(new GridLayout(2, false)); | ||
elementRowLayout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
|
||
Label label = new Label(elementRowLayout, SWT.NONE); | ||
label.setText(todo); | ||
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); | ||
Button button = new Button(elementRowLayout, SWT.NONE); | ||
button.setText("Delete"); | ||
|
||
// parent.layout(true, true); | ||
// parent.requestLayout(); | ||
parent.pack(); | ||
} | ||
} |
Oops, something went wrong.